Skip to content

I need help distinguish math operations and string concatenations with function calls in them #1437

Answered by bd82
phartenfeller asked this question in Q&A
Discussion options

You must be logged in to vote

So how can I effectively distinguish math operations and string concatenations to make all the statements parse? And is the root problem that both string and math expressions can be a function?

Remove the semantics from the syntactic analysis. Don't try to figure out if its a string concatenation or a number addition during parse time. Build a more general "expression" during parse time and figure out what it means in a post-parsing.
Said post-parsing steps may also perform validations to assert that correct operands types match the operators used.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@phartenfeller
Comment options

Answer selected by phartenfeller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants