Sha256: ab42de2441d6f37f106226462c9f258d71c221341616d7bbd29a31275560cb38
Contents?: true
Size: 510 Bytes
Versions: 12
Compression:
Stored size: 510 Bytes
Contents
# frozen_string_literal: true module Parser class Lexer::MaxNumparamStack def initialize @stack = [] end def cant_have_numparams! set(-1) end def can_have_numparams? top >= 0 end def register(numparam) set( [top, numparam].max ) end def top @stack.last end def push @stack.push(0) end def pop @stack.pop end private def set(value) @stack.pop @stack.push(value) end end end
Version data entries
12 entries across 8 versions & 2 rubygems