Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(2.0) Error checking when using multiple conditions #110

Open
MicroNovaX opened this issue Aug 6, 2023 · 2 comments
Open

(2.0) Error checking when using multiple conditions #110

MicroNovaX opened this issue Aug 6, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@MicroNovaX
Copy link

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))

@andreypfau andreypfau added this to the 2.0 Release milestone Aug 7, 2023
@andreypfau
Copy link
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.

@andreypfau andreypfau added the bug Something isn't working label Aug 7, 2023
@andreypfau andreypfau self-assigned this Aug 7, 2023
@Oualid200410
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants