@@ -841,37 +841,11 @@ ExprPrecedence02: Synth<ast::Expr> = {
841841}
842842
843843PathExpr: ast::Path = {
844- <l:ExprPrecedence01> "." <steps:PathSteps> => ast::Path { root:Box::new(l.data), steps },
845- <l:ExprPrecedence01> "[" "*" "]" "." <s:PathSteps> => {
844+ <l:ExprPrecedence01> <s:PathSteps> => {
846845 let step = ast::PathStep::PathWildCard;
847846 ast::Path {
848847 root: Box::new(l.data),
849- steps: std::iter::once(step).chain(s.into_iter()).collect()
850- }
851- },
852- <l:ExprPrecedence01> "[" <expr:ExprQuery> "]" "." <s:PathSteps> => {
853- let step = ast::PathStep::PathExpr(
854- ast::PathExpr{
855- index: Box::new(*expr),
856- }
857- );
858-
859- ast::Path {
860- root: Box::new(l.data),
861- steps: std::iter::once(step).chain(s.into_iter()).collect()
862- }
863- },
864- <l:ExprPrecedence01> "[" "*" "]" => ast::Path {
865- root:Box::new(l.data), steps:vec![ast::PathStep::PathWildCard]
866- },
867- <l:ExprPrecedence01> "[" <expr:ExprQuery> "]" => {
868- let step = ast::PathStep::PathExpr(
869- ast::PathExpr{
870- index: Box::new(*expr),
871- });
872-
873- ast::Path {
874- root:Box::new(l.data), steps:vec![step]
848+ steps: s
875849 }
876850 },
877851}
@@ -1111,9 +1085,10 @@ FunctionArgName: ast::SymbolPrimitive = {
11111085// Examples:
11121086// a.b
11131087// a.*
1114- // a.[*]
11151088// a[*]
1089+ // a[*][*]
11161090// a.b.c
1091+ // a[*].b[*].c
11171092// "a".b
11181093// "a"."b"
11191094// { 'a': 1, 'b': 2 }.a
@@ -1137,7 +1112,6 @@ PathSteps: Vec<ast::PathStep> = {
11371112 let mut steps = path;
11381113 steps.push(ast::PathStep::PathUnpivot);
11391114 steps
1140- // ast::Path{ root:path.root, steps }
11411115 },
11421116 <lo:@L> <path:PathSteps> "[" <expr:ExprQuery> "]" <hi:@R> => {
11431117 let step = ast::PathStep::PathExpr(
@@ -1149,17 +1123,17 @@ PathSteps: Vec<ast::PathStep> = {
11491123 steps.push(step);
11501124 steps
11511125 },
1126+ "." <v:PathExprVarRef> => {
1127+ vec![ast::PathStep::PathExpr( ast::PathExpr{ index: Box::new(v) })]
1128+ },
11521129 "[" "*" "]" => {
11531130 vec![ast::PathStep::PathWildCard]
11541131 },
1155- "[" <expr:ExprQuery> "]" => {
1156- vec![ast::PathStep::PathExpr( ast::PathExpr{ index: Box::new(*expr) })]
1157- },
1158- "*" => {
1132+ "." "*" => {
11591133 vec![ast::PathStep::PathUnpivot]
11601134 },
1161- <v:PathExprVarRef> => {
1162- vec![ast::PathStep::PathExpr( ast::PathExpr{ index: Box::new(v ) })]
1135+ "[" <expr:ExprQuery> "]" => {
1136+ vec![ast::PathStep::PathExpr( ast::PathExpr{ index: Box::new(*expr ) })]
11631137 },
11641138}
11651139
0 commit comments