Skip to content

Commit

Permalink
revset: remove deprecated "program" rule, rename "program_with_modifier"
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Jun 8, 2024
1 parent eda7069 commit 660a917
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/src/revset.pest
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ expression = {
~ (whitespace* ~ infix_op ~ whitespace* ~ (negate_op ~ whitespace*)* ~ range_expression)*
}

program = _{ SOI ~ whitespace* ~ expression ~ whitespace* ~ EOI }
program_modifier = { identifier ~ pattern_kind_op ~ !":" }
program_with_modifier = _{
program = _{
SOI ~ whitespace* ~ (program_modifier ~ whitespace*)? ~ expression ~ whitespace* ~ EOI
}

Expand Down
5 changes: 2 additions & 3 deletions lib/src/revset_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ impl Rule {
Rule::neighbors_expression => None,
Rule::range_expression => None,
Rule::expression => None,
Rule::program => None,
Rule::program_modifier => None,
Rule::program_with_modifier => None,
Rule::program => None,
Rule::function_alias_declaration => None,
Rule::alias_declaration => None,
}
Expand Down Expand Up @@ -421,7 +420,7 @@ pub struct ModifierNode<'i> {
}

pub(super) fn parse_program(revset_str: &str) -> Result<ExpressionNode, RevsetParseError> {
let mut pairs = RevsetParser::parse(Rule::program_with_modifier, revset_str)?;
let mut pairs = RevsetParser::parse(Rule::program, revset_str)?;
let first = pairs.next().unwrap();
match first.as_rule() {
Rule::expression => parse_expression_node(first.into_inner()),
Expand Down

0 comments on commit 660a917

Please sign in to comment.