mail 2.6.6 → 2.7.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.rdoc +25 -6
  3. data/Dependencies.txt +0 -1
  4. data/Gemfile +5 -8
  5. data/MIT-LICENSE +1 -1
  6. data/README.md +22 -11
  7. data/Rakefile +0 -6
  8. data/lib/mail.rb +2 -10
  9. data/lib/mail/attachments_list.rb +3 -2
  10. data/lib/mail/body.rb +3 -3
  11. data/lib/mail/core_extensions/smtp.rb +19 -16
  12. data/lib/mail/core_extensions/string.rb +0 -4
  13. data/lib/mail/elements/address.rb +9 -4
  14. data/lib/mail/elements/address_list.rb +10 -18
  15. data/lib/mail/elements/content_disposition_element.rb +8 -15
  16. data/lib/mail/elements/content_location_element.rb +5 -10
  17. data/lib/mail/elements/content_transfer_encoding_element.rb +5 -10
  18. data/lib/mail/elements/content_type_element.rb +8 -19
  19. data/lib/mail/elements/date_time_element.rb +6 -14
  20. data/lib/mail/elements/envelope_from_element.rb +14 -21
  21. data/lib/mail/elements/message_ids_element.rb +8 -12
  22. data/lib/mail/elements/mime_version_element.rb +6 -14
  23. data/lib/mail/elements/phrase_list.rb +6 -9
  24. data/lib/mail/elements/received_element.rb +9 -15
  25. data/lib/mail/encodings.rb +12 -14
  26. data/lib/mail/field.rb +7 -4
  27. data/lib/mail/fields/common/parameter_hash.rb +1 -1
  28. data/lib/mail/fields/content_type_field.rb +2 -7
  29. data/lib/mail/fields/unstructured_field.rb +2 -2
  30. data/lib/mail/header.rb +1 -0
  31. data/lib/mail/message.rb +23 -25
  32. data/lib/mail/multibyte.rb +51 -0
  33. data/lib/mail/multibyte/chars.rb +27 -27
  34. data/lib/mail/network/delivery_methods/exim.rb +10 -6
  35. data/lib/mail/network/delivery_methods/sendmail.rb +2 -6
  36. data/lib/mail/network/delivery_methods/smtp.rb +14 -6
  37. data/lib/mail/parsers.rb +16 -24
  38. data/lib/mail/parsers/address_lists_parser.rb +15321 -112
  39. data/lib/mail/parsers/address_lists_parser.rl +166 -0
  40. data/lib/mail/parsers/content_disposition_parser.rb +698 -55
  41. data/lib/mail/parsers/content_disposition_parser.rl +76 -0
  42. data/lib/mail/parsers/content_location_parser.rb +565 -23
  43. data/lib/mail/parsers/content_location_parser.rl +65 -0
  44. data/lib/mail/parsers/content_transfer_encoding_parser.rb +410 -22
  45. data/lib/mail/parsers/content_transfer_encoding_parser.rl +58 -0
  46. data/lib/mail/parsers/content_type_parser.rb +841 -54
  47. data/lib/mail/parsers/content_type_parser.rl +77 -0
  48. data/lib/mail/parsers/date_time_parser.rb +773 -26
  49. data/lib/mail/parsers/date_time_parser.rl +56 -0
  50. data/lib/mail/parsers/envelope_from_parser.rb +2051 -36
  51. data/lib/mail/parsers/envelope_from_parser.rl +76 -0
  52. data/lib/mail/parsers/message_ids_parser.rb +1494 -25
  53. data/lib/mail/parsers/message_ids_parser.rl +76 -0
  54. data/lib/mail/parsers/mime_version_parser.rb +393 -26
  55. data/lib/mail/parsers/mime_version_parser.rl +55 -0
  56. data/lib/mail/parsers/phrase_lists_parser.rb +529 -19
  57. data/lib/mail/parsers/phrase_lists_parser.rl +77 -0
  58. data/lib/mail/parsers/received_parser.rb +4711 -38
  59. data/lib/mail/parsers/received_parser.rl +78 -0
  60. data/lib/mail/parsers/rfc2045_content_transfer_encoding.rl +12 -0
  61. data/lib/mail/parsers/rfc2045_content_type.rl +24 -0
  62. data/lib/mail/parsers/rfc2045_mime.rl +15 -0
  63. data/lib/mail/parsers/rfc2183_content_disposition.rl +14 -0
  64. data/lib/mail/parsers/rfc5234_abnf_core_rules.rl +16 -0
  65. data/lib/mail/parsers/rfc5322.rl +57 -0
  66. data/lib/mail/parsers/rfc5322_address.rl +70 -0
  67. data/lib/mail/parsers/{ragel/date_time.rl → rfc5322_date_time.rl} +7 -1
  68. data/lib/mail/parsers/rfc5322_lexical_tokens.rl +56 -0
  69. data/lib/mail/part.rb +1 -1
  70. data/lib/mail/parts_list.rb +5 -6
  71. data/lib/mail/utilities.rb +4 -2
  72. data/lib/mail/version.rb +3 -3
  73. data/lib/mail/version_specific/ruby_1_8.rb +28 -2
  74. data/lib/mail/version_specific/ruby_1_9.rb +48 -8
  75. metadata +28 -45
  76. data/lib/mail/core_extensions/string/access.rb +0 -146
  77. data/lib/mail/core_extensions/string/multibyte.rb +0 -79
  78. data/lib/mail/parsers/ragel.rb +0 -18
  79. data/lib/mail/parsers/ragel/common.rl +0 -185
  80. data/lib/mail/parsers/ragel/parser_info.rb +0 -61
  81. data/lib/mail/parsers/ragel/ruby.rb +0 -40
  82. data/lib/mail/parsers/ragel/ruby/machines/address_lists_machine.rb +0 -14864
  83. data/lib/mail/parsers/ragel/ruby/machines/address_lists_machine.rb.rl +0 -37
  84. data/lib/mail/parsers/ragel/ruby/machines/content_disposition_machine.rb +0 -751
  85. data/lib/mail/parsers/ragel/ruby/machines/content_disposition_machine.rb.rl +0 -37
  86. data/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb +0 -614
  87. data/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl +0 -37
  88. data/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb +0 -447
  89. data/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb.rl +0 -37
  90. data/lib/mail/parsers/ragel/ruby/machines/content_type_machine.rb +0 -825
  91. data/lib/mail/parsers/ragel/ruby/machines/content_type_machine.rb.rl +0 -37
  92. data/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb +0 -817
  93. data/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb.rl +0 -37
  94. data/lib/mail/parsers/ragel/ruby/machines/envelope_from_machine.rb +0 -2149
  95. data/lib/mail/parsers/ragel/ruby/machines/envelope_from_machine.rb.rl +0 -37
  96. data/lib/mail/parsers/ragel/ruby/machines/message_ids_machine.rb +0 -1570
  97. data/lib/mail/parsers/ragel/ruby/machines/message_ids_machine.rb.rl +0 -37
  98. data/lib/mail/parsers/ragel/ruby/machines/mime_version_machine.rb +0 -440
  99. data/lib/mail/parsers/ragel/ruby/machines/mime_version_machine.rb.rl +0 -37
  100. data/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb +0 -564
  101. data/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb.rl +0 -37
  102. data/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl +0 -51
  103. data/lib/mail/parsers/ragel/ruby/machines/received_machine.rb +0 -5144
  104. data/lib/mail/parsers/ragel/ruby/machines/received_machine.rb.rl +0 -37
  105. data/lib/mail/parsers/ragel/ruby/parser.rb.rl.erb +0 -37
@@ -1,37 +0,0 @@
1
- %%{
2
- machine content_disposition;
3
-
4
- include rb_actions "rb_actions.rl";
5
- include common "../../common.rl";
6
-
7
- getkey data_unpacked[p];
8
-
9
- main := content_disposition;
10
- }%%
11
-
12
- module Mail
13
- module Parsers
14
- module Ragel
15
- module ContentDispositionMachine
16
- %%write data;
17
-
18
- def self.parse(data)
19
- p = 0
20
- eof = data.length
21
- stack = []
22
-
23
- actions = []
24
- data_unpacked = data.bytes.to_a
25
- %%write init;
26
- %%write exec;
27
-
28
- if p == eof && cs >= %%{ write first_final; }%%
29
- return actions, nil
30
- else
31
- return [], "Only able to parse up to #{data[0..p]}"
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,614 +0,0 @@
1
-
2
- # line 1 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
3
-
4
- # line 10 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
5
-
6
-
7
- module Mail
8
- module Parsers
9
- module Ragel
10
- module ContentLocationMachine
11
-
12
- # line 13 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
13
- class << self
14
- attr_accessor :_content_location_trans_keys
15
- private :_content_location_trans_keys, :_content_location_trans_keys=
16
- end
17
- self._content_location_trans_keys = [
18
- 0, 0, 9, 126, 10, 10,
19
- 9, 32, 10, 10, 9,
20
- 32, 1, 127, 10, 10,
21
- 9, 32, -128, -1, 10, 10,
22
- 9, 32, 9, 126, 1,
23
- 127, 1, 127, 10, 10,
24
- 9, 32, 0, 127, 9, 126,
25
- 9, 40, 9, 40, 1,
26
- 127, 1, 127, 1, 127,
27
- 1, 127, 9, 126, 0, 0,
28
- 0
29
- ]
30
-
31
- class << self
32
- attr_accessor :_content_location_key_spans
33
- private :_content_location_key_spans, :_content_location_key_spans=
34
- end
35
- self._content_location_key_spans = [
36
- 0, 118, 1, 24, 1, 24, 127, 1,
37
- 24, 128, 1, 24, 118, 127, 127, 1,
38
- 24, 128, 118, 32, 32, 127, 127, 127,
39
- 127, 118, 0
40
- ]
41
-
42
- class << self
43
- attr_accessor :_content_location_index_offsets
44
- private :_content_location_index_offsets, :_content_location_index_offsets=
45
- end
46
- self._content_location_index_offsets = [
47
- 0, 0, 119, 121, 146, 148, 173, 301,
48
- 303, 328, 457, 459, 484, 603, 731, 859,
49
- 861, 886, 1015, 1134, 1167, 1200, 1328, 1456,
50
- 1584, 1712, 1831
51
- ]
52
-
53
- class << self
54
- attr_accessor :_content_location_indicies
55
- private :_content_location_indicies, :_content_location_indicies=
56
- end
57
- self._content_location_indicies = [
58
- 0, 1, 1, 1, 2, 1, 1, 1,
59
- 1, 1, 1, 1, 1, 1, 1, 1,
60
- 1, 1, 1, 1, 1, 1, 1, 0,
61
- 3, 4, 3, 3, 3, 3, 3, 5,
62
- 1, 3, 3, 3, 3, 3, 1, 3,
63
- 3, 3, 3, 3, 3, 3, 3, 3,
64
- 3, 1, 1, 1, 3, 1, 1, 1,
65
- 3, 3, 3, 3, 3, 3, 3, 3,
66
- 3, 3, 3, 3, 3, 3, 3, 3,
67
- 3, 3, 3, 3, 3, 3, 3, 3,
68
- 3, 3, 1, 1, 1, 3, 3, 3,
69
- 3, 3, 3, 3, 3, 3, 3, 3,
70
- 3, 3, 3, 3, 3, 3, 3, 3,
71
- 3, 3, 3, 3, 3, 3, 3, 3,
72
- 3, 3, 3, 3, 3, 3, 1, 6,
73
- 1, 0, 1, 1, 1, 1, 1, 1,
74
- 1, 1, 1, 1, 1, 1, 1, 1,
75
- 1, 1, 1, 1, 1, 1, 1, 1,
76
- 0, 1, 7, 1, 8, 1, 1, 1,
77
- 1, 1, 1, 1, 1, 1, 1, 1,
78
- 1, 1, 1, 1, 1, 1, 1, 1,
79
- 1, 1, 1, 8, 1, 9, 9, 9,
80
- 9, 9, 9, 9, 9, 9, 1, 9,
81
- 9, 10, 9, 9, 9, 9, 9, 9,
82
- 9, 9, 9, 9, 9, 9, 9, 9,
83
- 9, 9, 9, 9, 9, 9, 11, 9,
84
- 9, 9, 9, 9, 9, 9, 9, 9,
85
- 9, 9, 9, 9, 9, 9, 9, 9,
86
- 9, 9, 9, 9, 9, 9, 9, 9,
87
- 9, 9, 9, 9, 9, 9, 9, 9,
88
- 9, 9, 9, 9, 9, 9, 9, 9,
89
- 9, 9, 9, 9, 9, 9, 9, 9,
90
- 9, 9, 9, 9, 9, 9, 9, 9,
91
- 12, 9, 9, 9, 9, 9, 9, 9,
92
- 9, 9, 9, 9, 9, 9, 9, 9,
93
- 9, 9, 9, 9, 9, 9, 9, 9,
94
- 9, 9, 9, 9, 9, 9, 9, 9,
95
- 9, 9, 9, 9, 1, 13, 1, 9,
96
- 1, 1, 1, 1, 1, 1, 1, 1,
97
- 1, 1, 1, 1, 1, 1, 1, 1,
98
- 1, 1, 1, 1, 1, 1, 9, 1,
99
- 1, 1, 1, 1, 1, 1, 1, 1,
100
- 1, 1, 1, 1, 1, 1, 1, 1,
101
- 1, 1, 1, 1, 1, 1, 1, 1,
102
- 1, 1, 1, 1, 1, 1, 1, 1,
103
- 1, 1, 1, 1, 1, 1, 1, 1,
104
- 1, 1, 1, 1, 1, 1, 1, 1,
105
- 1, 1, 1, 1, 1, 1, 1, 1,
106
- 1, 1, 1, 1, 1, 1, 1, 1,
107
- 1, 1, 1, 1, 1, 1, 1, 1,
108
- 1, 1, 1, 1, 1, 1, 1, 1,
109
- 1, 1, 1, 1, 1, 1, 1, 1,
110
- 1, 1, 1, 1, 1, 1, 1, 1,
111
- 1, 1, 1, 1, 1, 1, 1, 1,
112
- 1, 1, 1, 1, 1, 1, 1, 1,
113
- 1, 1, 1, 1, 1, 1, 1, 1,
114
- 1, 1, 1, 1, 1, 1, 1, 1,
115
- 9, 14, 1, 15, 1, 1, 1, 1,
116
- 1, 1, 1, 1, 1, 1, 1, 1,
117
- 1, 1, 1, 1, 1, 1, 1, 1,
118
- 1, 1, 15, 1, 16, 1, 1, 1,
119
- 17, 1, 1, 1, 1, 1, 1, 1,
120
- 1, 1, 1, 1, 1, 1, 1, 1,
121
- 1, 1, 1, 16, 18, 19, 18, 18,
122
- 18, 18, 18, 20, 1, 18, 18, 18,
123
- 18, 18, 1, 18, 18, 18, 18, 18,
124
- 18, 18, 18, 18, 18, 1, 1, 1,
125
- 18, 1, 1, 1, 18, 18, 18, 18,
126
- 18, 18, 18, 18, 18, 18, 18, 18,
127
- 18, 18, 18, 18, 18, 18, 18, 18,
128
- 18, 18, 18, 18, 18, 18, 1, 1,
129
- 1, 18, 18, 18, 18, 18, 18, 18,
130
- 18, 18, 18, 18, 18, 18, 18, 18,
131
- 18, 18, 18, 18, 18, 18, 18, 18,
132
- 18, 18, 18, 18, 18, 18, 18, 18,
133
- 18, 18, 1, 21, 21, 21, 21, 21,
134
- 21, 21, 21, 21, 1, 21, 21, 22,
135
- 21, 21, 21, 21, 21, 21, 21, 21,
136
- 21, 21, 21, 21, 21, 21, 21, 21,
137
- 21, 21, 21, 21, 21, 21, 21, 21,
138
- 21, 21, 23, 24, 21, 21, 21, 21,
139
- 21, 21, 21, 21, 21, 21, 21, 21,
140
- 21, 21, 21, 21, 21, 21, 21, 21,
141
- 21, 21, 21, 21, 21, 21, 21, 21,
142
- 21, 21, 21, 21, 21, 21, 21, 21,
143
- 21, 21, 21, 21, 21, 21, 21, 21,
144
- 21, 21, 21, 21, 21, 21, 25, 21,
145
- 21, 21, 21, 21, 21, 21, 21, 21,
146
- 21, 21, 21, 21, 21, 21, 21, 21,
147
- 21, 21, 21, 21, 21, 21, 21, 21,
148
- 21, 21, 21, 21, 21, 21, 21, 21,
149
- 21, 21, 1, 26, 26, 26, 26, 26,
150
- 26, 26, 26, 26, 1, 26, 26, 27,
151
- 26, 26, 26, 26, 26, 26, 26, 26,
152
- 26, 26, 26, 26, 26, 26, 26, 26,
153
- 26, 26, 26, 26, 26, 26, 26, 26,
154
- 26, 26, 28, 29, 26, 26, 26, 26,
155
- 26, 26, 26, 26, 26, 26, 26, 26,
156
- 26, 26, 26, 26, 26, 26, 26, 26,
157
- 26, 26, 26, 26, 26, 26, 26, 26,
158
- 26, 26, 26, 26, 26, 26, 26, 26,
159
- 26, 26, 26, 26, 26, 26, 26, 26,
160
- 26, 26, 26, 26, 26, 26, 30, 26,
161
- 26, 26, 26, 26, 26, 26, 26, 26,
162
- 26, 26, 26, 26, 26, 26, 26, 26,
163
- 26, 26, 26, 26, 26, 26, 26, 26,
164
- 26, 26, 26, 26, 26, 26, 26, 26,
165
- 26, 26, 1, 31, 1, 26, 1, 1,
166
- 1, 1, 1, 1, 1, 1, 1, 1,
167
- 1, 1, 1, 1, 1, 1, 1, 1,
168
- 1, 1, 1, 1, 26, 1, 26, 26,
169
- 26, 26, 26, 26, 26, 26, 26, 26,
170
- 26, 26, 26, 26, 26, 26, 26, 26,
171
- 26, 26, 26, 26, 26, 26, 26, 26,
172
- 26, 26, 26, 26, 26, 26, 26, 26,
173
- 26, 26, 26, 26, 26, 26, 26, 26,
174
- 26, 26, 26, 26, 26, 26, 26, 26,
175
- 26, 26, 26, 26, 26, 26, 26, 26,
176
- 26, 26, 26, 26, 26, 26, 26, 26,
177
- 26, 26, 26, 26, 26, 26, 26, 26,
178
- 26, 26, 26, 26, 26, 26, 26, 26,
179
- 26, 26, 26, 26, 26, 26, 26, 26,
180
- 26, 26, 26, 26, 26, 26, 26, 26,
181
- 26, 26, 26, 26, 26, 26, 26, 26,
182
- 26, 26, 26, 26, 26, 26, 26, 26,
183
- 26, 26, 26, 26, 26, 26, 26, 26,
184
- 26, 26, 26, 26, 26, 26, 1, 32,
185
- 1, 1, 1, 33, 1, 1, 1, 1,
186
- 1, 1, 1, 1, 1, 1, 1, 1,
187
- 1, 1, 1, 1, 1, 1, 32, 34,
188
- 34, 34, 34, 34, 34, 34, 35, 1,
189
- 34, 34, 34, 34, 34, 1, 34, 34,
190
- 34, 34, 34, 34, 34, 34, 34, 34,
191
- 1, 1, 1, 34, 1, 1, 1, 34,
192
- 34, 34, 34, 34, 34, 34, 34, 34,
193
- 34, 34, 34, 34, 34, 34, 34, 34,
194
- 34, 34, 34, 34, 34, 34, 34, 34,
195
- 34, 1, 1, 1, 34, 34, 34, 34,
196
- 34, 34, 34, 34, 34, 34, 34, 34,
197
- 34, 34, 34, 34, 34, 34, 34, 34,
198
- 34, 34, 34, 34, 34, 34, 34, 34,
199
- 34, 34, 34, 34, 34, 1, 8, 1,
200
- 1, 1, 36, 1, 1, 1, 1, 1,
201
- 1, 1, 1, 1, 1, 1, 1, 1,
202
- 1, 1, 1, 1, 1, 8, 1, 1,
203
- 1, 1, 1, 1, 1, 37, 1, 38,
204
- 1, 1, 1, 39, 1, 1, 1, 1,
205
- 1, 1, 1, 1, 1, 1, 1, 1,
206
- 1, 1, 1, 1, 1, 1, 38, 1,
207
- 1, 1, 1, 1, 1, 1, 40, 1,
208
- 41, 41, 41, 41, 41, 41, 41, 41,
209
- 42, 1, 41, 41, 43, 41, 41, 41,
210
- 41, 41, 41, 41, 41, 41, 41, 41,
211
- 41, 41, 41, 41, 41, 41, 41, 42,
212
- 44, 45, 44, 44, 44, 44, 44, 46,
213
- 41, 44, 44, 44, 44, 44, 41, 44,
214
- 44, 44, 44, 44, 44, 44, 44, 44,
215
- 44, 41, 41, 41, 44, 41, 41, 41,
216
- 44, 44, 44, 44, 44, 44, 44, 44,
217
- 44, 44, 44, 44, 44, 44, 44, 44,
218
- 44, 44, 44, 44, 44, 44, 44, 44,
219
- 44, 44, 41, 47, 41, 44, 44, 44,
220
- 44, 44, 44, 44, 44, 44, 44, 44,
221
- 44, 44, 44, 44, 44, 44, 44, 44,
222
- 44, 44, 44, 44, 44, 44, 44, 44,
223
- 44, 44, 44, 44, 44, 44, 41, 1,
224
- 9, 9, 9, 9, 9, 9, 9, 9,
225
- 15, 1, 9, 9, 48, 9, 9, 9,
226
- 9, 9, 9, 9, 9, 9, 9, 9,
227
- 9, 9, 9, 9, 9, 9, 9, 15,
228
- 9, 11, 9, 9, 9, 9, 9, 49,
229
- 9, 9, 9, 9, 9, 9, 9, 9,
230
- 9, 9, 9, 9, 9, 9, 9, 9,
231
- 9, 9, 9, 9, 9, 9, 9, 9,
232
- 9, 9, 9, 9, 9, 9, 9, 9,
233
- 9, 9, 9, 9, 9, 9, 9, 9,
234
- 9, 9, 9, 9, 9, 9, 9, 9,
235
- 9, 9, 9, 12, 9, 9, 9, 9,
236
- 9, 9, 9, 9, 9, 9, 9, 9,
237
- 9, 9, 9, 9, 9, 9, 9, 9,
238
- 9, 9, 9, 9, 9, 9, 9, 9,
239
- 9, 9, 9, 9, 9, 9, 9, 1,
240
- 9, 9, 9, 9, 9, 9, 9, 9,
241
- 50, 1, 9, 9, 51, 9, 9, 9,
242
- 9, 9, 9, 9, 9, 9, 9, 9,
243
- 9, 9, 9, 9, 9, 9, 9, 50,
244
- 9, 11, 9, 9, 9, 9, 9, 52,
245
- 9, 9, 9, 9, 9, 9, 9, 9,
246
- 9, 9, 9, 9, 9, 9, 9, 9,
247
- 9, 9, 9, 9, 9, 9, 9, 9,
248
- 9, 9, 9, 9, 9, 9, 9, 9,
249
- 9, 9, 9, 9, 9, 9, 9, 9,
250
- 9, 9, 9, 9, 9, 9, 9, 9,
251
- 9, 9, 9, 12, 9, 9, 9, 9,
252
- 9, 9, 9, 9, 9, 9, 9, 9,
253
- 9, 9, 9, 9, 9, 9, 9, 9,
254
- 9, 9, 9, 9, 9, 9, 9, 9,
255
- 9, 9, 9, 9, 9, 9, 9, 1,
256
- 9, 9, 9, 9, 9, 9, 9, 9,
257
- 53, 1, 9, 9, 54, 9, 9, 9,
258
- 9, 9, 9, 9, 9, 9, 9, 9,
259
- 9, 9, 9, 9, 9, 9, 9, 53,
260
- 55, 56, 55, 55, 55, 55, 55, 57,
261
- 9, 55, 55, 55, 55, 55, 9, 55,
262
- 55, 55, 55, 55, 55, 55, 55, 55,
263
- 55, 9, 9, 9, 55, 9, 9, 9,
264
- 55, 55, 55, 55, 55, 55, 55, 55,
265
- 55, 55, 55, 55, 55, 55, 55, 55,
266
- 55, 55, 55, 55, 55, 55, 55, 55,
267
- 55, 55, 9, 12, 9, 55, 55, 55,
268
- 55, 55, 55, 55, 55, 55, 55, 55,
269
- 55, 55, 55, 55, 55, 55, 55, 55,
270
- 55, 55, 55, 55, 55, 55, 55, 55,
271
- 55, 55, 55, 55, 55, 55, 9, 1,
272
- 32, 1, 1, 1, 33, 1, 1, 1,
273
- 1, 1, 1, 1, 1, 1, 1, 1,
274
- 1, 1, 1, 1, 1, 1, 1, 32,
275
- 34, 34, 34, 34, 34, 34, 34, 58,
276
- 1, 34, 34, 34, 34, 34, 1, 34,
277
- 34, 34, 34, 34, 34, 34, 34, 34,
278
- 34, 1, 1, 1, 34, 1, 1, 1,
279
- 34, 34, 34, 34, 34, 34, 34, 34,
280
- 34, 34, 34, 34, 34, 34, 34, 34,
281
- 34, 34, 34, 34, 34, 34, 34, 34,
282
- 34, 34, 1, 1, 1, 34, 34, 34,
283
- 34, 34, 34, 34, 34, 34, 34, 34,
284
- 34, 34, 34, 34, 34, 34, 34, 34,
285
- 34, 34, 34, 34, 34, 34, 34, 34,
286
- 34, 34, 34, 34, 34, 34, 1, 1,
287
- 0
288
- ]
289
-
290
- class << self
291
- attr_accessor :_content_location_trans_targs
292
- private :_content_location_trans_targs, :_content_location_trans_targs=
293
- end
294
- self._content_location_trans_targs = [
295
- 1, 0, 2, 18, 21, 12, 3, 5,
296
- 19, 6, 7, 19, 9, 8, 11, 22,
297
- 1, 2, 18, 21, 12, 14, 15, 14,
298
- 26, 17, 14, 15, 14, 26, 17, 16,
299
- 19, 4, 18, 20, 4, 20, 19, 4,
300
- 20, 6, 22, 10, 24, 25, 23, 9,
301
- 10, 23, 22, 10, 23, 22, 10, 24,
302
- 25, 23, 20
303
- ]
304
-
305
- class << self
306
- attr_accessor :_content_location_trans_actions
307
- private :_content_location_trans_actions, :_content_location_trans_actions=
308
- end
309
- self._content_location_trans_actions = [
310
- 0, 0, 0, 1, 1, 2, 0, 0,
311
- 0, 0, 0, 3, 0, 0, 0, 0,
312
- 4, 4, 5, 5, 6, 7, 7, 8,
313
- 9, 7, 0, 0, 2, 10, 0, 0,
314
- 11, 11, 0, 12, 0, 2, 4, 4,
315
- 6, 13, 14, 14, 13, 15, 16, 13,
316
- 0, 2, 4, 4, 6, 11, 11, 0,
317
- 3, 12, 17
318
- ]
319
-
320
- class << self
321
- attr_accessor :_content_location_eof_actions
322
- private :_content_location_eof_actions, :_content_location_eof_actions=
323
- end
324
- self._content_location_eof_actions = [
325
- 0, 0, 0, 0, 0, 0, 0, 0,
326
- 0, 0, 0, 0, 0, 0, 0, 0,
327
- 0, 0, 11, 0, 4, 11, 0, 4,
328
- 11, 11, 0
329
- ]
330
-
331
- class << self
332
- attr_accessor :content_location_start
333
- end
334
- self.content_location_start = 1;
335
- class << self
336
- attr_accessor :content_location_first_final
337
- end
338
- self.content_location_first_final = 18;
339
- class << self
340
- attr_accessor :content_location_error
341
- end
342
- self.content_location_error = 0;
343
-
344
- class << self
345
- attr_accessor :content_location_en_comment_tail
346
- end
347
- self.content_location_en_comment_tail = 13;
348
- class << self
349
- attr_accessor :content_location_en_main
350
- end
351
- self.content_location_en_main = 1;
352
-
353
-
354
- # line 17 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
355
-
356
- def self.parse(data)
357
- p = 0
358
- eof = data.length
359
- stack = []
360
-
361
- actions = []
362
- data_unpacked = data.bytes.to_a
363
-
364
- # line 365 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
365
- begin
366
- p ||= 0
367
- pe ||= data.length
368
- cs = content_location_start
369
- top = 0
370
- end
371
-
372
- # line 26 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
373
-
374
- # line 375 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
375
- begin
376
- testEof = false
377
- _slen, _trans, _keys, _inds, _acts, _nacts = nil
378
- _goto_level = 0
379
- _resume = 10
380
- _eof_trans = 15
381
- _again = 20
382
- _test_eof = 30
383
- _out = 40
384
- while true
385
- if _goto_level <= 0
386
- if p == pe
387
- _goto_level = _test_eof
388
- next
389
- end
390
- if cs == 0
391
- _goto_level = _out
392
- next
393
- end
394
- end
395
- if _goto_level <= _resume
396
- _keys = cs << 1
397
- _inds = _content_location_index_offsets[cs]
398
- _slen = _content_location_key_spans[cs]
399
- _trans = if ( _slen > 0 &&
400
- _content_location_trans_keys[_keys] <= ( data_unpacked[p]) &&
401
- ( data_unpacked[p]) <= _content_location_trans_keys[_keys + 1]
402
- ) then
403
- _content_location_indicies[ _inds + ( data_unpacked[p]) - _content_location_trans_keys[_keys] ]
404
- else
405
- _content_location_indicies[ _inds + _slen ]
406
- end
407
- cs = _content_location_trans_targs[_trans]
408
- if _content_location_trans_actions[_trans] != 0
409
- case _content_location_trans_actions[_trans]
410
- when 4 then
411
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
412
- begin
413
- actions.push(4, p) end
414
- when 7 then
415
- # line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
416
- begin
417
- actions.push(5, p) end
418
- when 3 then
419
- # line 41 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
420
- begin
421
- actions.push(38, p) end
422
- when 13 then
423
- # line 42 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
424
- begin
425
- actions.push(39, p) end
426
- when 11 then
427
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
428
- begin
429
- actions.push(46, p) end
430
- when 1 then
431
- # line 50 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
432
- begin
433
- actions.push(47, p) end
434
- when 2 then
435
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
436
- begin
437
- begin
438
- stack[top] = cs
439
- top+= 1
440
- cs = 13
441
- _goto_level = _again
442
- next
443
- end
444
- end
445
- when 10 then
446
- # line 6 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
447
- begin
448
- begin
449
- top -= 1
450
- cs = stack[top]
451
- _goto_level = _again
452
- next
453
- end
454
- end
455
- when 5 then
456
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
457
- begin
458
- actions.push(4, p) end
459
- # line 50 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
460
- begin
461
- actions.push(47, p) end
462
- when 6 then
463
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
464
- begin
465
- actions.push(4, p) end
466
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
467
- begin
468
- begin
469
- stack[top] = cs
470
- top+= 1
471
- cs = 13
472
- _goto_level = _again
473
- next
474
- end
475
- end
476
- when 8 then
477
- # line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
478
- begin
479
- actions.push(5, p) end
480
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
481
- begin
482
- begin
483
- stack[top] = cs
484
- top+= 1
485
- cs = 13
486
- _goto_level = _again
487
- next
488
- end
489
- end
490
- when 9 then
491
- # line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
492
- begin
493
- actions.push(5, p) end
494
- # line 6 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
495
- begin
496
- begin
497
- top -= 1
498
- cs = stack[top]
499
- _goto_level = _again
500
- next
501
- end
502
- end
503
- when 15 then
504
- # line 42 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
505
- begin
506
- actions.push(39, p) end
507
- # line 41 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
508
- begin
509
- actions.push(38, p) end
510
- when 14 then
511
- # line 42 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
512
- begin
513
- actions.push(39, p) end
514
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
515
- begin
516
- actions.push(46, p) end
517
- when 12 then
518
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
519
- begin
520
- actions.push(46, p) end
521
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
522
- begin
523
- begin
524
- stack[top] = cs
525
- top+= 1
526
- cs = 13
527
- _goto_level = _again
528
- next
529
- end
530
- end
531
- when 17 then
532
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
533
- begin
534
- begin
535
- stack[top] = cs
536
- top+= 1
537
- cs = 13
538
- _goto_level = _again
539
- next
540
- end
541
- end
542
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
543
- begin
544
- actions.push(46, p) end
545
- when 16 then
546
- # line 42 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
547
- begin
548
- actions.push(39, p) end
549
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
550
- begin
551
- actions.push(46, p) end
552
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
553
- begin
554
- begin
555
- stack[top] = cs
556
- top+= 1
557
- cs = 13
558
- _goto_level = _again
559
- next
560
- end
561
- end
562
- # line 563 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
563
- end
564
- end
565
- end
566
- if _goto_level <= _again
567
- if cs == 0
568
- _goto_level = _out
569
- next
570
- end
571
- p += 1
572
- if p != pe
573
- _goto_level = _resume
574
- next
575
- end
576
- end
577
- if _goto_level <= _test_eof
578
- if p == eof
579
- case _content_location_eof_actions[cs]
580
- when 4 then
581
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
582
- begin
583
- actions.push(4, p) end
584
- when 11 then
585
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
586
- begin
587
- actions.push(46, p) end
588
- # line 589 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
589
- end
590
- end
591
-
592
- end
593
- if _goto_level <= _out
594
- break
595
- end
596
- end
597
- end
598
-
599
- # line 27 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
600
-
601
- if p == eof && cs >=
602
- # line 603 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
603
- 18
604
- # line 28 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
605
-
606
- return actions, nil
607
- else
608
- return [], "Only able to parse up to #{data[0..p]}"
609
- end
610
- end
611
- end
612
- end
613
- end
614
- end