File Coverage

tstr_cparse_rfc2822.c
Criterion Covered Total %
statement 180 553 32.5
branch 79 252 31.3
condition n/a
subroutine n/a
pod n/a
total 259 805 32.1


line stmt bran cond sub pod time code
1              
2             #line 1 "ragel/tstr_cparse_rfc2822.rl"
3             #include
4             #include
5             #include
6              
7             #include "tstr_parsed.h"
8             #include "tstr_token_parse.h"
9             #include "tstr_cparse.h"
10              
11              
12             #line 34 "ragel/tstr_cparse_rfc2822.rl"
13              
14              
15              
16             #line 17 "tstr_cparse_rfc2822.c"
17             static const int rfc2822_start = 1;
18             static const int rfc2822_first_final = 65;
19             static const int rfc2822_error = 0;
20              
21             static const int rfc2822_en_main = 1;
22              
23              
24             #line 37 "ragel/tstr_cparse_rfc2822.rl"
25              
26             tstr_parse_result_t tstr_cparse_rfc2822(const char* p,
27             size_t len,
28             tstr_parsed_t* parsed) {
29             int cs, v;
30             const char* pe = p + len;
31             const char* eof = pe;
32             const char* mark = NULL;
33             tstr_parse_result_t result = TSTR_PARSE_OK;
34              
35             (void)tstr_parsed_init(parsed);
36              
37            
38             #line 39 "tstr_cparse_rfc2822.c"
39             {
40 29           cs = rfc2822_start;
41             }
42              
43             #line 50 "ragel/tstr_cparse_rfc2822.rl"
44            
45             #line 46 "tstr_cparse_rfc2822.c"
46             {
47 29 50         if ( p == pe )
48 0           goto _test_eof;
49 29           switch ( cs )
50             {
51 29           case 1:
52 29           switch( (*p) ) {
53 0           case 70: goto tr2;
54 3           case 77: goto tr3;
55 0           case 83: goto tr4;
56 0           case 84: goto tr5;
57 0           case 87: goto tr6;
58 0           case 102: goto tr2;
59 1           case 109: goto tr3;
60 0           case 115: goto tr4;
61 0           case 116: goto tr5;
62 0           case 119: goto tr6;
63             }
64 25 50         if ( 48 <= (*p) && (*p) <= 57 )
    100          
65 24           goto tr0;
66 1           goto st0;
67 1           st0:
68 1           cs = 0;
69 1           goto _out;
70 28           tr0:
71             #line 4 "ragel/tstr_common.rl"
72             { mark = p; }
73             goto st2;
74             st2:
75             if ( ++p == pe )
76             goto _test_eof2;
77             case 2:
78             #line 79 "tstr_cparse_rfc2822.c"
79 28 100         if ( (*p) == 32 )
80 4           goto tr7;
81 24 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
82 24           goto st50;
83 0           goto st0;
84 28           tr7:
85             #line 30 "ragel/tstr_common.rl"
86             {
87             if (!tstr_token_parse_day(mark, p - mark, &v)) {
88             result = TSTR_PARSE_ERR_DAY;
89             {p++; cs = 3; goto _out;}
90             }
91             tstr_parsed_set_day(parsed, v);
92             }
93             goto st3;
94             st3:
95             if ( ++p == pe )
96             goto _test_eof3;
97             case 3:
98             #line 99 "tstr_cparse_rfc2822.c"
99 28           switch( (*p) ) {
100 0           case 65: goto tr9;
101 23           case 68: goto tr10;
102 0           case 70: goto tr11;
103 4           case 74: goto tr12;
104 0           case 77: goto tr13;
105 0           case 78: goto tr14;
106 0           case 79: goto tr15;
107 0           case 83: goto tr16;
108 0           case 97: goto tr9;
109 1           case 100: goto tr10;
110 0           case 102: goto tr11;
111 0           case 106: goto tr12;
112 0           case 109: goto tr13;
113 0           case 110: goto tr14;
114 0           case 111: goto tr15;
115 0           case 115: goto tr16;
116             }
117 0           goto st0;
118 0           tr9:
119             #line 4 "ragel/tstr_common.rl"
120             { mark = p; }
121             goto st4;
122             st4:
123             if ( ++p == pe )
124             goto _test_eof4;
125             case 4:
126             #line 127 "tstr_cparse_rfc2822.c"
127 0           switch( (*p) ) {
128 0           case 80: goto st5;
129 0           case 85: goto st34;
130 0           case 112: goto st5;
131 0           case 117: goto st34;
132             }
133 0           goto st0;
134 0           st5:
135 0 0         if ( ++p == pe )
136 0           goto _test_eof5;
137             case 5:
138 0           switch( (*p) ) {
139 0           case 82: goto st6;
140 0           case 114: goto st6;
141             }
142 0           goto st0;
143 28           st6:
144 28 50         if ( ++p == pe )
145 0           goto _test_eof6;
146             case 6:
147 28 50         if ( (*p) == 32 )
148 28           goto tr20;
149 0           goto st0;
150 28           tr20:
151             #line 22 "ragel/tstr_common.rl"
152             {
153             if (!tstr_token_parse_month(mark, p - mark, &v)) {
154             result = TSTR_PARSE_ERR_MONTH;
155             {p++; cs = 7; goto _out;}
156             }
157             tstr_parsed_set_month(parsed, v);
158             }
159             goto st7;
160             st7:
161             if ( ++p == pe )
162             goto _test_eof7;
163             case 7:
164             #line 165 "tstr_cparse_rfc2822.c"
165 28 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
166 28           goto tr21;
167 0           goto st0;
168 28           tr21:
169             #line 4 "ragel/tstr_common.rl"
170             { mark = p; }
171             goto st8;
172             st8:
173             if ( ++p == pe )
174             goto _test_eof8;
175             case 8:
176             #line 177 "tstr_cparse_rfc2822.c"
177 28 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
178 28           goto st9;
179 0           goto st0;
180 28           st9:
181 28 50         if ( ++p == pe )
182 0           goto _test_eof9;
183             case 9:
184 28 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
185 28           goto st10;
186 0           goto st0;
187 28           st10:
188 28 50         if ( ++p == pe )
189 0           goto _test_eof10;
190             case 10:
191 28 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
192 28           goto st11;
193 0           goto st0;
194 28           st11:
195 28 50         if ( ++p == pe )
196 0           goto _test_eof11;
197             case 11:
198 28 50         if ( (*p) == 32 )
199 28           goto tr25;
200 0           goto st0;
201 28           tr25:
202             #line 6 "ragel/tstr_common.rl"
203             {
204             if (!tstr_token_parse_year(mark, p - mark, &v)) {
205             result = TSTR_PARSE_ERR_YEAR;
206             {p++; cs = 12; goto _out;}
207             }
208             tstr_parsed_set_year4(parsed, v);
209             }
210             goto st12;
211             st12:
212             if ( ++p == pe )
213             goto _test_eof12;
214             case 12:
215             #line 216 "tstr_cparse_rfc2822.c"
216 28 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
217 28           goto tr26;
218 0           goto st0;
219 28           tr26:
220             #line 4 "ragel/tstr_common.rl"
221             { mark = p; }
222             goto st13;
223             st13:
224             if ( ++p == pe )
225             goto _test_eof13;
226             case 13:
227             #line 228 "tstr_cparse_rfc2822.c"
228 28 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
229 28           goto st14;
230 0           goto st0;
231 28           st14:
232 28 50         if ( ++p == pe )
233 0           goto _test_eof14;
234             case 14:
235 28 50         if ( (*p) == 58 )
236 28           goto tr28;
237 0           goto st0;
238 28           tr28:
239             #line 46 "ragel/tstr_common.rl"
240             {
241             if (!tstr_token_parse_hour(mark, p - mark, &v)) {
242             result = TSTR_PARSE_ERR_HOUR;
243             {p++; cs = 15; goto _out;}
244             }
245             tstr_parsed_set_hour(parsed, v);
246             }
247             goto st15;
248             st15:
249             if ( ++p == pe )
250             goto _test_eof15;
251             case 15:
252             #line 253 "tstr_cparse_rfc2822.c"
253 28 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
254 28           goto tr29;
255 0           goto st0;
256 28           tr29:
257             #line 4 "ragel/tstr_common.rl"
258             { mark = p; }
259             goto st16;
260             st16:
261             if ( ++p == pe )
262             goto _test_eof16;
263             case 16:
264             #line 265 "tstr_cparse_rfc2822.c"
265 28 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
266 28           goto st17;
267 0           goto st0;
268 28           st17:
269 28 50         if ( ++p == pe )
270 0           goto _test_eof17;
271             case 17:
272 28           switch( (*p) ) {
273 2           case 32: goto tr31;
274 26           case 58: goto tr32;
275             }
276 0           goto st0;
277 2           tr31:
278             #line 54 "ragel/tstr_common.rl"
279             {
280             if (!tstr_token_parse_minute(mark, p - mark, &v)) {
281             result = TSTR_PARSE_ERR_MINUTE;
282             {p++; cs = 18; goto _out;}
283             }
284             tstr_parsed_set_minute(parsed, v);
285             }
286             goto st18;
287             tr51:
288             #line 62 "ragel/tstr_common.rl"
289             {
290             if (!tstr_token_parse_second(mark, p - mark, &v)) {
291             result = TSTR_PARSE_ERR_SECOND;
292             {p++; cs = 18; goto _out;}
293             }
294             tstr_parsed_set_second(parsed, v);
295             }
296             goto st18;
297             st18:
298             if ( ++p == pe )
299             goto _test_eof18;
300             case 18:
301             #line 302 "tstr_cparse_rfc2822.c"
302 28           switch( (*p) ) {
303 18           case 43: goto tr33;
304 7           case 45: goto tr33;
305 1           case 71: goto tr35;
306 2           case 85: goto tr36;
307             }
308 0 0         if ( 65 <= (*p) && (*p) <= 90 )
    0          
309 0           goto tr34;
310 0           goto st0;
311 25           tr33:
312             #line 4 "ragel/tstr_common.rl"
313             { mark = p; }
314             goto st19;
315             st19:
316             if ( ++p == pe )
317             goto _test_eof19;
318             case 19:
319             #line 320 "tstr_cparse_rfc2822.c"
320 25 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
321 25           goto st20;
322 0           goto st0;
323 25           st20:
324 25 50         if ( ++p == pe )
325 0           goto _test_eof20;
326             case 20:
327 25 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
328 25           goto st21;
329 0           goto st0;
330 25           st21:
331 25 50         if ( ++p == pe )
332 0           goto _test_eof21;
333             case 21:
334 25 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
335 25           goto st22;
336 0           goto st0;
337 25           st22:
338 25 50         if ( ++p == pe )
339 0           goto _test_eof22;
340             case 22:
341 25 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
342 25           goto st65;
343 0           goto st0;
344 25           st65:
345 25 100         if ( ++p == pe )
346 24           goto _test_eof65;
347             case 65:
348 1 50         if ( (*p) == 32 )
349 1           goto tr69;
350 0           goto st0;
351 1           tr69:
352             #line 78 "ragel/tstr_common.rl"
353             {
354             if (!tstr_token_parse_tz_offset(mark, p - mark, &v)) {
355             result = TSTR_PARSE_ERR_OFFSET;
356             {p++; cs = 23; goto _out;}
357             }
358             tstr_parsed_set_offset(parsed, v);
359             }
360             goto st23;
361             tr70:
362             #line 90 "ragel/tstr_common.rl"
363             {
364             tstr_parsed_set_tz_abbrev(parsed, mark, p - mark);
365             }
366             goto st23;
367             tr74:
368             #line 86 "ragel/tstr_common.rl"
369             {
370             tstr_parsed_set_tz_utc(parsed, mark, p - mark);
371             }
372             goto st23;
373             st23:
374             if ( ++p == pe )
375             goto _test_eof23;
376             case 23:
377             #line 378 "tstr_cparse_rfc2822.c"
378 1 50         if ( (*p) == 40 )
379 1           goto st24;
380 0           goto st0;
381 1           st24:
382 1 50         if ( ++p == pe )
383 0           goto _test_eof24;
384             case 24:
385 1 50         if ( 40 <= (*p) && (*p) <= 41 )
    50          
386 0           goto st0;
387 1           goto st25;
388 3           st25:
389 3 50         if ( ++p == pe )
390 0           goto _test_eof25;
391             case 25:
392 3           switch( (*p) ) {
393 0           case 40: goto st0;
394 1           case 41: goto st66;
395             }
396 2           goto st25;
397 1           st66:
398 1 50         if ( ++p == pe )
399 1           goto _test_eof66;
400             case 66:
401 0           goto st0;
402 0           tr34:
403             #line 4 "ragel/tstr_common.rl"
404             { mark = p; }
405             goto st26;
406             st26:
407             if ( ++p == pe )
408             goto _test_eof26;
409             case 26:
410             #line 411 "tstr_cparse_rfc2822.c"
411 0 0         if ( (*p) > 90 ) {
412 0 0         if ( 97 <= (*p) && (*p) <= 122 )
    0          
413 0           goto st27;
414 0 0         } else if ( (*p) >= 65 )
415 0           goto st27;
416 0           goto st0;
417 0           st27:
418 0 0         if ( ++p == pe )
419 0           goto _test_eof27;
420             case 27:
421 0 0         if ( 65 <= (*p) && (*p) <= 90 )
    0          
422 0           goto st67;
423 0           goto st0;
424 0           st67:
425 0 0         if ( ++p == pe )
426 0           goto _test_eof67;
427             case 67:
428 0 0         if ( (*p) == 32 )
429 0           goto tr70;
430 0 0         if ( 65 <= (*p) && (*p) <= 90 )
    0          
431 0           goto st68;
432 0           goto st0;
433 0           st68:
434 0 0         if ( ++p == pe )
435 0           goto _test_eof68;
436             case 68:
437 0 0         if ( (*p) == 32 )
438 0           goto tr70;
439 0 0         if ( 65 <= (*p) && (*p) <= 90 )
    0          
440 0           goto st69;
441 0           goto st0;
442 0           st69:
443 0 0         if ( ++p == pe )
444 0           goto _test_eof69;
445             case 69:
446 0 0         if ( (*p) == 32 )
447 0           goto tr70;
448 0 0         if ( 65 <= (*p) && (*p) <= 90 )
    0          
449 0           goto st70;
450 0           goto st0;
451 0           st70:
452 0 0         if ( ++p == pe )
453 0           goto _test_eof70;
454             case 70:
455 0 0         if ( (*p) == 32 )
456 0           goto tr70;
457 0           goto st0;
458 1           tr35:
459             #line 4 "ragel/tstr_common.rl"
460             { mark = p; }
461             goto st28;
462             st28:
463             if ( ++p == pe )
464             goto _test_eof28;
465             case 28:
466             #line 467 "tstr_cparse_rfc2822.c"
467 1 50         if ( (*p) == 77 )
468 1           goto st29;
469 0 0         if ( (*p) > 90 ) {
470 0 0         if ( 97 <= (*p) && (*p) <= 122 )
    0          
471 0           goto st27;
472 0 0         } else if ( (*p) >= 65 )
473 0           goto st27;
474 0           goto st0;
475 1           st29:
476 1 50         if ( ++p == pe )
477 0           goto _test_eof29;
478             case 29:
479 1 50         if ( (*p) == 84 )
480 1           goto st71;
481 0 0         if ( 65 <= (*p) && (*p) <= 90 )
    0          
482 0           goto st67;
483 0           goto st0;
484 2           st71:
485 2 50         if ( ++p == pe )
486 2           goto _test_eof71;
487             case 71:
488 0 0         if ( (*p) == 32 )
489 0           goto tr74;
490 0 0         if ( 65 <= (*p) && (*p) <= 90 )
    0          
491 0           goto st68;
492 0           goto st0;
493 2           tr36:
494             #line 4 "ragel/tstr_common.rl"
495             { mark = p; }
496             goto st30;
497             st30:
498             if ( ++p == pe )
499             goto _test_eof30;
500             case 30:
501             #line 502 "tstr_cparse_rfc2822.c"
502 2 50         if ( (*p) == 84 )
503 2           goto st72;
504 0 0         if ( (*p) > 90 ) {
505 0 0         if ( 97 <= (*p) && (*p) <= 122 )
    0          
506 0           goto st27;
507 0 0         } else if ( (*p) >= 65 )
508 0           goto st27;
509 0           goto st0;
510 2           st72:
511 2 100         if ( ++p == pe )
512 1           goto _test_eof72;
513             case 72:
514 1           switch( (*p) ) {
515 0           case 32: goto tr74;
516 1           case 67: goto st71;
517             }
518 0 0         if ( 65 <= (*p) && (*p) <= 90 )
    0          
519 0           goto st67;
520 0           goto st0;
521 26           tr32:
522             #line 54 "ragel/tstr_common.rl"
523             {
524             if (!tstr_token_parse_minute(mark, p - mark, &v)) {
525             result = TSTR_PARSE_ERR_MINUTE;
526             {p++; cs = 31; goto _out;}
527             }
528             tstr_parsed_set_minute(parsed, v);
529             }
530             goto st31;
531             st31:
532             if ( ++p == pe )
533             goto _test_eof31;
534             case 31:
535             #line 536 "tstr_cparse_rfc2822.c"
536 26 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
537 26           goto tr49;
538 0           goto st0;
539 26           tr49:
540             #line 4 "ragel/tstr_common.rl"
541             { mark = p; }
542             goto st32;
543             st32:
544             if ( ++p == pe )
545             goto _test_eof32;
546             case 32:
547             #line 548 "tstr_cparse_rfc2822.c"
548 26 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
549 26           goto st33;
550 0           goto st0;
551 26           st33:
552 26 50         if ( ++p == pe )
553 0           goto _test_eof33;
554             case 33:
555 26 50         if ( (*p) == 32 )
556 26           goto tr51;
557 0           goto st0;
558 0           st34:
559 0 0         if ( ++p == pe )
560 0           goto _test_eof34;
561             case 34:
562 0           switch( (*p) ) {
563 0           case 71: goto st6;
564 0           case 103: goto st6;
565             }
566 0           goto st0;
567 24           tr10:
568             #line 4 "ragel/tstr_common.rl"
569             { mark = p; }
570             goto st35;
571             st35:
572             if ( ++p == pe )
573             goto _test_eof35;
574             case 35:
575             #line 576 "tstr_cparse_rfc2822.c"
576 24           switch( (*p) ) {
577 0           case 69: goto st36;
578 24           case 101: goto st36;
579             }
580 0           goto st0;
581 24           st36:
582 24 50         if ( ++p == pe )
583 0           goto _test_eof36;
584             case 36:
585 24           switch( (*p) ) {
586 0           case 67: goto st6;
587 24           case 99: goto st6;
588             }
589 0           goto st0;
590 0           tr11:
591             #line 4 "ragel/tstr_common.rl"
592             { mark = p; }
593             goto st37;
594             st37:
595             if ( ++p == pe )
596             goto _test_eof37;
597             case 37:
598             #line 599 "tstr_cparse_rfc2822.c"
599 0           switch( (*p) ) {
600 0           case 69: goto st38;
601 0           case 101: goto st38;
602             }
603 0           goto st0;
604 0           st38:
605 0 0         if ( ++p == pe )
606 0           goto _test_eof38;
607             case 38:
608 0           switch( (*p) ) {
609 0           case 66: goto st6;
610 0           case 98: goto st6;
611             }
612 0           goto st0;
613 4           tr12:
614             #line 4 "ragel/tstr_common.rl"
615             { mark = p; }
616             goto st39;
617             st39:
618             if ( ++p == pe )
619             goto _test_eof39;
620             case 39:
621             #line 622 "tstr_cparse_rfc2822.c"
622 4           switch( (*p) ) {
623 0           case 65: goto st40;
624 0           case 85: goto st41;
625 4           case 97: goto st40;
626 0           case 117: goto st41;
627             }
628 0           goto st0;
629 4           st40:
630 4 50         if ( ++p == pe )
631 0           goto _test_eof40;
632             case 40:
633 4           switch( (*p) ) {
634 0           case 78: goto st6;
635 4           case 110: goto st6;
636             }
637 0           goto st0;
638 0           st41:
639 0 0         if ( ++p == pe )
640 0           goto _test_eof41;
641             case 41:
642 0           switch( (*p) ) {
643 0           case 76: goto st6;
644 0           case 78: goto st6;
645 0           case 108: goto st6;
646 0           case 110: goto st6;
647             }
648 0           goto st0;
649 0           tr13:
650             #line 4 "ragel/tstr_common.rl"
651             { mark = p; }
652             goto st42;
653             st42:
654             if ( ++p == pe )
655             goto _test_eof42;
656             case 42:
657             #line 658 "tstr_cparse_rfc2822.c"
658 0           switch( (*p) ) {
659 0           case 65: goto st43;
660 0           case 97: goto st43;
661             }
662 0           goto st0;
663 0           st43:
664 0 0         if ( ++p == pe )
665 0           goto _test_eof43;
666             case 43:
667 0           switch( (*p) ) {
668 0           case 82: goto st6;
669 0           case 89: goto st6;
670 0           case 114: goto st6;
671 0           case 121: goto st6;
672             }
673 0           goto st0;
674 0           tr14:
675             #line 4 "ragel/tstr_common.rl"
676             { mark = p; }
677             goto st44;
678             st44:
679             if ( ++p == pe )
680             goto _test_eof44;
681             case 44:
682             #line 683 "tstr_cparse_rfc2822.c"
683 0           switch( (*p) ) {
684 0           case 79: goto st45;
685 0           case 111: goto st45;
686             }
687 0           goto st0;
688 0           st45:
689 0 0         if ( ++p == pe )
690 0           goto _test_eof45;
691             case 45:
692 0           switch( (*p) ) {
693 0           case 86: goto st6;
694 0           case 118: goto st6;
695             }
696 0           goto st0;
697 0           tr15:
698             #line 4 "ragel/tstr_common.rl"
699             { mark = p; }
700             goto st46;
701             st46:
702             if ( ++p == pe )
703             goto _test_eof46;
704             case 46:
705             #line 706 "tstr_cparse_rfc2822.c"
706 0           switch( (*p) ) {
707 0           case 67: goto st47;
708 0           case 99: goto st47;
709             }
710 0           goto st0;
711 0           st47:
712 0 0         if ( ++p == pe )
713 0           goto _test_eof47;
714             case 47:
715 0           switch( (*p) ) {
716 0           case 84: goto st6;
717 0           case 116: goto st6;
718             }
719 0           goto st0;
720 0           tr16:
721             #line 4 "ragel/tstr_common.rl"
722             { mark = p; }
723             goto st48;
724             st48:
725             if ( ++p == pe )
726             goto _test_eof48;
727             case 48:
728             #line 729 "tstr_cparse_rfc2822.c"
729 0           switch( (*p) ) {
730 0           case 69: goto st49;
731 0           case 101: goto st49;
732             }
733 0           goto st0;
734 0           st49:
735 0 0         if ( ++p == pe )
736 0           goto _test_eof49;
737             case 49:
738 0           switch( (*p) ) {
739 0           case 80: goto st6;
740 0           case 112: goto st6;
741             }
742 0           goto st0;
743 24           st50:
744 24 50         if ( ++p == pe )
745 0           goto _test_eof50;
746             case 50:
747 24 50         if ( (*p) == 32 )
748 24           goto tr7;
749 0           goto st0;
750 0           tr2:
751             #line 4 "ragel/tstr_common.rl"
752             { mark = p; }
753             goto st51;
754             st51:
755             if ( ++p == pe )
756             goto _test_eof51;
757             case 51:
758             #line 759 "tstr_cparse_rfc2822.c"
759 0           switch( (*p) ) {
760 0           case 82: goto st52;
761 0           case 114: goto st52;
762             }
763 0           goto st0;
764 0           st52:
765 0 0         if ( ++p == pe )
766 0           goto _test_eof52;
767             case 52:
768 0           switch( (*p) ) {
769 0           case 73: goto st53;
770 0           case 105: goto st53;
771             }
772 0           goto st0;
773 4           st53:
774 4 50         if ( ++p == pe )
775 0           goto _test_eof53;
776             case 53:
777 4 50         if ( (*p) == 44 )
778 4           goto tr62;
779 0           goto st0;
780 4           tr62:
781             #line 38 "ragel/tstr_common.rl"
782             {
783             if (!tstr_token_parse_day_name(mark, p - mark, &v)) {
784             result = TSTR_PARSE_ERR_DAY_NAME;
785             {p++; cs = 54; goto _out;}
786             }
787             tstr_parsed_set_day_name(parsed, v);
788             }
789             goto st54;
790             st54:
791             if ( ++p == pe )
792             goto _test_eof54;
793             case 54:
794             #line 795 "tstr_cparse_rfc2822.c"
795 4 50         if ( (*p) == 32 )
796 4           goto st55;
797 0           goto st0;
798 4           st55:
799 4 50         if ( ++p == pe )
800 0           goto _test_eof55;
801             case 55:
802 4 50         if ( 48 <= (*p) && (*p) <= 57 )
    50          
803 4           goto tr0;
804 0           goto st0;
805 4           tr3:
806             #line 4 "ragel/tstr_common.rl"
807             { mark = p; }
808             goto st56;
809             st56:
810             if ( ++p == pe )
811             goto _test_eof56;
812             case 56:
813             #line 814 "tstr_cparse_rfc2822.c"
814 4           switch( (*p) ) {
815 0           case 79: goto st57;
816 4           case 111: goto st57;
817             }
818 0           goto st0;
819 4           st57:
820 4 50         if ( ++p == pe )
821 0           goto _test_eof57;
822             case 57:
823 4           switch( (*p) ) {
824 0           case 78: goto st53;
825 4           case 110: goto st53;
826             }
827 0           goto st0;
828 0           tr4:
829             #line 4 "ragel/tstr_common.rl"
830             { mark = p; }
831             goto st58;
832             st58:
833             if ( ++p == pe )
834             goto _test_eof58;
835             case 58:
836             #line 837 "tstr_cparse_rfc2822.c"
837 0           switch( (*p) ) {
838 0           case 65: goto st59;
839 0           case 85: goto st57;
840 0           case 97: goto st59;
841 0           case 117: goto st57;
842             }
843 0           goto st0;
844 0           st59:
845 0 0         if ( ++p == pe )
846 0           goto _test_eof59;
847             case 59:
848 0           switch( (*p) ) {
849 0           case 84: goto st53;
850 0           case 116: goto st53;
851             }
852 0           goto st0;
853 0           tr5:
854             #line 4 "ragel/tstr_common.rl"
855             { mark = p; }
856             goto st60;
857             st60:
858             if ( ++p == pe )
859             goto _test_eof60;
860             case 60:
861             #line 862 "tstr_cparse_rfc2822.c"
862 0           switch( (*p) ) {
863 0           case 72: goto st61;
864 0           case 85: goto st62;
865 0           case 104: goto st61;
866 0           case 117: goto st62;
867             }
868 0           goto st0;
869 0           st61:
870 0 0         if ( ++p == pe )
871 0           goto _test_eof61;
872             case 61:
873 0           switch( (*p) ) {
874 0           case 85: goto st53;
875 0           case 117: goto st53;
876             }
877 0           goto st0;
878 0           st62:
879 0 0         if ( ++p == pe )
880 0           goto _test_eof62;
881             case 62:
882 0           switch( (*p) ) {
883 0           case 69: goto st53;
884 0           case 101: goto st53;
885             }
886 0           goto st0;
887 0           tr6:
888             #line 4 "ragel/tstr_common.rl"
889             { mark = p; }
890             goto st63;
891             st63:
892             if ( ++p == pe )
893             goto _test_eof63;
894             case 63:
895             #line 896 "tstr_cparse_rfc2822.c"
896 0           switch( (*p) ) {
897 0           case 69: goto st64;
898 0           case 101: goto st64;
899             }
900 0           goto st0;
901 0           st64:
902 0 0         if ( ++p == pe )
903 0           goto _test_eof64;
904             case 64:
905 0           switch( (*p) ) {
906 0           case 68: goto st53;
907 0           case 100: goto st53;
908             }
909 0           goto st0;
910             }
911 0           _test_eof2: cs = 2; goto _test_eof;
912 0           _test_eof3: cs = 3; goto _test_eof;
913 0           _test_eof4: cs = 4; goto _test_eof;
914 0           _test_eof5: cs = 5; goto _test_eof;
915 0           _test_eof6: cs = 6; goto _test_eof;
916 0           _test_eof7: cs = 7; goto _test_eof;
917 0           _test_eof8: cs = 8; goto _test_eof;
918 0           _test_eof9: cs = 9; goto _test_eof;
919 0           _test_eof10: cs = 10; goto _test_eof;
920 0           _test_eof11: cs = 11; goto _test_eof;
921 0           _test_eof12: cs = 12; goto _test_eof;
922 0           _test_eof13: cs = 13; goto _test_eof;
923 0           _test_eof14: cs = 14; goto _test_eof;
924 0           _test_eof15: cs = 15; goto _test_eof;
925 0           _test_eof16: cs = 16; goto _test_eof;
926 0           _test_eof17: cs = 17; goto _test_eof;
927 0           _test_eof18: cs = 18; goto _test_eof;
928 0           _test_eof19: cs = 19; goto _test_eof;
929 0           _test_eof20: cs = 20; goto _test_eof;
930 0           _test_eof21: cs = 21; goto _test_eof;
931 0           _test_eof22: cs = 22; goto _test_eof;
932 24           _test_eof65: cs = 65; goto _test_eof;
933 0           _test_eof23: cs = 23; goto _test_eof;
934 0           _test_eof24: cs = 24; goto _test_eof;
935 0           _test_eof25: cs = 25; goto _test_eof;
936 1           _test_eof66: cs = 66; goto _test_eof;
937 0           _test_eof26: cs = 26; goto _test_eof;
938 0           _test_eof27: cs = 27; goto _test_eof;
939 0           _test_eof67: cs = 67; goto _test_eof;
940 0           _test_eof68: cs = 68; goto _test_eof;
941 0           _test_eof69: cs = 69; goto _test_eof;
942 0           _test_eof70: cs = 70; goto _test_eof;
943 0           _test_eof28: cs = 28; goto _test_eof;
944 0           _test_eof29: cs = 29; goto _test_eof;
945 2           _test_eof71: cs = 71; goto _test_eof;
946 0           _test_eof30: cs = 30; goto _test_eof;
947 1           _test_eof72: cs = 72; goto _test_eof;
948 0           _test_eof31: cs = 31; goto _test_eof;
949 0           _test_eof32: cs = 32; goto _test_eof;
950 0           _test_eof33: cs = 33; goto _test_eof;
951 0           _test_eof34: cs = 34; goto _test_eof;
952 0           _test_eof35: cs = 35; goto _test_eof;
953 0           _test_eof36: cs = 36; goto _test_eof;
954 0           _test_eof37: cs = 37; goto _test_eof;
955 0           _test_eof38: cs = 38; goto _test_eof;
956 0           _test_eof39: cs = 39; goto _test_eof;
957 0           _test_eof40: cs = 40; goto _test_eof;
958 0           _test_eof41: cs = 41; goto _test_eof;
959 0           _test_eof42: cs = 42; goto _test_eof;
960 0           _test_eof43: cs = 43; goto _test_eof;
961 0           _test_eof44: cs = 44; goto _test_eof;
962 0           _test_eof45: cs = 45; goto _test_eof;
963 0           _test_eof46: cs = 46; goto _test_eof;
964 0           _test_eof47: cs = 47; goto _test_eof;
965 0           _test_eof48: cs = 48; goto _test_eof;
966 0           _test_eof49: cs = 49; goto _test_eof;
967 0           _test_eof50: cs = 50; goto _test_eof;
968 0           _test_eof51: cs = 51; goto _test_eof;
969 0           _test_eof52: cs = 52; goto _test_eof;
970 0           _test_eof53: cs = 53; goto _test_eof;
971 0           _test_eof54: cs = 54; goto _test_eof;
972 0           _test_eof55: cs = 55; goto _test_eof;
973 0           _test_eof56: cs = 56; goto _test_eof;
974 0           _test_eof57: cs = 57; goto _test_eof;
975 0           _test_eof58: cs = 58; goto _test_eof;
976 0           _test_eof59: cs = 59; goto _test_eof;
977 0           _test_eof60: cs = 60; goto _test_eof;
978 0           _test_eof61: cs = 61; goto _test_eof;
979 0           _test_eof62: cs = 62; goto _test_eof;
980 0           _test_eof63: cs = 63; goto _test_eof;
981 0           _test_eof64: cs = 64; goto _test_eof;
982              
983 28           _test_eof: {}
984 28 50         if ( p == eof )
985             {
986 28           switch ( cs ) {
987 24           case 65:
988             #line 78 "ragel/tstr_common.rl"
989             {
990             if (!tstr_token_parse_tz_offset(mark, p - mark, &v)) {
991             result = TSTR_PARSE_ERR_OFFSET;
992             {p++; cs = 0; goto _out;}
993             }
994             tstr_parsed_set_offset(parsed, v);
995             }
996             break;
997             case 71:
998             case 72:
999             #line 86 "ragel/tstr_common.rl"
1000             {
1001             tstr_parsed_set_tz_utc(parsed, mark, p - mark);
1002             }
1003             break;
1004             case 67:
1005             case 68:
1006             case 69:
1007             case 70:
1008             #line 90 "ragel/tstr_common.rl"
1009             {
1010             tstr_parsed_set_tz_abbrev(parsed, mark, p - mark);
1011             }
1012             break;
1013             #line 1014 "tstr_cparse_rfc2822.c"
1014             }
1015             }
1016              
1017 29 50         _out: {}
1018             }
1019              
1020             #line 51 "ragel/tstr_cparse_rfc2822.rl"
1021              
1022             if (result != TSTR_PARSE_OK)
1023             return result;
1024              
1025             return (cs >= rfc2822_first_final) ? TSTR_PARSE_OK : TSTR_PARSE_NOMATCH;
1026             }