class RDoc::Parser::RipperStateLex

Constants

EXPR_ARG
EXPR_ARG_ANY
EXPR_BEG
EXPR_BEG_ANY
EXPR_CLASS
EXPR_CMDARG
EXPR_DOT
EXPR_END
EXPR_ENDARG
EXPR_ENDFN
EXPR_END_ANY
EXPR_FITEM
EXPR_FNAME
EXPR_LABEL
EXPR_LABELED
EXPR_MID
EXPR_NONE
EXPR_VALUE
RIPPER_HAS_LEX_STATE

TODO: Remove this constants after Ruby 2.4 EOL

Token

Public Instance Methods

on_backref(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 223
def on_backref(tok, data)
  @lex_state = EXPR_END
  on_variables(__method__, tok, data)
end
on_comma(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 274
def on_comma(tok, data)
  @lex_state = EXPR_BEG | EXPR_LABEL if (EXPR_ARG_ANY & @lex_state) != 0
  data << Token.new(lineno, column, __method__, tok, @lex_state)
end
on_comment(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 279
def on_comment(tok, data)
  @lex_state = EXPR_BEG unless (EXPR_LABEL & @lex_state) != 0
  data << Token.new(lineno, column, __method__, tok, @lex_state)
end
on_const(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 258
def on_const(tok, data)
  case @lex_state
  when EXPR_FNAME
    @lex_state = EXPR_ENDFN
  when EXPR_CLASS, EXPR_CMDARG, EXPR_MID
    @lex_state = EXPR_ARG
  else
    @lex_state = EXPR_CMDARG
  end
  data << Token.new(lineno, column, __method__, tok, @lex_state)
end
on_cvar(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 213
def on_cvar(tok, data)
  @lex_state = EXPR_END
  on_variables(__method__, tok, data)
end
on_default(event, tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 301
def on_default(event, tok, data)
  reset
  data << Token.new(lineno, column, event, tok, @lex_state)
end
on_gvar(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 218
def on_gvar(tok, data)
  @lex_state = EXPR_END
  on_variables(__method__, tok, data)
end
on_heredoc_beg(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 289
def on_heredoc_beg(tok, data)
  data << Token.new(lineno, column, __method__, tok, @lex_state)
  @lex_state = EXPR_END
  data
end
on_heredoc_end(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 295
def on_heredoc_end(tok, data)
  data << Token.new(lineno, column, __method__, tok, @lex_state)
  @lex_state = EXPR_BEG
  data
end
on_ident(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 204
def on_ident(tok, data)
  on_variables(__method__, tok, data)
end
on_ignored_sp(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 284
def on_ignored_sp(tok, data)
  @lex_state = EXPR_BEG unless (EXPR_LABEL & @lex_state) != 0
  data << Token.new(lineno, column, __method__, tok, @lex_state)
end
on_ivar(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 208
def on_ivar(tok, data)
  @lex_state = EXPR_END
  on_variables(__method__, tok, data)
end
on_lbrace(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 238
def on_lbrace(tok, data)
  @lex_state = EXPR_LABEL | EXPR_BEG
  data << Token.new(lineno, column, __method__, tok, @lex_state)
end
on_lbracket(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 248
def on_lbracket(tok, data)
  @lex_state = EXPR_LABEL | EXPR_BEG
  data << Token.new(lineno, column, __method__, tok, @lex_state)
end
on_lparen(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 228
def on_lparen(tok, data)
  @lex_state = EXPR_LABEL | EXPR_BEG
  data << Token.new(lineno, column, __method__, tok, @lex_state)
end
on_rbrace(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 243
def on_rbrace(tok, data)
  @lex_state = EXPR_ENDARG
  data << Token.new(lineno, column, __method__, tok, @lex_state)
end
on_rbracket(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 253
def on_rbracket(tok, data)
  @lex_state = EXPR_ENDARG
  data << Token.new(lineno, column, __method__, tok, @lex_state)
end
on_rparen(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 233
def on_rparen(tok, data)
  @lex_state = EXPR_ENDFN
  data << Token.new(lineno, column, __method__, tok, @lex_state)
end
on_sp(tok, data) click to toggle source
# File lib/rdoc/parser/ripper_state_lex.rb, line 270
def on_sp(tok, data)
  data << Token.new(lineno, column, __method__, tok, @lex_state)
end