# File lib/jmespath/parser.rb, line 36 def parse(expression) tokens = @lexer.tokenize(expression) stream = TokenStream.new(expression, tokens) result = expr(stream) if stream.token.type != Lexer::T_EOF raise Errors::SyntaxError, "expected :eof got #{stream.token.type}" else result end end