Sha256: 5aa6e90dcf2973d2990f7688b30fe83645b127aed45311e3c5717bd1b5bfd9f6
Contents?: true
Size: 584 Bytes
Versions: 103
Compression:
Stored size: 584 Bytes
Contents
module Parser class StaticEnvironment def initialize reset end def reset @variables = Set[] @stack = [] end def extend_static @stack.push(@variables) @variables = Set[] self end def extend_dynamic @stack.push(@variables) @variables = @variables.dup self end def unextend @variables = @stack.pop self end def declare(name) @variables.add(name.to_sym) self end def declared?(name) @variables.include?(name.to_sym) end end end
Version data entries
103 entries across 103 versions & 5 rubygems