#38 fix saving positions for php5 ArrayDimFetch, PropertyFetch and MethodCall nodes

This commit is contained in:
z7zmey 2018-06-10 10:01:25 +03:00
parent d21a0a3dc9
commit d13681c042
2 changed files with 12 additions and 12 deletions

View File

@ -7387,17 +7387,17 @@ yydefault:
switch nn := n.(type) {
case *expr.ArrayDimFetch:
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
case *expr.PropertyFetch:
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
case *expr.MethodCall:
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
}
}
@ -7406,17 +7406,17 @@ yydefault:
switch nn := n.(type) {
case *expr.ArrayDimFetch:
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
case *expr.PropertyFetch:
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
case *expr.MethodCall:
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
}
}

View File

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