Module: Mail::Parsers::MessageIdsParser

Extended by:
Mail::ParserTools
Defined in:
lib/mail/parsers/message_ids_parser.rb

Defined Under Namespace

Classes: MessageIdsStruct

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Mail::ParserTools

chars

Class Attribute Details

._eof_actionsObject

Returns the value of attribute _eof_actions.



2504
2505
2506
# File 'lib/mail/parsers/message_ids_parser.rb', line 2504

def _eof_actions
  @_eof_actions
end

._index_offsetsObject

Returns the value of attribute _index_offsets.



138
139
140
# File 'lib/mail/parsers/message_ids_parser.rb', line 138

def _index_offsets
  @_index_offsets
end

._indiciesObject

Returns the value of attribute _indicies.



172
173
174
# File 'lib/mail/parsers/message_ids_parser.rb', line 172

def _indicies
  @_indicies
end

._key_spansObject

Returns the value of attribute _key_spans.



104
105
106
# File 'lib/mail/parsers/message_ids_parser.rb', line 104

def _key_spans
  @_key_spans
end

._trans_actionsObject

Returns the value of attribute _trans_actions.



2447
2448
2449
# File 'lib/mail/parsers/message_ids_parser.rb', line 2447

def _trans_actions
  @_trans_actions
end

._trans_keysObject

Returns the value of attribute _trans_keys.



17
18
19
# File 'lib/mail/parsers/message_ids_parser.rb', line 17

def _trans_keys
  @_trans_keys
end

._trans_targsObject

Returns the value of attribute _trans_targs.



2390
2391
2392
# File 'lib/mail/parsers/message_ids_parser.rb', line 2390

def _trans_targs
  @_trans_targs
end

.en_comment_tailObject

Returns the value of attribute en_comment_tail.



2551
2552
2553
# File 'lib/mail/parsers/message_ids_parser.rb', line 2551

def en_comment_tail
  @en_comment_tail
end

.en_mainObject

Returns the value of attribute en_main.



2555
2556
2557
# File 'lib/mail/parsers/message_ids_parser.rb', line 2555

def en_main
  @en_main
end

.errorObject

Returns the value of attribute error.



2546
2547
2548
# File 'lib/mail/parsers/message_ids_parser.rb', line 2546

def error
  @error
end

.first_finalObject

Returns the value of attribute first_final.



2542
2543
2544
# File 'lib/mail/parsers/message_ids_parser.rb', line 2542

def first_final
  @first_final
end

.startObject

Returns the value of attribute start.



2538
2539
2540
# File 'lib/mail/parsers/message_ids_parser.rb', line 2538

def start
  @start
end

Class Method Details

.parse(data) ⇒ Object



2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
# File 'lib/mail/parsers/message_ids_parser.rb', line 2561

def self.parse(data)
  data = data.dup.force_encoding(Encoding::ASCII_8BIT) if data.respond_to?(:force_encoding)

  raise Mail::Field::NilParseError.new(Mail::MessageIdsElement) if data.nil?

  # Parser state
  message_ids = MessageIdsStruct.new([])
  msg_id_s = nil

  # 5.1 Variables Used by Ragel
  p = 0
  eof = pe = data.length
  stack = []

  
begin
	p ||= 0
	pe ||= data.length
	cs = start
	top = 0
end

  
begin
	testEof = false
	_slen, _trans, _keys, _inds, _acts, _nacts = nil
	_goto_level = 0
	_resume = 10
	_eof_trans = 15
	_again = 20
	_test_eof = 30
	_out = 40
	while true
	if _goto_level <= 0
	if p == pe
		_goto_level = _test_eof
		next
	end
	if cs == 0
		_goto_level = _out
		next
	end
	end
	if _goto_level <= _resume
	_keys = cs << 1
	_inds = _index_offsets[cs]
	_slen = _key_spans[cs]
	_wide = data[p].ord
	_trans = if (   _slen > 0 && 
			_trans_keys[_keys] <= _wide && 
			_wide <= _trans_keys[_keys + 1] 
  ) then
			_indicies[ _inds + _wide - _trans_keys[_keys] ] 
		 else 
			_indicies[ _inds + _slen ]
		 end
	cs = _trans_targs[_trans]
	if _trans_actions[_trans] != 0
	case _trans_actions[_trans]
	when 2 then
		begin
 msg_id_s = p 		end
	when 30 then
		begin
 message_ids.message_ids << chars(data, msg_id_s, p-1).rstrip 		end
	when 3 then
		begin
		end
	when 26 then
		begin
		end
	when 15 then
		begin
		end
	when 13 then
		begin
		end
	when 11 then
		begin
		end
	when 8 then
		begin
		end
	when 6 then
		begin
		end
	when 19 then
		begin
		end
	when 17 then
		begin
		end
	when 23 then
		begin
		end
	when 1 then
		begin
 	begin
		stack[top] = cs
		top+= 1
		cs = 196
		_goto_level = _again
		next
	end
 		end
	when 29 then
		begin
 	begin
		top -= 1
		cs = stack[top]
		_goto_level = _again
		next
	end
 		end
	when 32 then
		begin
 message_ids.message_ids << chars(data, msg_id_s, p-1).rstrip 		end
		begin
 msg_id_s = p 		end
	when 31 then
		begin
 message_ids.message_ids << chars(data, msg_id_s, p-1).rstrip 		end
		begin
 	begin
		stack[top] = cs
		top+= 1
		cs = 196
		_goto_level = _again
		next
	end
 		end
	when 5 then
		begin
		end
		begin
 msg_id_s = p 		end
	when 16 then
		begin
		end
		begin
		end
	when 12 then
		begin
		end
		begin
		end
	when 25 then
		begin
		end
		begin
		end
	when 24 then
		begin
		end
		begin
		end
	when 4 then
		begin
		end
		begin
 	begin
		stack[top] = cs
		top+= 1
		cs = 196
		_goto_level = _again
		next
	end
 		end
	when 27 then
		begin
		end
		begin
 	begin
		stack[top] = cs
		top+= 1
		cs = 196
		_goto_level = _again
		next
	end
 		end
	when 28 then
		begin
		end
		begin
 	begin
		top -= 1
		cs = stack[top]
		_goto_level = _again
		next
	end
 		end
	when 14 then
		begin
		end
		begin
 	begin
		stack[top] = cs
		top+= 1
		cs = 196
		_goto_level = _again
		next
	end
 		end
	when 21 then
		begin
		end
		begin
		end
	when 10 then
		begin
		end
		begin
		end
	when 9 then
		begin
		end
		begin
 	begin
		stack[top] = cs
		top+= 1
		cs = 196
		_goto_level = _again
		next
	end
 		end
	when 7 then
		begin
		end
		begin
 	begin
		stack[top] = cs
		top+= 1
		cs = 196
		_goto_level = _again
		next
	end
 		end
	when 18 then
		begin
		end
		begin
		end
	when 22 then
		begin
		end
		begin
		end
		begin
		end
	when 20 then
		begin
		end
		begin
		end
		begin
		end
	end
	end
	end
	if _goto_level <= _again
	if cs == 0
		_goto_level = _out
		next
	end
	p += 1
	if p != pe
		_goto_level = _resume
		next
	end
	end
	if _goto_level <= _test_eof
	if p == eof
	  case _eof_actions[cs]
	when 30 then
		begin
 message_ids.message_ids << chars(data, msg_id_s, p-1).rstrip 		end
	when 3 then
		begin
		end
	  end
	end

	end
	if _goto_level <= _out
		break
	end
end
	end


  if p != eof || cs < 208
    raise Mail::Field::IncompleteParseError.new(Mail::MessageIdsElement, data, p)
  end

  message_ids
end