breakout_parser 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/breakout_parser/lex.yy.c +720 -648
- data/ext/breakout_parser/parser.l +12 -6
- data/ext/breakout_parser/parser.tab.c +274 -215
- data/ext/breakout_parser/parser.tab.h +39 -35
- data/ext/breakout_parser/parser.y +25 -0
- data/spec/parser_spec.rb +43 -10
- metadata +2 -2
@@ -103,8 +103,14 @@ extern size_t in_buf_len;
|
|
103
103
|
^_/[^ \t\r\n_] { yylval.ivalue=0; yy_push_state(_ITALIC); return ITALIC_START; }
|
104
104
|
[ \t]+_/[^ \t\r\n_] { yylval.ivalue=1; yy_push_state(_ITALIC); return ITALIC_START; }
|
105
105
|
|
106
|
-
|
107
|
-
[ \t]
|
106
|
+
^\*_/[^ \t\r\n*_.] { yylval.ivalue=0; yy_push_state(_BOLD); yy_push_state(_ITALIC); return BOLD_ITALIC_START; }
|
107
|
+
[ \t]+\*_/[^ \t\r\n*_.] { yylval.ivalue=1; yy_push_state(_BOLD); yy_push_state(_ITALIC); return BOLD_ITALIC_START; }
|
108
|
+
|
109
|
+
^_\*/[^ \t\r\n*_.] { yylval.ivalue=0; yy_push_state(_ITALIC); yy_push_state(_BOLD); return ITALIC_BOLD_START; }
|
110
|
+
[ \t]+_\*/[^ \t\r\n*_.] { yylval.ivalue=1; yy_push_state(_ITALIC); yy_push_state(_BOLD); return ITALIC_BOLD_START; }
|
111
|
+
|
112
|
+
^@[^\r\n\xff@]+@/[ \t\r\n,.\xff] { yylval.svalue = yytext; return INLINE_CODE; }
|
113
|
+
[ \t]+@[^\r\n\xff@]+@/[ \t\r\n,.\xff] { yylval.svalue = yytext; return INLINE_CODE; }
|
108
114
|
|
109
115
|
^h[1-5]\.[ \t]+[^ \t\r\n][^\r\n]*/[\r\n\xff] {
|
110
116
|
yylval.svalue = yytext+4;
|
@@ -176,12 +182,12 @@ extern size_t in_buf_len;
|
|
176
182
|
<_CODE><<EOF>> { yy_pop_state(); return CODE_END; }
|
177
183
|
|
178
184
|
<_BOLD>[ \t]+\*/[ \t]+ { yylval.svalue = " *"; return T_WORD; } /* skip lone star */
|
179
|
-
<_BOLD>\*/[ \t\r\n'.,]
|
180
|
-
<_BOLD><<EOF>> { yy_pop_state(); return
|
185
|
+
<_BOLD>\*/[ \t\r\n'.,_] { yy_pop_state(); return BOLD_END; }
|
186
|
+
<_BOLD><<EOF>> { yy_pop_state(); return REVERT_BOLD; }
|
181
187
|
|
182
188
|
<_ITALIC>[ \t]+_/[ \t]+ { yylval.svalue = " _"; return T_WORD; } /* skip lone underscore */
|
183
|
-
<_ITALIC>_/[ \t\r\n'
|
184
|
-
<_ITALIC><<EOF>> { yy_pop_state(); return
|
189
|
+
<_ITALIC>_/[ \t\r\n'.,*] { yy_pop_state(); return ITALIC_END; }
|
190
|
+
<_ITALIC><<EOF>> { yy_pop_state(); return REVERT_ITALIC; }
|
185
191
|
|
186
192
|
%%
|
187
193
|
|
@@ -160,40 +160,44 @@ void yyerror(const char *msg)
|
|
160
160
|
T_CHAR = 258,
|
161
161
|
BOLD_START = 259,
|
162
162
|
ITALIC_START = 260,
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
163
|
+
BOLD_ITALIC_START = 261,
|
164
|
+
ITALIC_BOLD_START = 262,
|
165
|
+
T_WORD = 263,
|
166
|
+
TICKET_LINK = 264,
|
167
|
+
LINK = 265,
|
168
|
+
SVN_REVISION_LINK = 266,
|
169
|
+
GIT_REVISION_LINK = 267,
|
170
|
+
WIKI_LINK = 268,
|
171
|
+
ANCHOR_LINK = 269,
|
172
|
+
URL_WITH_PROTO_LINK = 270,
|
173
|
+
URL_WITHOUT_PROTO_LINK = 271,
|
174
|
+
FILE_LINK = 272,
|
175
|
+
IMAGE_LINK = 273,
|
176
|
+
URL = 274,
|
177
|
+
EMAIL = 275,
|
178
|
+
UL = 276,
|
179
|
+
H1 = 277,
|
180
|
+
H2 = 278,
|
181
|
+
H3 = 279,
|
182
|
+
H4 = 280,
|
183
|
+
H5 = 281,
|
184
|
+
INLINE_CODE = 282,
|
185
|
+
SPACE = 283,
|
186
|
+
BR = 284,
|
187
|
+
OLI = 285,
|
188
|
+
ULI = 286,
|
189
|
+
PRE_CODE_START = 287,
|
190
|
+
PRE_CODE_END = 288,
|
191
|
+
PRE_START = 289,
|
192
|
+
PRE_END = 290,
|
193
|
+
CODE_START = 291,
|
194
|
+
CODE_END = 292,
|
195
|
+
NOTEXTILE_START = 293,
|
196
|
+
NOTEXTILE_END = 294,
|
197
|
+
BOLD_END = 295,
|
198
|
+
ITALIC_END = 296,
|
199
|
+
REVERT_BOLD = 297,
|
200
|
+
REVERT_ITALIC = 298
|
197
201
|
};
|
198
202
|
#endif
|
199
203
|
|
@@ -213,7 +217,7 @@ typedef union YYSTYPE
|
|
213
217
|
|
214
218
|
|
215
219
|
/* Line 214 of yacc.c */
|
216
|
-
#line
|
220
|
+
#line 221 "parser.tab.c"
|
217
221
|
} YYSTYPE;
|
218
222
|
# define YYSTYPE_IS_TRIVIAL 1
|
219
223
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
@@ -225,7 +229,7 @@ typedef union YYSTYPE
|
|
225
229
|
|
226
230
|
|
227
231
|
/* Line 264 of yacc.c */
|
228
|
-
#line
|
232
|
+
#line 233 "parser.tab.c"
|
229
233
|
|
230
234
|
#ifdef short
|
231
235
|
# undef short
|
@@ -438,22 +442,22 @@ union yyalloc
|
|
438
442
|
#endif
|
439
443
|
|
440
444
|
/* YYFINAL -- State number of the termination state. */
|
441
|
-
#define YYFINAL
|
445
|
+
#define YYFINAL 53
|
442
446
|
/* YYLAST -- Last index in YYTABLE. */
|
443
|
-
#define YYLAST
|
447
|
+
#define YYLAST 128
|
444
448
|
|
445
449
|
/* YYNTOKENS -- Number of terminals. */
|
446
|
-
#define YYNTOKENS
|
450
|
+
#define YYNTOKENS 44
|
447
451
|
/* YYNNTS -- Number of nonterminals. */
|
448
452
|
#define YYNNTS 28
|
449
453
|
/* YYNRULES -- Number of rules. */
|
450
|
-
#define YYNRULES
|
454
|
+
#define YYNRULES 68
|
451
455
|
/* YYNRULES -- Number of states. */
|
452
|
-
#define YYNSTATES
|
456
|
+
#define YYNSTATES 82
|
453
457
|
|
454
458
|
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
455
459
|
#define YYUNDEFTOK 2
|
456
|
-
#define YYMAXUTOK
|
460
|
+
#define YYMAXUTOK 298
|
457
461
|
|
458
462
|
#define YYTRANSLATE(YYX) \
|
459
463
|
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
@@ -490,7 +494,7 @@ static const yytype_uint8 yytranslate[] =
|
|
490
494
|
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
491
495
|
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
492
496
|
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
|
493
|
-
35, 36, 37, 38, 39
|
497
|
+
35, 36, 37, 38, 39, 40, 41, 42, 43
|
494
498
|
};
|
495
499
|
|
496
500
|
#if YYDEBUG
|
@@ -502,41 +506,42 @@ static const yytype_uint8 yyprhs[] =
|
|
502
506
|
19, 21, 22, 23, 28, 29, 30, 35, 37, 39,
|
503
507
|
42, 45, 49, 51, 54, 57, 61, 63, 66, 68,
|
504
508
|
70, 72, 74, 76, 78, 80, 82, 84, 86, 88,
|
505
|
-
90, 92, 94, 96, 98, 100, 102, 104,
|
506
|
-
110, 112,
|
507
|
-
132,
|
509
|
+
90, 92, 94, 96, 98, 100, 102, 104, 106, 108,
|
510
|
+
110, 112, 113, 116, 118, 120, 122, 124, 126, 128,
|
511
|
+
130, 132, 134, 135, 140, 144, 145, 150, 151
|
508
512
|
};
|
509
513
|
|
510
514
|
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
511
515
|
static const yytype_int8 yyrhs[] =
|
512
516
|
{
|
513
|
-
|
514
|
-
-1,
|
515
|
-
-1, -1, -1,
|
516
|
-
|
517
|
-
|
518
|
-
-1,
|
519
|
-
-1,
|
520
|
-
|
521
|
-
5, -1,
|
522
|
-
|
523
|
-
15, -1, 16, -1, -1,
|
524
|
-
|
525
|
-
|
526
|
-
31, -1,
|
527
|
-
|
517
|
+
45, 0, -1, -1, 46, 45, -1, 67, -1, 55,
|
518
|
+
-1, 60, -1, 61, -1, 62, -1, 63, -1, 64,
|
519
|
+
-1, -1, -1, 47, 51, 48, 46, -1, -1, -1,
|
520
|
+
49, 53, 50, 46, -1, 68, -1, 52, -1, 51,
|
521
|
+
52, -1, 66, 55, -1, 66, 55, 29, -1, 54,
|
522
|
+
-1, 53, 54, -1, 65, 55, -1, 65, 55, 29,
|
523
|
+
-1, 56, -1, 56, 55, -1, 58, -1, 57, -1,
|
524
|
+
8, -1, 19, -1, 20, -1, 4, -1, 40, -1,
|
525
|
+
5, -1, 41, -1, 6, -1, 7, -1, 27, -1,
|
526
|
+
42, -1, 43, -1, 9, -1, 11, -1, 12, -1,
|
527
|
+
15, -1, 16, -1, 13, -1, 14, -1, 17, -1,
|
528
|
+
18, -1, -1, 59, 58, -1, 3, -1, 22, -1,
|
529
|
+
23, -1, 24, -1, 25, -1, 26, -1, 30, -1,
|
530
|
+
31, -1, 29, -1, -1, 32, 69, 58, 33, -1,
|
531
|
+
38, 58, 39, -1, -1, 34, 70, 58, 35, -1,
|
532
|
+
-1, 36, 71, 58, 37, -1
|
528
533
|
};
|
529
534
|
|
530
535
|
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
531
536
|
static const yytype_uint8 yyrline[] =
|
532
537
|
{
|
533
|
-
0,
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
538
|
+
0, 87, 87, 88, 91, 92, 93, 94, 95, 96,
|
539
|
+
97, 98, 98, 98, 99, 99, 99, 100, 102, 103,
|
540
|
+
105, 106, 108, 109, 111, 112, 114, 115, 117, 118,
|
541
|
+
119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
|
542
|
+
129, 130, 132, 133, 134, 135, 136, 137, 138, 139,
|
543
|
+
140, 142, 143, 145, 152, 153, 154, 155, 156, 158,
|
544
|
+
159, 160, 163, 163, 164, 165, 165, 166, 166
|
540
545
|
};
|
541
546
|
#endif
|
542
547
|
|
@@ -546,16 +551,17 @@ static const yytype_uint8 yyrline[] =
|
|
546
551
|
static const char *const yytname[] =
|
547
552
|
{
|
548
553
|
"$end", "error", "$undefined", "T_CHAR", "BOLD_START", "ITALIC_START",
|
549
|
-
"
|
550
|
-
"
|
551
|
-
"
|
552
|
-
"
|
553
|
-
"
|
554
|
-
"
|
555
|
-
"
|
556
|
-
"
|
557
|
-
"
|
558
|
-
"
|
554
|
+
"BOLD_ITALIC_START", "ITALIC_BOLD_START", "T_WORD", "TICKET_LINK",
|
555
|
+
"LINK", "SVN_REVISION_LINK", "GIT_REVISION_LINK", "WIKI_LINK",
|
556
|
+
"ANCHOR_LINK", "URL_WITH_PROTO_LINK", "URL_WITHOUT_PROTO_LINK",
|
557
|
+
"FILE_LINK", "IMAGE_LINK", "URL", "EMAIL", "UL", "H1", "H2", "H3", "H4",
|
558
|
+
"H5", "INLINE_CODE", "SPACE", "BR", "OLI", "ULI", "PRE_CODE_START",
|
559
|
+
"PRE_CODE_END", "PRE_START", "PRE_END", "CODE_START", "CODE_END",
|
560
|
+
"NOTEXTILE_START", "NOTEXTILE_END", "BOLD_END", "ITALIC_END",
|
561
|
+
"REVERT_BOLD", "REVERT_ITALIC", "$accept", "text", "textitem", "$@1",
|
562
|
+
"$@2", "$@3", "$@4", "ulist", "ulitem", "olist", "olitem", "words",
|
563
|
+
"word", "link", "chars", "char", "h1", "h2", "h3", "h4", "h5", "oli",
|
564
|
+
"uli", "br", "code", "$@5", "$@6", "$@7", 0
|
559
565
|
};
|
560
566
|
#endif
|
561
567
|
|
@@ -567,20 +573,21 @@ static const yytype_uint16 yytoknum[] =
|
|
567
573
|
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
568
574
|
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
|
569
575
|
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
|
570
|
-
285, 286, 287, 288, 289, 290, 291, 292, 293, 294
|
576
|
+
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
|
577
|
+
295, 296, 297, 298
|
571
578
|
};
|
572
579
|
# endif
|
573
580
|
|
574
581
|
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
575
582
|
static const yytype_uint8 yyr1[] =
|
576
583
|
{
|
577
|
-
0,
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
+
0, 44, 45, 45, 46, 46, 46, 46, 46, 46,
|
585
|
+
46, 47, 48, 46, 49, 50, 46, 46, 51, 51,
|
586
|
+
52, 52, 53, 53, 54, 54, 55, 55, 56, 56,
|
587
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
588
|
+
56, 56, 57, 57, 57, 57, 57, 57, 57, 57,
|
589
|
+
57, 58, 58, 59, 60, 61, 62, 63, 64, 65,
|
590
|
+
66, 67, 69, 68, 68, 70, 68, 71, 68
|
584
591
|
};
|
585
592
|
|
586
593
|
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
@@ -590,9 +597,9 @@ static const yytype_uint8 yyr2[] =
|
|
590
597
|
1, 0, 0, 4, 0, 0, 4, 1, 1, 2,
|
591
598
|
2, 3, 1, 2, 2, 3, 1, 2, 1, 1,
|
592
599
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
593
|
-
1, 1, 1, 1, 1, 1, 1,
|
594
|
-
1,
|
595
|
-
3, 0, 4, 0, 4
|
600
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
601
|
+
1, 0, 2, 1, 1, 1, 1, 1, 1, 1,
|
602
|
+
1, 1, 0, 4, 3, 0, 4, 0, 4
|
596
603
|
};
|
597
604
|
|
598
605
|
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
|
@@ -600,96 +607,101 @@ static const yytype_uint8 yyr2[] =
|
|
600
607
|
means the default is an error. */
|
601
608
|
static const yytype_uint8 yydefact[] =
|
602
609
|
{
|
603
|
-
2,
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
24,
|
610
|
+
2, 53, 33, 35, 37, 38, 30, 42, 43, 44,
|
611
|
+
47, 48, 45, 46, 49, 50, 31, 32, 54, 55,
|
612
|
+
56, 57, 58, 39, 61, 62, 65, 67, 51, 34,
|
613
|
+
36, 40, 41, 0, 2, 0, 0, 5, 26, 29,
|
614
|
+
28, 51, 6, 7, 8, 9, 10, 4, 17, 51,
|
615
|
+
51, 51, 0, 1, 3, 60, 12, 18, 51, 59,
|
616
|
+
15, 22, 51, 27, 52, 0, 0, 0, 64, 11,
|
617
|
+
19, 20, 11, 23, 24, 63, 66, 68, 13, 21,
|
618
|
+
16, 25
|
611
619
|
};
|
612
620
|
|
613
621
|
/* YYDEFGOTO[NTERM-NUM]. */
|
614
622
|
static const yytype_int8 yydefgoto[] =
|
615
623
|
{
|
616
|
-
-1,
|
617
|
-
|
618
|
-
|
624
|
+
-1, 33, 34, 35, 69, 36, 72, 56, 57, 60,
|
625
|
+
61, 37, 38, 39, 40, 41, 42, 43, 44, 45,
|
626
|
+
46, 62, 58, 47, 48, 49, 50, 51
|
619
627
|
};
|
620
628
|
|
621
629
|
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
622
630
|
STATE-NUM. */
|
623
|
-
#define YYPACT_NINF -
|
631
|
+
#define YYPACT_NINF -42
|
624
632
|
static const yytype_int8 yypact[] =
|
625
633
|
{
|
626
|
-
|
627
|
-
-
|
628
|
-
-
|
629
|
-
|
630
|
-
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
+
41, -42, -42, -42, -42, -42, -42, -42, -42, -42,
|
635
|
+
-42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
|
636
|
+
-42, -42, -42, -42, -42, -42, -42, -42, -2, -42,
|
637
|
+
-42, -42, -42, 2, 41, -21, -9, -42, 82, -42,
|
638
|
+
-42, -2, -42, -42, -42, -42, -42, -42, -42, -2,
|
639
|
+
-2, -2, -6, -42, -42, -42, -21, -42, 82, -42,
|
640
|
+
-9, -42, 82, -42, -42, 4, 16, 25, -42, 0,
|
641
|
+
-42, 6, 0, -42, 10, -42, -42, -42, -42, -42,
|
642
|
+
-42, -42
|
634
643
|
};
|
635
644
|
|
636
645
|
/* YYPGOTO[NTERM-NUM]. */
|
637
646
|
static const yytype_int8 yypgoto[] =
|
638
647
|
{
|
639
|
-
-
|
640
|
-
|
641
|
-
-
|
648
|
+
-42, 35, -41, -42, -42, -42, -42, -42, 18, -42,
|
649
|
+
20, 54, -42, -42, 77, -42, -42, -42, -42, -42,
|
650
|
+
-42, -42, -42, -42, -42, -42, -42, -42
|
642
651
|
};
|
643
652
|
|
644
653
|
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
645
654
|
positive, shift that token. If negative, reduce the rule which
|
646
655
|
number is the opposite. If zero, do what YYDEFACT says.
|
647
656
|
If YYTABLE_NINF, syntax error. */
|
648
|
-
#define YYTABLE_NINF -
|
657
|
+
#define YYTABLE_NINF -52
|
649
658
|
static const yytype_int8 yytable[] =
|
650
659
|
{
|
651
|
-
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
0, 0,
|
660
|
+
-51, 1, 53, 1, 2, 3, 4, 5, 6, 7,
|
661
|
+
55, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
662
|
+
17, 59, 18, 19, 20, 21, 22, 23, 78, 24,
|
663
|
+
-14, 80, 25, 68, 26, 79, 27, 75, 28, 81,
|
664
|
+
29, 30, 31, 32, 1, 2, 3, 4, 5, 6,
|
665
|
+
7, 76, 8, 9, 10, 11, 12, 13, 14, 15,
|
666
|
+
16, 17, 77, 18, 19, 20, 21, 22, 23, 54,
|
667
|
+
24, -14, -11, 25, 70, 26, 0, 27, 0, 28,
|
668
|
+
73, 29, 30, 31, 32, 1, 2, 3, 4, 5,
|
669
|
+
6, 7, 63, 8, 9, 10, 11, 12, 13, 14,
|
670
|
+
15, 16, 17, 0, 0, 52, 0, 0, 0, 23,
|
671
|
+
0, 0, 71, 0, 0, 0, 74, 0, 64, 0,
|
672
|
+
0, 0, 29, 30, 31, 32, 65, 66, 67
|
663
673
|
};
|
664
674
|
|
665
675
|
static const yytype_int8 yycheck[] =
|
666
676
|
{
|
667
|
-
0, 3, 0, 3, 4, 5, 6, 7,
|
668
|
-
|
669
|
-
20,
|
670
|
-
30,
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
56, 34, -1, 36,
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
-1, -1,
|
677
|
+
0, 3, 0, 3, 4, 5, 6, 7, 8, 9,
|
678
|
+
31, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
679
|
+
20, 30, 22, 23, 24, 25, 26, 27, 69, 29,
|
680
|
+
30, 72, 32, 39, 34, 29, 36, 33, 38, 29,
|
681
|
+
40, 41, 42, 43, 3, 4, 5, 6, 7, 8,
|
682
|
+
9, 35, 11, 12, 13, 14, 15, 16, 17, 18,
|
683
|
+
19, 20, 37, 22, 23, 24, 25, 26, 27, 34,
|
684
|
+
29, 30, 31, 32, 56, 34, -1, 36, -1, 38,
|
685
|
+
60, 40, 41, 42, 43, 3, 4, 5, 6, 7,
|
686
|
+
8, 9, 38, 11, 12, 13, 14, 15, 16, 17,
|
687
|
+
18, 19, 20, -1, -1, 28, -1, -1, -1, 27,
|
688
|
+
-1, -1, 58, -1, -1, -1, 62, -1, 41, -1,
|
689
|
+
-1, -1, 40, 41, 42, 43, 49, 50, 51
|
679
690
|
};
|
680
691
|
|
681
692
|
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
|
682
693
|
symbol of state STATE-NUM. */
|
683
694
|
static const yytype_uint8 yystos[] =
|
684
695
|
{
|
685
|
-
0, 3, 4, 5, 6, 7, 9,
|
686
|
-
13, 14, 15, 16, 17, 18,
|
687
|
-
24, 25, 27,
|
688
|
-
42, 43, 45,
|
689
|
-
58, 59, 60,
|
690
|
-
|
691
|
-
|
692
|
-
|
696
|
+
0, 3, 4, 5, 6, 7, 8, 9, 11, 12,
|
697
|
+
13, 14, 15, 16, 17, 18, 19, 20, 22, 23,
|
698
|
+
24, 25, 26, 27, 29, 32, 34, 36, 38, 40,
|
699
|
+
41, 42, 43, 45, 46, 47, 49, 55, 56, 57,
|
700
|
+
58, 59, 60, 61, 62, 63, 64, 67, 68, 69,
|
701
|
+
70, 71, 58, 0, 45, 31, 51, 52, 66, 30,
|
702
|
+
53, 54, 65, 55, 58, 58, 58, 58, 39, 48,
|
703
|
+
52, 55, 50, 54, 55, 33, 35, 37, 46, 29,
|
704
|
+
46, 29
|
693
705
|
};
|
694
706
|
|
695
707
|
#define yyerrok (yyerrstatus = 0)
|
@@ -1503,322 +1515,350 @@ yyreduce:
|
|
1503
1515
|
case 6:
|
1504
1516
|
|
1505
1517
|
/* Line 1455 of yacc.c */
|
1506
|
-
#line
|
1518
|
+
#line 93 "parser.y"
|
1507
1519
|
{concat("</h1>",5);}
|
1508
1520
|
break;
|
1509
1521
|
|
1510
1522
|
case 7:
|
1511
1523
|
|
1512
1524
|
/* Line 1455 of yacc.c */
|
1513
|
-
#line
|
1525
|
+
#line 94 "parser.y"
|
1514
1526
|
{concat("</h2>",5);}
|
1515
1527
|
break;
|
1516
1528
|
|
1517
1529
|
case 8:
|
1518
1530
|
|
1519
1531
|
/* Line 1455 of yacc.c */
|
1520
|
-
#line
|
1532
|
+
#line 95 "parser.y"
|
1521
1533
|
{concat("</h3>",5);}
|
1522
1534
|
break;
|
1523
1535
|
|
1524
1536
|
case 9:
|
1525
1537
|
|
1526
1538
|
/* Line 1455 of yacc.c */
|
1527
|
-
#line
|
1539
|
+
#line 96 "parser.y"
|
1528
1540
|
{concat("</h4>",5);}
|
1529
1541
|
break;
|
1530
1542
|
|
1531
1543
|
case 10:
|
1532
1544
|
|
1533
1545
|
/* Line 1455 of yacc.c */
|
1534
|
-
#line
|
1546
|
+
#line 97 "parser.y"
|
1535
1547
|
{concat("</h5>",5);}
|
1536
1548
|
break;
|
1537
1549
|
|
1538
1550
|
case 11:
|
1539
1551
|
|
1540
1552
|
/* Line 1455 of yacc.c */
|
1541
|
-
#line
|
1553
|
+
#line 98 "parser.y"
|
1542
1554
|
{concat("<ul>",4);}
|
1543
1555
|
break;
|
1544
1556
|
|
1545
1557
|
case 12:
|
1546
1558
|
|
1547
1559
|
/* Line 1455 of yacc.c */
|
1548
|
-
#line
|
1560
|
+
#line 98 "parser.y"
|
1549
1561
|
{concat("</ul>",5);}
|
1550
1562
|
break;
|
1551
1563
|
|
1552
1564
|
case 14:
|
1553
1565
|
|
1554
1566
|
/* Line 1455 of yacc.c */
|
1555
|
-
#line
|
1567
|
+
#line 99 "parser.y"
|
1556
1568
|
{concat("<ol>",4);}
|
1557
1569
|
break;
|
1558
1570
|
|
1559
1571
|
case 15:
|
1560
1572
|
|
1561
1573
|
/* Line 1455 of yacc.c */
|
1562
|
-
#line
|
1574
|
+
#line 99 "parser.y"
|
1563
1575
|
{concat("</ol>",5);}
|
1564
1576
|
break;
|
1565
1577
|
|
1566
1578
|
case 18:
|
1567
1579
|
|
1568
1580
|
/* Line 1455 of yacc.c */
|
1569
|
-
#line
|
1581
|
+
#line 102 "parser.y"
|
1570
1582
|
{concat("</li>",5);}
|
1571
1583
|
break;
|
1572
1584
|
|
1573
1585
|
case 19:
|
1574
1586
|
|
1575
1587
|
/* Line 1455 of yacc.c */
|
1576
|
-
#line
|
1588
|
+
#line 103 "parser.y"
|
1577
1589
|
{concat("</li>",5);}
|
1578
1590
|
break;
|
1579
1591
|
|
1580
1592
|
case 22:
|
1581
1593
|
|
1582
1594
|
/* Line 1455 of yacc.c */
|
1583
|
-
#line
|
1595
|
+
#line 108 "parser.y"
|
1584
1596
|
{concat("</li>",5);}
|
1585
1597
|
break;
|
1586
1598
|
|
1587
1599
|
case 23:
|
1588
1600
|
|
1589
1601
|
/* Line 1455 of yacc.c */
|
1590
|
-
#line
|
1602
|
+
#line 109 "parser.y"
|
1591
1603
|
{concat("</li>",5);}
|
1592
1604
|
break;
|
1593
1605
|
|
1594
1606
|
case 30:
|
1595
1607
|
|
1596
1608
|
/* Line 1455 of yacc.c */
|
1597
|
-
#line
|
1609
|
+
#line 119 "parser.y"
|
1598
1610
|
{concat2((yyvsp[(1) - (1)].svalue));}
|
1599
1611
|
break;
|
1600
1612
|
|
1601
1613
|
case 31:
|
1602
1614
|
|
1603
1615
|
/* Line 1455 of yacc.c */
|
1604
|
-
#line
|
1616
|
+
#line 120 "parser.y"
|
1605
1617
|
{process_url((yyvsp[(1) - (1)].svalue));}
|
1606
1618
|
break;
|
1607
1619
|
|
1608
1620
|
case 32:
|
1609
1621
|
|
1610
1622
|
/* Line 1455 of yacc.c */
|
1611
|
-
#line
|
1623
|
+
#line 121 "parser.y"
|
1612
1624
|
{process_email((yyvsp[(1) - (1)].svalue));}
|
1613
1625
|
break;
|
1614
1626
|
|
1615
1627
|
case 33:
|
1616
1628
|
|
1617
1629
|
/* Line 1455 of yacc.c */
|
1618
|
-
#line
|
1630
|
+
#line 122 "parser.y"
|
1619
1631
|
{(yyvsp[(1) - (1)].ivalue) ? concat(" <strong>",9) : concat("<strong>",8);}
|
1620
1632
|
break;
|
1621
1633
|
|
1622
1634
|
case 34:
|
1623
1635
|
|
1624
1636
|
/* Line 1455 of yacc.c */
|
1625
|
-
#line
|
1637
|
+
#line 123 "parser.y"
|
1626
1638
|
{concat("</strong>",9);}
|
1627
1639
|
break;
|
1628
1640
|
|
1629
1641
|
case 35:
|
1630
1642
|
|
1631
1643
|
/* Line 1455 of yacc.c */
|
1632
|
-
#line
|
1644
|
+
#line 124 "parser.y"
|
1633
1645
|
{(yyvsp[(1) - (1)].ivalue) ? concat(" <em>",5) : concat("<em>",4);}
|
1634
1646
|
break;
|
1635
1647
|
|
1636
1648
|
case 36:
|
1637
1649
|
|
1638
1650
|
/* Line 1455 of yacc.c */
|
1639
|
-
#line
|
1651
|
+
#line 125 "parser.y"
|
1640
1652
|
{concat("</em>",5);}
|
1641
1653
|
break;
|
1642
1654
|
|
1643
1655
|
case 37:
|
1644
1656
|
|
1645
1657
|
/* Line 1455 of yacc.c */
|
1646
|
-
#line
|
1647
|
-
{
|
1658
|
+
#line 126 "parser.y"
|
1659
|
+
{(yyvsp[(1) - (1)].ivalue) ? concat(" <strong><em>",13) : concat("<strong><em>",12);}
|
1648
1660
|
break;
|
1649
1661
|
|
1650
1662
|
case 38:
|
1651
1663
|
|
1652
1664
|
/* Line 1455 of yacc.c */
|
1653
|
-
#line
|
1654
|
-
{
|
1665
|
+
#line 127 "parser.y"
|
1666
|
+
{(yyvsp[(1) - (1)].ivalue) ? concat(" <em><strong>",13) : concat("<em><strong>",12);}
|
1655
1667
|
break;
|
1656
1668
|
|
1657
1669
|
case 39:
|
1658
1670
|
|
1659
1671
|
/* Line 1455 of yacc.c */
|
1660
|
-
#line
|
1661
|
-
{
|
1672
|
+
#line 128 "parser.y"
|
1673
|
+
{process_inline_code((yyvsp[(1) - (1)].svalue));}
|
1662
1674
|
break;
|
1663
1675
|
|
1664
1676
|
case 40:
|
1665
1677
|
|
1666
1678
|
/* Line 1455 of yacc.c */
|
1667
|
-
#line
|
1668
|
-
{
|
1679
|
+
#line 129 "parser.y"
|
1680
|
+
{revert_bold();}
|
1669
1681
|
break;
|
1670
1682
|
|
1671
1683
|
case 41:
|
1672
1684
|
|
1673
1685
|
/* Line 1455 of yacc.c */
|
1674
|
-
#line
|
1675
|
-
{
|
1686
|
+
#line 130 "parser.y"
|
1687
|
+
{revert_italic();}
|
1676
1688
|
break;
|
1677
1689
|
|
1678
1690
|
case 42:
|
1679
1691
|
|
1680
1692
|
/* Line 1455 of yacc.c */
|
1681
|
-
#line
|
1682
|
-
{
|
1693
|
+
#line 132 "parser.y"
|
1694
|
+
{process_ticket_link((yyvsp[(1) - (1)].svalue));}
|
1683
1695
|
break;
|
1684
1696
|
|
1685
1697
|
case 43:
|
1686
1698
|
|
1687
1699
|
/* Line 1455 of yacc.c */
|
1688
|
-
#line
|
1689
|
-
{
|
1700
|
+
#line 133 "parser.y"
|
1701
|
+
{process_svn_link((yyvsp[(1) - (1)].svalue));}
|
1690
1702
|
break;
|
1691
1703
|
|
1692
1704
|
case 44:
|
1693
1705
|
|
1694
1706
|
/* Line 1455 of yacc.c */
|
1695
|
-
#line
|
1696
|
-
{
|
1707
|
+
#line 134 "parser.y"
|
1708
|
+
{process_git_link((yyvsp[(1) - (1)].svalue));}
|
1697
1709
|
break;
|
1698
1710
|
|
1699
1711
|
case 45:
|
1700
1712
|
|
1701
1713
|
/* Line 1455 of yacc.c */
|
1702
|
-
#line
|
1703
|
-
{
|
1714
|
+
#line 135 "parser.y"
|
1715
|
+
{process_url_link((yyvsp[(1) - (1)].svalue),NULL);}
|
1704
1716
|
break;
|
1705
1717
|
|
1706
1718
|
case 46:
|
1707
1719
|
|
1708
1720
|
/* Line 1455 of yacc.c */
|
1709
|
-
#line
|
1710
|
-
{
|
1721
|
+
#line 136 "parser.y"
|
1722
|
+
{process_url_link((yyvsp[(1) - (1)].svalue),"http://");}
|
1723
|
+
break;
|
1724
|
+
|
1725
|
+
case 47:
|
1726
|
+
|
1727
|
+
/* Line 1455 of yacc.c */
|
1728
|
+
#line 137 "parser.y"
|
1729
|
+
{process_wiki_link((yyvsp[(1) - (1)].svalue));}
|
1730
|
+
break;
|
1731
|
+
|
1732
|
+
case 48:
|
1733
|
+
|
1734
|
+
/* Line 1455 of yacc.c */
|
1735
|
+
#line 138 "parser.y"
|
1736
|
+
{process_anchor_link((yyvsp[(1) - (1)].svalue));}
|
1711
1737
|
break;
|
1712
1738
|
|
1713
1739
|
case 49:
|
1714
1740
|
|
1715
1741
|
/* Line 1455 of yacc.c */
|
1716
1742
|
#line 139 "parser.y"
|
1717
|
-
{
|
1743
|
+
{process_file_link((yyvsp[(1) - (1)].svalue));}
|
1718
1744
|
break;
|
1719
1745
|
|
1720
1746
|
case 50:
|
1721
1747
|
|
1722
1748
|
/* Line 1455 of yacc.c */
|
1723
|
-
#line
|
1749
|
+
#line 140 "parser.y"
|
1750
|
+
{process_image_link((yyvsp[(1) - (1)].svalue));}
|
1751
|
+
break;
|
1752
|
+
|
1753
|
+
case 53:
|
1754
|
+
|
1755
|
+
/* Line 1455 of yacc.c */
|
1756
|
+
#line 145 "parser.y"
|
1757
|
+
{concat_escaped_char((yyvsp[(1) - (1)].ivalue));}
|
1758
|
+
break;
|
1759
|
+
|
1760
|
+
case 54:
|
1761
|
+
|
1762
|
+
/* Line 1455 of yacc.c */
|
1763
|
+
#line 152 "parser.y"
|
1724
1764
|
{concat("<h1 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1725
1765
|
break;
|
1726
1766
|
|
1727
|
-
case
|
1767
|
+
case 55:
|
1728
1768
|
|
1729
1769
|
/* Line 1455 of yacc.c */
|
1730
|
-
#line
|
1770
|
+
#line 153 "parser.y"
|
1731
1771
|
{concat("<h2 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1732
1772
|
break;
|
1733
1773
|
|
1734
|
-
case
|
1774
|
+
case 56:
|
1735
1775
|
|
1736
1776
|
/* Line 1455 of yacc.c */
|
1737
|
-
#line
|
1777
|
+
#line 154 "parser.y"
|
1738
1778
|
{concat("<h3 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1739
1779
|
break;
|
1740
1780
|
|
1741
|
-
case
|
1781
|
+
case 57:
|
1742
1782
|
|
1743
1783
|
/* Line 1455 of yacc.c */
|
1744
|
-
#line
|
1784
|
+
#line 155 "parser.y"
|
1745
1785
|
{concat("<h4 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1746
1786
|
break;
|
1747
1787
|
|
1748
|
-
case
|
1788
|
+
case 58:
|
1749
1789
|
|
1750
1790
|
/* Line 1455 of yacc.c */
|
1751
|
-
#line
|
1791
|
+
#line 156 "parser.y"
|
1752
1792
|
{concat("<h5 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1753
1793
|
break;
|
1754
1794
|
|
1755
|
-
case
|
1795
|
+
case 59:
|
1756
1796
|
|
1757
1797
|
/* Line 1455 of yacc.c */
|
1758
|
-
#line
|
1798
|
+
#line 158 "parser.y"
|
1759
1799
|
{concat("<li>",4);}
|
1760
1800
|
break;
|
1761
1801
|
|
1762
|
-
case
|
1802
|
+
case 60:
|
1763
1803
|
|
1764
1804
|
/* Line 1455 of yacc.c */
|
1765
|
-
#line
|
1805
|
+
#line 159 "parser.y"
|
1766
1806
|
{concat("<li>",4);}
|
1767
1807
|
break;
|
1768
1808
|
|
1769
|
-
case
|
1809
|
+
case 61:
|
1770
1810
|
|
1771
1811
|
/* Line 1455 of yacc.c */
|
1772
|
-
#line
|
1812
|
+
#line 160 "parser.y"
|
1773
1813
|
{concat("<br />",6);}
|
1774
1814
|
break;
|
1775
1815
|
|
1776
|
-
case
|
1816
|
+
case 62:
|
1777
1817
|
|
1778
1818
|
/* Line 1455 of yacc.c */
|
1779
|
-
#line
|
1819
|
+
#line 163 "parser.y"
|
1780
1820
|
{concat("<pre><code>",11);}
|
1781
1821
|
break;
|
1782
1822
|
|
1783
|
-
case
|
1823
|
+
case 63:
|
1784
1824
|
|
1785
1825
|
/* Line 1455 of yacc.c */
|
1786
|
-
#line
|
1826
|
+
#line 163 "parser.y"
|
1787
1827
|
{concat("</code></pre>",13);}
|
1788
1828
|
break;
|
1789
1829
|
|
1790
|
-
case
|
1830
|
+
case 65:
|
1791
1831
|
|
1792
1832
|
/* Line 1455 of yacc.c */
|
1793
|
-
#line
|
1833
|
+
#line 165 "parser.y"
|
1794
1834
|
{concat("<pre>",5);}
|
1795
1835
|
break;
|
1796
1836
|
|
1797
|
-
case
|
1837
|
+
case 66:
|
1798
1838
|
|
1799
1839
|
/* Line 1455 of yacc.c */
|
1800
|
-
#line
|
1840
|
+
#line 165 "parser.y"
|
1801
1841
|
{concat("</pre>",6);}
|
1802
1842
|
break;
|
1803
1843
|
|
1804
|
-
case
|
1844
|
+
case 67:
|
1805
1845
|
|
1806
1846
|
/* Line 1455 of yacc.c */
|
1807
|
-
#line
|
1847
|
+
#line 166 "parser.y"
|
1808
1848
|
{concat("<code>",6);}
|
1809
1849
|
break;
|
1810
1850
|
|
1811
|
-
case
|
1851
|
+
case 68:
|
1812
1852
|
|
1813
1853
|
/* Line 1455 of yacc.c */
|
1814
|
-
#line
|
1854
|
+
#line 166 "parser.y"
|
1815
1855
|
{concat("</code>",7);}
|
1816
1856
|
break;
|
1817
1857
|
|
1818
1858
|
|
1819
1859
|
|
1820
1860
|
/* Line 1455 of yacc.c */
|
1821
|
-
#line
|
1861
|
+
#line 1862 "parser.tab.c"
|
1822
1862
|
default: break;
|
1823
1863
|
}
|
1824
1864
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
@@ -2030,7 +2070,7 @@ yyreturn:
|
|
2030
2070
|
|
2031
2071
|
|
2032
2072
|
/* Line 1675 of yacc.c */
|
2033
|
-
#line
|
2073
|
+
#line 170 "parser.y"
|
2034
2074
|
|
2035
2075
|
|
2036
2076
|
concat_hex_char(char c){
|
@@ -2291,4 +2331,23 @@ process_email(const char*url){
|
|
2291
2331
|
process_link_tail(url,NULL,NULL);
|
2292
2332
|
}
|
2293
2333
|
|
2334
|
+
revert_bold(){
|
2335
|
+
char *p;
|
2336
|
+
for( p=bufptr-1; p >= (buf+7) ; p--){
|
2337
|
+
if( 0 == strncmp(p-7, "<strong>", 8) ){
|
2338
|
+
memcpy(p-7," *",8);
|
2339
|
+
break;
|
2340
|
+
}
|
2341
|
+
}
|
2342
|
+
}
|
2343
|
+
|
2344
|
+
revert_italic(){
|
2345
|
+
char *p;
|
2346
|
+
for( p=bufptr-1; p >= (buf+3) ; p--){
|
2347
|
+
if( 0 == strncmp(p-3, "<em>", 4) ){
|
2348
|
+
memcpy(p-3," _",4);
|
2349
|
+
break;
|
2350
|
+
}
|
2351
|
+
}
|
2352
|
+
}
|
2294
2353
|
|