First page Back Continue Last page Overview Graphics

The Rest

  • Throw away other characters...
  • smulti(:parse, /./) { |junk, rest| parse(rest) }
  • And if we get to end of the string and have no unmatched opening parens left and the stack is empty, the string is balanced.
  • smulti(:parse, /$/) { @stack.empty? }

    Notes: