Browse Source

Merge pull request #510 from Mingun/group-location

Add location information to group AST node
master
Futago-za Ryuu 4 years ago
committed by GitHub
parent
commit
1afe682c65
  1. 2
      lib/parser.js
  2. 2
      src/parser.pegjs

2
lib/parser.js

@ -236,7 +236,7 @@ function peg$parse(input, options) {
// nodes that already isolate label scope themselves. This leaves us with
// "labeled" and "sequence".
return expression.type === "labeled" || expression.type === "sequence"
? { type: "group", expression: expression }
? { type: "group", expression: expression, location: location() }
: expression;
};
var peg$c32 = function(name) {

2
src/parser.pegjs

@ -180,7 +180,7 @@ PrimaryExpression
// nodes that already isolate label scope themselves. This leaves us with
// "labeled" and "sequence".
return expression.type === "labeled" || expression.type === "sequence"
? { type: "group", expression: expression }
? { type: "group", expression: expression, location: location() }
: expression;
}

Loading…
Cancel
Save