breakout_parser 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ext/breakout_parser/lex.yy.c +401 -361
- data/ext/breakout_parser/parser.l +3 -0
- data/ext/breakout_parser/parser.tab.c +222 -175
- data/ext/breakout_parser/parser.tab.h +22 -20
- data/ext/breakout_parser/parser.y +29 -2
- data/spec/parser_spec.rb +61 -27
- metadata +2 -2
@@ -139,6 +139,9 @@ https?:\/\/[^ \r\n<>"(){}*]+[^ \r\n<>"(){}*,.\[\]] { yylval.svalue = yytext; re
|
|
139
139
|
|
140
140
|
\[\[#[^\r\n\[\]]+\]\] { yylval.svalue = yytext+3; return ANCHOR_LINK; }
|
141
141
|
|
142
|
+
\[\[file:[a-zA-Z0-9_.-]+(\|[^\[\]]+)?\]\] { yylval.svalue = yytext+7; return FILE_LINK; }
|
143
|
+
\[\[image:[a-zA-Z0-9_.-]+(\|[^\[\]]+)?\]\] { yylval.svalue = yytext+8; return IMAGE_LINK; }
|
144
|
+
|
142
145
|
^[ \t]+ ; /* skip spaces at line start */
|
143
146
|
[ \t]+ { yylval.ivalue = ' '; return T_CHAR; }
|
144
147
|
|
@@ -169,25 +169,27 @@ void yyerror(const char *msg)
|
|
169
169
|
ANCHOR_LINK = 267,
|
170
170
|
URL_WITH_PROTO_LINK = 268,
|
171
171
|
URL_WITHOUT_PROTO_LINK = 269,
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
172
|
+
FILE_LINK = 270,
|
173
|
+
IMAGE_LINK = 271,
|
174
|
+
URL = 272,
|
175
|
+
UL = 273,
|
176
|
+
H1 = 274,
|
177
|
+
H2 = 275,
|
178
|
+
H3 = 276,
|
179
|
+
H4 = 277,
|
180
|
+
H5 = 278,
|
181
|
+
SPACE = 279,
|
182
|
+
BR = 280,
|
183
|
+
OLI = 281,
|
184
|
+
ULI = 282,
|
185
|
+
PRE_CODE_START = 283,
|
186
|
+
PRE_CODE_END = 284,
|
187
|
+
PRE_START = 285,
|
188
|
+
PRE_END = 286,
|
189
|
+
CODE_START = 287,
|
190
|
+
CODE_END = 288,
|
191
|
+
BOLD_END = 289,
|
192
|
+
ITALIC_END = 290
|
191
193
|
};
|
192
194
|
#endif
|
193
195
|
|
@@ -207,7 +209,7 @@ typedef union YYSTYPE
|
|
207
209
|
|
208
210
|
|
209
211
|
/* Line 214 of yacc.c */
|
210
|
-
#line
|
212
|
+
#line 213 "parser.tab.c"
|
211
213
|
} YYSTYPE;
|
212
214
|
# define YYSTYPE_IS_TRIVIAL 1
|
213
215
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
@@ -219,7 +221,7 @@ typedef union YYSTYPE
|
|
219
221
|
|
220
222
|
|
221
223
|
/* Line 264 of yacc.c */
|
222
|
-
#line
|
224
|
+
#line 225 "parser.tab.c"
|
223
225
|
|
224
226
|
#ifdef short
|
225
227
|
# undef short
|
@@ -432,22 +434,22 @@ union yyalloc
|
|
432
434
|
#endif
|
433
435
|
|
434
436
|
/* YYFINAL -- State number of the termination state. */
|
435
|
-
#define YYFINAL
|
437
|
+
#define YYFINAL 45
|
436
438
|
/* YYLAST -- Last index in YYTABLE. */
|
437
|
-
#define YYLAST
|
439
|
+
#define YYLAST 101
|
438
440
|
|
439
441
|
/* YYNTOKENS -- Number of terminals. */
|
440
|
-
#define YYNTOKENS
|
442
|
+
#define YYNTOKENS 36
|
441
443
|
/* YYNNTS -- Number of nonterminals. */
|
442
444
|
#define YYNNTS 28
|
443
445
|
/* YYNRULES -- Number of rules. */
|
444
|
-
#define YYNRULES
|
446
|
+
#define YYNRULES 61
|
445
447
|
/* YYNRULES -- Number of states. */
|
446
|
-
#define YYNSTATES
|
448
|
+
#define YYNSTATES 73
|
447
449
|
|
448
450
|
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
449
451
|
#define YYUNDEFTOK 2
|
450
|
-
#define YYMAXUTOK
|
452
|
+
#define YYMAXUTOK 290
|
451
453
|
|
452
454
|
#define YYTRANSLATE(YYX) \
|
453
455
|
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
@@ -483,7 +485,8 @@ static const yytype_uint8 yytranslate[] =
|
|
483
485
|
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
|
484
486
|
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
485
487
|
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
486
|
-
25, 26, 27, 28, 29, 30, 31, 32, 33
|
488
|
+
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
|
489
|
+
35
|
487
490
|
};
|
488
491
|
|
489
492
|
#if YYDEBUG
|
@@ -495,38 +498,40 @@ static const yytype_uint8 yyprhs[] =
|
|
495
498
|
19, 21, 22, 23, 28, 29, 30, 35, 37, 39,
|
496
499
|
42, 45, 49, 51, 54, 57, 61, 63, 66, 68,
|
497
500
|
70, 72, 74, 76, 78, 80, 82, 84, 86, 88,
|
498
|
-
90, 92, 94, 96,
|
499
|
-
110, 112, 114, 116, 118,
|
501
|
+
90, 92, 94, 96, 98, 100, 101, 104, 106, 108,
|
502
|
+
110, 112, 114, 116, 118, 120, 122, 123, 128, 129,
|
503
|
+
134, 135
|
500
504
|
};
|
501
505
|
|
502
506
|
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
503
507
|
static const yytype_int8 yyrhs[] =
|
504
508
|
{
|
505
|
-
|
506
|
-
-1,
|
507
|
-
-1, -1, -1,
|
508
|
-
|
509
|
-
|
510
|
-
-1,
|
511
|
-
-1,
|
512
|
-
6, -1,
|
513
|
-
|
514
|
-
14, -1, 11, -1, 12, -1, -1,
|
515
|
-
|
516
|
-
21, -1,
|
517
|
-
|
518
|
-
-1,
|
509
|
+
37, 0, -1, -1, 38, 37, -1, 59, -1, 47,
|
510
|
+
-1, 52, -1, 53, -1, 54, -1, 55, -1, 56,
|
511
|
+
-1, -1, -1, 39, 43, 40, 38, -1, -1, -1,
|
512
|
+
41, 45, 42, 38, -1, 60, -1, 44, -1, 43,
|
513
|
+
44, -1, 58, 47, -1, 58, 47, 25, -1, 46,
|
514
|
+
-1, 45, 46, -1, 57, 47, -1, 57, 47, 25,
|
515
|
+
-1, 48, -1, 48, 47, -1, 50, -1, 49, -1,
|
516
|
+
6, -1, 17, -1, 4, -1, 34, -1, 5, -1,
|
517
|
+
35, -1, 7, -1, 9, -1, 10, -1, 13, -1,
|
518
|
+
14, -1, 11, -1, 12, -1, 15, -1, 16, -1,
|
519
|
+
-1, 51, 50, -1, 3, -1, 19, -1, 20, -1,
|
520
|
+
21, -1, 22, -1, 23, -1, 26, -1, 27, -1,
|
521
|
+
25, -1, -1, 28, 61, 50, 29, -1, -1, 30,
|
522
|
+
62, 50, 31, -1, -1, 32, 63, 50, 33, -1
|
519
523
|
};
|
520
524
|
|
521
525
|
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
522
526
|
static const yytype_uint8 yyrline[] =
|
523
527
|
{
|
524
|
-
0,
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
528
|
+
0, 83, 83, 84, 87, 88, 89, 90, 91, 92,
|
529
|
+
93, 94, 94, 94, 95, 95, 95, 96, 98, 99,
|
530
|
+
101, 102, 104, 105, 107, 108, 110, 111, 113, 114,
|
531
|
+
115, 116, 117, 118, 119, 120, 122, 123, 124, 125,
|
532
|
+
126, 127, 128, 129, 130, 132, 133, 135, 142, 143,
|
533
|
+
144, 145, 146, 148, 149, 150, 153, 153, 154, 154,
|
534
|
+
155, 155
|
530
535
|
};
|
531
536
|
#endif
|
532
537
|
|
@@ -538,13 +543,13 @@ static const char *const yytname[] =
|
|
538
543
|
"$end", "error", "$undefined", "T_CHAR", "BOLD_START", "ITALIC_START",
|
539
544
|
"T_WORD", "TICKET_LINK", "LINK", "SVN_REVISION_LINK",
|
540
545
|
"GIT_REVISION_LINK", "WIKI_LINK", "ANCHOR_LINK", "URL_WITH_PROTO_LINK",
|
541
|
-
"URL_WITHOUT_PROTO_LINK", "
|
542
|
-
"SPACE", "BR", "OLI", "ULI", "PRE_CODE_START",
|
543
|
-
"PRE_START", "PRE_END", "CODE_START", "CODE_END",
|
544
|
-
"ITALIC_END", "$accept", "text", "textitem", "$@1", "$@2",
|
545
|
-
"
|
546
|
-
"char", "h1", "h2", "h3", "h4", "h5", "oli", "uli",
|
547
|
-
"$@6", "$@7", 0
|
546
|
+
"URL_WITHOUT_PROTO_LINK", "FILE_LINK", "IMAGE_LINK", "URL", "UL", "H1",
|
547
|
+
"H2", "H3", "H4", "H5", "SPACE", "BR", "OLI", "ULI", "PRE_CODE_START",
|
548
|
+
"PRE_CODE_END", "PRE_START", "PRE_END", "CODE_START", "CODE_END",
|
549
|
+
"BOLD_END", "ITALIC_END", "$accept", "text", "textitem", "$@1", "$@2",
|
550
|
+
"$@3", "$@4", "ulist", "ulitem", "olist", "olitem", "words", "word",
|
551
|
+
"link", "chars", "char", "h1", "h2", "h3", "h4", "h5", "oli", "uli",
|
552
|
+
"br", "code", "$@5", "$@6", "$@7", 0
|
548
553
|
};
|
549
554
|
#endif
|
550
555
|
|
@@ -556,19 +561,20 @@ static const yytype_uint16 yytoknum[] =
|
|
556
561
|
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
557
562
|
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
|
558
563
|
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
|
559
|
-
285, 286, 287, 288
|
564
|
+
285, 286, 287, 288, 289, 290
|
560
565
|
};
|
561
566
|
# endif
|
562
567
|
|
563
568
|
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
564
569
|
static const yytype_uint8 yyr1[] =
|
565
570
|
{
|
566
|
-
0,
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
54, 55, 56, 57, 59,
|
571
|
+
0, 36, 37, 37, 38, 38, 38, 38, 38, 38,
|
572
|
+
38, 39, 40, 38, 41, 42, 38, 38, 43, 43,
|
573
|
+
44, 44, 45, 45, 46, 46, 47, 47, 48, 48,
|
574
|
+
48, 48, 48, 48, 48, 48, 49, 49, 49, 49,
|
575
|
+
49, 49, 49, 49, 49, 50, 50, 51, 52, 53,
|
576
|
+
54, 55, 56, 57, 58, 59, 61, 60, 62, 60,
|
577
|
+
63, 60
|
572
578
|
};
|
573
579
|
|
574
580
|
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
@@ -578,8 +584,9 @@ static const yytype_uint8 yyr2[] =
|
|
578
584
|
1, 0, 0, 4, 0, 0, 4, 1, 1, 2,
|
579
585
|
2, 3, 1, 2, 2, 3, 1, 2, 1, 1,
|
580
586
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
581
|
-
1, 1, 1,
|
582
|
-
1, 1, 1, 1,
|
587
|
+
1, 1, 1, 1, 1, 0, 2, 1, 1, 1,
|
588
|
+
1, 1, 1, 1, 1, 1, 0, 4, 0, 4,
|
589
|
+
0, 4
|
583
590
|
};
|
584
591
|
|
585
592
|
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
|
@@ -587,78 +594,80 @@ static const yytype_uint8 yyr2[] =
|
|
587
594
|
means the default is an error. */
|
588
595
|
static const yytype_uint8 yydefact[] =
|
589
596
|
{
|
590
|
-
2,
|
591
|
-
39, 40,
|
592
|
-
56, 58, 33, 35, 0, 2, 0, 0,
|
593
|
-
|
594
|
-
|
595
|
-
15, 22,
|
596
|
-
20, 11, 23, 24,
|
597
|
-
25
|
597
|
+
2, 47, 32, 34, 30, 36, 37, 38, 41, 42,
|
598
|
+
39, 40, 43, 44, 31, 48, 49, 50, 51, 52,
|
599
|
+
55, 56, 58, 60, 33, 35, 0, 2, 0, 0,
|
600
|
+
5, 26, 29, 28, 45, 6, 7, 8, 9, 10,
|
601
|
+
4, 17, 45, 45, 45, 1, 3, 54, 12, 18,
|
602
|
+
45, 53, 15, 22, 45, 27, 46, 0, 0, 0,
|
603
|
+
11, 19, 20, 11, 23, 24, 57, 59, 61, 13,
|
604
|
+
21, 16, 25
|
598
605
|
};
|
599
606
|
|
600
607
|
/* YYDEFGOTO[NTERM-NUM]. */
|
601
608
|
static const yytype_int8 yydefgoto[] =
|
602
609
|
{
|
603
|
-
-1,
|
604
|
-
|
605
|
-
|
610
|
+
-1, 26, 27, 28, 60, 29, 63, 48, 49, 52,
|
611
|
+
53, 30, 31, 32, 33, 34, 35, 36, 37, 38,
|
612
|
+
39, 54, 50, 40, 41, 42, 43, 44
|
606
613
|
};
|
607
614
|
|
608
615
|
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
609
616
|
STATE-NUM. */
|
610
|
-
#define YYPACT_NINF -
|
617
|
+
#define YYPACT_NINF -26
|
611
618
|
static const yytype_int8 yypact[] =
|
612
619
|
{
|
613
|
-
|
614
|
-
-
|
615
|
-
-
|
616
|
-
-
|
617
|
-
|
618
|
-
-8, -
|
619
|
-
|
620
|
-
-
|
620
|
+
33, -26, -26, -26, -26, -26, -26, -26, -26, -26,
|
621
|
+
-26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
|
622
|
+
-26, -26, -26, -26, -26, -26, 1, 33, -25, -8,
|
623
|
+
-26, 66, -26, -26, 21, -26, -26, -26, -26, -26,
|
624
|
+
-26, -26, 21, 21, 21, -26, -26, -26, -25, -26,
|
625
|
+
66, -26, -8, -26, 66, -26, -26, 4, -2, 8,
|
626
|
+
0, -26, 26, 0, -26, 32, -26, -26, -26, -26,
|
627
|
+
-26, -26, -26
|
621
628
|
};
|
622
629
|
|
623
630
|
/* YYPGOTO[NTERM-NUM]. */
|
624
631
|
static const yytype_int8 yypgoto[] =
|
625
632
|
{
|
626
|
-
-
|
627
|
-
|
628
|
-
-
|
633
|
+
-26, 35, 25, -26, -26, -26, -26, -26, 16, -26,
|
634
|
+
14, -23, -26, -26, 50, -26, -26, -26, -26, -26,
|
635
|
+
-26, -26, -26, -26, -26, -26, -26, -26
|
629
636
|
};
|
630
637
|
|
631
638
|
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
632
639
|
positive, shift that token. If negative, reduce the rule which
|
633
640
|
number is the opposite. If zero, do what YYDEFACT says.
|
634
641
|
If YYTABLE_NINF, syntax error. */
|
635
|
-
#define YYTABLE_NINF -
|
642
|
+
#define YYTABLE_NINF -46
|
636
643
|
static const yytype_int8 yytable[] =
|
637
644
|
{
|
638
|
-
-
|
639
|
-
7, 8, 9, 10, 11, 12,
|
640
|
-
16, 17,
|
641
|
-
|
642
|
-
6, 7, 8, 9, 10, 11, 12,
|
643
|
-
15, 16, 17,
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
0, 0, 0, 0,
|
645
|
+
-45, 45, 47, 1, 2, 3, 4, 5, 55, 6,
|
646
|
+
7, 8, 9, 10, 11, 12, 13, 14, 51, 15,
|
647
|
+
16, 17, 18, 19, 1, 20, -14, 62, 21, 67,
|
648
|
+
22, 65, 23, 66, 24, 25, 1, 2, 3, 4,
|
649
|
+
5, 68, 6, 7, 8, 9, 10, 11, 12, 13,
|
650
|
+
14, 70, 15, 16, 17, 18, 19, 72, 20, -14,
|
651
|
+
-11, 21, 46, 22, 61, 23, 64, 24, 25, 1,
|
652
|
+
2, 3, 4, 5, 0, 6, 7, 8, 9, 10,
|
653
|
+
11, 12, 13, 14, 56, 69, 0, 0, 71, 0,
|
654
|
+
0, 0, 57, 58, 59, 0, 0, 0, 0, 0,
|
655
|
+
24, 25
|
648
656
|
};
|
649
657
|
|
650
658
|
static const yytype_int8 yycheck[] =
|
651
659
|
{
|
652
|
-
0, 0,
|
653
|
-
10, 11, 12, 13, 14, 15,
|
654
|
-
20, 21,
|
655
|
-
30,
|
656
|
-
9, 10, 11, 12, 13, 14, 15,
|
657
|
-
19, 20, 21,
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
-1, -1, -1, -1,
|
660
|
+
0, 0, 27, 3, 4, 5, 6, 7, 31, 9,
|
661
|
+
10, 11, 12, 13, 14, 15, 16, 17, 26, 19,
|
662
|
+
20, 21, 22, 23, 3, 25, 26, 50, 28, 31,
|
663
|
+
30, 54, 32, 29, 34, 35, 3, 4, 5, 6,
|
664
|
+
7, 33, 9, 10, 11, 12, 13, 14, 15, 16,
|
665
|
+
17, 25, 19, 20, 21, 22, 23, 25, 25, 26,
|
666
|
+
27, 28, 27, 30, 48, 32, 52, 34, 35, 3,
|
667
|
+
4, 5, 6, 7, -1, 9, 10, 11, 12, 13,
|
668
|
+
14, 15, 16, 17, 34, 60, -1, -1, 63, -1,
|
669
|
+
-1, -1, 42, 43, 44, -1, -1, -1, -1, -1,
|
670
|
+
34, 35
|
662
671
|
};
|
663
672
|
|
664
673
|
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
|
@@ -666,13 +675,13 @@ static const yytype_int8 yycheck[] =
|
|
666
675
|
static const yytype_uint8 yystos[] =
|
667
676
|
{
|
668
677
|
0, 3, 4, 5, 6, 7, 9, 10, 11, 12,
|
669
|
-
13, 14, 15,
|
670
|
-
28, 30, 32,
|
671
|
-
47, 48, 49, 50, 51, 52, 53, 54,
|
672
|
-
59, 60, 61,
|
673
|
-
|
674
|
-
|
675
|
-
|
678
|
+
13, 14, 15, 16, 17, 19, 20, 21, 22, 23,
|
679
|
+
25, 28, 30, 32, 34, 35, 37, 38, 39, 41,
|
680
|
+
47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
|
681
|
+
59, 60, 61, 62, 63, 0, 37, 27, 43, 44,
|
682
|
+
58, 26, 45, 46, 57, 47, 50, 50, 50, 50,
|
683
|
+
40, 44, 47, 42, 46, 47, 29, 31, 33, 38,
|
684
|
+
25, 38, 25
|
676
685
|
};
|
677
686
|
|
678
687
|
#define yyerrok (yyerrstatus = 0)
|
@@ -1486,294 +1495,308 @@ yyreduce:
|
|
1486
1495
|
case 6:
|
1487
1496
|
|
1488
1497
|
/* Line 1455 of yacc.c */
|
1489
|
-
#line
|
1498
|
+
#line 89 "parser.y"
|
1490
1499
|
{concat("</h1>",5);}
|
1491
1500
|
break;
|
1492
1501
|
|
1493
1502
|
case 7:
|
1494
1503
|
|
1495
1504
|
/* Line 1455 of yacc.c */
|
1496
|
-
#line
|
1505
|
+
#line 90 "parser.y"
|
1497
1506
|
{concat("</h2>",5);}
|
1498
1507
|
break;
|
1499
1508
|
|
1500
1509
|
case 8:
|
1501
1510
|
|
1502
1511
|
/* Line 1455 of yacc.c */
|
1503
|
-
#line
|
1512
|
+
#line 91 "parser.y"
|
1504
1513
|
{concat("</h3>",5);}
|
1505
1514
|
break;
|
1506
1515
|
|
1507
1516
|
case 9:
|
1508
1517
|
|
1509
1518
|
/* Line 1455 of yacc.c */
|
1510
|
-
#line
|
1519
|
+
#line 92 "parser.y"
|
1511
1520
|
{concat("</h4>",5);}
|
1512
1521
|
break;
|
1513
1522
|
|
1514
1523
|
case 10:
|
1515
1524
|
|
1516
1525
|
/* Line 1455 of yacc.c */
|
1517
|
-
#line
|
1526
|
+
#line 93 "parser.y"
|
1518
1527
|
{concat("</h5>",5);}
|
1519
1528
|
break;
|
1520
1529
|
|
1521
1530
|
case 11:
|
1522
1531
|
|
1523
1532
|
/* Line 1455 of yacc.c */
|
1524
|
-
#line
|
1533
|
+
#line 94 "parser.y"
|
1525
1534
|
{concat("<ul>",4);}
|
1526
1535
|
break;
|
1527
1536
|
|
1528
1537
|
case 12:
|
1529
1538
|
|
1530
1539
|
/* Line 1455 of yacc.c */
|
1531
|
-
#line
|
1540
|
+
#line 94 "parser.y"
|
1532
1541
|
{concat("</ul>",5);}
|
1533
1542
|
break;
|
1534
1543
|
|
1535
1544
|
case 14:
|
1536
1545
|
|
1537
1546
|
/* Line 1455 of yacc.c */
|
1538
|
-
#line
|
1547
|
+
#line 95 "parser.y"
|
1539
1548
|
{concat("<ol>",4);}
|
1540
1549
|
break;
|
1541
1550
|
|
1542
1551
|
case 15:
|
1543
1552
|
|
1544
1553
|
/* Line 1455 of yacc.c */
|
1545
|
-
#line
|
1554
|
+
#line 95 "parser.y"
|
1546
1555
|
{concat("</ol>",5);}
|
1547
1556
|
break;
|
1548
1557
|
|
1549
1558
|
case 18:
|
1550
1559
|
|
1551
1560
|
/* Line 1455 of yacc.c */
|
1552
|
-
#line
|
1561
|
+
#line 98 "parser.y"
|
1553
1562
|
{concat("</li>",5);}
|
1554
1563
|
break;
|
1555
1564
|
|
1556
1565
|
case 19:
|
1557
1566
|
|
1558
1567
|
/* Line 1455 of yacc.c */
|
1559
|
-
#line
|
1568
|
+
#line 99 "parser.y"
|
1560
1569
|
{concat("</li>",5);}
|
1561
1570
|
break;
|
1562
1571
|
|
1563
1572
|
case 22:
|
1564
1573
|
|
1565
1574
|
/* Line 1455 of yacc.c */
|
1566
|
-
#line
|
1575
|
+
#line 104 "parser.y"
|
1567
1576
|
{concat("</li>",5);}
|
1568
1577
|
break;
|
1569
1578
|
|
1570
1579
|
case 23:
|
1571
1580
|
|
1572
1581
|
/* Line 1455 of yacc.c */
|
1573
|
-
#line
|
1582
|
+
#line 105 "parser.y"
|
1574
1583
|
{concat("</li>",5);}
|
1575
1584
|
break;
|
1576
1585
|
|
1577
1586
|
case 30:
|
1578
1587
|
|
1579
1588
|
/* Line 1455 of yacc.c */
|
1580
|
-
#line
|
1589
|
+
#line 115 "parser.y"
|
1581
1590
|
{concat2((yyvsp[(1) - (1)].svalue));}
|
1582
1591
|
break;
|
1583
1592
|
|
1584
1593
|
case 31:
|
1585
1594
|
|
1586
1595
|
/* Line 1455 of yacc.c */
|
1587
|
-
#line
|
1596
|
+
#line 116 "parser.y"
|
1588
1597
|
{process_url((yyvsp[(1) - (1)].svalue));}
|
1589
1598
|
break;
|
1590
1599
|
|
1591
1600
|
case 32:
|
1592
1601
|
|
1593
1602
|
/* Line 1455 of yacc.c */
|
1594
|
-
#line
|
1603
|
+
#line 117 "parser.y"
|
1595
1604
|
{(yyvsp[(1) - (1)].ivalue) ? concat(" <strong>",9) : concat("<strong>",8);}
|
1596
1605
|
break;
|
1597
1606
|
|
1598
1607
|
case 33:
|
1599
1608
|
|
1600
1609
|
/* Line 1455 of yacc.c */
|
1601
|
-
#line
|
1610
|
+
#line 118 "parser.y"
|
1602
1611
|
{concat("</strong>",9);}
|
1603
1612
|
break;
|
1604
1613
|
|
1605
1614
|
case 34:
|
1606
1615
|
|
1607
1616
|
/* Line 1455 of yacc.c */
|
1608
|
-
#line
|
1617
|
+
#line 119 "parser.y"
|
1609
1618
|
{(yyvsp[(1) - (1)].ivalue) ? concat(" <em>",5) : concat("<em>",4);}
|
1610
1619
|
break;
|
1611
1620
|
|
1612
1621
|
case 35:
|
1613
1622
|
|
1614
1623
|
/* Line 1455 of yacc.c */
|
1615
|
-
#line
|
1624
|
+
#line 120 "parser.y"
|
1616
1625
|
{concat("</em>",5);}
|
1617
1626
|
break;
|
1618
1627
|
|
1619
1628
|
case 36:
|
1620
1629
|
|
1621
1630
|
/* Line 1455 of yacc.c */
|
1622
|
-
#line
|
1631
|
+
#line 122 "parser.y"
|
1623
1632
|
{process_ticket_link((yyvsp[(1) - (1)].svalue));}
|
1624
1633
|
break;
|
1625
1634
|
|
1626
1635
|
case 37:
|
1627
1636
|
|
1628
1637
|
/* Line 1455 of yacc.c */
|
1629
|
-
#line
|
1638
|
+
#line 123 "parser.y"
|
1630
1639
|
{process_svn_link((yyvsp[(1) - (1)].svalue));}
|
1631
1640
|
break;
|
1632
1641
|
|
1633
1642
|
case 38:
|
1634
1643
|
|
1635
1644
|
/* Line 1455 of yacc.c */
|
1636
|
-
#line
|
1645
|
+
#line 124 "parser.y"
|
1637
1646
|
{process_git_link((yyvsp[(1) - (1)].svalue));}
|
1638
1647
|
break;
|
1639
1648
|
|
1640
1649
|
case 39:
|
1641
1650
|
|
1642
1651
|
/* Line 1455 of yacc.c */
|
1643
|
-
#line
|
1652
|
+
#line 125 "parser.y"
|
1644
1653
|
{process_url_link((yyvsp[(1) - (1)].svalue),NULL);}
|
1645
1654
|
break;
|
1646
1655
|
|
1647
1656
|
case 40:
|
1648
1657
|
|
1649
1658
|
/* Line 1455 of yacc.c */
|
1650
|
-
#line
|
1659
|
+
#line 126 "parser.y"
|
1651
1660
|
{process_url_link((yyvsp[(1) - (1)].svalue),"http://");}
|
1652
1661
|
break;
|
1653
1662
|
|
1654
1663
|
case 41:
|
1655
1664
|
|
1656
1665
|
/* Line 1455 of yacc.c */
|
1657
|
-
#line
|
1666
|
+
#line 127 "parser.y"
|
1658
1667
|
{process_wiki_link((yyvsp[(1) - (1)].svalue));}
|
1659
1668
|
break;
|
1660
1669
|
|
1661
1670
|
case 42:
|
1662
1671
|
|
1663
1672
|
/* Line 1455 of yacc.c */
|
1664
|
-
#line
|
1673
|
+
#line 128 "parser.y"
|
1665
1674
|
{process_anchor_link((yyvsp[(1) - (1)].svalue));}
|
1666
1675
|
break;
|
1667
1676
|
|
1668
|
-
case
|
1677
|
+
case 43:
|
1669
1678
|
|
1670
1679
|
/* Line 1455 of yacc.c */
|
1671
|
-
#line
|
1672
|
-
{
|
1680
|
+
#line 129 "parser.y"
|
1681
|
+
{process_file_link((yyvsp[(1) - (1)].svalue));}
|
1673
1682
|
break;
|
1674
1683
|
|
1675
|
-
case
|
1684
|
+
case 44:
|
1676
1685
|
|
1677
1686
|
/* Line 1455 of yacc.c */
|
1678
|
-
#line
|
1679
|
-
{
|
1687
|
+
#line 130 "parser.y"
|
1688
|
+
{process_image_link((yyvsp[(1) - (1)].svalue));}
|
1680
1689
|
break;
|
1681
1690
|
|
1682
1691
|
case 47:
|
1683
1692
|
|
1684
1693
|
/* Line 1455 of yacc.c */
|
1685
|
-
#line
|
1686
|
-
{
|
1694
|
+
#line 135 "parser.y"
|
1695
|
+
{concat_escaped_char((yyvsp[(1) - (1)].ivalue));}
|
1687
1696
|
break;
|
1688
1697
|
|
1689
1698
|
case 48:
|
1690
1699
|
|
1691
1700
|
/* Line 1455 of yacc.c */
|
1692
|
-
#line
|
1693
|
-
{concat("<
|
1701
|
+
#line 142 "parser.y"
|
1702
|
+
{concat("<h1 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1694
1703
|
break;
|
1695
1704
|
|
1696
1705
|
case 49:
|
1697
1706
|
|
1698
1707
|
/* Line 1455 of yacc.c */
|
1699
|
-
#line
|
1700
|
-
{concat("<
|
1708
|
+
#line 143 "parser.y"
|
1709
|
+
{concat("<h2 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1701
1710
|
break;
|
1702
1711
|
|
1703
1712
|
case 50:
|
1704
1713
|
|
1705
1714
|
/* Line 1455 of yacc.c */
|
1706
|
-
#line
|
1707
|
-
{concat("<
|
1715
|
+
#line 144 "parser.y"
|
1716
|
+
{concat("<h3 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1708
1717
|
break;
|
1709
1718
|
|
1710
1719
|
case 51:
|
1711
1720
|
|
1712
1721
|
/* Line 1455 of yacc.c */
|
1713
1722
|
#line 145 "parser.y"
|
1714
|
-
{concat("<
|
1723
|
+
{concat("<h4 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1715
1724
|
break;
|
1716
1725
|
|
1717
1726
|
case 52:
|
1718
1727
|
|
1719
1728
|
/* Line 1455 of yacc.c */
|
1720
1729
|
#line 146 "parser.y"
|
1721
|
-
{concat("<
|
1730
|
+
{concat("<h5 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1722
1731
|
break;
|
1723
1732
|
|
1724
1733
|
case 53:
|
1725
1734
|
|
1726
1735
|
/* Line 1455 of yacc.c */
|
1727
|
-
#line
|
1728
|
-
{concat("<
|
1736
|
+
#line 148 "parser.y"
|
1737
|
+
{concat("<li>",4);}
|
1729
1738
|
break;
|
1730
1739
|
|
1731
1740
|
case 54:
|
1732
1741
|
|
1733
1742
|
/* Line 1455 of yacc.c */
|
1734
|
-
#line
|
1735
|
-
{concat("<
|
1743
|
+
#line 149 "parser.y"
|
1744
|
+
{concat("<li>",4);}
|
1736
1745
|
break;
|
1737
1746
|
|
1738
1747
|
case 55:
|
1739
1748
|
|
1740
1749
|
/* Line 1455 of yacc.c */
|
1741
1750
|
#line 150 "parser.y"
|
1742
|
-
{concat("
|
1751
|
+
{concat("<br />",6);}
|
1743
1752
|
break;
|
1744
1753
|
|
1745
1754
|
case 56:
|
1746
1755
|
|
1747
1756
|
/* Line 1455 of yacc.c */
|
1748
|
-
#line
|
1749
|
-
{concat("<pre>",
|
1757
|
+
#line 153 "parser.y"
|
1758
|
+
{concat("<pre><code>",11);}
|
1750
1759
|
break;
|
1751
1760
|
|
1752
1761
|
case 57:
|
1753
1762
|
|
1754
1763
|
/* Line 1455 of yacc.c */
|
1755
|
-
#line
|
1756
|
-
{concat("</pre>",
|
1764
|
+
#line 153 "parser.y"
|
1765
|
+
{concat("</code></pre>",13);}
|
1757
1766
|
break;
|
1758
1767
|
|
1759
1768
|
case 58:
|
1760
1769
|
|
1761
1770
|
/* Line 1455 of yacc.c */
|
1762
|
-
#line
|
1763
|
-
{concat("<
|
1771
|
+
#line 154 "parser.y"
|
1772
|
+
{concat("<pre>",5);}
|
1764
1773
|
break;
|
1765
1774
|
|
1766
1775
|
case 59:
|
1767
1776
|
|
1768
1777
|
/* Line 1455 of yacc.c */
|
1769
|
-
#line
|
1778
|
+
#line 154 "parser.y"
|
1779
|
+
{concat("</pre>",6);}
|
1780
|
+
break;
|
1781
|
+
|
1782
|
+
case 60:
|
1783
|
+
|
1784
|
+
/* Line 1455 of yacc.c */
|
1785
|
+
#line 155 "parser.y"
|
1786
|
+
{concat("<code>",6);}
|
1787
|
+
break;
|
1788
|
+
|
1789
|
+
case 61:
|
1790
|
+
|
1791
|
+
/* Line 1455 of yacc.c */
|
1792
|
+
#line 155 "parser.y"
|
1770
1793
|
{concat("</code>",7);}
|
1771
1794
|
break;
|
1772
1795
|
|
1773
1796
|
|
1774
1797
|
|
1775
1798
|
/* Line 1455 of yacc.c */
|
1776
|
-
#line
|
1799
|
+
#line 1800 "parser.tab.c"
|
1777
1800
|
default: break;
|
1778
1801
|
}
|
1779
1802
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
@@ -1985,7 +2008,7 @@ yyreturn:
|
|
1985
2008
|
|
1986
2009
|
|
1987
2010
|
/* Line 1675 of yacc.c */
|
1988
|
-
#line
|
2011
|
+
#line 159 "parser.y"
|
1989
2012
|
|
1990
2013
|
|
1991
2014
|
concat_hex_char(char c){
|
@@ -2085,7 +2108,7 @@ process_anchor_link(const char*target){
|
|
2085
2108
|
|
2086
2109
|
process_url_link(const char*target,const char* proto){
|
2087
2110
|
const char *c;
|
2088
|
-
concat("<a href=\"",
|
2111
|
+
concat("<a rel=\"nofollow\" href=\"",24);
|
2089
2112
|
if(proto) concat2(proto);
|
2090
2113
|
for(c=target; *c && *c != ']' && *c != '|'; c++) concat_raw_char(*c);
|
2091
2114
|
process_link_tail(target,NULL,proto);
|
@@ -2120,6 +2143,30 @@ process_wiki_link(const char*target){
|
|
2120
2143
|
process_link_tail(target,NULL,NULL);
|
2121
2144
|
}
|
2122
2145
|
|
2146
|
+
process_file_link(const char*target){
|
2147
|
+
const char *c;
|
2148
|
+
concat("<a href=\"/spaces/",17);
|
2149
|
+
concat(space_name,space_name_len);
|
2150
|
+
concat("/documents/download/",20);
|
2151
|
+
for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
|
2152
|
+
process_link_tail(target,NULL,"file:");
|
2153
|
+
}
|
2154
|
+
|
2155
|
+
process_image_link(const char*target){
|
2156
|
+
const char *c, *p;
|
2157
|
+
concat("<img src=\"/spaces/",18);
|
2158
|
+
concat(space_name,space_name_len);
|
2159
|
+
concat("/documents/download/",20);
|
2160
|
+
for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
|
2161
|
+
concat("\" alt=\"",7);
|
2162
|
+
if(p = strchr(target,'|')){
|
2163
|
+
for(c=p+1; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
|
2164
|
+
} else {
|
2165
|
+
for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
|
2166
|
+
}
|
2167
|
+
concat("\" />",4);
|
2168
|
+
}
|
2169
|
+
|
2123
2170
|
process_ticket_link(const char*ticket_id){
|
2124
2171
|
const char *c;
|
2125
2172
|
while(*ticket_id && (*ticket_id < '0' || *ticket_id > '9') ) ticket_id++;
|
@@ -2189,7 +2236,7 @@ concat_escaping_html(const char*what){
|
|
2189
2236
|
process_url(const char*url){
|
2190
2237
|
const char *p;
|
2191
2238
|
|
2192
|
-
concat("<a href=\"",
|
2239
|
+
concat("<a rel=\"nofollow\" href=\"",24);
|
2193
2240
|
for(p=url; *p; p++) concat_raw_char(*p);
|
2194
2241
|
process_link_tail(url,NULL,NULL);
|
2195
2242
|
}
|