Class: Echoes::Parser
- Inherits:
-
Object
- Object
- Echoes::Parser
- Defined in:
- lib/echoes/parser.rb
Instance Method Summary collapse
- #feed(data) ⇒ Object
-
#initialize(screen, writer: nil) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(screen, writer: nil) ⇒ Parser
Returns a new instance of Parser.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/echoes/parser.rb', line 5 def initialize(screen, writer: nil) @screen = screen @writer = writer @state = :ground @params = [] @current_param = +"" @private_flag = false @csi_prefix = nil # tracks <, =, > prefix bytes in CSI @csi_intermediate = nil @osc_string = +"" @esc_intermediate = nil @dcs_params = [] @dcs_current_param = +"" @dcs_data = "".b @utf8_buf = "".b @utf8_remaining = 0 end |
Instance Method Details
#feed(data) ⇒ Object
23 24 25 26 27 |
# File 'lib/echoes/parser.rb', line 23 def feed(data) data.each_byte do |byte| process_byte(byte) end end |