class RpRb::Reader

Public Instance Methods

read(string) click to toggle source
# File lib/expr.rb, line 36
def read(string)
   to_stream(Parser.parse_string(string))
end
to_stream(ast) click to toggle source
# File lib/expr.rb, line 42
def to_stream(ast)
   case ast
   when Stream
      ast.children[0].collect { |child| to_stream(child) }
   when Expression, Block
      to_stream ast.children[0]
   else
      ast
   end
end