@@ -841,37 +841,11 @@ ExprPrecedence02: Synth<ast::Expr> = {
841
841
}
842
842
843
843
PathExpr: 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> => {
846
845
let step = ast::PathStep::PathWildCard;
847
846
ast::Path {
848
847
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
875
849
}
876
850
},
877
851
}
@@ -1111,9 +1085,10 @@ FunctionArgName: ast::SymbolPrimitive = {
1111
1085
// Examples:
1112
1086
// a.b
1113
1087
// a.*
1114
- // a.[*]
1115
1088
// a[*]
1089
+ // a[*][*]
1116
1090
// a.b.c
1091
+ // a[*].b[*].c
1117
1092
// "a".b
1118
1093
// "a"."b"
1119
1094
// { 'a': 1, 'b': 2 }.a
@@ -1137,7 +1112,6 @@ PathSteps: Vec<ast::PathStep> = {
1137
1112
let mut steps = path;
1138
1113
steps.push(ast::PathStep::PathUnpivot);
1139
1114
steps
1140
- // ast::Path{ root:path.root, steps }
1141
1115
},
1142
1116
<lo:@L> <path:PathSteps> "[" <expr:ExprQuery> "]" <hi:@R> => {
1143
1117
let step = ast::PathStep::PathExpr(
@@ -1149,17 +1123,17 @@ PathSteps: Vec<ast::PathStep> = {
1149
1123
steps.push(step);
1150
1124
steps
1151
1125
},
1126
+ "." <v:PathExprVarRef> => {
1127
+ vec![ast::PathStep::PathExpr( ast::PathExpr{ index: Box::new(v) })]
1128
+ },
1152
1129
"[" "*" "]" => {
1153
1130
vec![ast::PathStep::PathWildCard]
1154
1131
},
1155
- "[" <expr:ExprQuery> "]" => {
1156
- vec![ast::PathStep::PathExpr( ast::PathExpr{ index: Box::new(*expr) })]
1157
- },
1158
- "*" => {
1132
+ "." "*" => {
1159
1133
vec![ast::PathStep::PathUnpivot]
1160
1134
},
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 ) })]
1163
1137
},
1164
1138
}
1165
1139
0 commit comments