def advance
if @token_queue.any?
return @token_queue.shift
end
klass = self.class
_lex_trans_keys = klass.send :_lex_trans_keys
_lex_key_spans = klass.send :_lex_key_spans
_lex_index_offsets = klass.send :_lex_index_offsets
_lex_indicies = klass.send :_lex_indicies
_lex_trans_targs = klass.send :_lex_trans_targs
_lex_trans_actions = klass.send :_lex_trans_actions
_lex_to_state_actions = klass.send :_lex_to_state_actions
_lex_from_state_actions = klass.send :_lex_from_state_actions
_lex_eof_trans = klass.send :_lex_eof_trans
pe = @source_pts.size + 2
p, eof = @p, pe
@command_state = (@cs == klass.lex_en_expr_value ||
@cs == klass.lex_en_line_begin)
begin
testEof = false
_slen, _trans, _keys, _inds, _acts, _nacts = nil
_goto_level = 0
_resume = 10
_eof_trans = 15
_again = 20
_test_eof = 30
_out = 40
while true
if _goto_level <= 0
if p == pe
_goto_level = _test_eof
next
end
if @cs == 0
_goto_level = _out
next
end
end
if _goto_level <= _resume
case _lex_from_state_actions[ @cs]
when 84 then
begin
@ts = p
end
end
_keys = @cs << 1
_inds = _lex_index_offsets[ @cs]
_slen = _lex_key_spans[ @cs]
_wide = ( (@source_pts[p] || 0))
_trans = if ( _slen > 0 &&
_lex_trans_keys[_keys] <= _wide &&
_wide <= _lex_trans_keys[_keys + 1]
) then
_lex_indicies[ _inds + _wide - _lex_trans_keys[_keys] ]
else
_lex_indicies[ _inds + _slen ]
end
end
if _goto_level <= _eof_trans
@cs = _lex_trans_targs[_trans]
if _lex_trans_actions[_trans] != 0
case _lex_trans_actions[_trans]
when 28 then
begin
@newline_s = p
end
when 103 then
begin
@escape_s = p
@escape = nil
end
when 29 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
when 56 then
begin
@sharp_s = p - 1 end
when 60 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
when 283 then
begin
tm = p end
when 36 then
begin
tm = p end
when 38 then
begin
tm = p end
when 40 then
begin
tm = p end
when 66 then
begin
heredoc_e = p end
when 323 then
begin
@escape = nil end
when 352 then
begin
tm = p end
when 428 then
begin
@num_base = 16; @num_digits_s = p end
when 422 then
begin
@num_base = 10; @num_digits_s = p end
when 425 then
begin
@num_base = 8; @num_digits_s = p end
when 419 then
begin
@num_base = 2; @num_digits_s = p end
when 434 then
begin
@num_base = 10; @num_digits_s = @ts end
when 402 then
begin
@num_base = 8; @num_digits_s = @ts end
when 414 then
begin
@num_suffix_s = p end
when 409 then
begin
@num_suffix_s = p end
when 407 then
begin
@num_suffix_s = p end
when 80 then
begin
tm = p end
when 7 then
begin
@te = p+1
end
when 100 then
begin
@te = p+1
begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DBEG, '#{'.freeze)
if current_literal.heredoc?
current_literal.saved_herebody_s = @herebody_s
@herebody_s = nil
end
current_literal.start_interp_brace
begin
@stack[ @top] = @cs
@top+= 1
@cs = 765
_goto_level = _again
next
end
end
end
when 5 then
begin
@te = p+1
begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DVAR, nil, @ts, @ts + 1)
p = @ts
begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 96 then
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 95 then
begin
@te = p+1
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 101 then
begin
@te = p
p = p - 1; begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DVAR, nil, @ts, @ts + 1)
p = @ts
begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 98 then
begin
@te = p
p = p - 1; begin
literal.extend_space @ts, @te
end
end
when 99 then
begin
@te = p
p = p - 1; begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 6 then
begin
begin p = (( @te))-1; end
begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 4 then
begin
begin p = (( @te))-1; end
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 127 then
begin
@te = p+1
begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DBEG, '#{'.freeze)
if current_literal.heredoc?
current_literal.saved_herebody_s = @herebody_s
@herebody_s = nil
end
current_literal.start_interp_brace
begin
@stack[ @top] = @cs
@top+= 1
@cs = 765
_goto_level = _again
next
end
end
end
when 10 then
begin
@te = p+1
begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DVAR, nil, @ts, @ts + 1)
p = @ts
begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 124 then
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 123 then
begin
@te = p+1
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 128 then
begin
@te = p
p = p - 1; begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DVAR, nil, @ts, @ts + 1)
p = @ts
begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 126 then
begin
@te = p
p = p - 1; begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 11 then
begin
begin p = (( @te))-1; end
begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 9 then
begin
begin p = (( @te))-1; end
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 150 then
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 149 then
begin
@te = p+1
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 152 then
begin
@te = p
p = p - 1; begin
literal.extend_space @ts, @te
end
end
when 153 then
begin
@te = p
p = p - 1; begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 156 then
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 155 then
begin
@te = p+1
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 158 then
begin
@te = p
p = p - 1; begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 165 then
begin
@te = p+1
begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DBEG, '#{'.freeze)
if current_literal.heredoc?
current_literal.saved_herebody_s = @herebody_s
@herebody_s = nil
end
current_literal.start_interp_brace
begin
@stack[ @top] = @cs
@top+= 1
@cs = 765
_goto_level = _again
next
end
end
end
when 13 then
begin
@te = p+1
begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DVAR, nil, @ts, @ts + 1)
p = @ts
begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 162 then
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 161 then
begin
@te = p+1
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 166 then
begin
@te = p
p = p - 1; begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DVAR, nil, @ts, @ts + 1)
p = @ts
begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 164 then
begin
@te = p
p = p - 1; begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 12 then
begin
begin p = (( @te))-1; end
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 168 then
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 167 then
begin
@te = p+1
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 175 then
begin
@te = p+1
begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DBEG, '#{'.freeze)
if current_literal.heredoc?
current_literal.saved_herebody_s = @herebody_s
@herebody_s = nil
end
current_literal.start_interp_brace
begin
@stack[ @top] = @cs
@top+= 1
@cs = 765
_goto_level = _again
next
end
end
end
when 15 then
begin
@te = p+1
begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DVAR, nil, @ts, @ts + 1)
p = @ts
begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 171 then
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 170 then
begin
@te = p+1
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 176 then
begin
@te = p
p = p - 1; begin
current_literal = literal
current_literal.flush_string
current_literal.extend_content
emit(:tSTRING_DVAR, nil, @ts, @ts + 1)
p = @ts
begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 173 then
begin
@te = p
p = p - 1; begin
literal.extend_space @ts, @te
end
end
when 174 then
begin
@te = p
p = p - 1; begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 14 then
begin
begin p = (( @te))-1; end
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 178 then
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 177 then
begin
@te = p+1
begin
string = tok
if @version >= 22 && !@cond.active?
lookahead = @source_buffer.slice(@te...@te+2)
end
current_literal = literal
if !current_literal.heredoc? &&
(token = current_literal.nest_and_try_closing(string, @ts, @te, lookahead))
if token[0] == :tLABEL_END
p += 1
pop_literal
@cs = 758;
else
@cs = (pop_literal);
end
begin
p += 1
_goto_level = _out
next
end
else
current_literal.extend_string(string, @ts, @te)
end
end
end
when 180 then
begin
@te = p
p = p - 1; begin
literal.extend_space @ts, @te
end
end
when 181 then
begin
@te = p+1
begin
emit(:tREGEXP_OPT, tok(@ts, @te - 1), @ts, @te - 1)
p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 182 then
begin
@te = p
p = p - 1; begin
unknown_options = tok.scan(/[^imxouesn]/)
if unknown_options.any?
diagnostic :error, :regexp_options,
{ :options => unknown_options.join }
end
emit(:tREGEXP_OPT)
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 16 then
begin
@te = p+1
begin
if tok =~ /^\$([1-9][0-9]*)$/
emit(:tNTH_REF, tok(@ts + 1).to_i)
elsif tok =~ /^\$([&`'+])$/
emit(:tBACK_REF)
else
emit(:tGVAR)
end
@cs = (stack_pop); begin
p += 1
_goto_level = _out
next
end
end
end
when 183 then
begin
@te = p
p = p - 1; begin
if tok =~ /^\$([1-9][0-9]*)$/
emit(:tNTH_REF, tok(@ts + 1).to_i)
elsif tok =~ /^\$([&`'+])$/
emit(:tBACK_REF)
else
emit(:tGVAR)
end
@cs = (stack_pop); begin
p += 1
_goto_level = _out
next
end
end
end
when 185 then
begin
@te = p
p = p - 1; begin
if tok =~ /^@@[0-9]/
diagnostic :error, :cvar_name, { :name => tok }
end
emit(:tCVAR)
@cs = (stack_pop); begin
p += 1
_goto_level = _out
next
end
end
end
when 184 then
begin
@te = p
p = p - 1; begin
if tok =~ /^@[0-9]/
diagnostic :error, :ivar_name, { :name => tok }
end
emit(:tIVAR)
@cs = (stack_pop); begin
p += 1
_goto_level = _out
next
end
end
end
when 206 then
begin
@te = p+1
begin emit_table(KEYWORDS_BEGIN);
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
end
when 192 then
begin
@te = p+1
begin emit(:tIDENTIFIER)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
end
when 18 then
begin
@te = p+1
begin p = @ts - 1
@cs = 773; begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 189 then
begin
@te = p+1
begin emit_table(PUNCTUATION)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
end
when 201 then
begin
@te = p+1
begin p = p - 1; p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 20 then
begin
@te = p+1
begin
if version?(23)
type, delimiter = tok[0..-2], tok[-1].chr
begin
@cs = (push_literal(type, delimiter, @ts))
_goto_level = _again
next
end
else
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
end
when 188 then
begin
@te = p+1
begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 187 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 205 then
begin
@te = p
p = p - 1; begin emit_table(KEYWORDS_BEGIN);
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
end
when 202 then
begin
@te = p
p = p - 1; begin emit(:tCONSTANT)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
end
when 204 then
begin
@te = p
p = p - 1; begin emit(:tIDENTIFIER)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
end
when 199 then
begin
@te = p
p = p - 1; begin p = @ts - 1
@cs = 773; begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 195 then
begin
@te = p
p = p - 1; begin emit_table(PUNCTUATION)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
end
when 200 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 193 then
begin
@te = p
p = p - 1; end
when 198 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 19 then
begin
begin p = (( @te))-1; end
begin emit_table(PUNCTUATION)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
end
when 17 then
begin
begin p = (( @te))-1; end
begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 191 then
begin
case @act
when 39 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS_BEGIN);
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
when 40 then
begin begin p = (( @te))-1; end
emit(:tCONSTANT)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
when 41 then
begin begin p = (( @te))-1; end
emit(:tIDENTIFIER)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
end
end
when 22 then
begin
@te = p+1
begin emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)
p = p - 1; @cs = 758; begin
p += 1
_goto_level = _out
next
end
end
end
when 208 then
begin
@te = p+1
begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 207 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 210 then
begin
@te = p
p = p - 1; end
when 209 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 21 then
begin
begin p = (( @te))-1; end
begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 216 then
begin
@te = p+1
begin emit_table(PUNCTUATION)
@cs = 474; begin
p += 1
_goto_level = _out
next
end
end
end
when 215 then
begin
@te = p+1
begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 214 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 226 then
begin
@te = p
p = p - 1; begin emit(:tCONSTANT)
@cs = (arg_or_cmdarg); begin
p += 1
_goto_level = _out
next
end
end
end
when 217 then
begin
@te = p
p = p - 1; begin emit(:tIDENTIFIER)
@cs = (arg_or_cmdarg); begin
p += 1
_goto_level = _out
next
end
end
end
when 222 then
begin
@te = p
p = p - 1; begin emit_table(PUNCTUATION)
@cs = 474; begin
p += 1
_goto_level = _out
next
end
end
end
when 220 then
begin
@te = p
p = p - 1; end
when 225 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 249 then
begin
@te = p+1
begin
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 232 then
begin
@te = p+1
begin
if tok(tm, tm + 1) == '/'.freeze
diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)
end
p = tm - 1
begin
@cs = 543
_goto_level = _again
next
end
end
end
when 238 then
begin
@te = p+1
begin p = p - 1; p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 24 then
begin
@te = p+1
begin p = @ts - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 240 then
begin
@te = p+1
begin p = tm - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 39 then
begin
@te = p+1
begin
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 227 then
begin
@te = p+1
begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 228 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 239 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 235 then
begin
@te = p
p = p - 1; begin
diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },
range(tm, @te)
p = tm - 1
begin
@cs = 543
_goto_level = _again
next
end
end
end
when 237 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 231 then
begin
@te = p
p = p - 1; begin
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 230 then
begin
@te = p
p = p - 1; end
when 248 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 25 then
begin
begin p = (( @te))-1; end
end
when 41 then
begin
begin p = (( @te))-1; end
begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 23 then
begin
case @act
when 67 then
begin begin p = (( @te))-1; end
if tok(tm, tm + 1) == '/'.freeze
diagnostic :warning, :ambiguous_literal, nil, range(tm, tm + 1)
end
p = tm - 1
begin
@cs = 543
_goto_level = _again
next
end
end
when 68 then
begin begin p = (( @te))-1; end
diagnostic :warning, :ambiguous_prefix, { :prefix => tok(tm, @te) },
range(tm, @te)
p = tm - 1
begin
@cs = 543
_goto_level = _again
next
end
end
when 73 then
begin begin p = (( @te))-1; end
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
else
begin begin p = (( @te))-1; end
end
end
end
when 43 then
begin
@te = p+1
begin p = @ts - 1
begin
@cs = 474
_goto_level = _again
next
end
end
end
when 253 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 254 then
begin
@te = p
p = p - 1; begin p = @ts - 1
begin
@cs = 474
_goto_level = _again
next
end
end
end
when 44 then
begin
begin p = (( @te))-1; end
begin p = @ts - 1
begin
@cs = 474
_goto_level = _again
next
end
end
end
when 42 then
begin
case @act
when 80 then
begin begin p = (( @te))-1; end
if @cond.active?
emit(:kDO_COND, 'do'.freeze, @te - 2, @te)
else
emit(:kDO, 'do'.freeze, @te - 2, @te)
end
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
when 81 then
begin begin p = (( @te))-1; end
p = @ts - 1
begin
@cs = 474
_goto_level = _again
next
end
end
end
end
when 264 then
begin
@te = p+1
begin emit_do(true)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
end
when 257 then
begin
@te = p+1
begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 258 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 259 then
begin
@te = p
p = p - 1; end
when 262 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 268 then
begin
@te = p+1
begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 267 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 276 then
begin
@te = p
p = p - 1; begin p = @ts - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 270 then
begin
@te = p
p = p - 1; end
when 274 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 269 then
begin
case @act
when 88 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
when 89 then
begin begin p = (( @te))-1; end
p = @ts - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
end
when 53 then
begin
@te = p+1
begin
emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)
p = p - 1; @cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 305 then
begin
@te = p+1
begin
type = delimiter = tok[0].chr
p = p - 1; begin
@cs = (push_literal(type, delimiter, @ts))
_goto_level = _again
next
end
end
end
when 299 then
begin
@te = p+1
begin
type, delimiter = @source_buffer.slice(@ts).chr, tok[-1].chr
begin
@cs = (push_literal(type, delimiter, @ts))
_goto_level = _again
next
end
end
end
when 51 then
begin
@te = p+1
begin
type, delimiter = tok[0..-2], tok[-1].chr
begin
@cs = (push_literal(type, delimiter, @ts))
_goto_level = _again
next
end
end
end
when 306 then
begin
@te = p+1
begin
type, delimiter = tok, tok[-1].chr
begin
@cs = (push_literal(type, delimiter, @ts))
_goto_level = _again
next
end
end
end
when 65 then
begin
@te = p+1
begin
emit(:tSYMBOL, tok(@ts + 1), @ts)
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 320 then
begin
@te = p+1
begin
escape = { " " => '\s', "\r" => '\r', "\n" => '\n', "\t" => '\t',
"\v" => '\v', "\f" => '\f' }[@source_buffer.slice(@ts + 1)]
diagnostic :warning, :invalid_escape_use, { :escape => escape }, range
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 319 then
begin
@te = p+1
begin
diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)
end
end
when 307 then
begin
@te = p+1
begin emit_table(PUNCTUATION_BEGIN)
begin
p += 1
_goto_level = _out
next
end
end
end
when 48 then
begin
@te = p+1
begin
p = p - 1;
if version?(18)
ident = tok(@ts, @te - 2)
emit((@source_buffer.slice(@ts) =~ /[A-Z]/) ? :tCONSTANT : :tIDENTIFIER,
ident, @ts, @te - 2)
p = p - 1;
if !@static_env.nil? && @static_env.declared?(ident)
@cs = 773;
else
@cs = (arg_or_cmdarg);
end
else
emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)
@cs = 758;
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 293 then
begin
@te = p+1
begin p = @ts - 1
begin
@cs = 171
_goto_level = _again
next
end
end
end
when 52 then
begin
@te = p+1
begin p = @ts - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 279 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 304 then
begin
@te = p
p = p - 1; begin
emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)
p = p - 1; @cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 303 then
begin
@te = p
p = p - 1; begin emit(:tSTAR, '*'.freeze)
begin
p += 1
_goto_level = _out
next
end
end
end
when 300 then
begin
@te = p
p = p - 1; begin
type, delimiter = tok[0..-2], tok[-1].chr
begin
@cs = (push_literal(type, delimiter, @ts))
_goto_level = _again
next
end
end
end
when 298 then
begin
@te = p
p = p - 1; begin
diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)
end
end
when 308 then
begin
@te = p
p = p - 1; begin
emit(:tSYMBOL, tok(@ts + 1), @ts)
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 318 then
begin
@te = p
p = p - 1; begin
diagnostic :fatal, :incomplete_escape, nil, range(@ts, @ts + 1)
end
end
when 324 then
begin
@te = p
p = p - 1; begin
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 301 then
begin
@te = p
p = p - 1; begin emit_table(PUNCTUATION_BEGIN)
begin
p += 1
_goto_level = _out
next
end
end
end
when 346 then
begin
@te = p
p = p - 1; begin
emit(:tIDENTIFIER)
if !@static_env.nil? && @static_env.declared?(tok)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
else
@cs = (arg_or_cmdarg); begin
p += 1
_goto_level = _out
next
end
end
end
end
when 290 then
begin
@te = p
p = p - 1; end
when 292 then
begin
@te = p
p = p - 1; begin p = @ts - 1
begin
@cs = 171
_goto_level = _again
next
end
end
end
when 295 then
begin
@te = p
p = p - 1; begin p = @ts - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 50 then
begin
begin p = (( @te))-1; end
begin
diagnostic :fatal, :string_eof, nil, range(@ts, @ts + 1)
end
end
when 68 then
begin
begin p = (( @te))-1; end
begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 49 then
begin
begin p = (( @te))-1; end
end
when 64 then
begin
begin p = (( @te))-1; end
begin p = @ts - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 47 then
begin
case @act
when 94 then
begin begin p = (( @te))-1; end
emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)
p = p - 1; @cs = 773; begin
p += 1
_goto_level = _out
next
end
end
when 111 then
begin begin p = (( @te))-1; end
emit_table(PUNCTUATION_BEGIN)
begin
p += 1
_goto_level = _out
next
end
end
when 112 then
begin begin p = (( @te))-1; end
emit(:kRESCUE, 'rescue'.freeze, @ts, tm)
p = tm - 1
@cs = 519; begin
p += 1
_goto_level = _out
next
end
end
when 113 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS_BEGIN)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
when 115 then
begin begin p = (( @te))-1; end
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
when 116 then
begin begin p = (( @te))-1; end
emit(:tIDENTIFIER)
if !@static_env.nil? && @static_env.declared?(tok)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
else
@cs = (arg_or_cmdarg); begin
p += 1
_goto_level = _out
next
end
end
end
when 119 then
begin begin p = (( @te))-1; end
p = @ts - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
end
when 354 then
begin
@te = p+1
begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 355 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 356 then
begin
@te = p
p = p - 1; end
when 360 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 71 then
begin
@te = p+1
begin p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 364 then
begin
@te = p+1
begin
begin
@cs = (push_literal(tok, tok, @ts))
_goto_level = _again
next
end
end
end
when 363 then
begin
@te = p+1
begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 362 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 366 then
begin
@te = p
p = p - 1; end
when 365 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 70 then
begin
begin p = (( @te))-1; end
begin p = p - 1; begin
@cs = 543
_goto_level = _again
next
end
end
end
when 396 then
begin
@te = p+1
begin
emit(:tLAMBDA, '->'.freeze, @ts, @ts + 2)
@lambda_stack.push @paren_nest
@cs = 446; begin
p += 1
_goto_level = _out
next
end
end
end
when 78 then
begin
@te = p+1
begin emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)
emit(:tLSHFT, '<<'.freeze, @te - 2, @te)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
end
when 374 then
begin
@te = p+1
begin
type, delimiter = tok, tok[-1].chr
begin
@cs = (push_literal(type, delimiter, @ts, nil, false, false, true))
_goto_level = _again
next
end
end
end
when 73 then
begin
@te = p+1
begin p = @ts - 1; begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 393 then
begin
@te = p+1
begin emit_table(PUNCTUATION)
@cs = 453; begin
p += 1
_goto_level = _out
next
end
end
end
when 387 then
begin
@te = p+1
begin emit_table(PUNCTUATION)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
end
when 380 then
begin
@te = p+1
begin
emit_table(PUNCTUATION)
@cond.lexpop; @cmdarg.lexpop
if RBRACE_OR_RBRACK.include?(tok)
@cs = 511;
else
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 392 then
begin
@te = p+1
begin emit(:tOP_ASGN, tok(@ts, @te - 1))
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
end
when 378 then
begin
@te = p+1
begin emit(:tEH, '?'.freeze)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
end
when 375 then
begin
@te = p+1
begin emit_table(PUNCTUATION)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
end
when 377 then
begin
@te = p+1
begin emit(:tSEMI, ';'.freeze)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
end
when 442 then
begin
@te = p+1
begin
diagnostic :error, :bare_backslash, nil, range(@ts, @ts + 1)
p = p - 1;
end
end
when 373 then
begin
@te = p+1
begin
diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }
end
end
when 372 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 452 then
begin
@te = p
p = p - 1; begin emit_table(KEYWORDS)
@cs = 333; begin
p += 1
_goto_level = _out
next
end
end
end
when 450 then
begin
@te = p
p = p - 1; begin emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)
emit(:tLSHFT, '<<'.freeze, @te - 2, @te)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
end
when 449 then
begin
@te = p
p = p - 1; begin emit_table(KEYWORDS)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
end
when 399 then
begin
@te = p
p = p - 1; begin
diagnostic :error, :no_dot_digit_literal
end
end
when 439 then
begin
@te = p
p = p - 1; begin emit(:tCONSTANT)
@cs = (arg_or_cmdarg); begin
p += 1
_goto_level = _out
next
end
end
end
when 391 then
begin
@te = p
p = p - 1; begin p = @ts - 1; begin
@stack[ @top] = @cs
@top+= 1
@cs = 328
_goto_level = _again
next
end
end
end
when 397 then
begin
@te = p
p = p - 1; begin emit_table(PUNCTUATION)
@cs = 453; begin
p += 1
_goto_level = _out
next
end
end
end
when 444 then
begin
@te = p
p = p - 1; begin
emit(:tIDENTIFIER)
if !@static_env.nil? && @static_env.declared?(tok)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
else
@cs = (arg_or_cmdarg); begin
p += 1
_goto_level = _out
next
end
end
end
end
when 386 then
begin
@te = p
p = p - 1; begin emit_table(PUNCTUATION)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
end
when 398 then
begin
@te = p
p = p - 1; begin emit_table(PUNCTUATION)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
end
when 384 then
begin
@te = p
p = p - 1; end
when 390 then
begin
@te = p
p = p - 1; begin
diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }
end
end
when 74 then
begin
begin p = (( @te))-1; end
begin
diagnostic :error, :no_dot_digit_literal
end
end
when 72 then
begin
begin p = (( @te))-1; end
begin
diagnostic :fatal, :unexpected, { :character => tok.inspect[1..-2] }
end
end
when 75 then
begin
case @act
when 132 then
begin begin p = (( @te))-1; end
if @lambda_stack.last == @paren_nest
@lambda_stack.pop
if tok == '{'.freeze
emit(:tLAMBEG, '{'.freeze)
else
emit(:kDO_LAMBDA, 'do'.freeze)
end
else
if tok == '{'.freeze
emit(:tLCURLY, '{'.freeze)
else
emit_do
end
end
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
when 133 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
@cs = 333; begin
p += 1
_goto_level = _out
next
end
end
when 134 then
begin begin p = (( @te))-1; end
emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)
emit(:tLSHFT, '<<'.freeze, @te - 2, @te)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
when 135 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
when 136 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
when 137 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
@cs = 519; begin
p += 1
_goto_level = _out
next
end
end
when 138 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
if version?(18) && tok == 'not'.freeze
@cs = 543; begin
p += 1
_goto_level = _out
next
end
else
@cs = 474; begin
p += 1
_goto_level = _out
next
end
end
end
when 139 then
begin begin p = (( @te))-1; end
if version?(18)
emit(:tIDENTIFIER)
unless !@static_env.nil? && @static_env.declared?(tok)
@cs = (arg_or_cmdarg);
end
else
emit(:k__ENCODING__, '__ENCODING__'.freeze)
end
begin
p += 1
_goto_level = _out
next
end
end
when 140 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
begin
p += 1
_goto_level = _out
next
end
end
when 141 then
begin begin p = (( @te))-1; end
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
when 143 then
begin begin p = (( @te))-1; end
if version?(18, 19, 20)
diagnostic :error,
:trailing_in_number, { :character => tok(@te - 1, @te) },
range(@te - 1, @te)
else
emit(:tINTEGER, tok(@ts, @te - 1).to_i, @ts, @te - 1)
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 144 then
begin begin p = (( @te))-1; end
if version?(18, 19, 20)
diagnostic :error,
:trailing_in_number, { :character => tok(@te - 1, @te) },
range(@te - 1, @te)
else
emit(:tFLOAT, tok(@ts, @te - 1).to_f, @ts, @te - 1)
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 145 then
begin begin p = (( @te))-1; end
digits = tok(@ts, @num_suffix_s)
if version?(18, 19, 20)
emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits)
end
begin
p += 1
_goto_level = _out
next
end
end
when 147 then
begin begin p = (( @te))-1; end
emit(:tCONSTANT)
@cs = (arg_or_cmdarg); begin
p += 1
_goto_level = _out
next
end
end
when 151 then
begin begin p = (( @te))-1; end
emit(:tIDENTIFIER)
if !@static_env.nil? && @static_env.declared?(tok)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
else
@cs = (arg_or_cmdarg); begin
p += 1
_goto_level = _out
next
end
end
end
when 152 then
begin begin p = (( @te))-1; end
if tm == @te
emit(:tFID)
else
emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)
p = tm - 1
end
@cs = 474; begin
p += 1
_goto_level = _out
next
end
end
end
end
when 82 then
begin
@te = p+1
begin p = tm - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 457 then
begin
@te = p+1
begin emit(:tNL, nil, @newline_s, @newline_s + 1)
p = p - 1; @cs = 171; begin
p += 1
_goto_level = _out
next
end
end
end
when 458 then
begin
@te = p
p = p - 1; begin emit(:tNL, nil, @newline_s, @newline_s + 1)
p = p - 1; @cs = 171; begin
p += 1
_goto_level = _out
next
end
end
end
when 79 then
begin
begin p = (( @te))-1; end
begin emit(:tNL, nil, @newline_s, @newline_s + 1)
p = p - 1; @cs = 171; begin
p += 1
_goto_level = _out
next
end
end
end
when 461 then
begin
@te = p
p = p - 1; begin
emit_comment(@eq_begin_s, @te)
begin
@cs = 171
_goto_level = _again
next
end
end
end
when 460 then
begin
@te = p
p = p - 1; begin
diagnostic :fatal, :embedded_document, nil,
range(@eq_begin_s, @eq_begin_s + '=begin'.length)
end
end
when 93 then
begin
@te = p+1
begin @eq_begin_s = @ts
begin
@cs = 949
_goto_level = _again
next
end
end
end
when 2 then
begin
@te = p+1
begin p = pe - 3 end
end
when 85 then
begin
@te = p+1
begin p = p - 1; begin
@cs = 765
_goto_level = _again
next
end
end
end
when 86 then
begin
@te = p+1
begin
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 87 then
begin
@te = p
p = p - 1; end
when 92 then
begin
@te = p
p = p - 1; begin @eq_begin_s = @ts
begin
@cs = 949
_goto_level = _again
next
end
end
end
when 91 then
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 765
_goto_level = _again
next
end
end
end
when 1 then
begin
begin p = (( @te))-1; end
begin p = p - 1; begin
@cs = 765
_goto_level = _again
next
end
end
end
when 63 then
begin
@newline_s = p
end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
when 97 then
begin
@newline_s = p
end
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 125 then
begin
@newline_s = p
end
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 151 then
begin
@newline_s = p
end
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 157 then
begin
@newline_s = p
end
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 163 then
begin
@newline_s = p
end
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 169 then
begin
@newline_s = p
end
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 172 then
begin
@newline_s = p
end
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 179 then
begin
@newline_s = p
end
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
when 250 then
begin
@newline_s = p
end
begin
@te = p+1
begin
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 241 then
begin
@newline_s = p
end
begin
@te = p+1
begin p = tm - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 233 then
begin
@newline_s = p
end
begin
@te = p+1
begin
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 321 then
begin
@newline_s = p
end
begin
@te = p+1
begin
escape = { " " => '\s', "\r" => '\r', "\n" => '\n', "\t" => '\t',
"\v" => '\v', "\f" => '\f' }[@source_buffer.slice(@ts + 1)]
diagnostic :warning, :invalid_escape_use, { :escape => escape }, range
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 294 then
begin
@newline_s = p
end
begin
@te = p+1
begin p = @ts - 1
begin
@cs = 171
_goto_level = _again
next
end
end
end
when 462 then
begin
@newline_s = p
end
begin
@te = p+1
begin
emit_comment(@eq_begin_s, @te)
begin
@cs = 171
_goto_level = _again
next
end
end
end
when 459 then
begin
@newline_s = p
end
begin
@te = p+1
end
when 94 then
begin
@newline_s = p
end
begin
@te = p+1
begin @eq_begin_s = @ts
begin
@cs = 949
_goto_level = _again
next
end
end
end
when 3 then
begin
@newline_s = p
end
begin
@te = p+1
begin p = pe - 3 end
end
when 416 then
begin
@num_xfrm = lambda { |chars| emit(:tRATIONAL, Rational(chars)) } end
begin
@te = p
p = p - 1; begin
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 415 then
begin
@num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, chars)) } end
begin
@te = p
p = p - 1; begin
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 417 then
begin
@num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Rational(chars))) } end
begin
@te = p
p = p - 1; begin
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 410 then
begin
@num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Float(chars))) } end
begin
@te = p
p = p - 1; begin
digits = tok(@ts, @num_suffix_s)
if version?(18, 19, 20)
emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits)
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 411 then
begin
@num_xfrm = lambda { |chars| emit(:tRATIONAL, Rational(chars)) } end
begin
@te = p
p = p - 1; begin
digits = tok(@ts, @num_suffix_s)
if version?(18, 19, 20)
emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits)
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 412 then
begin
@num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Rational(chars))) } end
begin
@te = p
p = p - 1; begin
digits = tok(@ts, @num_suffix_s)
if version?(18, 19, 20)
emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits)
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 120 then
begin
@escape = ""
codepoints = tok(@escape_s + 2, p - 1)
codepoint_s = @escape_s + 2
codepoints.split(/[ \t]/).each do |codepoint_str|
codepoint = codepoint_str.to_i(16)
if codepoint >= 0x110000
diagnostic :error, :unicode_point_too_large, nil,
range(codepoint_s, codepoint_s + codepoint_str.length)
break
end
@escape += codepoint.chr(Encoding::UTF_8)
codepoint_s += codepoint_str.length + 1
end
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 146 then
begin
@escape = ""
codepoints = tok(@escape_s + 2, p - 1)
codepoint_s = @escape_s + 2
codepoints.split(/[ \t]/).each do |codepoint_str|
codepoint = codepoint_str.to_i(16)
if codepoint >= 0x110000
diagnostic :error, :unicode_point_too_large, nil,
range(codepoint_s, codepoint_s + codepoint_str.length)
break
end
@escape += codepoint.chr(Encoding::UTF_8)
codepoint_s += codepoint_str.length + 1
end
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 342 then
begin
@escape = ""
codepoints = tok(@escape_s + 2, p - 1)
codepoint_s = @escape_s + 2
codepoints.split(/[ \t]/).each do |codepoint_str|
codepoint = codepoint_str.to_i(16)
if codepoint >= 0x110000
diagnostic :error, :unicode_point_too_large, nil,
range(codepoint_s, codepoint_s + codepoint_str.length)
break
end
@escape += codepoint.chr(Encoding::UTF_8)
codepoint_s += codepoint_str.length + 1
end
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 104 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 130 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 326 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 107 then
begin
diagnostic :fatal, :invalid_escape
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 133 then
begin
diagnostic :fatal, :invalid_escape
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 329 then
begin
diagnostic :fatal, :invalid_escape
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 109 then
begin
@escape = "\x7f" end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 135 then
begin
@escape = "\x7f" end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 331 then
begin
@escape = "\x7f" end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 106 then
begin
@escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 132 then
begin
@escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 328 then
begin
@escape = encode_escape(tok(@escape_s, p).to_i(8) % 0x100) end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 122 then
begin
@escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 148 then
begin
@escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 344 then
begin
@escape = encode_escape(tok(@escape_s + 1, p).to_i(16)) end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 117 then
begin
@escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 143 then
begin
@escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 339 then
begin
@escape = tok(@escape_s + 1, p).to_i(16).chr(Encoding::UTF_8) end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 121 then
begin
diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 147 then
begin
diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 343 then
begin
diagnostic :fatal, :invalid_hex_escape, nil, range(@escape_s - 1, p + 2)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 116 then
begin
diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 142 then
begin
diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 338 then
begin
diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 119 then
begin
diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 145 then
begin
diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 341 then
begin
diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 105 then
begin
diagnostic :fatal, :escape_eof, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 131 then
begin
diagnostic :fatal, :escape_eof, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 327 then
begin
diagnostic :fatal, :escape_eof, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 154 then
begin
@escape_s = p
@escape = nil
end
begin
@te = p+1
begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 159 then
begin
@escape_s = p
@escape = nil
end
begin
@te = p+1
begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 54 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@newline_s = p
end
when 30 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
tm = p end
when 32 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
tm = p end
when 34 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
tm = p end
when 194 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; end
when 213 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; end
when 221 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; end
when 33 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p+1
begin
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 252 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; end
when 244 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 263 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; end
when 275 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; end
when 271 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; begin p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 55 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p+1
begin
emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)
p = p - 1; @cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 291 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; end
when 361 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; end
when 357 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; begin
if @in_kwarg
p = p - 1; begin
@cs = 773
_goto_level = _again
next
end
else
begin
@cs = 171
_goto_level = _again
next
end
end
end
end
when 370 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; end
when 367 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; begin begin
@cs = 171
_goto_level = _again
next
end
end
end
when 443 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; end
when 385 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; begin begin
@cs = 946
_goto_level = _again
next
end
end
end
when 88 then
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@te = p
p = p - 1; end
when 243 then
begin
@cond.push(false); @cmdarg.push(false)
current_literal = literal
if current_literal
current_literal.start_interp_brace
end
end
begin
@te = p
p = p - 1; begin
if @lambda_stack.last == @paren_nest
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
else
emit(:tLCURLY, '{'.freeze, @te - 1, @te)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
end
end
when 265 then
begin
@cond.push(false); @cmdarg.push(false)
current_literal = literal
if current_literal
current_literal.start_interp_brace
end
end
begin
@te = p
p = p - 1; begin
if @lambda_stack.last == @paren_nest
@lambda_stack.pop
emit(:tLAMBEG, '{'.freeze)
else
emit(:tLBRACE_ARG, '{'.freeze)
end
@cs = 765;
end
end
when 353 then
begin
@cond.push(false); @cmdarg.push(false)
current_literal = literal
if current_literal
current_literal.start_interp_brace
end
end
begin
@te = p
p = p - 1; begin
if @lambda_stack.last == @paren_nest
@lambda_stack.pop
emit(:tLAMBEG, '{'.freeze)
else
emit(:tLBRACE, '{'.freeze)
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 455 then
begin
@cond.push(false); @cmdarg.push(false)
current_literal = literal
if current_literal
current_literal.start_interp_brace
end
end
begin
@te = p
p = p - 1; begin
if @lambda_stack.last == @paren_nest
@lambda_stack.pop
if tok == '{'.freeze
emit(:tLAMBEG, '{'.freeze)
else
emit(:kDO_LAMBDA, 'do'.freeze)
end
else
if tok == '{'.freeze
emit(:tLCURLY, '{'.freeze)
else
emit_do
end
end
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
end
when 456 then
begin
current_literal = literal
if current_literal
if current_literal.end_interp_brace_and_try_closing
if version?(18, 19)
emit(:tRCURLY, '}'.freeze, p - 1, p)
else
emit(:tSTRING_DEND, '}'.freeze, p - 1, p)
end
if current_literal.saved_herebody_s
@herebody_s = current_literal.saved_herebody_s
end
p = p - 1;
@cs = (stack_pop);
begin
p += 1
_goto_level = _out
next
end
end
end
end
begin
@te = p
p = p - 1; begin
emit_table(PUNCTUATION)
@cond.lexpop; @cmdarg.lexpop
if RBRACE_OR_RBRACK.include?(tok)
@cs = 511;
else
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 57 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
when 61 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@newline_s = p
end
when 197 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 212 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 224 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 246 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; begin begin
@cs = 773
_goto_level = _again
next
end
end
end
when 261 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 273 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 297 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 359 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 369 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 389 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 90 then
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 218 then
begin
tm = p end
begin
@te = p
p = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)
@cs = (arg_or_cmdarg); p = tm - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 309 then
begin
tm = p end
begin
@te = p
p = p - 1; begin
emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)
p = tm - 1
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 282 then
begin
tm = p end
begin
@te = p
p = p - 1; begin p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 382 then
begin
tm = p end
begin
case @act
when 132 then
begin begin p = (( @te))-1; end
if @lambda_stack.last == @paren_nest
@lambda_stack.pop
if tok == '{'.freeze
emit(:tLAMBEG, '{'.freeze)
else
emit(:kDO_LAMBDA, 'do'.freeze)
end
else
if tok == '{'.freeze
emit(:tLCURLY, '{'.freeze)
else
emit_do
end
end
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
when 133 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
@cs = 333; begin
p += 1
_goto_level = _out
next
end
end
when 134 then
begin begin p = (( @te))-1; end
emit(:kCLASS, 'class'.freeze, @ts, @ts + 5)
emit(:tLSHFT, '<<'.freeze, @te - 2, @te)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
when 135 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
when 136 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
when 137 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
@cs = 519; begin
p += 1
_goto_level = _out
next
end
end
when 138 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
if version?(18) && tok == 'not'.freeze
@cs = 543; begin
p += 1
_goto_level = _out
next
end
else
@cs = 474; begin
p += 1
_goto_level = _out
next
end
end
end
when 139 then
begin begin p = (( @te))-1; end
if version?(18)
emit(:tIDENTIFIER)
unless !@static_env.nil? && @static_env.declared?(tok)
@cs = (arg_or_cmdarg);
end
else
emit(:k__ENCODING__, '__ENCODING__'.freeze)
end
begin
p += 1
_goto_level = _out
next
end
end
when 140 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS)
begin
p += 1
_goto_level = _out
next
end
end
when 141 then
begin begin p = (( @te))-1; end
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
when 143 then
begin begin p = (( @te))-1; end
if version?(18, 19, 20)
diagnostic :error,
:trailing_in_number, { :character => tok(@te - 1, @te) },
range(@te - 1, @te)
else
emit(:tINTEGER, tok(@ts, @te - 1).to_i, @ts, @te - 1)
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 144 then
begin begin p = (( @te))-1; end
if version?(18, 19, 20)
diagnostic :error,
:trailing_in_number, { :character => tok(@te - 1, @te) },
range(@te - 1, @te)
else
emit(:tFLOAT, tok(@ts, @te - 1).to_f, @ts, @te - 1)
p = p - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 145 then
begin begin p = (( @te))-1; end
digits = tok(@ts, @num_suffix_s)
if version?(18, 19, 20)
emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits)
end
begin
p += 1
_goto_level = _out
next
end
end
when 147 then
begin begin p = (( @te))-1; end
emit(:tCONSTANT)
@cs = (arg_or_cmdarg); begin
p += 1
_goto_level = _out
next
end
end
when 151 then
begin begin p = (( @te))-1; end
emit(:tIDENTIFIER)
if !@static_env.nil? && @static_env.declared?(tok)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
else
@cs = (arg_or_cmdarg); begin
p += 1
_goto_level = _out
next
end
end
end
when 152 then
begin begin p = (( @te))-1; end
if tm == @te
emit(:tFID)
else
emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)
p = tm - 1
end
@cs = 474; begin
p += 1
_goto_level = _out
next
end
end
end
end
when 219 then
begin
tm = p - 2 end
begin
@te = p
p = p - 1; begin emit(:tFID, tok(@ts, tm), @ts, tm)
@cs = (arg_or_cmdarg); p = tm - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 310 then
begin
tm = p - 2 end
begin
@te = p
p = p - 1; begin
emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)
p = tm - 1
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 284 then
begin
tm = p - 2 end
begin
@te = p
p = p - 1; begin p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 383 then
begin
tm = p - 2 end
begin
@te = p
p = p - 1; begin
if tm == @te
emit(:tFID)
else
emit(:tIDENTIFIER, tok(@ts, tm), @ts, tm)
p = tm - 1
end
@cs = 474; begin
p += 1
_goto_level = _out
next
end
end
end
when 311 then
begin
tm = p end
begin
@te = p
p = p - 1; begin
emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)
p = tm - 1
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 285 then
begin
tm = p end
begin
@te = p
p = p - 1; begin p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 312 then
begin
tm = p - 2 end
begin
@te = p
p = p - 1; begin
emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)
p = tm - 1
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 286 then
begin
tm = p - 2 end
begin
@te = p
p = p - 1; begin p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 316 then
begin
tm = p - 2 end
begin
@te = p
p = p - 1; begin
emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)
p = tm - 1
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 289 then
begin
tm = p - 2 end
begin
@te = p
p = p - 1; begin p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 315 then
begin
tm = p - 2 end
begin
@te = p
p = p - 1; begin
emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)
p = tm - 1
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 288 then
begin
tm = p - 2 end
begin
case @act
when 94 then
begin begin p = (( @te))-1; end
emit(:tUNARY_NUM, tok(@ts, @ts + 1), @ts, @ts + 1)
p = p - 1; @cs = 773; begin
p += 1
_goto_level = _out
next
end
end
when 111 then
begin begin p = (( @te))-1; end
emit_table(PUNCTUATION_BEGIN)
begin
p += 1
_goto_level = _out
next
end
end
when 112 then
begin begin p = (( @te))-1; end
emit(:kRESCUE, 'rescue'.freeze, @ts, tm)
p = tm - 1
@cs = 519; begin
p += 1
_goto_level = _out
next
end
end
when 113 then
begin begin p = (( @te))-1; end
emit_table(KEYWORDS_BEGIN)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
end
when 115 then
begin begin p = (( @te))-1; end
p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
when 116 then
begin begin p = (( @te))-1; end
emit(:tIDENTIFIER)
if !@static_env.nil? && @static_env.declared?(tok)
@cs = 446; begin
p += 1
_goto_level = _out
next
end
else
@cs = (arg_or_cmdarg); begin
p += 1
_goto_level = _out
next
end
end
end
when 119 then
begin begin p = (( @te))-1; end
p = @ts - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
end
when 313 then
begin
tm = p - 3 end
begin
@te = p
p = p - 1; begin
emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)
p = tm - 1
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 287 then
begin
tm = p - 3 end
begin
@te = p
p = p - 1; begin p = @ts - 1
begin
@cs = 773
_goto_level = _again
next
end
end
end
when 314 then
begin
tm = p - 2 end
begin
@te = p
p = p - 1; begin
emit(:tSYMBOL, tok(@ts + 1, tm), @ts, tm)
p = tm - 1
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 438 then
begin
tm = p - 2 end
begin
@te = p
p = p - 1; begin emit(:tCONSTANT, tok(@ts, tm), @ts, tm)
p = tm - 1; begin
p += 1
_goto_level = _out
next
end
end
end
when 242 then
begin
@cond.push(false); @cmdarg.push(false)
end
begin
@te = p
p = p - 1; begin emit(:tLBRACK, '['.freeze, @te - 1, @te)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
end
when 345 then
begin
@cond.push(false); @cmdarg.push(false)
end
begin
@te = p
p = p - 1; begin emit(:tLBRACK, '['.freeze)
begin
p += 1
_goto_level = _out
next
end
end
end
when 441 then
begin
@cond.push(false); @cmdarg.push(false)
end
begin
@te = p
p = p - 1; begin emit(:tLBRACK2, '['.freeze)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
end
when 234 then
begin
@cond.push(false); @cmdarg.push(false)
@paren_nest += 1
end
begin
@te = p
p = p - 1; begin
if version?(18)
emit(:tLPAREN2, '('.freeze, @te - 1, @te)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
else
emit(:tLPAREN_ARG, '('.freeze, @te - 1, @te)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
end
end
when 247 then
begin
@cond.push(false); @cmdarg.push(false)
@paren_nest += 1
end
begin
@te = p
p = p - 1; begin emit(:tLPAREN2, '('.freeze)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
end
when 255 then
begin
@cond.push(false); @cmdarg.push(false)
@paren_nest += 1
end
begin
@te = p
p = p - 1; begin
emit(:tLPAREN_ARG, '('.freeze, @te - 1, @te)
if version?(18)
@cs = 765; begin
p += 1
_goto_level = _out
next
end
else
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
end
end
when 302 then
begin
@cond.push(false); @cmdarg.push(false)
@paren_nest += 1
end
begin
@te = p
p = p - 1; begin emit(:tLPAREN, '('.freeze)
begin
p += 1
_goto_level = _out
next
end
end
end
when 394 then
begin
@cond.push(false); @cmdarg.push(false)
@paren_nest += 1
end
begin
@te = p
p = p - 1; begin emit_table(PUNCTUATION)
@cs = 543; begin
p += 1
_goto_level = _out
next
end
end
end
when 395 then
begin
@paren_nest -= 1
end
begin
@te = p
p = p - 1; begin
emit_table(PUNCTUATION)
@cond.lexpop; @cmdarg.lexpop
if RBRACE_OR_RBRACK.include?(tok)
@cs = 511;
else
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 67 then
begin
heredoc_e = p end
begin
@newline_s = p
end
when 317 then
begin
new_herebody_s = p end
begin
@te = p
p = p - 1; begin
tok(@ts, heredoc_e) =~ /^<<(-?)(~?)(["'`]?)(.*)\3$/
indent = !$1.empty? || !$2.empty?
dedent_body = !$2.empty?
type = $3.empty? ? '<<"'.freeze : ('<<'.freeze + $3)
delimiter = $4
if dedent_body && version?(18, 19, 20, 21, 22)
emit(:tLSHFT, '<<'.freeze, @ts, @ts + 2)
p = @ts + 1
@cs = 543; begin
p += 1
_goto_level = _out
next
end
else
@cs = (push_literal(type, delimiter, @ts, heredoc_e, indent, dedent_body));
@herebody_s ||= new_herebody_s
p = @herebody_s - 1
end
end
end
when 322 then
begin
@escape = nil end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 349 then
begin
tm = p end
begin
@te = p
p = p - 1; begin emit(:kRESCUE, 'rescue'.freeze, @ts, tm)
p = tm - 1
@cs = 519; begin
p += 1
_goto_level = _out
next
end
end
end
when 429 then
begin
@num_base = 16; @num_digits_s = p end
begin
@num_suffix_s = p end
when 423 then
begin
@num_base = 10; @num_digits_s = p end
begin
@num_suffix_s = p end
when 426 then
begin
@num_base = 8; @num_digits_s = p end
begin
@num_suffix_s = p end
when 420 then
begin
@num_base = 2; @num_digits_s = p end
begin
@num_suffix_s = p end
when 435 then
begin
@num_base = 10; @num_digits_s = @ts end
begin
@num_suffix_s = p end
when 404 then
begin
@num_base = 8; @num_digits_s = @ts end
begin
@num_suffix_s = p end
when 436 then
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
when 81 then
begin
tm = p end
begin
@te = p+1
begin p = tm - 1; begin
@cs = 773
_goto_level = _again
next
end
end
end
when 8 then
begin
@te = p+1
end
begin
@newline_s = p
end
when 203 then
begin
@te = p+1
end
begin
@act = 39; end
when 190 then
begin
@te = p+1
end
begin
@act = 40; end
when 186 then
begin
@te = p+1
end
begin
@act = 41; end
when 26 then
begin
@te = p+1
end
begin
@act = 67; end
when 236 then
begin
@te = p+1
end
begin
@act = 68; end
when 27 then
begin
@te = p+1
end
begin
@act = 73; end
when 229 then
begin
@te = p+1
end
begin
@act = 74; end
when 256 then
begin
@te = p+1
end
begin
@act = 80; end
when 45 then
begin
@te = p+1
end
begin
@act = 81; end
when 277 then
begin
@te = p+1
end
begin
@act = 88; end
when 266 then
begin
@te = p+1
end
begin
@act = 89; end
when 280 then
begin
@te = p+1
end
begin
@act = 111; end
when 348 then
begin
@te = p+1
end
begin
@act = 112; end
when 347 then
begin
@te = p+1
end
begin
@act = 113; end
when 69 then
begin
@te = p+1
end
begin
@act = 115; end
when 278 then
begin
@te = p+1
end
begin
@act = 116; end
when 281 then
begin
@te = p+1
end
begin
@act = 119; end
when 451 then
begin
@te = p+1
end
begin
@act = 132; end
when 446 then
begin
@te = p+1
end
begin
@act = 133; end
when 454 then
begin
@te = p+1
end
begin
@act = 135; end
when 447 then
begin
@te = p+1
end
begin
@act = 136; end
when 448 then
begin
@te = p+1
end
begin
@act = 137; end
when 453 then
begin
@te = p+1
end
begin
@act = 138; end
when 445 then
begin
@te = p+1
end
begin
@act = 139; end
when 440 then
begin
@te = p+1
end
begin
@act = 140; end
when 376 then
begin
@te = p+1
end
begin
@act = 141; end
when 406 then
begin
@te = p+1
end
begin
@act = 144; end
when 76 then
begin
@te = p+1
end
begin
@act = 145; end
when 379 then
begin
@te = p+1
end
begin
@act = 147; end
when 371 then
begin
@te = p+1
end
begin
@act = 151; end
when 381 then
begin
@te = p+1
end
begin
@act = 152; end
when 160 then
begin
@newline_s = p
end
begin
@te = p+1
begin
current_literal = literal
if @te == pe
diagnostic :fatal, :string_eof, nil,
range(current_literal.str_s, current_literal.str_s + 1)
end
if current_literal.heredoc?
line = tok(@herebody_s, @ts).gsub(/\r+$/, ''.freeze)
if version?(18, 19, 20)
line = line.gsub(/\r.*$/, ''.freeze)
end
if current_literal.nest_and_try_closing(line, @herebody_s, @ts)
@herebody_s = @te
p = current_literal.heredoc_e - 1
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
else
current_literal.infer_indent_level(line)
@herebody_s = @te
end
else
if current_literal.nest_and_try_closing(tok, @ts, @te)
@cs = (pop_literal); begin
p += 1
_goto_level = _out
next
end
end
if @herebody_s
p = @herebody_s - 1
@herebody_s = nil
end
end
if current_literal.words? && !eof_codepoint?(@source_pts[p])
current_literal.extend_space @ts, @te
else
current_literal.extend_string tok, @ts, @te
current_literal.flush_string
end
end
end
begin
@escape_s = p
@escape = nil
end
when 110 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 136 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 332 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 115 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 141 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 337 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 114 then
begin
@escape = @source_buffer.slice(p - 1).chr end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 140 then
begin
@escape = @source_buffer.slice(p - 1).chr end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 336 then
begin
@escape = @source_buffer.slice(p - 1).chr end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 112 then
begin
@escape = "\x7f" end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 138 then
begin
@escape = "\x7f" end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 334 then
begin
@escape = "\x7f" end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 108 then
begin
@escape = @source_buffer.slice(p - 1).chr end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 134 then
begin
@escape = @source_buffer.slice(p - 1).chr end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 330 then
begin
@escape = @source_buffer.slice(p - 1).chr end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 118 then
begin
diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)
end
begin
diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 144 then
begin
diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)
end
begin
diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 340 then
begin
diagnostic :fatal, :invalid_unicode_escape, nil, range(@escape_s - 1, p)
end
begin
diagnostic :fatal, :unterminated_unicode, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 102 then
begin
@escape_s = p
@escape = nil
end
begin
diagnostic :fatal, :escape_eof, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 129 then
begin
@escape_s = p
@escape = nil
end
begin
diagnostic :fatal, :escape_eof, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 325 then
begin
@escape_s = p
@escape = nil
end
begin
diagnostic :fatal, :escape_eof, nil, range(p - 1, p)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 58 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@newline_s = p
end
when 196 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 211 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 223 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 245 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; begin begin
@cs = 773
_goto_level = _again
next
end
end
end
when 260 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 272 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 296 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 358 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 368 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 388 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 89 then
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@te = p
p = p - 1; end
when 431 then
begin
@num_base = 10; @num_digits_s = @ts end
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
when 401 then
begin
@num_base = 8; @num_digits_s = @ts end
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
when 413 then
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
begin
@te = p
p = p - 1; begin
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 408 then
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars)) } end
begin
@te = p
p = p - 1; begin
digits = tok(@ts, @num_suffix_s)
if version?(18, 19, 20)
emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits)
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 405 then
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tFLOAT, Float(chars)) } end
begin
@te = p
p = p - 1; begin
digits = tok(@ts, @num_suffix_s)
if version?(18, 19, 20)
emit(:tFLOAT, Float(digits), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits)
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 251 then
begin
@te = p+1
end
begin
@newline_s = p
end
begin
@act = 74; end
when 35 then
begin
@te = p+1
end
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@act = 73; end
when 46 then
begin
@te = p+1
end
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
@act = 81; end
when 62 then
begin
@te = p+1
end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@act = 94; end
when 77 then
begin
@te = p+1
end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@act = 134; end
when 37 then
begin
@te = p+1
end
begin
tm = p end
begin
@act = 68; end
when 351 then
begin
@te = p+1
end
begin
tm = p end
begin
@act = 115; end
when 350 then
begin
@te = p+1
end
begin
tm = p end
begin
@act = 116; end
when 432 then
begin
@te = p+1
end
begin
@num_base = 10; @num_digits_s = @ts end
begin
@act = 141; end
when 113 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 139 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 335 then
begin
codepoint = @source_pts[p - 1]
if (@escape = ESCAPES[codepoint]).nil?
@escape = encode_escape(@source_buffer.slice(p - 1))
end
end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 111 then
begin
@escape = @source_buffer.slice(p - 1).chr end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 137 then
begin
@escape = @source_buffer.slice(p - 1).chr end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
current_literal = literal
escaped_char = @source_buffer.slice(@escape_s).chr
if current_literal.munge_escape? escaped_char
if current_literal.regexp? && REGEXP_META_CHARACTERS.match(escaped_char)
current_literal.extend_string(tok, @ts, @te)
else
current_literal.extend_string(escaped_char, @ts, @te)
end
else
if current_literal.regexp?
current_literal.extend_string(tok.gsub("\\\n".freeze, ''.freeze), @ts, @te)
else
current_literal.extend_string(@escape || tok, @ts, @te)
end
end
end
end
when 333 then
begin
@escape = @source_buffer.slice(p - 1).chr end
begin
@escape = encode_escape(@escape[0].ord & 0x9f)
end
begin
@escape = encode_escape(@escape[0].ord | 0x80)
end
begin
@te = p
p = p - 1; begin
value = @escape || tok(@ts + 1)
if version?(18)
if defined?(Encoding)
emit(:tINTEGER, value.dup.force_encoding(Encoding::BINARY)[0].ord)
else
emit(:tINTEGER, value[0].ord)
end
else
emit(:tCHARACTER, value)
end
@cs = 773; begin
p += 1
_goto_level = _out
next
end
end
end
when 427 then
begin
@num_base = 16; @num_digits_s = p end
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
begin
@te = p
p = p - 1; begin
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 421 then
begin
@num_base = 10; @num_digits_s = p end
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
begin
@te = p
p = p - 1; begin
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 424 then
begin
@num_base = 8; @num_digits_s = p end
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
begin
@te = p
p = p - 1; begin
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 418 then
begin
@num_base = 2; @num_digits_s = p end
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
begin
@te = p
p = p - 1; begin
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 430 then
begin
@num_base = 10; @num_digits_s = @ts end
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
begin
@te = p
p = p - 1; begin
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 400 then
begin
@num_base = 8; @num_digits_s = @ts end
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
begin
@te = p
p = p - 1; begin
digits = tok(@num_digits_s, @num_suffix_s)
if digits.end_with? '_'.freeze
diagnostic :error, :trailing_in_number, { :character => '_'.freeze },
range(@te - 1, @te)
elsif digits.empty? && @num_base == 8 && version?(18)
digits = '0'.freeze
elsif digits.empty?
diagnostic :error, :empty_numeric
elsif @num_base == 8 && (invalid_idx = digits.index(/[89]/))
invalid_s = @num_digits_s + invalid_idx
diagnostic :error, :invalid_octal, nil,
range(invalid_s, invalid_s + 1)
end
if version?(18, 19, 20)
emit(:tINTEGER, digits.to_i(@num_base), @ts, @num_suffix_s)
p = @num_suffix_s - 1
else
@num_xfrm.call(digits.to_i(@num_base))
end
begin
p += 1
_goto_level = _out
next
end
end
end
when 31 then
begin
@te = p+1
end
begin
if @herebody_s
p = @herebody_s
@herebody_s = nil
end
end
begin
tm = p end
begin
@act = 68; end
when 59 then
begin
@te = p+1
end
begin
@sharp_s = p - 1 end
begin
emit_comment(@sharp_s, p == pe ? p - 2 : p) end
begin
@act = 94; end
when 437 then
begin
@te = p+1
end
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
begin
@act = 143; end
when 433 then
begin
@te = p+1
end
begin
@num_base = 10; @num_digits_s = @ts end
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
begin
@act = 143; end
when 403 then
begin
@te = p+1
end
begin
@num_base = 8; @num_digits_s = @ts end
begin
@num_suffix_s = p end
begin
@num_xfrm = lambda { |chars| emit(:tINTEGER, chars) } end
begin
@act = 143; end
end
end
end
if _goto_level <= _again
case _lex_to_state_actions[ @cs]
when 83 then
begin
@ts = nil; end
end
if @cs == 0
_goto_level = _out
next
end
p += 1
if p != pe
_goto_level = _resume
next
end
end
if _goto_level <= _test_eof
if p == eof
if _lex_eof_trans[ @cs] > 0
_trans = _lex_eof_trans[ @cs] - 1;
_goto_level = _eof_trans
next;
end
end
end
if _goto_level <= _out
break
end
end
end
@p = p
if @token_queue.any?
@token_queue.shift
elsif @cs == klass.lex_error
[ false, [ '$error'.freeze, range(p - 1, p) ] ]
else
eof = @source_pts.size
[ false, [ '$eof'.freeze, range(eof, eof) ] ]
end
end