lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb in adhearsion-1.0.0 vs lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb in adhearsion-1.0.1

- old
+ new

@@ -38,13 +38,14 @@ def initialize @data = "" @current_pointer = 0 @ragel_stack = [] + @ami_version = 0.0 -# line 46 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" +# line 47 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" class << self attr_accessor :_ami_protocol_parser_actions private :_ami_protocol_parser_actions, :_ami_protocol_parser_actions= end self._ami_protocol_parser_actions = [ @@ -857,22 +858,22 @@ attr_accessor :ami_protocol_parser_en_response_follows end self.ami_protocol_parser_en_response_follows = 268; -# line 863 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" +# line 864 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" begin @current_pointer ||= 0 @data_ending_pointer ||= @data.length @current_state = ami_protocol_parser_start @ragel_stack_top = 0 @token_start = nil @token_end = nil @ragel_act = 0 end -# line 98 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb" +# line 99 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb" ## end def <<(new_data) @@ -880,11 +881,11 @@ resume! end def resume! -# line 886 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" +# line 887 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" begin _klen, _trans, _keys, _acts, _nacts = nil _goto_level = 0 _resume = 10 _eof_trans = 15 @@ -914,11 +915,11 @@ when 30 then # line 1 "NONE" begin @token_start = @current_pointer end -# line 920 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" +# line 921 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" end # from state action switch end if _trigger_goto next end @@ -934,13 +935,13 @@ loop do break if _upper < _lower _mid = _lower + ( (_upper - _lower) >> 1 ) - if @data[ @current_pointer] < _ami_protocol_parser_trans_keys[_mid] + if @data[ @current_pointer].ord < _ami_protocol_parser_trans_keys[_mid] _upper = _mid - 1 - elsif @data[ @current_pointer] > _ami_protocol_parser_trans_keys[_mid] + elsif @data[ @current_pointer].ord > _ami_protocol_parser_trans_keys[_mid] _lower = _mid + 1 else _trans += (_mid - _keys) _break_match = true break @@ -955,13 +956,13 @@ _lower = _keys _upper = _keys + (_klen << 1) - 2 loop do break if _upper < _lower _mid = _lower + (((_upper-_lower) >> 1) & ~1) - if @data[ @current_pointer] < _ami_protocol_parser_trans_keys[_mid] + if @data[ @current_pointer].ord < _ami_protocol_parser_trans_keys[_mid] _upper = _mid - 2 - elsif @data[ @current_pointer] > _ami_protocol_parser_trans_keys[_mid+1] + elsif @data[ @current_pointer].ord > _ami_protocol_parser_trans_keys[_mid+1] _lower = _mid + 2 else _trans += ((_mid - _keys) >> 1) _break_match = true break @@ -1386,11 +1387,11 @@ else begin begin @current_pointer = (( @token_end))-1; end end end end -# line 1392 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" +# line 1393 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" end # action switch end end if _trigger_goto next @@ -1411,11 +1412,11 @@ when 29 then # line 1 "NONE" begin @ragel_act = 0 end -# line 1417 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" +# line 1418 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb" end # to state action switch end if _trigger_goto next end @@ -1442,10 +1443,10 @@ break end end end -# line 108 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb" +# line 109 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb" ## end def extend_buffer_with(new_data) length = new_data.size