Class: ParseComment
- Inherits:
-
ParseState
- Object
- ParseState
- ParseComment
- Defined in:
- lib/saikuro.rb
Overview
Read and consume tokens in comments until a new line.
Instance Attribute Summary
Attributes inherited from ParseState
#children, #complexity, #lines, #name, #parent
Instance Method Summary collapse
-
#count_tokens? ⇒ Boolean
While in a comment state do not count the tokens.
- #parse_token(token) ⇒ Object
Methods inherited from ParseState
#calc_complexity, #calc_lines, #compute_state, #compute_state_for_global, #do_begin_token, #do_block_token, #do_case_token, #do_class_token, #do_comment_token, #do_conditional_do_control_token, #do_conditional_token, #do_constant_token, #do_def_token, #do_else_token, #do_end_token, #do_identifier_token, #do_module_token, #do_one_line_conditional_token, #do_right_brace_token, #do_symbol_token, #end_debug, get_token_counter, #initialize, #lexer=, #lexer_loop?, #make_state, make_top_state, #parse, set_token_counter, #top_state?
Constructor Details
This class inherits a constructor from ParseState
Instance Method Details
#count_tokens? ⇒ Boolean
While in a comment state do not count the tokens.
392 393 394 |
# File 'lib/saikuro.rb', line 392 def count_tokens? false end |
#parse_token(token) ⇒ Object
396 397 398 399 400 401 |
# File 'lib/saikuro.rb', line 396 def parse_token(token) if token.is_a?(TkNL) @lines += 1 @run = false end end |