Method: CqlRuby::CqlLexer#underlying_next_token

Defined in:
lib/cql_ruby/cql_lexer.rb

#underlying_next_tokenObject



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/cql_ruby/cql_lexer.rb', line 130

def underlying_next_token
  @index += 1
  if @index >= @simple_tokens.length
    @token_type = CqlLexer::TT_EOF
    @value = nil
    return
  end
  @value = @simple_tokens[ @index ]
  if /^[0-9]+$/ =~ @value
    @token_type = CqlLexer::TT_NUMBER
  elsif @value.length > 1
    if @value.slice(0..0) == '"'
      @token_type = '"'
      @value = @value.slice(1..-2)
    else
      @token_type = @@keywords[ @value.downcase ] || CqlLexer::TT_WORD
    end
  else
    @token_type = @value
  end
end