We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29fdbf7 commit ceb2d60Copy full SHA for ceb2d60
lib/idl/passes/prune.rb
@@ -51,6 +51,17 @@ def prune(symtab)
51
52
new_node
53
end
54
+
55
+ def nullify_assignments(symtab)
56
+ @children.each do |child|
57
+ child.nullify_assignments(symtab)
58
+ end
59
60
61
+ class VariableAssignmentAst
62
63
+ symtab.get(lhs.text_value).value = nil
64
65
66
class FunctionCallExpressionAst
67
def prune(symtab)
@@ -78,6 +89,9 @@ class ForLoopAst
78
89
79
90
symtab.push(self)
80
91
symtab.add(init.lhs.name, Var.new(init.lhs.name, init.lhs_type(symtab)))
92
93
+ stmts.each { |stmt| stmt.nullify_assignments(symtab) }
94
81
95
begin
82
96
new_loop =
83
97
ForLoopAst.new(
0 commit comments