MCPcopy Create free account
hub / github.com/PDAL/PDAL / primary

Method primary

filters/private/expr/MathParser.cpp:146–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146bool MathParser::primary(Expression& expr)
147{
148 if (match(TokenType::Number))
149 {
150 expr.pushNode(NodePtr(new ConstValueNode(curToken().dval())));
151 return true;
152 }
153 else if (match(TokenType::Identifier))
154 {
155 if (!function(expr))
156 expr.pushNode(NodePtr(new VarNode(curToken().sval())));
157 return true;
158 }
159 bool status = parexpr(expr);
160 if (!status)
161 setError("Expecting value expression following '" + curToken().sval() +
162 "', instead found '" + peekToken().sval() + "'.");
163
164 return status;
165}
166
167bool MathParser::function(Expression& expr)
168{

Callers

nothing calls this directly

Calls 3

pushNodeMethod · 0.80
dvalMethod · 0.80
svalMethod · 0.80

Tested by

no test coverage detected