Class: RBS::Inline::Annotator::Writer::InsertAfter
- Defined in:
- lib/rbs/inline/annotator/writer.rb
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
Methods inherited from Action
Constructor Details
This class inherits a constructor from RBS::Inline::Annotator::Writer::Action
Instance Method Details
#process(writer) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/rbs/inline/annotator/writer.rb', line 34 def process(writer) if writer.before_pos < range.end writer.slice << writer.source[writer.before_pos...range.end] writer.before_pos = range.end elsif writer.before_pos == range.end - 1 # do nothing else raise "invalid range: #{range}, before_pos: #{writer.before_pos}" end writer.slice << text end |