Skip to content

Commit 8f7742f

Browse files
committed
Handle TkPLUS or TkMINUS and number as TkINTEGER
For example, lexical analyser splitted sign character and follow number such as "-5r" to "-" and "5r", "+1.08" to "+" and "1.08". But this "-" or "+" is a part of number and not operator. So this Pull Request joins it.
1 parent 0c47b30 commit 8f7742f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/rdoc/ruby_lex.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@ def token
376376
else
377377
tk = tk1
378378
end
379+
elsif (TkPLUS === tk or TkMINUS === tk) and peek(0) =~ /\d/ then
380+
tk1 = token
381+
set_token_position tk.seek, tk.line_no, tk.char_no
382+
tk = Token(tk1.class, tk.text + tk1.text)
379383
end
380384
# Tracer.off
381385
tk

0 commit comments

Comments
 (0)