MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenShadingLanguage / parseSymbol

Method parseSymbol

src/liboslexec/lpeparse.cpp:106–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105
106LPexp *
107Parser::parseSymbol()
108{
109 bool iscustom = false;
110 ustring sym = parseRawSymbol(iscustom);
111 if (m_ingroup) {
112 if (sym == udot)
113 return new lpexp::Wildexp(m_minus_stop);
114 else
115 return new lpexp::Symbol(sym);
116 } else {
117 if (iscustom) {
118 std::list<LPexp *> custom;
119 custom.push_back(new lpexp::Symbol(sym));
120 return buildStop(new lpexp::Wildexp(m_minus_stop), new lpexp::Wildexp(m_minus_stop), custom);
121 } else {
122 LPexp *basics[2] = {NULL, NULL};
123 if (sym != ".") {
124 SymbolToInt::const_iterator i = m_label_position.find(sym);
125 if (i == m_label_position.end()) {
126 m_error = std::string("Unrecognized basic label: ") + sym.c_str();
127 return NULL;
128 }
129 int pos = i->second;
130 basics[pos] = new lpexp::Symbol(sym);
131 }
132 for (int k = 0; k < 2; ++k)
133 if (!basics[k])
134 basics[k] = new lpexp::Wildexp(m_minus_stop);
135 std::list<LPexp *> empty;
136 return buildStop (basics[0], basics[1], empty);
137 }
138 }
139}
140
141
142

Callers

nothing calls this directly

Calls 3

c_strMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected