File tree 3 files changed +18
-1
lines changed
3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,14 @@ std::unique_ptr<parser::Node> Translator::translate(pm_node_t *node) {
282
282
283
283
return make_unique<parser::Kwrestarg>(parser.translateLocation (loc), gs.enterNameUTF8 (name));
284
284
}
285
+ case PM_LOCAL_VARIABLE_READ_NODE: {
286
+ auto localVarReadNode = reinterpret_cast <pm_local_variable_read_node *>(node);
287
+ pm_location_t *loc = &localVarReadNode->base .location ;
288
+
289
+ std::string_view name = parser.resolveConstant (localVarReadNode->name );
290
+
291
+ return make_unique<parser::LVar>(parser.translateLocation (loc), gs.enterNameUTF8 (name));
292
+ }
285
293
case PM_LOCAL_VARIABLE_WRITE_NODE: {
286
294
auto localVarWriteNode = reinterpret_cast <pm_local_variable_write_node *>(node);
287
295
pm_location_t *loc = &localVarWriteNode->base .location ;
@@ -631,7 +639,6 @@ std::unique_ptr<parser::Node> Translator::translate(pm_node_t *node) {
631
639
case PM_LOCAL_VARIABLE_AND_WRITE_NODE:
632
640
case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE:
633
641
case PM_LOCAL_VARIABLE_OR_WRITE_NODE:
634
- case PM_LOCAL_VARIABLE_READ_NODE:
635
642
case PM_LOCAL_VARIABLE_TARGET_NODE:
636
643
case PM_MATCH_LAST_LINE_NODE:
637
644
case PM_MATCH_PREDICATE_NODE:
Original file line number Diff line number Diff line change @@ -19,5 +19,13 @@ Begin {
19
19
]
20
20
}
21
21
}
22
+ Assign {
23
+ lhs = LVarLhs {
24
+ name = <U local_variable2>
25
+ }
26
+ rhs = LVar {
27
+ name = <U local_variable1>
28
+ }
29
+ }
22
30
]
23
31
}
Original file line number Diff line number Diff line change 4
4
5
5
local_variable2 = this_is_a_method_call
6
6
# ^^^^^^^^^^^^^^^^^^^^^ error: Method `this_is_a_method_call` does not exist on `T.class_of(<root>)`
7
+
8
+ local_variable2 = local_variable1 # should parse as local variable lookup
You can’t perform that action at this time.
0 commit comments