-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: DSL semantic checking analysis #24
Conversation
Signed-off-by: Yuchen Liang <[email protected]>
Signed-off-by: Yuchen Liang <[email protected]>
Signed-off-by: Yuchen Liang <[email protected]>
Signed-off-by: Yuchen Liang <[email protected]>
Signed-off-by: Yuchen Liang <[email protected]>
Signed-off-by: Yuchen Liang <[email protected]>
Signed-off-by: Yuchen Liang <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally LGTM
@@ -0,0 +1,148 @@ | |||
// Shared properties for Logical operators |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dup w/ parser/programs?
let result = analyzer.validate_file(&file); | ||
assert!(result.is_err()); | ||
assert_eq!( | ||
result.unwrap_err(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it user friendly in the future, we probably need to raise the compiler error at the site where the error occurs, for example, Line X Column Y, (something like a source code span could help, pest should support that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I was planning to add that in the future. Usually you add that in the AST annotations.
a884974
to
bf92829
Compare
Problem
We want to reject DSL programs that are semantically incorrect. This PR analyzes the parsed AST and rejects if an error is detected.
Summary of changes
SemanticAnalyzer
to perform comprehensive static analysis on DSL programsThe semantic analyzer provides early error detection for DSL programs, helping users identify issues before runtime.