intellij-ton
intellij-ton copied to clipboard
(2.0) Error checking when using multiple conditions
While using multiple conditions, the lexer does not notice the error.
Broken code: (cpu > max_cpu | cpu < min_cpu)
Working code: ((cpu > max_cpu) | (cpu < min_cpu))
for reference: Lexer splits raw text into a list of tokens Token((), ID(cpu), Token(>), ID(max_cpu), Token(|), ID(cpu), Token(<), ID(min_cpu), Token())
Here issue related to Parser (which transforms list of tokens into AST (asbtract syntax tree)).
As i understand, expected parser behavior is:
ParenExpression {
OrExpression {
ParenExpression {
ID(cpu), Token(>), ID(max_cpu)
}
Token(|)
ParenExpression {
ID(cpu), Token(<), ID(min_cpu)
}
}
}
But actually it's not.
@andreypfau andreypfau on Aug 7, 2023 Member for reference: Lexer splits raw text into a list of tokens Token((), ID(cpu), Token(>), ID(max_cpu), Token(|), ID(cpu), Token(<), ID(min_cpu), Token()) Here issue related to Parser (which transforms list of tokens into AST (asbtract syntax tree)). As i understand, expected parser behavior is:
ParenExpression { OrExpression { ParenExpression { ID(cpu), Token(>), ID(max_cpu) } Token(|) ParenExpression { ID(cpu), Token(<), ID(min_cpu) } } } But actually it's not.