mail 2.7.0.rc1 → 2.7.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +71 -98
  3. data/lib/mail.rb +1 -6
  4. data/lib/mail/attachments_list.rb +5 -2
  5. data/lib/mail/body.rb +39 -33
  6. data/lib/mail/check_delivery_params.rb +8 -6
  7. data/lib/mail/configuration.rb +2 -0
  8. data/lib/mail/elements/address.rb +19 -18
  9. data/lib/mail/encodings.rb +89 -31
  10. data/lib/mail/encodings/7bit.rb +5 -15
  11. data/lib/mail/encodings/8bit.rb +2 -21
  12. data/lib/mail/encodings/base64.rb +11 -12
  13. data/lib/mail/encodings/binary.rb +3 -22
  14. data/lib/mail/encodings/identity.rb +24 -0
  15. data/lib/mail/encodings/quoted_printable.rb +6 -6
  16. data/lib/mail/encodings/transfer_encoding.rb +38 -29
  17. data/lib/mail/encodings/unix_to_unix.rb +2 -1
  18. data/lib/mail/envelope.rb +1 -1
  19. data/lib/mail/field.rb +93 -61
  20. data/lib/mail/fields/bcc_field.rb +2 -2
  21. data/lib/mail/fields/cc_field.rb +1 -1
  22. data/lib/mail/fields/comments_field.rb +1 -1
  23. data/lib/mail/fields/common/common_address.rb +32 -7
  24. data/lib/mail/fields/common/common_field.rb +1 -10
  25. data/lib/mail/fields/content_description_field.rb +1 -1
  26. data/lib/mail/fields/content_disposition_field.rb +3 -3
  27. data/lib/mail/fields/content_id_field.rb +2 -2
  28. data/lib/mail/fields/content_location_field.rb +1 -1
  29. data/lib/mail/fields/content_transfer_encoding_field.rb +1 -1
  30. data/lib/mail/fields/content_type_field.rb +1 -1
  31. data/lib/mail/fields/date_field.rb +2 -3
  32. data/lib/mail/fields/from_field.rb +1 -1
  33. data/lib/mail/fields/in_reply_to_field.rb +1 -1
  34. data/lib/mail/fields/keywords_field.rb +1 -1
  35. data/lib/mail/fields/message_id_field.rb +1 -1
  36. data/lib/mail/fields/mime_version_field.rb +1 -1
  37. data/lib/mail/fields/optional_field.rb +4 -1
  38. data/lib/mail/fields/received_field.rb +1 -1
  39. data/lib/mail/fields/references_field.rb +1 -1
  40. data/lib/mail/fields/reply_to_field.rb +1 -1
  41. data/lib/mail/fields/resent_bcc_field.rb +1 -1
  42. data/lib/mail/fields/resent_cc_field.rb +1 -1
  43. data/lib/mail/fields/resent_date_field.rb +0 -1
  44. data/lib/mail/fields/resent_from_field.rb +1 -1
  45. data/lib/mail/fields/resent_message_id_field.rb +1 -1
  46. data/lib/mail/fields/resent_sender_field.rb +1 -1
  47. data/lib/mail/fields/resent_to_field.rb +1 -1
  48. data/lib/mail/fields/return_path_field.rb +1 -1
  49. data/lib/mail/fields/sender_field.rb +1 -1
  50. data/lib/mail/fields/subject_field.rb +1 -1
  51. data/lib/mail/fields/to_field.rb +1 -1
  52. data/lib/mail/fields/unstructured_field.rb +19 -2
  53. data/lib/mail/header.rb +9 -8
  54. data/lib/mail/mail.rb +2 -10
  55. data/lib/mail/matchers/has_sent_mail.rb +21 -1
  56. data/lib/mail/message.rb +64 -51
  57. data/lib/mail/multibyte.rb +14 -16
  58. data/lib/mail/multibyte/chars.rb +2 -1
  59. data/lib/mail/network.rb +1 -0
  60. data/lib/mail/network/delivery_methods/exim.rb +6 -10
  61. data/lib/mail/network/delivery_methods/logger_delivery.rb +37 -0
  62. data/lib/mail/network/delivery_methods/sendmail.rb +8 -4
  63. data/lib/mail/network/delivery_methods/smtp.rb +56 -55
  64. data/lib/mail/network/delivery_methods/smtp_connection.rb +9 -1
  65. data/lib/mail/network/retriever_methods/imap.rb +18 -5
  66. data/lib/mail/network/retriever_methods/pop3.rb +3 -1
  67. data/lib/mail/parser_tools.rb +15 -0
  68. data/lib/mail/parsers/address_lists_parser.rb +30462 -12597
  69. data/lib/mail/parsers/address_lists_parser.rl +18 -12
  70. data/lib/mail/parsers/content_disposition_parser.rb +405 -215
  71. data/lib/mail/parsers/content_disposition_parser.rl +11 -5
  72. data/lib/mail/parsers/content_location_parser.rb +443 -208
  73. data/lib/mail/parsers/content_location_parser.rl +9 -3
  74. data/lib/mail/parsers/content_transfer_encoding_parser.rb +180 -80
  75. data/lib/mail/parsers/content_transfer_encoding_parser.rl +8 -2
  76. data/lib/mail/parsers/content_type_parser.rb +436 -245
  77. data/lib/mail/parsers/content_type_parser.rl +12 -6
  78. data/lib/mail/parsers/date_time_parser.rb +172 -72
  79. data/lib/mail/parsers/date_time_parser.rl +10 -4
  80. data/lib/mail/parsers/envelope_from_parser.rb +2833 -1320
  81. data/lib/mail/parsers/envelope_from_parser.rl +9 -3
  82. data/lib/mail/parsers/message_ids_parser.rb +2325 -976
  83. data/lib/mail/parsers/message_ids_parser.rl +9 -3
  84. data/lib/mail/parsers/mime_version_parser.rb +164 -64
  85. data/lib/mail/parsers/mime_version_parser.rl +9 -3
  86. data/lib/mail/parsers/phrase_lists_parser.rb +582 -237
  87. data/lib/mail/parsers/phrase_lists_parser.rl +9 -3
  88. data/lib/mail/parsers/received_parser.rb +7036 -3004
  89. data/lib/mail/parsers/received_parser.rl +11 -5
  90. data/lib/mail/parsers/rfc2045_content_transfer_encoding.rl +1 -0
  91. data/lib/mail/parsers/rfc2045_content_type.rl +1 -0
  92. data/lib/mail/parsers/rfc2045_mime.rl +1 -0
  93. data/lib/mail/parsers/rfc2183_content_disposition.rl +1 -0
  94. data/lib/mail/parsers/rfc3629_utf8.rl +19 -0
  95. data/lib/mail/parsers/rfc5234_abnf_core_rules.rl +7 -1
  96. data/lib/mail/parsers/rfc5322.rl +3 -1
  97. data/lib/mail/parsers/rfc5322_address.rl +3 -1
  98. data/lib/mail/parsers/rfc5322_date_time.rl +1 -0
  99. data/lib/mail/parsers/rfc5322_lexical_tokens.rl +9 -5
  100. data/lib/mail/part.rb +1 -1
  101. data/lib/mail/utilities.rb +44 -15
  102. data/lib/mail/version.rb +1 -1
  103. data/lib/mail/version_specific/ruby_1_8.rb +12 -1
  104. data/lib/mail/version_specific/ruby_1_9.rb +13 -1
  105. metadata +7 -13
  106. data/CHANGELOG.rdoc +0 -822
  107. data/CONTRIBUTING.md +0 -60
  108. data/Dependencies.txt +0 -1
  109. data/Gemfile +0 -11
  110. data/Rakefile +0 -23
  111. data/TODO.rdoc +0 -9
  112. data/lib/mail/multibyte/exceptions.rb +0 -9
@@ -1,14 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
  require 'mail/utilities'
3
+ require 'mail/parser_tools'
3
4
 
4
5
  %%{
5
6
  # RFC 5322 Section 3.6.4: Identification Fields
6
7
  # https://tools.ietf.org/html/rfc5322#section-3.6.4
7
8
  machine message_ids;
9
+ alphtype int;
8
10
 
9
11
  # Message Ids
10
12
  action msg_id_s { msg_id_s = p }
11
- action msg_id_e { message_ids.message_ids << data[msg_id_s..(p-1)].rstrip }
13
+ action msg_id_e { message_ids.message_ids << chars(data, msg_id_s, p-1).rstrip }
12
14
 
13
15
  # No-op actions
14
16
  action angle_addr_s {}
@@ -47,12 +49,16 @@ require 'mail/utilities'
47
49
 
48
50
  module Mail::Parsers
49
51
  module MessageIdsParser
52
+ extend Mail::ParserTools
53
+
50
54
  MessageIdsStruct = Struct.new(:message_ids, :error)
51
55
 
52
56
  %%write data noprefix;
53
57
 
54
58
  def self.parse(data)
55
- raise Mail::Field::ParseError.new(Mail::MessageIdsElement, data, 'nil is invalid') if data.nil?
59
+ data = data.dup.force_encoding(Encoding::ASCII_8BIT) if data.respond_to?(:force_encoding)
60
+
61
+ raise Mail::Field::NilParseError.new(Mail::MessageIdsElement) if data.nil?
56
62
 
57
63
  # Parser state
58
64
  message_ids = MessageIdsStruct.new([])
@@ -67,7 +73,7 @@ module Mail::Parsers
67
73
  %%write exec;
68
74
 
69
75
  if p != eof || cs < %%{ write first_final; }%%
70
- raise Mail::Field::ParseError.new(Mail::MessageIdsElement, data, "Only able to parse up to #{data[0..p]}")
76
+ raise Mail::Field::IncompleteParseError.new(Mail::MessageIdsElement, data, p)
71
77
  end
72
78
 
73
79
  message_ids
@@ -1,12 +1,15 @@
1
1
 
2
2
  # frozen_string_literal: true
3
3
  require 'mail/utilities'
4
+ require 'mail/parser_tools'
4
5
 
5
6
 
6
7
 
7
8
 
8
9
  module Mail::Parsers
9
10
  module MimeVersionParser
11
+ extend Mail::ParserTools
12
+
10
13
  MimeVersionStruct = Struct.new(:major, :minor, :error)
11
14
 
12
15
 
@@ -19,10 +22,13 @@ self._trans_keys = [
19
22
  9, 32, 9, 57, 40,
20
23
  57, 46, 46, 40, 57,
21
24
  48, 57, 10, 10, 9, 32,
22
- 1, 127, 1, 127, 10,
23
- 10, 9, 32, 0, 127,
24
- 9, 57, 9, 40, 9, 40,
25
- 0, 0, 0
25
+ 1, 244, 1, 244, 10,
26
+ 10, 9, 32, 0, 244,
27
+ 128, 191, 160, 191, 128, 191,
28
+ 128, 159, 144, 191, 128,
29
+ 191, 128, 143, 9, 57,
30
+ 9, 40, 9, 40, 0, 0,
31
+ 0
26
32
  ]
27
33
 
28
34
  class << self
@@ -31,8 +37,9 @@ class << self
31
37
  end
32
38
  self._key_spans = [
33
39
  0, 49, 1, 24, 49, 18, 1, 18,
34
- 10, 1, 24, 127, 127, 1, 24, 128,
35
- 49, 32, 32, 0
40
+ 10, 1, 24, 244, 244, 1, 24, 245,
41
+ 64, 32, 64, 32, 48, 64, 16, 49,
42
+ 32, 32, 0
36
43
  ]
37
44
 
38
45
  class << self
@@ -41,8 +48,9 @@ class << self
41
48
  end
42
49
  self._index_offsets = [
43
50
  0, 0, 50, 52, 77, 127, 146, 148,
44
- 167, 178, 180, 205, 333, 461, 463, 488,
45
- 617, 667, 700, 733
51
+ 167, 178, 180, 205, 450, 695, 697, 722,
52
+ 968, 1033, 1066, 1131, 1164, 1213, 1278, 1295,
53
+ 1345, 1378, 1411
46
54
  ]
47
55
 
48
56
  class << self
@@ -91,57 +99,142 @@ self._indicies = [
91
99
  19, 19, 19, 19, 19, 19, 19, 19,
92
100
  19, 19, 19, 19, 19, 19, 19, 19,
93
101
  19, 19, 19, 19, 19, 19, 19, 19,
94
- 19, 19, 19, 19, 1, 24, 24, 24,
95
- 24, 24, 24, 24, 24, 24, 1, 24,
96
- 24, 25, 24, 24, 24, 24, 24, 24,
97
- 24, 24, 24, 24, 24, 24, 24, 24,
98
- 24, 24, 24, 24, 24, 24, 24, 24,
99
- 24, 24, 24, 24, 26, 27, 24, 24,
100
- 24, 24, 24, 24, 24, 24, 24, 24,
101
- 24, 24, 24, 24, 24, 24, 24, 24,
102
- 24, 24, 24, 24, 24, 24, 24, 24,
103
- 24, 24, 24, 24, 24, 24, 24, 24,
104
- 24, 24, 24, 24, 24, 24, 24, 24,
105
- 24, 24, 24, 24, 24, 24, 24, 24,
106
- 28, 24, 24, 24, 24, 24, 24, 24,
107
- 24, 24, 24, 24, 24, 24, 24, 24,
108
- 24, 24, 24, 24, 24, 24, 24, 24,
109
- 24, 24, 24, 24, 24, 24, 24, 24,
110
- 24, 24, 24, 24, 1, 29, 1, 24,
102
+ 19, 19, 19, 19, 1, 1, 1, 1,
111
103
  1, 1, 1, 1, 1, 1, 1, 1,
112
104
  1, 1, 1, 1, 1, 1, 1, 1,
113
- 1, 1, 1, 1, 1, 1, 24, 1,
114
- 24, 24, 24, 24, 24, 24, 24, 24,
115
- 24, 24, 24, 24, 24, 24, 24, 24,
116
- 24, 24, 24, 24, 24, 24, 24, 24,
117
- 24, 24, 24, 24, 24, 24, 24, 24,
118
- 24, 24, 24, 24, 24, 24, 24, 24,
119
- 24, 24, 24, 24, 24, 24, 24, 24,
120
- 24, 24, 24, 24, 24, 24, 24, 24,
121
- 24, 24, 24, 24, 24, 24, 24, 24,
122
- 24, 24, 24, 24, 24, 24, 24, 24,
123
- 24, 24, 24, 24, 24, 24, 24, 24,
124
- 24, 24, 24, 24, 24, 24, 24, 24,
125
- 24, 24, 24, 24, 24, 24, 24, 24,
126
- 24, 24, 24, 24, 24, 24, 24, 24,
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, 24, 24,
127
111
  24, 24, 24, 24, 24, 24, 24, 24,
128
112
  24, 24, 24, 24, 24, 24, 24, 24,
129
113
  24, 24, 24, 24, 24, 24, 24, 24,
130
- 1, 30, 1, 1, 1, 31, 1, 1,
114
+ 24, 24, 24, 24, 25, 26, 26, 26,
115
+ 26, 26, 26, 26, 26, 26, 26, 26,
116
+ 26, 27, 26, 26, 28, 29, 29, 29,
117
+ 30, 1, 31, 31, 31, 31, 31, 31,
118
+ 31, 31, 31, 1, 31, 31, 32, 31,
119
+ 31, 31, 31, 31, 31, 31, 31, 31,
120
+ 31, 31, 31, 31, 31, 31, 31, 31,
121
+ 31, 31, 31, 31, 31, 31, 31, 31,
122
+ 31, 33, 34, 31, 31, 31, 31, 31,
123
+ 31, 31, 31, 31, 31, 31, 31, 31,
124
+ 31, 31, 31, 31, 31, 31, 31, 31,
125
+ 31, 31, 31, 31, 31, 31, 31, 31,
126
+ 31, 31, 31, 31, 31, 31, 31, 31,
127
+ 31, 31, 31, 31, 31, 31, 31, 31,
128
+ 31, 31, 31, 31, 31, 35, 31, 31,
129
+ 31, 31, 31, 31, 31, 31, 31, 31,
130
+ 31, 31, 31, 31, 31, 31, 31, 31,
131
+ 31, 31, 31, 31, 31, 31, 31, 31,
132
+ 31, 31, 31, 31, 31, 31, 31, 31,
133
+ 31, 1, 1, 1, 1, 1, 1, 1,
134
+ 1, 1, 1, 1, 1, 1, 1, 1,
135
+ 1, 1, 1, 1, 1, 1, 1, 1,
136
+ 1, 1, 1, 1, 1, 1, 1, 1,
137
+ 1, 1, 1, 1, 1, 1, 1, 1,
138
+ 1, 1, 1, 1, 1, 1, 1, 1,
139
+ 1, 1, 1, 1, 1, 1, 1, 1,
131
140
  1, 1, 1, 1, 1, 1, 1, 1,
141
+ 1, 1, 1, 36, 36, 36, 36, 36,
142
+ 36, 36, 36, 36, 36, 36, 36, 36,
143
+ 36, 36, 36, 36, 36, 36, 36, 36,
144
+ 36, 36, 36, 36, 36, 36, 36, 36,
145
+ 36, 37, 38, 38, 38, 38, 38, 38,
146
+ 38, 38, 38, 38, 38, 38, 39, 38,
147
+ 38, 40, 41, 41, 41, 42, 1, 43,
148
+ 1, 31, 1, 1, 1, 1, 1, 1,
132
149
  1, 1, 1, 1, 1, 1, 1, 1,
133
- 30, 1, 1, 1, 1, 1, 1, 1,
134
- 32, 1, 1, 1, 1, 1, 1, 1,
135
- 33, 33, 33, 33, 33, 33, 33, 33,
136
- 33, 33, 1, 18, 1, 1, 1, 34,
137
150
  1, 1, 1, 1, 1, 1, 1, 1,
151
+ 31, 1, 31, 31, 31, 31, 31, 31,
152
+ 31, 31, 31, 31, 31, 31, 31, 31,
153
+ 31, 31, 31, 31, 31, 31, 31, 31,
154
+ 31, 31, 31, 31, 31, 31, 31, 31,
155
+ 31, 31, 31, 31, 31, 31, 31, 31,
156
+ 31, 31, 31, 31, 31, 31, 31, 31,
157
+ 31, 31, 31, 31, 31, 31, 31, 31,
158
+ 31, 31, 31, 31, 31, 31, 31, 31,
159
+ 31, 31, 31, 31, 31, 31, 31, 31,
160
+ 31, 31, 31, 31, 31, 31, 31, 31,
161
+ 31, 31, 31, 31, 31, 31, 31, 31,
162
+ 31, 31, 31, 31, 31, 31, 31, 31,
163
+ 31, 31, 31, 31, 31, 31, 31, 31,
164
+ 31, 31, 31, 31, 31, 31, 31, 31,
165
+ 31, 31, 31, 31, 31, 31, 31, 31,
166
+ 31, 31, 31, 31, 31, 31, 31, 31,
167
+ 31, 31, 1, 1, 1, 1, 1, 1,
138
168
  1, 1, 1, 1, 1, 1, 1, 1,
139
- 1, 1, 18, 1, 1, 1, 1, 1,
140
- 1, 1, 35, 1, 36, 1, 1, 1,
141
- 37, 1, 1, 1, 1, 1, 1, 1,
142
169
  1, 1, 1, 1, 1, 1, 1, 1,
143
- 1, 1, 1, 36, 1, 1, 1, 1,
144
- 1, 1, 1, 38, 1, 1, 0
170
+ 1, 1, 1, 1, 1, 1, 1, 1,
171
+ 1, 1, 1, 1, 1, 1, 1, 1,
172
+ 1, 1, 1, 1, 1, 1, 1, 1,
173
+ 1, 1, 1, 1, 1, 1, 1, 1,
174
+ 1, 1, 1, 1, 1, 1, 1, 1,
175
+ 1, 1, 1, 1, 36, 36, 36, 36,
176
+ 36, 36, 36, 36, 36, 36, 36, 36,
177
+ 36, 36, 36, 36, 36, 36, 36, 36,
178
+ 36, 36, 36, 36, 36, 36, 36, 36,
179
+ 36, 36, 37, 38, 38, 38, 38, 38,
180
+ 38, 38, 38, 38, 38, 38, 38, 39,
181
+ 38, 38, 40, 41, 41, 41, 42, 1,
182
+ 31, 31, 31, 31, 31, 31, 31, 31,
183
+ 31, 31, 31, 31, 31, 31, 31, 31,
184
+ 31, 31, 31, 31, 31, 31, 31, 31,
185
+ 31, 31, 31, 31, 31, 31, 31, 31,
186
+ 31, 31, 31, 31, 31, 31, 31, 31,
187
+ 31, 31, 31, 31, 31, 31, 31, 31,
188
+ 31, 31, 31, 31, 31, 31, 31, 31,
189
+ 31, 31, 31, 31, 31, 31, 31, 31,
190
+ 1, 36, 36, 36, 36, 36, 36, 36,
191
+ 36, 36, 36, 36, 36, 36, 36, 36,
192
+ 36, 36, 36, 36, 36, 36, 36, 36,
193
+ 36, 36, 36, 36, 36, 36, 36, 36,
194
+ 36, 1, 36, 36, 36, 36, 36, 36,
195
+ 36, 36, 36, 36, 36, 36, 36, 36,
196
+ 36, 36, 36, 36, 36, 36, 36, 36,
197
+ 36, 36, 36, 36, 36, 36, 36, 36,
198
+ 36, 36, 36, 36, 36, 36, 36, 36,
199
+ 36, 36, 36, 36, 36, 36, 36, 36,
200
+ 36, 36, 36, 36, 36, 36, 36, 36,
201
+ 36, 36, 36, 36, 36, 36, 36, 36,
202
+ 36, 36, 1, 36, 36, 36, 36, 36,
203
+ 36, 36, 36, 36, 36, 36, 36, 36,
204
+ 36, 36, 36, 36, 36, 36, 36, 36,
205
+ 36, 36, 36, 36, 36, 36, 36, 36,
206
+ 36, 36, 36, 1, 38, 38, 38, 38,
207
+ 38, 38, 38, 38, 38, 38, 38, 38,
208
+ 38, 38, 38, 38, 38, 38, 38, 38,
209
+ 38, 38, 38, 38, 38, 38, 38, 38,
210
+ 38, 38, 38, 38, 38, 38, 38, 38,
211
+ 38, 38, 38, 38, 38, 38, 38, 38,
212
+ 38, 38, 38, 38, 1, 38, 38, 38,
213
+ 38, 38, 38, 38, 38, 38, 38, 38,
214
+ 38, 38, 38, 38, 38, 38, 38, 38,
215
+ 38, 38, 38, 38, 38, 38, 38, 38,
216
+ 38, 38, 38, 38, 38, 38, 38, 38,
217
+ 38, 38, 38, 38, 38, 38, 38, 38,
218
+ 38, 38, 38, 38, 38, 38, 38, 38,
219
+ 38, 38, 38, 38, 38, 38, 38, 38,
220
+ 38, 38, 38, 38, 38, 1, 38, 38,
221
+ 38, 38, 38, 38, 38, 38, 38, 38,
222
+ 38, 38, 38, 38, 38, 38, 1, 44,
223
+ 1, 1, 1, 45, 1, 1, 1, 1,
224
+ 1, 1, 1, 1, 1, 1, 1, 1,
225
+ 1, 1, 1, 1, 1, 1, 44, 1,
226
+ 1, 1, 1, 1, 1, 1, 46, 1,
227
+ 1, 1, 1, 1, 1, 1, 47, 47,
228
+ 47, 47, 47, 47, 47, 47, 47, 47,
229
+ 1, 18, 1, 1, 1, 48, 1, 1,
230
+ 1, 1, 1, 1, 1, 1, 1, 1,
231
+ 1, 1, 1, 1, 1, 1, 1, 1,
232
+ 18, 1, 1, 1, 1, 1, 1, 1,
233
+ 49, 1, 50, 1, 1, 1, 51, 1,
234
+ 1, 1, 1, 1, 1, 1, 1, 1,
235
+ 1, 1, 1, 1, 1, 1, 1, 1,
236
+ 1, 50, 1, 1, 1, 1, 1, 1,
237
+ 1, 52, 1, 1, 0
145
238
  ]
146
239
 
147
240
  class << self
@@ -150,10 +243,12 @@ class << self
150
243
  end
151
244
  self._trans_targs = [
152
245
  1, 0, 2, 4, 5, 3, 1, 2,
153
- 4, 5, 6, 7, 5, 7, 8, 16,
154
- 16, 10, 17, 12, 13, 12, 19, 15,
155
- 12, 13, 12, 19, 15, 14, 17, 9,
156
- 18, 16, 9, 18, 17, 9, 18
246
+ 4, 5, 6, 7, 5, 7, 8, 23,
247
+ 23, 10, 24, 12, 13, 12, 26, 15,
248
+ 16, 17, 18, 19, 20, 21, 22, 12,
249
+ 13, 12, 26, 15, 16, 17, 18, 19,
250
+ 20, 21, 22, 14, 24, 9, 25, 23,
251
+ 9, 25, 24, 9, 25
157
252
  ]
158
253
 
159
254
  class << self
@@ -164,8 +259,10 @@ self._trans_actions = [
164
259
  0, 0, 0, 1, 2, 0, 3, 3,
165
260
  4, 5, 6, 7, 0, 3, 1, 8,
166
261
  9, 0, 0, 10, 10, 11, 12, 10,
167
- 0, 0, 1, 13, 0, 0, 14, 14,
168
- 15, 0, 0, 1, 3, 3, 4
262
+ 10, 10, 10, 10, 10, 10, 10, 0,
263
+ 0, 1, 13, 0, 0, 0, 0, 0,
264
+ 0, 0, 0, 0, 14, 14, 15, 0,
265
+ 0, 1, 3, 3, 4
169
266
  ]
170
267
 
171
268
  class << self
@@ -175,7 +272,8 @@ end
175
272
  self._eof_actions = [
176
273
  0, 0, 0, 0, 0, 0, 0, 0,
177
274
  0, 0, 0, 0, 0, 0, 0, 0,
178
- 14, 0, 3, 0
275
+ 0, 0, 0, 0, 0, 0, 0, 14,
276
+ 0, 3, 0
179
277
  ]
180
278
 
181
279
  class << self
@@ -185,7 +283,7 @@ self.start = 1;
185
283
  class << self
186
284
  attr_accessor :first_final
187
285
  end
188
- self.first_final = 16;
286
+ self.first_final = 23;
189
287
  class << self
190
288
  attr_accessor :error
191
289
  end
@@ -203,6 +301,8 @@ self.en_main = 1;
203
301
 
204
302
 
205
303
  def self.parse(data)
304
+ data = data.dup.force_encoding(Encoding::ASCII_8BIT) if data.respond_to?(:force_encoding)
305
+
206
306
  return MimeVersionStruct.new('', nil) if Mail::Utilities.blank?(data)
207
307
 
208
308
  # Parser state
@@ -264,13 +364,13 @@ begin
264
364
  major_digits_s = p end
265
365
  when 7 then
266
366
  begin
267
- mime_version.major = data[major_digits_s..(p-1)] end
367
+ mime_version.major = chars(data, major_digits_s, p-1) end
268
368
  when 8 then
269
369
  begin
270
370
  minor_digits_s = p end
271
371
  when 14 then
272
372
  begin
273
- mime_version.minor = data[minor_digits_s..(p-1)] end
373
+ mime_version.minor = chars(data, minor_digits_s, p-1) end
274
374
  when 10 then
275
375
  begin
276
376
  end
@@ -298,7 +398,7 @@ begin
298
398
  end
299
399
  when 6 then
300
400
  begin
301
- mime_version.major = data[major_digits_s..(p-1)] end
401
+ mime_version.major = chars(data, major_digits_s, p-1) end
302
402
  begin
303
403
  begin
304
404
  stack[top] = cs
@@ -310,7 +410,7 @@ begin
310
410
  end
311
411
  when 15 then
312
412
  begin
313
- mime_version.minor = data[minor_digits_s..(p-1)] end
413
+ mime_version.minor = chars(data, minor_digits_s, p-1) end
314
414
  begin
315
415
  begin
316
416
  stack[top] = cs
@@ -384,7 +484,7 @@ begin
384
484
  case _eof_actions[cs]
385
485
  when 14 then
386
486
  begin
387
- mime_version.minor = data[minor_digits_s..(p-1)] end
487
+ mime_version.minor = chars(data, minor_digits_s, p-1) end
388
488
  when 3 then
389
489
  begin
390
490
  end
@@ -399,8 +499,8 @@ end
399
499
  end
400
500
 
401
501
 
402
- if p != eof || cs < 16
403
- raise Mail::Field::ParseError.new(Mail::MimeVersionElement, data, "Only able to parse up to #{data[0..p]}")
502
+ if p != eof || cs < 23
503
+ raise Mail::Field::IncompleteParseError.new(Mail::MimeVersionElement, data, p)
404
504
  end
405
505
 
406
506
  mime_version
@@ -1,16 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
  require 'mail/utilities'
3
+ require 'mail/parser_tools'
3
4
 
4
5
  %%{
5
6
  machine mime_version;
7
+ alphtype int;
6
8
 
7
9
  # Major Digits
8
10
  action major_digits_s { major_digits_s = p }
9
- action major_digits_e { mime_version.major = data[major_digits_s..(p-1)] }
11
+ action major_digits_e { mime_version.major = chars(data, major_digits_s, p-1) }
10
12
 
11
13
  # Minor Digits
12
14
  action minor_digits_s { minor_digits_s = p }
13
- action minor_digits_e { mime_version.minor = data[minor_digits_s..(p-1)] }
15
+ action minor_digits_e { mime_version.minor = chars(data, minor_digits_s, p-1) }
14
16
 
15
17
  # No-op actions
16
18
  action comment_s {}
@@ -26,11 +28,15 @@ require 'mail/utilities'
26
28
 
27
29
  module Mail::Parsers
28
30
  module MimeVersionParser
31
+ extend Mail::ParserTools
32
+
29
33
  MimeVersionStruct = Struct.new(:major, :minor, :error)
30
34
 
31
35
  %%write data noprefix;
32
36
 
33
37
  def self.parse(data)
38
+ data = data.dup.force_encoding(Encoding::ASCII_8BIT) if data.respond_to?(:force_encoding)
39
+
34
40
  return MimeVersionStruct.new('', nil) if Mail::Utilities.blank?(data)
35
41
 
36
42
  # Parser state
@@ -46,7 +52,7 @@ module Mail::Parsers
46
52
  %%write exec;
47
53
 
48
54
  if p != eof || cs < %%{ write first_final; }%%
49
- raise Mail::Field::ParseError.new(Mail::MimeVersionElement, data, "Only able to parse up to #{data[0..p]}")
55
+ raise Mail::Field::IncompleteParseError.new(Mail::MimeVersionElement, data, p)
50
56
  end
51
57
 
52
58
  mime_version
@@ -1,12 +1,15 @@
1
1
 
2
2
  # frozen_string_literal: true
3
3
  require 'mail/utilities'
4
+ require 'mail/parser_tools'
4
5
 
5
6
 
6
7
 
7
8
 
8
9
  module Mail::Parsers
9
10
  class PhraseListsParser
11
+ extend Mail::ParserTools
12
+
10
13
  PhraseListsStruct = Struct.new(:phrases, :error)
11
14
 
12
15
 
@@ -15,16 +18,24 @@ class << self
15
18
  private :_trans_keys, :_trans_keys=
16
19
  end
17
20
  self._trans_keys = [
18
- 0, 0, 9, 126, 9, 126,
21
+ 0, 0, 9, 244, 9, 244,
19
22
  10, 10, 9, 32, 10,
20
- 10, 9, 32, 1, 127,
21
- 1, 127, 10, 10, 9, 32,
22
- 0, 127, 9, 126, 10,
23
- 10, 9, 32, 9, 126,
24
- 1, 127, 1, 127, 10, 10,
25
- 9, 32, 0, 127, 9,
26
- 126, 9, 126, 9, 126,
27
- 0, 0, 0
23
+ 10, 9, 32, 1, 244,
24
+ 1, 244, 10, 10, 9, 32,
25
+ 0, 244, 128, 191, 160,
26
+ 191, 128, 191, 128, 159,
27
+ 144, 191, 128, 191, 128, 143,
28
+ 9, 244, 10, 10, 9,
29
+ 32, 9, 244, 128, 191,
30
+ 160, 191, 128, 191, 128, 159,
31
+ 144, 191, 128, 191, 128,
32
+ 143, 1, 244, 1, 244,
33
+ 10, 10, 9, 32, 0, 244,
34
+ 128, 191, 160, 191, 128,
35
+ 191, 128, 159, 144, 191,
36
+ 128, 191, 128, 143, 9, 244,
37
+ 9, 244, 9, 244, 0,
38
+ 0, 0
28
39
  ]
29
40
 
30
41
  class << self
@@ -32,10 +43,12 @@ class << self
32
43
  private :_key_spans, :_key_spans=
33
44
  end
34
45
  self._key_spans = [
35
- 0, 118, 118, 1, 24, 1, 24, 127,
36
- 127, 1, 24, 128, 118, 1, 24, 118,
37
- 127, 127, 1, 24, 128, 118, 118, 118,
38
- 0
46
+ 0, 236, 236, 1, 24, 1, 24, 244,
47
+ 244, 1, 24, 245, 64, 32, 64, 32,
48
+ 48, 64, 16, 236, 1, 24, 236, 64,
49
+ 32, 64, 32, 48, 64, 16, 244, 244,
50
+ 1, 24, 245, 64, 32, 64, 32, 48,
51
+ 64, 16, 236, 236, 236, 0
39
52
  ]
40
53
 
41
54
  class << self
@@ -43,10 +56,12 @@ class << self
43
56
  private :_index_offsets, :_index_offsets=
44
57
  end
45
58
  self._index_offsets = [
46
- 0, 0, 119, 238, 240, 265, 267, 292,
47
- 420, 548, 550, 575, 704, 823, 825, 850,
48
- 969, 1097, 1225, 1227, 1252, 1381, 1500, 1619,
49
- 1738
59
+ 0, 0, 237, 474, 476, 501, 503, 528,
60
+ 773, 1018, 1020, 1045, 1291, 1356, 1389, 1454,
61
+ 1487, 1536, 1601, 1618, 1855, 1857, 1882, 2119,
62
+ 2184, 2217, 2282, 2315, 2364, 2429, 2446, 2691,
63
+ 2936, 2938, 2963, 3209, 3274, 3307, 3372, 3405,
64
+ 3454, 3519, 3536, 3773, 4010, 4247
50
65
  ]
51
66
 
52
67
  class << self
@@ -68,210 +83,524 @@ self._indicies = [
68
83
  3, 3, 3, 3, 3, 3, 3, 3,
69
84
  3, 3, 3, 3, 3, 3, 3, 3,
70
85
  3, 3, 3, 3, 3, 3, 3, 3,
71
- 3, 3, 3, 3, 3, 3, 1, 7,
72
- 1, 1, 1, 8, 1, 1, 1, 1,
86
+ 3, 3, 3, 3, 3, 3, 1, 1,
73
87
  1, 1, 1, 1, 1, 1, 1, 1,
74
- 1, 1, 1, 1, 1, 1, 7, 9,
75
- 10, 9, 9, 9, 9, 9, 11, 1,
76
- 9, 9, 1, 9, 1, 9, 9, 9,
77
- 9, 9, 9, 9, 9, 9, 9, 9,
78
- 1, 1, 1, 9, 1, 9, 1, 9,
79
- 9, 9, 9, 9, 9, 9, 9, 9,
80
- 9, 9, 9, 9, 9, 9, 9, 9,
81
- 9, 9, 9, 9, 9, 9, 9, 9,
82
- 9, 1, 1, 1, 9, 9, 9, 9,
83
- 9, 9, 9, 9, 9, 9, 9, 9,
84
- 9, 9, 9, 9, 9, 9, 9, 9,
88
+ 1, 1, 1, 1, 1, 1, 1, 1,
89
+ 1, 1, 1, 1, 1, 1, 1, 1,
90
+ 1, 1, 1, 1, 1, 1, 1, 1,
91
+ 1, 1, 1, 1, 1, 1, 1, 1,
92
+ 1, 1, 1, 1, 1, 1, 1, 1,
93
+ 1, 1, 1, 1, 1, 1, 1, 1,
94
+ 1, 1, 1, 1, 1, 1, 1, 1,
95
+ 1, 7, 7, 7, 7, 7, 7, 7,
96
+ 7, 7, 7, 7, 7, 7, 7, 7,
97
+ 7, 7, 7, 7, 7, 7, 7, 7,
98
+ 7, 7, 7, 7, 7, 7, 7, 8,
85
99
  9, 9, 9, 9, 9, 9, 9, 9,
86
- 9, 9, 9, 9, 9, 1, 12, 1,
87
- 7, 1, 1, 1, 1, 1, 1, 1,
88
- 1, 1, 1, 1, 1, 1, 1, 1,
89
- 1, 1, 1, 1, 1, 1, 1, 7,
90
- 1, 13, 1, 9, 1, 1, 1, 1,
91
- 1, 1, 1, 1, 1, 1, 1, 1,
92
- 1, 1, 1, 1, 1, 1, 1, 1,
93
- 1, 1, 9, 1, 14, 14, 14, 14,
94
- 14, 14, 14, 14, 14, 1, 14, 14,
95
- 15, 14, 14, 14, 14, 14, 14, 14,
96
- 14, 14, 14, 14, 14, 14, 14, 14,
97
- 14, 14, 14, 14, 14, 16, 14, 14,
98
- 14, 14, 14, 14, 14, 14, 14, 14,
99
- 14, 14, 14, 14, 14, 14, 14, 14,
100
- 14, 14, 14, 14, 14, 14, 14, 14,
101
- 14, 14, 14, 14, 14, 14, 14, 14,
102
- 14, 14, 14, 14, 14, 14, 14, 14,
103
- 14, 14, 14, 14, 14, 14, 14, 14,
104
- 14, 14, 14, 14, 14, 14, 14, 17,
105
- 14, 14, 14, 14, 14, 14, 14, 14,
106
- 14, 14, 14, 14, 14, 14, 14, 14,
107
- 14, 14, 14, 14, 14, 14, 14, 14,
108
- 14, 14, 14, 14, 14, 14, 14, 14,
109
- 14, 14, 14, 1, 18, 18, 18, 18,
110
- 18, 18, 18, 18, 18, 1, 18, 18,
111
- 19, 18, 18, 18, 18, 18, 18, 18,
112
- 18, 18, 18, 18, 18, 18, 18, 18,
113
- 18, 18, 18, 18, 18, 20, 18, 18,
114
- 18, 18, 18, 18, 18, 18, 18, 18,
115
- 18, 18, 18, 18, 18, 18, 18, 18,
116
- 18, 18, 18, 18, 18, 18, 18, 18,
117
- 18, 18, 18, 18, 18, 18, 18, 18,
118
- 18, 18, 18, 18, 18, 18, 18, 18,
119
- 18, 18, 18, 18, 18, 18, 18, 18,
120
- 18, 18, 18, 18, 18, 18, 18, 21,
121
- 18, 18, 18, 18, 18, 18, 18, 18,
122
- 18, 18, 18, 18, 18, 18, 18, 18,
123
- 18, 18, 18, 18, 18, 18, 18, 18,
124
- 18, 18, 18, 18, 18, 18, 18, 18,
125
- 18, 18, 18, 1, 22, 1, 18, 1,
126
- 1, 1, 1, 1, 1, 1, 1, 1,
127
- 1, 1, 1, 1, 1, 1, 1, 1,
128
- 1, 1, 1, 1, 1, 18, 1, 18,
129
- 18, 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, 18, 18, 18, 18, 18, 18,
134
- 18, 18, 18, 18, 18, 18, 18, 18,
135
- 18, 18, 18, 18, 18, 18, 18, 18,
136
- 18, 18, 18, 18, 18, 18, 18, 18,
137
- 18, 18, 18, 18, 18, 18, 18, 18,
138
- 18, 18, 18, 18, 18, 18, 18, 18,
139
- 18, 18, 18, 18, 18, 18, 18, 18,
140
- 18, 18, 18, 18, 18, 18, 18, 18,
141
- 18, 18, 18, 18, 18, 18, 18, 18,
142
- 18, 18, 18, 18, 18, 18, 18, 18,
143
- 18, 18, 18, 18, 18, 18, 18, 18,
144
- 18, 18, 18, 18, 18, 18, 18, 1,
145
- 23, 1, 1, 1, 24, 1, 1, 1,
146
- 1, 1, 1, 1, 1, 1, 1, 1,
147
- 1, 1, 1, 1, 1, 1, 1, 23,
148
- 3, 4, 3, 3, 3, 3, 3, 5,
149
- 1, 3, 3, 1, 3, 6, 3, 3,
100
+ 9, 9, 9, 9, 10, 9, 9, 11,
101
+ 12, 12, 12, 13, 1, 14, 1, 1,
102
+ 1, 15, 1, 1, 1, 1, 1, 1,
103
+ 1, 1, 1, 1, 1, 1, 1, 1,
104
+ 1, 1, 1, 1, 14, 16, 17, 16,
105
+ 16, 16, 16, 16, 18, 1, 16, 16,
106
+ 1, 16, 1, 16, 16, 16, 16, 16,
107
+ 16, 16, 16, 16, 16, 16, 1, 1,
108
+ 1, 16, 1, 16, 1, 16, 16, 16,
109
+ 16, 16, 16, 16, 16, 16, 16, 16,
110
+ 16, 16, 16, 16, 16, 16, 16, 16,
111
+ 16, 16, 16, 16, 16, 16, 16, 1,
112
+ 1, 1, 16, 16, 16, 16, 16, 16,
113
+ 16, 16, 16, 16, 16, 16, 16, 16,
114
+ 16, 16, 16, 16, 16, 16, 16, 16,
115
+ 16, 16, 16, 16, 16, 16, 16, 16,
116
+ 16, 16, 16, 1, 1, 1, 1, 1,
117
+ 1, 1, 1, 1, 1, 1, 1, 1,
118
+ 1, 1, 1, 1, 1, 1, 1, 1,
119
+ 1, 1, 1, 1, 1, 1, 1, 1,
120
+ 1, 1, 1, 1, 1, 1, 1, 1,
121
+ 1, 1, 1, 1, 1, 1, 1, 1,
122
+ 1, 1, 1, 1, 1, 1, 1, 1,
123
+ 1, 1, 1, 1, 1, 1, 1, 1,
124
+ 1, 1, 1, 1, 1, 1, 19, 19,
125
+ 19, 19, 19, 19, 19, 19, 19, 19,
126
+ 19, 19, 19, 19, 19, 19, 19, 19,
127
+ 19, 19, 19, 19, 19, 19, 19, 19,
128
+ 19, 19, 19, 19, 20, 21, 21, 21,
129
+ 21, 21, 21, 21, 21, 21, 21, 21,
130
+ 21, 22, 21, 21, 23, 24, 24, 24,
131
+ 25, 1, 26, 1, 14, 1, 1, 1,
132
+ 1, 1, 1, 1, 1, 1, 1, 1,
133
+ 1, 1, 1, 1, 1, 1, 1, 1,
134
+ 1, 1, 1, 14, 1, 27, 1, 16,
135
+ 1, 1, 1, 1, 1, 1, 1, 1,
136
+ 1, 1, 1, 1, 1, 1, 1, 1,
137
+ 1, 1, 1, 1, 1, 1, 16, 1,
138
+ 28, 28, 28, 28, 28, 28, 28, 28,
139
+ 28, 1, 28, 28, 29, 28, 28, 28,
140
+ 28, 28, 28, 28, 28, 28, 28, 28,
141
+ 28, 28, 28, 28, 28, 28, 28, 28,
142
+ 28, 30, 28, 28, 28, 28, 28, 28,
143
+ 28, 28, 28, 28, 28, 28, 28, 28,
144
+ 28, 28, 28, 28, 28, 28, 28, 28,
145
+ 28, 28, 28, 28, 28, 28, 28, 28,
146
+ 28, 28, 28, 28, 28, 28, 28, 28,
147
+ 28, 28, 28, 28, 28, 28, 28, 28,
148
+ 28, 28, 28, 28, 28, 28, 28, 28,
149
+ 28, 28, 28, 31, 28, 28, 28, 28,
150
+ 28, 28, 28, 28, 28, 28, 28, 28,
151
+ 28, 28, 28, 28, 28, 28, 28, 28,
152
+ 28, 28, 28, 28, 28, 28, 28, 28,
153
+ 28, 28, 28, 28, 28, 28, 28, 1,
154
+ 1, 1, 1, 1, 1, 1, 1, 1,
155
+ 1, 1, 1, 1, 1, 1, 1, 1,
156
+ 1, 1, 1, 1, 1, 1, 1, 1,
157
+ 1, 1, 1, 1, 1, 1, 1, 1,
158
+ 1, 1, 1, 1, 1, 1, 1, 1,
159
+ 1, 1, 1, 1, 1, 1, 1, 1,
160
+ 1, 1, 1, 1, 1, 1, 1, 1,
161
+ 1, 1, 1, 1, 1, 1, 1, 1,
162
+ 1, 32, 32, 32, 32, 32, 32, 32,
163
+ 32, 32, 32, 32, 32, 32, 32, 32,
164
+ 32, 32, 32, 32, 32, 32, 32, 32,
165
+ 32, 32, 32, 32, 32, 32, 32, 33,
166
+ 34, 34, 34, 34, 34, 34, 34, 34,
167
+ 34, 34, 34, 34, 35, 34, 34, 36,
168
+ 37, 37, 37, 38, 1, 39, 39, 39,
169
+ 39, 39, 39, 39, 39, 39, 1, 39,
170
+ 39, 40, 39, 39, 39, 39, 39, 39,
171
+ 39, 39, 39, 39, 39, 39, 39, 39,
172
+ 39, 39, 39, 39, 39, 39, 41, 39,
173
+ 39, 39, 39, 39, 39, 39, 39, 39,
174
+ 39, 39, 39, 39, 39, 39, 39, 39,
175
+ 39, 39, 39, 39, 39, 39, 39, 39,
176
+ 39, 39, 39, 39, 39, 39, 39, 39,
177
+ 39, 39, 39, 39, 39, 39, 39, 39,
178
+ 39, 39, 39, 39, 39, 39, 39, 39,
179
+ 39, 39, 39, 39, 39, 39, 39, 39,
180
+ 42, 39, 39, 39, 39, 39, 39, 39,
181
+ 39, 39, 39, 39, 39, 39, 39, 39,
182
+ 39, 39, 39, 39, 39, 39, 39, 39,
183
+ 39, 39, 39, 39, 39, 39, 39, 39,
184
+ 39, 39, 39, 39, 1, 1, 1, 1,
185
+ 1, 1, 1, 1, 1, 1, 1, 1,
186
+ 1, 1, 1, 1, 1, 1, 1, 1,
187
+ 1, 1, 1, 1, 1, 1, 1, 1,
188
+ 1, 1, 1, 1, 1, 1, 1, 1,
189
+ 1, 1, 1, 1, 1, 1, 1, 1,
190
+ 1, 1, 1, 1, 1, 1, 1, 1,
191
+ 1, 1, 1, 1, 1, 1, 1, 1,
192
+ 1, 1, 1, 1, 1, 1, 43, 43,
193
+ 43, 43, 43, 43, 43, 43, 43, 43,
194
+ 43, 43, 43, 43, 43, 43, 43, 43,
195
+ 43, 43, 43, 43, 43, 43, 43, 43,
196
+ 43, 43, 43, 43, 44, 45, 45, 45,
197
+ 45, 45, 45, 45, 45, 45, 45, 45,
198
+ 45, 46, 45, 45, 47, 48, 48, 48,
199
+ 49, 1, 50, 1, 39, 1, 1, 1,
200
+ 1, 1, 1, 1, 1, 1, 1, 1,
201
+ 1, 1, 1, 1, 1, 1, 1, 1,
202
+ 1, 1, 1, 39, 1, 39, 39, 39,
203
+ 39, 39, 39, 39, 39, 39, 39, 39,
204
+ 39, 39, 39, 39, 39, 39, 39, 39,
205
+ 39, 39, 39, 39, 39, 39, 39, 39,
206
+ 39, 39, 39, 39, 39, 39, 39, 39,
207
+ 39, 39, 39, 39, 39, 39, 39, 39,
208
+ 39, 39, 39, 39, 39, 39, 39, 39,
209
+ 39, 39, 39, 39, 39, 39, 39, 39,
210
+ 39, 39, 39, 39, 39, 39, 39, 39,
211
+ 39, 39, 39, 39, 39, 39, 39, 39,
212
+ 39, 39, 39, 39, 39, 39, 39, 39,
213
+ 39, 39, 39, 39, 39, 39, 39, 39,
214
+ 39, 39, 39, 39, 39, 39, 39, 39,
215
+ 39, 39, 39, 39, 39, 39, 39, 39,
216
+ 39, 39, 39, 39, 39, 39, 39, 39,
217
+ 39, 39, 39, 39, 39, 39, 39, 39,
218
+ 39, 39, 39, 39, 39, 1, 1, 1,
219
+ 1, 1, 1, 1, 1, 1, 1, 1,
220
+ 1, 1, 1, 1, 1, 1, 1, 1,
221
+ 1, 1, 1, 1, 1, 1, 1, 1,
222
+ 1, 1, 1, 1, 1, 1, 1, 1,
223
+ 1, 1, 1, 1, 1, 1, 1, 1,
224
+ 1, 1, 1, 1, 1, 1, 1, 1,
225
+ 1, 1, 1, 1, 1, 1, 1, 1,
226
+ 1, 1, 1, 1, 1, 1, 1, 43,
227
+ 43, 43, 43, 43, 43, 43, 43, 43,
228
+ 43, 43, 43, 43, 43, 43, 43, 43,
229
+ 43, 43, 43, 43, 43, 43, 43, 43,
230
+ 43, 43, 43, 43, 43, 44, 45, 45,
231
+ 45, 45, 45, 45, 45, 45, 45, 45,
232
+ 45, 45, 46, 45, 45, 47, 48, 48,
233
+ 48, 49, 1, 39, 39, 39, 39, 39,
234
+ 39, 39, 39, 39, 39, 39, 39, 39,
235
+ 39, 39, 39, 39, 39, 39, 39, 39,
236
+ 39, 39, 39, 39, 39, 39, 39, 39,
237
+ 39, 39, 39, 39, 39, 39, 39, 39,
238
+ 39, 39, 39, 39, 39, 39, 39, 39,
239
+ 39, 39, 39, 39, 39, 39, 39, 39,
240
+ 39, 39, 39, 39, 39, 39, 39, 39,
241
+ 39, 39, 39, 1, 43, 43, 43, 43,
242
+ 43, 43, 43, 43, 43, 43, 43, 43,
243
+ 43, 43, 43, 43, 43, 43, 43, 43,
244
+ 43, 43, 43, 43, 43, 43, 43, 43,
245
+ 43, 43, 43, 43, 1, 43, 43, 43,
246
+ 43, 43, 43, 43, 43, 43, 43, 43,
247
+ 43, 43, 43, 43, 43, 43, 43, 43,
248
+ 43, 43, 43, 43, 43, 43, 43, 43,
249
+ 43, 43, 43, 43, 43, 43, 43, 43,
250
+ 43, 43, 43, 43, 43, 43, 43, 43,
251
+ 43, 43, 43, 43, 43, 43, 43, 43,
252
+ 43, 43, 43, 43, 43, 43, 43, 43,
253
+ 43, 43, 43, 43, 43, 1, 43, 43,
254
+ 43, 43, 43, 43, 43, 43, 43, 43,
255
+ 43, 43, 43, 43, 43, 43, 43, 43,
256
+ 43, 43, 43, 43, 43, 43, 43, 43,
257
+ 43, 43, 43, 43, 43, 43, 1, 45,
258
+ 45, 45, 45, 45, 45, 45, 45, 45,
259
+ 45, 45, 45, 45, 45, 45, 45, 45,
260
+ 45, 45, 45, 45, 45, 45, 45, 45,
261
+ 45, 45, 45, 45, 45, 45, 45, 45,
262
+ 45, 45, 45, 45, 45, 45, 45, 45,
263
+ 45, 45, 45, 45, 45, 45, 45, 1,
264
+ 45, 45, 45, 45, 45, 45, 45, 45,
265
+ 45, 45, 45, 45, 45, 45, 45, 45,
266
+ 45, 45, 45, 45, 45, 45, 45, 45,
267
+ 45, 45, 45, 45, 45, 45, 45, 45,
268
+ 45, 45, 45, 45, 45, 45, 45, 45,
269
+ 45, 45, 45, 45, 45, 45, 45, 45,
270
+ 45, 45, 45, 45, 45, 45, 45, 45,
271
+ 45, 45, 45, 45, 45, 45, 45, 45,
272
+ 1, 45, 45, 45, 45, 45, 45, 45,
273
+ 45, 45, 45, 45, 45, 45, 45, 45,
274
+ 45, 1, 51, 1, 1, 1, 52, 1,
275
+ 1, 1, 1, 1, 1, 1, 1, 1,
276
+ 1, 1, 1, 1, 1, 1, 1, 1,
277
+ 1, 51, 3, 4, 3, 3, 3, 3,
278
+ 3, 5, 1, 3, 3, 1, 3, 6,
150
279
  3, 3, 3, 3, 3, 3, 3, 3,
151
- 3, 1, 1, 1, 3, 1, 3, 6,
280
+ 3, 3, 3, 1, 1, 1, 3, 1,
281
+ 3, 6, 3, 3, 3, 3, 3, 3,
152
282
  3, 3, 3, 3, 3, 3, 3, 3,
153
283
  3, 3, 3, 3, 3, 3, 3, 3,
284
+ 3, 3, 3, 3, 1, 1, 1, 3,
154
285
  3, 3, 3, 3, 3, 3, 3, 3,
155
- 3, 3, 1, 1, 1, 3, 3, 3,
156
286
  3, 3, 3, 3, 3, 3, 3, 3,
157
287
  3, 3, 3, 3, 3, 3, 3, 3,
158
288
  3, 3, 3, 3, 3, 3, 3, 3,
159
- 3, 3, 3, 3, 3, 3, 1, 25,
160
- 1, 26, 1, 1, 1, 1, 1, 1,
161
289
  1, 1, 1, 1, 1, 1, 1, 1,
162
290
  1, 1, 1, 1, 1, 1, 1, 1,
163
- 26, 1, 27, 1, 1, 1, 28, 1,
164
291
  1, 1, 1, 1, 1, 1, 1, 1,
165
292
  1, 1, 1, 1, 1, 1, 1, 1,
166
- 1, 27, 29, 30, 29, 29, 29, 29,
167
- 29, 31, 1, 29, 29, 1, 29, 1,
168
- 29, 29, 29, 29, 29, 29, 29, 29,
169
- 29, 29, 29, 1, 1, 1, 29, 1,
170
- 29, 1, 29, 29, 29, 29, 29, 29,
171
- 29, 29, 29, 29, 29, 29, 29, 29,
172
- 29, 29, 29, 29, 29, 29, 29, 29,
173
- 29, 29, 29, 29, 1, 1, 1, 29,
174
- 29, 29, 29, 29, 29, 29, 29, 29,
175
- 29, 29, 29, 29, 29, 29, 29, 29,
176
- 29, 29, 29, 29, 29, 29, 29, 29,
177
- 29, 29, 29, 29, 29, 29, 29, 29,
178
- 1, 32, 32, 32, 32, 32, 32, 32,
179
- 32, 32, 1, 32, 32, 33, 32, 32,
180
- 32, 32, 32, 32, 32, 32, 32, 32,
181
- 32, 32, 32, 32, 32, 32, 32, 32,
182
- 32, 32, 32, 32, 32, 32, 32, 32,
183
- 34, 35, 32, 32, 32, 32, 32, 32,
184
- 32, 32, 32, 32, 32, 32, 32, 32,
185
- 32, 32, 32, 32, 32, 32, 32, 32,
186
- 32, 32, 32, 32, 32, 32, 32, 32,
187
- 32, 32, 32, 32, 32, 32, 32, 32,
188
- 32, 32, 32, 32, 32, 32, 32, 32,
189
- 32, 32, 32, 32, 36, 32, 32, 32,
190
- 32, 32, 32, 32, 32, 32, 32, 32,
191
- 32, 32, 32, 32, 32, 32, 32, 32,
192
- 32, 32, 32, 32, 32, 32, 32, 32,
193
- 32, 32, 32, 32, 32, 32, 32, 32,
194
- 1, 37, 37, 37, 37, 37, 37, 37,
195
- 37, 37, 1, 37, 37, 38, 37, 37,
196
- 37, 37, 37, 37, 37, 37, 37, 37,
197
- 37, 37, 37, 37, 37, 37, 37, 37,
198
- 37, 37, 37, 37, 37, 37, 37, 37,
199
- 39, 40, 37, 37, 37, 37, 37, 37,
200
- 37, 37, 37, 37, 37, 37, 37, 37,
201
- 37, 37, 37, 37, 37, 37, 37, 37,
202
- 37, 37, 37, 37, 37, 37, 37, 37,
203
- 37, 37, 37, 37, 37, 37, 37, 37,
204
- 37, 37, 37, 37, 37, 37, 37, 37,
205
- 37, 37, 37, 37, 41, 37, 37, 37,
206
- 37, 37, 37, 37, 37, 37, 37, 37,
207
- 37, 37, 37, 37, 37, 37, 37, 37,
208
- 37, 37, 37, 37, 37, 37, 37, 37,
209
- 37, 37, 37, 37, 37, 37, 37, 37,
210
- 1, 42, 1, 37, 1, 1, 1, 1,
211
- 1, 1, 1, 1, 1, 1, 1, 1,
212
- 1, 1, 1, 1, 1, 1, 1, 1,
213
- 1, 1, 37, 1, 37, 37, 37, 37,
214
- 37, 37, 37, 37, 37, 37, 37, 37,
215
- 37, 37, 37, 37, 37, 37, 37, 37,
216
- 37, 37, 37, 37, 37, 37, 37, 37,
217
- 37, 37, 37, 37, 37, 37, 37, 37,
218
- 37, 37, 37, 37, 37, 37, 37, 37,
219
- 37, 37, 37, 37, 37, 37, 37, 37,
220
- 37, 37, 37, 37, 37, 37, 37, 37,
221
- 37, 37, 37, 37, 37, 37, 37, 37,
222
- 37, 37, 37, 37, 37, 37, 37, 37,
223
- 37, 37, 37, 37, 37, 37, 37, 37,
224
- 37, 37, 37, 37, 37, 37, 37, 37,
225
- 37, 37, 37, 37, 37, 37, 37, 37,
226
- 37, 37, 37, 37, 37, 37, 37, 37,
227
- 37, 37, 37, 37, 37, 37, 37, 37,
228
- 37, 37, 37, 37, 37, 37, 37, 37,
229
- 37, 37, 37, 37, 1, 9, 1, 1,
230
- 1, 43, 1, 1, 1, 1, 1, 1,
231
- 1, 1, 1, 1, 1, 1, 1, 1,
232
- 1, 1, 1, 1, 9, 9, 10, 9,
233
- 9, 9, 9, 9, 44, 1, 9, 9,
234
- 45, 9, 46, 9, 9, 9, 9, 9,
235
- 9, 9, 9, 9, 9, 9, 1, 1,
236
- 1, 9, 1, 9, 46, 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
- 1, 1, 9, 9, 9, 9, 9, 9,
241
- 9, 9, 9, 9, 9, 9, 9, 9,
242
- 9, 9, 9, 9, 9, 9, 9, 9,
243
- 9, 9, 9, 9, 9, 9, 9, 9,
244
- 9, 9, 9, 1, 29, 1, 1, 1,
245
- 47, 1, 1, 1, 1, 1, 1, 1,
246
- 1, 1, 1, 1, 1, 1, 1, 1,
247
- 1, 1, 1, 29, 29, 30, 29, 29,
248
- 29, 29, 29, 48, 1, 29, 29, 49,
249
- 29, 50, 29, 29, 29, 29, 29, 29,
250
- 29, 29, 29, 29, 29, 1, 1, 1,
251
- 29, 1, 29, 50, 29, 29, 29, 29,
252
- 29, 29, 29, 29, 29, 29, 29, 29,
253
- 29, 29, 29, 29, 29, 29, 29, 29,
254
- 29, 29, 29, 29, 29, 29, 1, 1,
255
- 1, 29, 29, 29, 29, 29, 29, 29,
256
- 29, 29, 29, 29, 29, 29, 29, 29,
257
- 29, 29, 29, 29, 29, 29, 29, 29,
258
- 29, 29, 29, 29, 29, 29, 29, 29,
259
- 29, 29, 1, 7, 1, 1, 1, 8,
260
- 1, 1, 1, 1, 1, 1, 1, 1,
261
- 1, 1, 1, 1, 1, 1, 1, 1,
262
- 1, 1, 7, 9, 10, 9, 9, 9,
263
- 9, 9, 11, 1, 9, 9, 45, 9,
264
- 46, 9, 9, 9, 9, 9, 9, 9,
265
- 9, 9, 9, 9, 1, 1, 1, 9,
266
- 1, 9, 46, 9, 9, 9, 9, 9,
267
- 9, 9, 9, 9, 9, 9, 9, 9,
268
- 9, 9, 9, 9, 9, 9, 9, 9,
269
- 9, 9, 9, 9, 9, 1, 1, 1,
270
- 9, 9, 9, 9, 9, 9, 9, 9,
271
- 9, 9, 9, 9, 9, 9, 9, 9,
272
- 9, 9, 9, 9, 9, 9, 9, 9,
273
- 9, 9, 9, 9, 9, 9, 9, 9,
274
- 9, 1, 1, 0
293
+ 1, 1, 1, 1, 1, 1, 1, 1,
294
+ 1, 1, 1, 1, 1, 1, 1, 1,
295
+ 1, 1, 1, 1, 1, 1, 1, 1,
296
+ 1, 1, 1, 1, 1, 1, 1, 1,
297
+ 1, 1, 1, 7, 7, 7, 7, 7,
298
+ 7, 7, 7, 7, 7, 7, 7, 7,
299
+ 7, 7, 7, 7, 7, 7, 7, 7,
300
+ 7, 7, 7, 7, 7, 7, 7, 7,
301
+ 7, 8, 9, 9, 9, 9, 9, 9,
302
+ 9, 9, 9, 9, 9, 9, 10, 9,
303
+ 9, 11, 12, 12, 12, 13, 1, 53,
304
+ 1, 54, 1, 1, 1, 1, 1, 1,
305
+ 1, 1, 1, 1, 1, 1, 1, 1,
306
+ 1, 1, 1, 1, 1, 1, 1, 1,
307
+ 54, 1, 55, 1, 1, 1, 56, 1,
308
+ 1, 1, 1, 1, 1, 1, 1, 1,
309
+ 1, 1, 1, 1, 1, 1, 1, 1,
310
+ 1, 55, 57, 58, 57, 57, 57, 57,
311
+ 57, 59, 1, 57, 57, 1, 57, 1,
312
+ 57, 57, 57, 57, 57, 57, 57, 57,
313
+ 57, 57, 57, 1, 1, 1, 57, 1,
314
+ 57, 1, 57, 57, 57, 57, 57, 57,
315
+ 57, 57, 57, 57, 57, 57, 57, 57,
316
+ 57, 57, 57, 57, 57, 57, 57, 57,
317
+ 57, 57, 57, 57, 1, 1, 1, 57,
318
+ 57, 57, 57, 57, 57, 57, 57, 57,
319
+ 57, 57, 57, 57, 57, 57, 57, 57,
320
+ 57, 57, 57, 57, 57, 57, 57, 57,
321
+ 57, 57, 57, 57, 57, 57, 57, 57,
322
+ 1, 1, 1, 1, 1, 1, 1, 1,
323
+ 1, 1, 1, 1, 1, 1, 1, 1,
324
+ 1, 1, 1, 1, 1, 1, 1, 1,
325
+ 1, 1, 1, 1, 1, 1, 1, 1,
326
+ 1, 1, 1, 1, 1, 1, 1, 1,
327
+ 1, 1, 1, 1, 1, 1, 1, 1,
328
+ 1, 1, 1, 1, 1, 1, 1, 1,
329
+ 1, 1, 1, 1, 1, 1, 1, 1,
330
+ 1, 1, 1, 60, 60, 60, 60, 60,
331
+ 60, 60, 60, 60, 60, 60, 60, 60,
332
+ 60, 60, 60, 60, 60, 60, 60, 60,
333
+ 60, 60, 60, 60, 60, 60, 60, 60,
334
+ 60, 61, 62, 62, 62, 62, 62, 62,
335
+ 62, 62, 62, 62, 62, 62, 63, 62,
336
+ 62, 64, 65, 65, 65, 66, 1, 16,
337
+ 16, 16, 16, 16, 16, 16, 16, 16,
338
+ 16, 16, 16, 16, 16, 16, 16, 16,
339
+ 16, 16, 16, 16, 16, 16, 16, 16,
340
+ 16, 16, 16, 16, 16, 16, 16, 16,
341
+ 16, 16, 16, 16, 16, 16, 16, 16,
342
+ 16, 16, 16, 16, 16, 16, 16, 16,
343
+ 16, 16, 16, 16, 16, 16, 16, 16,
344
+ 16, 16, 16, 16, 16, 16, 16, 1,
345
+ 19, 19, 19, 19, 19, 19, 19, 19,
346
+ 19, 19, 19, 19, 19, 19, 19, 19,
347
+ 19, 19, 19, 19, 19, 19, 19, 19,
348
+ 19, 19, 19, 19, 19, 19, 19, 19,
349
+ 1, 19, 19, 19, 19, 19, 19, 19,
350
+ 19, 19, 19, 19, 19, 19, 19, 19,
351
+ 19, 19, 19, 19, 19, 19, 19, 19,
352
+ 19, 19, 19, 19, 19, 19, 19, 19,
353
+ 19, 19, 19, 19, 19, 19, 19, 19,
354
+ 19, 19, 19, 19, 19, 19, 19, 19,
355
+ 19, 19, 19, 19, 19, 19, 19, 19,
356
+ 19, 19, 19, 19, 19, 19, 19, 19,
357
+ 19, 1, 19, 19, 19, 19, 19, 19,
358
+ 19, 19, 19, 19, 19, 19, 19, 19,
359
+ 19, 19, 19, 19, 19, 19, 19, 19,
360
+ 19, 19, 19, 19, 19, 19, 19, 19,
361
+ 19, 19, 1, 21, 21, 21, 21, 21,
362
+ 21, 21, 21, 21, 21, 21, 21, 21,
363
+ 21, 21, 21, 21, 21, 21, 21, 21,
364
+ 21, 21, 21, 21, 21, 21, 21, 21,
365
+ 21, 21, 21, 21, 21, 21, 21, 21,
366
+ 21, 21, 21, 21, 21, 21, 21, 21,
367
+ 21, 21, 21, 1, 21, 21, 21, 21,
368
+ 21, 21, 21, 21, 21, 21, 21, 21,
369
+ 21, 21, 21, 21, 21, 21, 21, 21,
370
+ 21, 21, 21, 21, 21, 21, 21, 21,
371
+ 21, 21, 21, 21, 21, 21, 21, 21,
372
+ 21, 21, 21, 21, 21, 21, 21, 21,
373
+ 21, 21, 21, 21, 21, 21, 21, 21,
374
+ 21, 21, 21, 21, 21, 21, 21, 21,
375
+ 21, 21, 21, 21, 1, 21, 21, 21,
376
+ 21, 21, 21, 21, 21, 21, 21, 21,
377
+ 21, 21, 21, 21, 21, 1, 67, 67,
378
+ 67, 67, 67, 67, 67, 67, 67, 1,
379
+ 67, 67, 68, 67, 67, 67, 67, 67,
380
+ 67, 67, 67, 67, 67, 67, 67, 67,
381
+ 67, 67, 67, 67, 67, 67, 67, 67,
382
+ 67, 67, 67, 67, 67, 69, 70, 67,
383
+ 67, 67, 67, 67, 67, 67, 67, 67,
384
+ 67, 67, 67, 67, 67, 67, 67, 67,
385
+ 67, 67, 67, 67, 67, 67, 67, 67,
386
+ 67, 67, 67, 67, 67, 67, 67, 67,
387
+ 67, 67, 67, 67, 67, 67, 67, 67,
388
+ 67, 67, 67, 67, 67, 67, 67, 67,
389
+ 67, 71, 67, 67, 67, 67, 67, 67,
390
+ 67, 67, 67, 67, 67, 67, 67, 67,
391
+ 67, 67, 67, 67, 67, 67, 67, 67,
392
+ 67, 67, 67, 67, 67, 67, 67, 67,
393
+ 67, 67, 67, 67, 67, 1, 1, 1,
394
+ 1, 1, 1, 1, 1, 1, 1, 1,
395
+ 1, 1, 1, 1, 1, 1, 1, 1,
396
+ 1, 1, 1, 1, 1, 1, 1, 1,
397
+ 1, 1, 1, 1, 1, 1, 1, 1,
398
+ 1, 1, 1, 1, 1, 1, 1, 1,
399
+ 1, 1, 1, 1, 1, 1, 1, 1,
400
+ 1, 1, 1, 1, 1, 1, 1, 1,
401
+ 1, 1, 1, 1, 1, 1, 1, 72,
402
+ 72, 72, 72, 72, 72, 72, 72, 72,
403
+ 72, 72, 72, 72, 72, 72, 72, 72,
404
+ 72, 72, 72, 72, 72, 72, 72, 72,
405
+ 72, 72, 72, 72, 72, 73, 74, 74,
406
+ 74, 74, 74, 74, 74, 74, 74, 74,
407
+ 74, 74, 75, 74, 74, 76, 77, 77,
408
+ 77, 78, 1, 79, 79, 79, 79, 79,
409
+ 79, 79, 79, 79, 1, 79, 79, 80,
410
+ 79, 79, 79, 79, 79, 79, 79, 79,
411
+ 79, 79, 79, 79, 79, 79, 79, 79,
412
+ 79, 79, 79, 79, 79, 79, 79, 79,
413
+ 79, 79, 81, 82, 79, 79, 79, 79,
414
+ 79, 79, 79, 79, 79, 79, 79, 79,
415
+ 79, 79, 79, 79, 79, 79, 79, 79,
416
+ 79, 79, 79, 79, 79, 79, 79, 79,
417
+ 79, 79, 79, 79, 79, 79, 79, 79,
418
+ 79, 79, 79, 79, 79, 79, 79, 79,
419
+ 79, 79, 79, 79, 79, 79, 83, 79,
420
+ 79, 79, 79, 79, 79, 79, 79, 79,
421
+ 79, 79, 79, 79, 79, 79, 79, 79,
422
+ 79, 79, 79, 79, 79, 79, 79, 79,
423
+ 79, 79, 79, 79, 79, 79, 79, 79,
424
+ 79, 79, 1, 1, 1, 1, 1, 1,
425
+ 1, 1, 1, 1, 1, 1, 1, 1,
426
+ 1, 1, 1, 1, 1, 1, 1, 1,
427
+ 1, 1, 1, 1, 1, 1, 1, 1,
428
+ 1, 1, 1, 1, 1, 1, 1, 1,
429
+ 1, 1, 1, 1, 1, 1, 1, 1,
430
+ 1, 1, 1, 1, 1, 1, 1, 1,
431
+ 1, 1, 1, 1, 1, 1, 1, 1,
432
+ 1, 1, 1, 1, 84, 84, 84, 84,
433
+ 84, 84, 84, 84, 84, 84, 84, 84,
434
+ 84, 84, 84, 84, 84, 84, 84, 84,
435
+ 84, 84, 84, 84, 84, 84, 84, 84,
436
+ 84, 84, 85, 86, 86, 86, 86, 86,
437
+ 86, 86, 86, 86, 86, 86, 86, 87,
438
+ 86, 86, 88, 89, 89, 89, 90, 1,
439
+ 91, 1, 79, 1, 1, 1, 1, 1,
440
+ 1, 1, 1, 1, 1, 1, 1, 1,
441
+ 1, 1, 1, 1, 1, 1, 1, 1,
442
+ 1, 79, 1, 79, 79, 79, 79, 79,
443
+ 79, 79, 79, 79, 79, 79, 79, 79,
444
+ 79, 79, 79, 79, 79, 79, 79, 79,
445
+ 79, 79, 79, 79, 79, 79, 79, 79,
446
+ 79, 79, 79, 79, 79, 79, 79, 79,
447
+ 79, 79, 79, 79, 79, 79, 79, 79,
448
+ 79, 79, 79, 79, 79, 79, 79, 79,
449
+ 79, 79, 79, 79, 79, 79, 79, 79,
450
+ 79, 79, 79, 79, 79, 79, 79, 79,
451
+ 79, 79, 79, 79, 79, 79, 79, 79,
452
+ 79, 79, 79, 79, 79, 79, 79, 79,
453
+ 79, 79, 79, 79, 79, 79, 79, 79,
454
+ 79, 79, 79, 79, 79, 79, 79, 79,
455
+ 79, 79, 79, 79, 79, 79, 79, 79,
456
+ 79, 79, 79, 79, 79, 79, 79, 79,
457
+ 79, 79, 79, 79, 79, 79, 79, 79,
458
+ 79, 79, 79, 1, 1, 1, 1, 1,
459
+ 1, 1, 1, 1, 1, 1, 1, 1,
460
+ 1, 1, 1, 1, 1, 1, 1, 1,
461
+ 1, 1, 1, 1, 1, 1, 1, 1,
462
+ 1, 1, 1, 1, 1, 1, 1, 1,
463
+ 1, 1, 1, 1, 1, 1, 1, 1,
464
+ 1, 1, 1, 1, 1, 1, 1, 1,
465
+ 1, 1, 1, 1, 1, 1, 1, 1,
466
+ 1, 1, 1, 1, 1, 84, 84, 84,
467
+ 84, 84, 84, 84, 84, 84, 84, 84,
468
+ 84, 84, 84, 84, 84, 84, 84, 84,
469
+ 84, 84, 84, 84, 84, 84, 84, 84,
470
+ 84, 84, 84, 85, 86, 86, 86, 86,
471
+ 86, 86, 86, 86, 86, 86, 86, 86,
472
+ 87, 86, 86, 88, 89, 89, 89, 90,
473
+ 1, 79, 79, 79, 79, 79, 79, 79,
474
+ 79, 79, 79, 79, 79, 79, 79, 79,
475
+ 79, 79, 79, 79, 79, 79, 79, 79,
476
+ 79, 79, 79, 79, 79, 79, 79, 79,
477
+ 79, 79, 79, 79, 79, 79, 79, 79,
478
+ 79, 79, 79, 79, 79, 79, 79, 79,
479
+ 79, 79, 79, 79, 79, 79, 79, 79,
480
+ 79, 79, 79, 79, 79, 79, 79, 79,
481
+ 79, 1, 84, 84, 84, 84, 84, 84,
482
+ 84, 84, 84, 84, 84, 84, 84, 84,
483
+ 84, 84, 84, 84, 84, 84, 84, 84,
484
+ 84, 84, 84, 84, 84, 84, 84, 84,
485
+ 84, 84, 1, 84, 84, 84, 84, 84,
486
+ 84, 84, 84, 84, 84, 84, 84, 84,
487
+ 84, 84, 84, 84, 84, 84, 84, 84,
488
+ 84, 84, 84, 84, 84, 84, 84, 84,
489
+ 84, 84, 84, 84, 84, 84, 84, 84,
490
+ 84, 84, 84, 84, 84, 84, 84, 84,
491
+ 84, 84, 84, 84, 84, 84, 84, 84,
492
+ 84, 84, 84, 84, 84, 84, 84, 84,
493
+ 84, 84, 84, 1, 84, 84, 84, 84,
494
+ 84, 84, 84, 84, 84, 84, 84, 84,
495
+ 84, 84, 84, 84, 84, 84, 84, 84,
496
+ 84, 84, 84, 84, 84, 84, 84, 84,
497
+ 84, 84, 84, 84, 1, 86, 86, 86,
498
+ 86, 86, 86, 86, 86, 86, 86, 86,
499
+ 86, 86, 86, 86, 86, 86, 86, 86,
500
+ 86, 86, 86, 86, 86, 86, 86, 86,
501
+ 86, 86, 86, 86, 86, 86, 86, 86,
502
+ 86, 86, 86, 86, 86, 86, 86, 86,
503
+ 86, 86, 86, 86, 86, 1, 86, 86,
504
+ 86, 86, 86, 86, 86, 86, 86, 86,
505
+ 86, 86, 86, 86, 86, 86, 86, 86,
506
+ 86, 86, 86, 86, 86, 86, 86, 86,
507
+ 86, 86, 86, 86, 86, 86, 86, 86,
508
+ 86, 86, 86, 86, 86, 86, 86, 86,
509
+ 86, 86, 86, 86, 86, 86, 86, 86,
510
+ 86, 86, 86, 86, 86, 86, 86, 86,
511
+ 86, 86, 86, 86, 86, 86, 1, 86,
512
+ 86, 86, 86, 86, 86, 86, 86, 86,
513
+ 86, 86, 86, 86, 86, 86, 86, 1,
514
+ 16, 1, 1, 1, 92, 1, 1, 1,
515
+ 1, 1, 1, 1, 1, 1, 1, 1,
516
+ 1, 1, 1, 1, 1, 1, 1, 16,
517
+ 16, 17, 16, 16, 16, 16, 16, 93,
518
+ 1, 16, 16, 94, 16, 95, 16, 16,
519
+ 16, 16, 16, 16, 16, 16, 16, 16,
520
+ 16, 1, 1, 1, 16, 1, 16, 95,
521
+ 16, 16, 16, 16, 16, 16, 16, 16,
522
+ 16, 16, 16, 16, 16, 16, 16, 16,
523
+ 16, 16, 16, 16, 16, 16, 16, 16,
524
+ 16, 16, 1, 1, 1, 16, 16, 16,
525
+ 16, 16, 16, 16, 16, 16, 16, 16,
526
+ 16, 16, 16, 16, 16, 16, 16, 16,
527
+ 16, 16, 16, 16, 16, 16, 16, 16,
528
+ 16, 16, 16, 16, 16, 16, 1, 1,
529
+ 1, 1, 1, 1, 1, 1, 1, 1,
530
+ 1, 1, 1, 1, 1, 1, 1, 1,
531
+ 1, 1, 1, 1, 1, 1, 1, 1,
532
+ 1, 1, 1, 1, 1, 1, 1, 1,
533
+ 1, 1, 1, 1, 1, 1, 1, 1,
534
+ 1, 1, 1, 1, 1, 1, 1, 1,
535
+ 1, 1, 1, 1, 1, 1, 1, 1,
536
+ 1, 1, 1, 1, 1, 1, 1, 1,
537
+ 1, 19, 19, 19, 19, 19, 19, 19,
538
+ 19, 19, 19, 19, 19, 19, 19, 19,
539
+ 19, 19, 19, 19, 19, 19, 19, 19,
540
+ 19, 19, 19, 19, 19, 19, 19, 20,
541
+ 21, 21, 21, 21, 21, 21, 21, 21,
542
+ 21, 21, 21, 21, 22, 21, 21, 23,
543
+ 24, 24, 24, 25, 1, 57, 1, 1,
544
+ 1, 96, 1, 1, 1, 1, 1, 1,
545
+ 1, 1, 1, 1, 1, 1, 1, 1,
546
+ 1, 1, 1, 1, 57, 57, 58, 57,
547
+ 57, 57, 57, 57, 97, 1, 57, 57,
548
+ 98, 57, 99, 57, 57, 57, 57, 57,
549
+ 57, 57, 57, 57, 57, 57, 1, 1,
550
+ 1, 57, 1, 57, 99, 57, 57, 57,
551
+ 57, 57, 57, 57, 57, 57, 57, 57,
552
+ 57, 57, 57, 57, 57, 57, 57, 57,
553
+ 57, 57, 57, 57, 57, 57, 57, 1,
554
+ 1, 1, 57, 57, 57, 57, 57, 57,
555
+ 57, 57, 57, 57, 57, 57, 57, 57,
556
+ 57, 57, 57, 57, 57, 57, 57, 57,
557
+ 57, 57, 57, 57, 57, 57, 57, 57,
558
+ 57, 57, 57, 1, 1, 1, 1, 1,
559
+ 1, 1, 1, 1, 1, 1, 1, 1,
560
+ 1, 1, 1, 1, 1, 1, 1, 1,
561
+ 1, 1, 1, 1, 1, 1, 1, 1,
562
+ 1, 1, 1, 1, 1, 1, 1, 1,
563
+ 1, 1, 1, 1, 1, 1, 1, 1,
564
+ 1, 1, 1, 1, 1, 1, 1, 1,
565
+ 1, 1, 1, 1, 1, 1, 1, 1,
566
+ 1, 1, 1, 1, 1, 1, 60, 60,
567
+ 60, 60, 60, 60, 60, 60, 60, 60,
568
+ 60, 60, 60, 60, 60, 60, 60, 60,
569
+ 60, 60, 60, 60, 60, 60, 60, 60,
570
+ 60, 60, 60, 60, 61, 62, 62, 62,
571
+ 62, 62, 62, 62, 62, 62, 62, 62,
572
+ 62, 63, 62, 62, 64, 65, 65, 65,
573
+ 66, 1, 14, 1, 1, 1, 15, 1,
574
+ 1, 1, 1, 1, 1, 1, 1, 1,
575
+ 1, 1, 1, 1, 1, 1, 1, 1,
576
+ 1, 14, 16, 17, 16, 16, 16, 16,
577
+ 16, 18, 1, 16, 16, 94, 16, 95,
578
+ 16, 16, 16, 16, 16, 16, 16, 16,
579
+ 16, 16, 16, 1, 1, 1, 16, 1,
580
+ 16, 95, 16, 16, 16, 16, 16, 16,
581
+ 16, 16, 16, 16, 16, 16, 16, 16,
582
+ 16, 16, 16, 16, 16, 16, 16, 16,
583
+ 16, 16, 16, 16, 1, 1, 1, 16,
584
+ 16, 16, 16, 16, 16, 16, 16, 16,
585
+ 16, 16, 16, 16, 16, 16, 16, 16,
586
+ 16, 16, 16, 16, 16, 16, 16, 16,
587
+ 16, 16, 16, 16, 16, 16, 16, 16,
588
+ 1, 1, 1, 1, 1, 1, 1, 1,
589
+ 1, 1, 1, 1, 1, 1, 1, 1,
590
+ 1, 1, 1, 1, 1, 1, 1, 1,
591
+ 1, 1, 1, 1, 1, 1, 1, 1,
592
+ 1, 1, 1, 1, 1, 1, 1, 1,
593
+ 1, 1, 1, 1, 1, 1, 1, 1,
594
+ 1, 1, 1, 1, 1, 1, 1, 1,
595
+ 1, 1, 1, 1, 1, 1, 1, 1,
596
+ 1, 1, 1, 19, 19, 19, 19, 19,
597
+ 19, 19, 19, 19, 19, 19, 19, 19,
598
+ 19, 19, 19, 19, 19, 19, 19, 19,
599
+ 19, 19, 19, 19, 19, 19, 19, 19,
600
+ 19, 20, 21, 21, 21, 21, 21, 21,
601
+ 21, 21, 21, 21, 21, 21, 22, 21,
602
+ 21, 23, 24, 24, 24, 25, 1, 1,
603
+ 0
275
604
  ]
276
605
 
277
606
  class << self
@@ -279,13 +608,19 @@ class << self
279
608
  private :_trans_targs, :_trans_targs=
280
609
  end
281
610
  self._trans_targs = [
282
- 2, 0, 3, 21, 7, 15, 23, 2,
283
- 3, 21, 7, 15, 4, 6, 8, 9,
284
- 21, 11, 8, 9, 21, 11, 10, 12,
285
- 13, 14, 12, 2, 3, 21, 7, 15,
286
- 17, 18, 17, 24, 20, 17, 18, 17,
287
- 24, 20, 19, 5, 22, 12, 23, 5,
288
- 22, 12, 23
611
+ 2, 0, 3, 42, 7, 22, 44, 23,
612
+ 24, 25, 26, 27, 28, 29, 2, 3,
613
+ 42, 7, 22, 23, 24, 25, 26, 27,
614
+ 28, 29, 4, 6, 8, 9, 42, 11,
615
+ 12, 13, 14, 15, 16, 17, 18, 8,
616
+ 9, 42, 11, 12, 13, 14, 15, 16,
617
+ 17, 18, 10, 19, 20, 21, 19, 2,
618
+ 3, 42, 7, 22, 23, 24, 25, 26,
619
+ 27, 28, 29, 31, 32, 31, 45, 34,
620
+ 35, 36, 37, 38, 39, 40, 41, 31,
621
+ 32, 31, 45, 34, 35, 36, 37, 38,
622
+ 39, 40, 41, 33, 5, 43, 19, 44,
623
+ 5, 43, 19, 44
289
624
  ]
290
625
 
291
626
  class << self
@@ -293,13 +628,19 @@ class << self
293
628
  private :_trans_actions, :_trans_actions=
294
629
  end
295
630
  self._trans_actions = [
296
- 1, 0, 1, 1, 1, 2, 1, 0,
297
- 0, 0, 0, 3, 0, 0, 4, 4,
298
- 5, 4, 0, 0, 6, 0, 0, 1,
299
- 1, 0, 0, 7, 7, 7, 7, 8,
300
- 9, 9, 10, 11, 9, 0, 0, 3,
301
- 12, 0, 0, 0, 3, 13, 0, 7,
302
- 8, 14, 7
631
+ 1, 0, 1, 1, 1, 2, 1, 1,
632
+ 1, 1, 1, 1, 1, 1, 0, 0,
633
+ 0, 0, 3, 0, 0, 0, 0, 0,
634
+ 0, 0, 0, 0, 4, 4, 5, 4,
635
+ 4, 4, 4, 4, 4, 4, 4, 0,
636
+ 0, 6, 0, 0, 0, 0, 0, 0,
637
+ 0, 0, 0, 1, 1, 0, 0, 7,
638
+ 7, 7, 7, 8, 7, 7, 7, 7,
639
+ 7, 7, 7, 9, 9, 10, 11, 9,
640
+ 9, 9, 9, 9, 9, 9, 9, 0,
641
+ 0, 3, 12, 0, 0, 0, 0, 0,
642
+ 0, 0, 0, 0, 0, 3, 13, 0,
643
+ 7, 8, 14, 7
303
644
  ]
304
645
 
305
646
  class << self
@@ -309,8 +650,10 @@ end
309
650
  self._eof_actions = [
310
651
  0, 0, 0, 0, 0, 0, 0, 0,
311
652
  0, 0, 0, 0, 0, 0, 0, 0,
312
- 0, 0, 0, 0, 0, 13, 14, 13,
313
- 0
653
+ 0, 0, 0, 0, 0, 0, 0, 0,
654
+ 0, 0, 0, 0, 0, 0, 0, 0,
655
+ 0, 0, 0, 0, 0, 0, 0, 0,
656
+ 0, 0, 13, 14, 13, 0
314
657
  ]
315
658
 
316
659
  class << self
@@ -320,7 +663,7 @@ self.start = 1;
320
663
  class << self
321
664
  attr_accessor :first_final
322
665
  end
323
- self.first_final = 21;
666
+ self.first_final = 42;
324
667
  class << self
325
668
  attr_accessor :error
326
669
  end
@@ -329,7 +672,7 @@ self.error = 0;
329
672
  class << self
330
673
  attr_accessor :en_comment_tail
331
674
  end
332
- self.en_comment_tail = 16;
675
+ self.en_comment_tail = 30;
333
676
  class << self
334
677
  attr_accessor :en_main
335
678
  end
@@ -338,7 +681,9 @@ self.en_main = 1;
338
681
 
339
682
 
340
683
  def self.parse(data)
341
- raise Mail::Field::ParseError.new(Mail::PhraseList, data, 'nil is invalid') if data.nil?
684
+ data = data.dup.force_encoding(Encoding::ASCII_8BIT) if data.respond_to?(:force_encoding)
685
+
686
+ raise Mail::Field::NilParseError.new(Mail::PhraseList) if data.nil?
342
687
 
343
688
  # Parser state
344
689
  phrase_lists = PhraseListsStruct.new([])
@@ -400,7 +745,7 @@ begin
400
745
  when 13 then
401
746
  begin
402
747
 
403
- phrase_lists.phrases << data[phrase_s..(p-1)] if phrase_s
748
+ phrase_lists.phrases << chars(data, phrase_s, p-1) if phrase_s
404
749
  phrase_s = nil
405
750
  end
406
751
  when 7 then
@@ -420,7 +765,7 @@ begin
420
765
  begin
421
766
  stack[top] = cs
422
767
  top+= 1
423
- cs = 16
768
+ cs = 30
424
769
  _goto_level = _again
425
770
  next
426
771
  end
@@ -441,7 +786,7 @@ begin
441
786
  begin
442
787
  stack[top] = cs
443
788
  top+= 1
444
- cs = 16
789
+ cs = 30
445
790
  _goto_level = _again
446
791
  next
447
792
  end
@@ -451,7 +796,7 @@ begin
451
796
  end
452
797
  begin
453
798
 
454
- phrase_lists.phrases << data[phrase_s..(p-1)] if phrase_s
799
+ phrase_lists.phrases << chars(data, phrase_s, p-1) if phrase_s
455
800
  phrase_s = nil
456
801
  end
457
802
  when 8 then
@@ -461,7 +806,7 @@ begin
461
806
  begin
462
807
  stack[top] = cs
463
808
  top+= 1
464
- cs = 16
809
+ cs = 30
465
810
  _goto_level = _again
466
811
  next
467
812
  end
@@ -473,7 +818,7 @@ begin
473
818
  begin
474
819
  stack[top] = cs
475
820
  top+= 1
476
- cs = 16
821
+ cs = 30
477
822
  _goto_level = _again
478
823
  next
479
824
  end
@@ -514,7 +859,7 @@ begin
514
859
  when 13 then
515
860
  begin
516
861
 
517
- phrase_lists.phrases << data[phrase_s..(p-1)] if phrase_s
862
+ phrase_lists.phrases << chars(data, phrase_s, p-1) if phrase_s
518
863
  phrase_s = nil
519
864
  end
520
865
  when 14 then
@@ -522,7 +867,7 @@ begin
522
867
  end
523
868
  begin
524
869
 
525
- phrase_lists.phrases << data[phrase_s..(p-1)] if phrase_s
870
+ phrase_lists.phrases << chars(data, phrase_s, p-1) if phrase_s
526
871
  phrase_s = nil
527
872
  end
528
873
  end
@@ -536,8 +881,8 @@ end
536
881
  end
537
882
 
538
883
 
539
- if p != eof || cs < 21
540
- raise Mail::Field::ParseError.new(Mail::PhraseListsElement, data, "Only able to parse up to #{data[0..p]}")
884
+ if p != eof || cs < 42
885
+ raise Mail::Field::IncompleteParseError.new(Mail::PhraseListsElement, data, p)
541
886
  end
542
887
 
543
888
  phrase_lists