def next_token
case
when @ss.scan(NEWLINE) then [:NEWLINE, nil]
when @ss.scan(SPACE) then next_token
when @ss.scan(COMMENT) then next_token
when @ss.scan(DATETIME) then process_datetime
when @ss.scan(LOCAL_TIME) then process_local_time
when text = @ss.scan(STRING_MULTI) then [:STRING_MULTI, text[3..-4]]
when text = @ss.scan(STRING_BASIC) then [:STRING_BASIC, text[1..-2]]
when text = @ss.scan(STRING_LITERAL_MULTI) then [:STRING_LITERAL_MULTI, text[3..-4]]
when text = @ss.scan(STRING_LITERAL) then [:STRING_LITERAL, text[1..-2]]
when text = @ss.scan(FLOAT) then [:FLOAT, text]
when text = @ss.scan(FLOAT_KEYWORD) then [:FLOAT_KEYWORD, text]
when text = @ss.scan(INTEGER) then [:INTEGER, text]
when text = @ss.scan(NON_DEC_INTEGER) then [:NON_DEC_INTEGER, text]
when text = @ss.scan(BOOLEAN) then [:BOOLEAN, text]
when text = @ss.scan(IDENTIFIER) then [:IDENTIFIER, text]
when @ss.eos? then process_eos
else x = @ss.getch; [x, x]
end
end