Module: CodeMiner::RegexpProcessor
- Included in:
- Parser
- Defined in:
- lib/codeminer/processors/regexp_processor.rb
Instance Method Summary collapse
- #on_regexp_add(regexp_content, regex) ⇒ Object
- #on_regexp_beg(value) ⇒ Object
- #on_regexp_literal(regexp, regex_end) ⇒ Object
- #on_regexp_new ⇒ Object
Instance Method Details
#on_regexp_add(regexp_content, regex) ⇒ Object
17 18 19 |
# File 'lib/codeminer/processors/regexp_processor.rb', line 17 def on_regexp_add(regexp_content, regex) regexp_content.add(regex) end |
#on_regexp_beg(value) ⇒ Object
11 12 13 14 15 |
# File 'lib/codeminer/processors/regexp_processor.rb', line 11 def on_regexp_beg(value) super.tap do |token| @begin_regex << token end end |
#on_regexp_literal(regexp, regex_end) ⇒ Object
5 6 7 8 9 |
# File 'lib/codeminer/processors/regexp_processor.rb', line 5 def on_regexp_literal(regexp, regex_end) regexp.tap do |r| r.src = extract_src_by_token(@begin_regex.pop, regex_end.line, regex_end.end_column) end end |
#on_regexp_new ⇒ Object
21 22 23 |
# File 'lib/codeminer/processors/regexp_processor.rb', line 21 def on_regexp_new RegexpExpression.new end |