@@ -1098,42 +1098,27 @@ FunctionArgName: ast::SymbolPrimitive = {
1098
1098
//
1099
1099
// See the path expression conformance tests under `partiql-tests` or parser unit-tests for more examples.
1100
1100
PathSteps: Vec<ast::PathStep> = {
1101
- <path:PathSteps> "." <v:PathExprVarRef> => {
1102
- let mut steps = path;
1103
- steps.push(ast::PathStep::PathExpr( ast::PathExpr{ index: Box::new(v) }));
1104
- steps
1105
- },
1106
- <lo:@L> <path:PathSteps> "[" "*" "]" <hi:@R> => {
1107
- let mut steps = path;
1108
- steps.push(ast::PathStep::PathWildCard);
1109
- steps
1110
- },
1111
- <lo:@L> <path:PathSteps> "." "*" <hi:@R> => {
1112
- let mut steps = path;
1113
- steps.push(ast::PathStep::PathUnpivot);
1114
- steps
1115
- },
1116
- <lo:@L> <path:PathSteps> "[" <expr:ExprQuery> "]" <hi:@R> => {
1117
- let step = ast::PathStep::PathExpr(
1118
- ast::PathExpr{
1119
- index: Box::new(*expr),
1120
- });
1121
-
1101
+ <path:PathSteps> <step:PathStep> => {
1122
1102
let mut steps = path;
1123
1103
steps.push(step);
1124
1104
steps
1125
1105
},
1106
+ <step:PathStep> => {
1107
+ vec![step]
1108
+ },
1109
+ }
1110
+ PathStep: ast::PathStep = {
1126
1111
"." <v:PathExprVarRef> => {
1127
- vec![ ast::PathStep::PathExpr( ast::PathExpr{ index: Box::new(v) })]
1112
+ ast::PathStep::PathExpr( ast::PathExpr{ index: Box::new(v) })
1128
1113
},
1129
1114
"[" "*" "]" => {
1130
- vec![ ast::PathStep::PathWildCard]
1115
+ ast::PathStep::PathWildCard
1131
1116
},
1132
1117
"." "*" => {
1133
- vec![ ast::PathStep::PathUnpivot]
1118
+ ast::PathStep::PathUnpivot
1134
1119
},
1135
1120
"[" <expr:ExprQuery> "]" => {
1136
- vec![ ast::PathStep::PathExpr( ast::PathExpr{ index: Box::new(*expr) })]
1121
+ ast::PathStep::PathExpr( ast::PathExpr{ index: Box::new(*expr) })
1137
1122
},
1138
1123
}
1139
1124
0 commit comments