#38 fix saving positions for php5 ArrayDimFetch, PropertyFetch and MethodCall nodes
This commit is contained in:
parent
d21a0a3dc9
commit
d13681c042
12
php5/php5.go
12
php5/php5.go
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
php5/php5.y
12
php5/php5.y
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user