Skip to content

Commit 8ac1956

Browse files
committed
Fix for symbol detection when nested method
When nested method as identifer detected, @lex_state is :EXPR_MID and it becomes :EXPR_END. However, in ":" token processing, TkSYMBEG is generated only when @lex_state is not :EXPR_END. So symbol for nested method becomes TkCOLON as distinct from TkSYMBEG. This commit fixes the behavior.
1 parent e752c73 commit 8ac1956

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rdoc/ruby_lex.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ def identify_identifier
10731073
token.concat getc
10741074
end
10751075
elsif @lex_state == :EXPR_BEG || @lex_state == :EXPR_DOT ||
1076-
@lex_state == :EXPR_ARG
1076+
@lex_state == :EXPR_ARG || @lex_state == :EXPR_MID
10771077
@lex_state = :EXPR_ARG
10781078
else
10791079
@lex_state = :EXPR_END

0 commit comments

Comments
 (0)