-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
add validation for tags on silent rules (fixes #1035) #1036
Conversation
WalkthroughThe changes involve version updates across multiple Changes
Sequence Diagram(s)sequenceDiagram
participant Validator
participant Rules
participant Errors
Validator->>Rules: Validate AST
alt Check Silent Rules
Validator->>Errors: Collect Errors
Errors-->>Validator: Return Error List
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (11)
- debugger/Cargo.toml (2 hunks)
- derive/Cargo.toml (2 hunks)
- generator/Cargo.toml (2 hunks)
- grammars/Cargo.toml (2 hunks)
- meta/Cargo.toml (2 hunks)
- meta/src/validator.rs (3 hunks)
- pest/Cargo.toml (1 hunks)
- pest/examples/parens.rs (1 hunks)
- pest/src/error.rs (13 hunks)
- pest/src/parser_state.rs (1 hunks)
- vm/Cargo.toml (2 hunks)
Files skipped from review due to trivial changes (9)
- debugger/Cargo.toml
- derive/Cargo.toml
- generator/Cargo.toml
- grammars/Cargo.toml
- pest/Cargo.toml
- pest/examples/parens.rs
- pest/src/error.rs
- pest/src/parser_state.rs
- vm/Cargo.toml
Additional comments not posted (7)
meta/Cargo.toml (2)
4-4
: LGTM!The version update is approved.
25-25
: LGTM!The version update is approved.
meta/src/validator.rs (5)
229-230
: LGTM!The code changes are approved.
240-310
: LGTM!The new
validate_tag_silent_rules
function looks good:
- It is conditionally compiled based on the
grammar-extras
feature flag.- It constructs a hash map of parser rules and their types for efficient lookups.
- It recursively checks the parser expressions for tags on silent or built-in rules and generates appropriate error messages.
The implementation looks solid and serves the purpose of validating tags on silent and built-in rules effectively.
1873-1889
: LGTM!The new test case
tag_on_silent_rule
looks good:
- It is conditionally compiled based on the
grammar-extras
feature flag.- It verifies that using a tag on a silent rule generates an appropriate error message.
The test case ensures the correct behavior of the new validation functionality.
1891-1906
: LGTM!The new test case
tag_on_builtin_rule
looks good:
- It is conditionally compiled based on the
grammar-extras
feature flag.- It verifies that using a tag on a built-in rule generates an appropriate error message.
The test case ensures the correct behavior of the new validation functionality.
1908-1915
: LGTM!The new test case
tag_on_normal_rule
looks good:
- It is conditionally compiled based on the
grammar-extras
feature flag.- It verifies that using a tag on a normal rule is allowed and does not generate any errors.
The test case ensures the correct behavior of the new validation functionality.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
ParserState
struct.Style
#[allow(dead_code)]
attribute to theParen
struct.