mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
JSON like label ends by differs from the start
pp Ripper.lex('{ "a": 3 }') => [[[1, 0], :on_lbrace, "{", EXPR_BEG|EXPR_LABEL], [[1, 1], :on_sp, " ", EXPR_BEG|EXPR_LABEL], [[1, 2], :on_tstring_beg, "\"", EXPR_BEG|EXPR_LABEL], [[1, 3], :on_tstring_content, "a", EXPR_BEG|EXPR_LABEL], [[1, 4], :on_label_end, "\":", EXPR_BEG|EXPR_LABEL], [[1, 6], :on_sp, " ", EXPR_BEG|EXPR_LABEL], [[1, 7], :on_int, "3", EXPR_END], [[1, 8], :on_sp, " ", EXPR_END], [[1, 9], :on_rbrace, "}", EXPR_END]]
This commit is contained in:
parent
809ac9f2ea
commit
7686e33ee4
1 changed files with 2 additions and 2 deletions
|
@ -251,7 +251,7 @@ class RubyLex
|
|||
case t[1]
|
||||
when :on_tstring_beg
|
||||
start_token << t
|
||||
end_type << :on_tstring_end
|
||||
end_type << [:on_tstring_end, :on_label_end]
|
||||
when :on_regexp_beg
|
||||
start_token << t
|
||||
end_type << :on_regexp_end
|
||||
|
@ -269,7 +269,7 @@ class RubyLex
|
|||
when :on_heredoc_beg
|
||||
start_token << t
|
||||
end_type << :on_heredoc_end
|
||||
when end_type.last
|
||||
when *end_type.last
|
||||
start_token.pop
|
||||
end_type.pop
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue