Method: SQLPP::Parser#_expect

Defined in:
lib/sqlpp/parser.rb

#_expect(type_or_types, pattern = nil) ⇒ Object



538
539
540
541
542
543
544
545
546
# File 'lib/sqlpp/parser.rb', line 538

def _expect(type_or_types, pattern=nil)
  token = _next

  if !_match(token, type_or_types, pattern)
    raise UnexpectedToken, "expected #{type_or_types.inspect}(#{pattern.inspect}), got #{token.inspect}"
  end

  token
end