Merge pull request #39 from z7zmey/issue-38

#38 fix saving positions
This commit is contained in:
Vadym Slizov 2018-06-10 10:20:46 +03:00 committed by GitHub
commit 339c7e5296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -7387,17 +7387,17 @@ yydefault:
switch nn := n.(type) { switch nn := n.(type) {
case *expr.ArrayDimFetch: case *expr.ArrayDimFetch:
nn.Variable = yyVAL.node nn.Variable = yyVAL.node
yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn))
yyVAL.node = nn yyVAL.node = nn
case *expr.PropertyFetch: case *expr.PropertyFetch:
nn.Variable = yyVAL.node nn.Variable = yyVAL.node
yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn))
yyVAL.node = nn yyVAL.node = nn
case *expr.MethodCall: case *expr.MethodCall:
nn.Variable = yyVAL.node nn.Variable = yyVAL.node
yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn))
yyVAL.node = nn yyVAL.node = nn
} }
} }
@ -7406,17 +7406,17 @@ yydefault:
switch nn := n.(type) { switch nn := n.(type) {
case *expr.ArrayDimFetch: case *expr.ArrayDimFetch:
nn.Variable = yyVAL.node nn.Variable = yyVAL.node
yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn))
yyVAL.node = nn yyVAL.node = nn
case *expr.PropertyFetch: case *expr.PropertyFetch:
nn.Variable = yyVAL.node nn.Variable = yyVAL.node
yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn))
yyVAL.node = nn yyVAL.node = nn
case *expr.MethodCall: case *expr.MethodCall:
nn.Variable = yyVAL.node nn.Variable = yyVAL.node
yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn))
yyVAL.node = nn yyVAL.node = nn
} }
} }

View File

@ -4624,17 +4624,17 @@ variable:
switch nn := n.(type) { switch nn := n.(type) {
case *expr.ArrayDimFetch: case *expr.ArrayDimFetch:
nn.Variable = $$ nn.Variable = $$
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn))
$$ = nn $$ = nn
case *expr.PropertyFetch: case *expr.PropertyFetch:
nn.Variable = $$ nn.Variable = $$
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn))
$$ = nn $$ = nn
case *expr.MethodCall: case *expr.MethodCall:
nn.Variable = $$ nn.Variable = $$
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn))
$$ = nn $$ = nn
} }
} }
@ -4643,17 +4643,17 @@ variable:
switch nn := n.(type) { switch nn := n.(type) {
case *expr.ArrayDimFetch: case *expr.ArrayDimFetch:
nn.Variable = $$ nn.Variable = $$
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn))
$$ = nn $$ = nn
case *expr.PropertyFetch: case *expr.PropertyFetch:
nn.Variable = $$ nn.Variable = $$
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn))
$$ = nn $$ = nn
case *expr.MethodCall: case *expr.MethodCall:
nn.Variable = $$ nn.Variable = $$
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn))
$$ = nn $$ = nn
} }
} }