0
Doc = a:Blocks BlankLine* Eof
0
-Blocks = a:StartList (
b:Block { pushelt(b, &a); } )*
0
+Blocks = a:StartList (
Block { pushelt($$, &a); } )*
0
{ $$ = mk_list(LIST, a); }
0
AtxStart = < ( "######" | "#####" | "####" | "###" | "##" | "#" ) >
0
{ $$.key = H1 + (strlen(yytext) - 1); }
0
-AtxHeading = s:AtxStart Sp a:StartList (
b:AtxInline { pushelt(b, &a); } )+ (Sp '#'* Sp)? Newline
0
+AtxHeading = s:AtxStart Sp a:StartList (
AtxInline { pushelt($$, &a); } )+ (Sp '#'* Sp)? Newline
0
{ $$ = mk_list(s.key, a); }
0
SetextHeading = SetextHeading1 | SetextHeading2
0
-SetextHeadingInline = !Endline Inline
0
-SetextHeading1 = a:StartList ( b:SetextHeadingInline { pushelt(b, &a); } )+ Newline "===" '='* Newline
0
+SetextHeading1 = a:StartList ( !Endline Inline { pushelt($$, &a); } )+ Newline "===" '='* Newline
0
{ $$ = mk_list(H1, a); }
0
-SetextHeading2 = a:StartList (
b:SetextHeadingInline { pushelt(b, &a) ; } )+ Newline "---" '-'* Newline
0
+SetextHeading2 = a:StartList (
!Endline Inline { pushelt($$, &a) ; } )+ Newline "---" '-'* Newline
0
{ $$ = mk_list(H2, a); }
0
Heading = AtxHeading | SetextHeading
0
BlockQuote = BlockQuoteRaw
0
-BlockQuoteLine = '>' ' '? Line
0
-BlockQuoteRaw = a:StartList ( b:BlockQuoteLine { pushelt(b, &a); } )+
0
+BlockQuoteRaw = a:StartList ( '>' ' '? Line { pushelt($$, &a); } )+
0
{ char *c = concat_string_list(reverse(a.children));
0
strcat(c, "\n"); /* Note: an extra byte was allocated for this */
0
NonblankIndentedLine = !BlankLine IndentedLine
0
VerbatimChunk = a:StartList
0
- ( c:BlankLine { pushelt(c, &a); } )*
0
- ( b:NonblankIndentedLine { pushelt(b, &a); } )+
0
+ ( BlankLine { pushelt($$, &a); } )*
0
+ ( NonblankIndentedLine { pushelt($$, &a); } )+
0
{ $$ = mk_str(concat_string_list(reverse(a.children))); }
0
-Verbatim = a:StartList (
b:VerbatimChunk { pushelt(b, &a); } )+
0
+Verbatim = a:StartList (
VerbatimChunk { pushelt($$, &a); } )+
0
{ $$ = mk_str(concat_string_list(reverse(a.children))); $$.key = VERBATIM; }
0
HorizontalRule = NonindentSpace
0
BulletList = BulletListTight | BulletListLoose
0
-BulletListTight = a:StartList (
b:BulletListItem { pushelt(b, &a); } )+ BlankLine* !BulletListLoose
0
+BulletListTight = a:StartList (
BulletListItem { pushelt($$, &a); } )+ BlankLine* !BulletListLoose
0
{ $$ = mk_list(BULLETLIST, a); }
0
BulletListLoose = a:StartList
0
BulletListItem = !HorizontalRule Bullet
0
- b:BulletListBlock { pushelt(b, &a); }
0
- ( c:BulletListContinuationBlock { pushelt(c, &a); } )*
0
+ BulletListBlock { pushelt($$, &a); }
0
+ ( BulletListContinuationBlock { pushelt($$, &a); } )*
0
{ $$ = mk_str(concat_string_list(reverse(a.children))); $$.key = LISTITEM; }
0
-BulletListBlock = a:StartList
b:Line { pushelt(b, &a); } (c:ListBlockLine { pushelt(c, &a); })*
0
+BulletListBlock = a:StartList
Line { pushelt($$, &a); } (ListBlockLine { pushelt($$, &a); })*
0
{ $$ = mk_str(concat_string_list(reverse(a.children))); }
0
BulletListContinuationBlock = a:StartList
0
- { if (strlen(b.contents.str) == 0)
0
- b.contents.str = strdup("\001"); /* block separator */
0
- ( Indent c:BulletListBlock { pushelt(c, &a); } )+
0
+ { if (strlen($$.contents.str) == 0)
0
+ $$.contents.str = strdup("\001"); /* block separator */
0
+ ( Indent BulletListBlock { pushelt($$, &a); } )+
0
{ $$ = mk_str(concat_string_list(reverse(a.children))); }
0
Enumerator = NonindentSpace [0-9]+ '.' Spacechar+
0
OrderedList = OrderedListTight | OrderedListLoose
0
OrderedListTight = a:StartList
0
- (
b:OrderedListItem { pushelt(b, &a); } )+
0
+ (
OrderedListItem { pushelt($$, &a); } )+
0
BlankLine* !OrderedListLoose
0
{ $$ = mk_list(ORDEREDLIST, a); }
0
OrderedListItem = !HorizontalRule Enumerator
0
- b:OrderedListBlock { pushelt(b, &a); }
0
- ( c:OrderedListContinuationBlock { pushelt(c, &a); } )*
0
+ OrderedListBlock { pushelt($$, &a); }
0
+ ( OrderedListContinuationBlock { pushelt($$, &a); } )*
0
{ $$ = mk_str(concat_string_list(reverse(a.children))); $$.key = LISTITEM; }
0
-OrderedListBlock = a:StartList b:Line { pushelt(b, &a); }
0
- ( c:ListBlockLine { pushelt(c, &a); } )*
0
+OrderedListBlock = a:StartList Line { pushelt($$, &a); }
0
+ ( ListBlockLine { pushelt($$, &a); } )*
0
{ $$ = mk_str(concat_string_list(reverse(a.children))); }
0
OrderedListContinuationBlock = a:StartList
0
- { if (strlen(b.contents.str) == 0)
0
- b.contents.str = strdup("\001"); /* block separator */
0
+ { if (strlen($$.contents.str) == 0)
0
+ $$.contents.str = strdup("\001"); /* block separator */
0
- ( Indent
c:OrderedListBlock { pushelt(c, &a); } )+
0
+ ( Indent
OrderedListBlock { pushelt($$, &a); } )+
0
{ $$ = mk_str(concat_string_list(reverse(a.children))); }
0
BlankLines = < BlankLine* >
0
"H4" | "H5" | "H6" | "HR" | "ISINDEX" | "MENU" | "NOFRAMES" | "NOSCRIPT" | "OL" | "P" | "PRE" | "TABLE" |
0
"UL" | "DD" | "DT" | "FRAMESET" | "LI" | "TBODY" | "TD" | "TFOOT" | "TH" | "THEAD" | "TR" | "SCRIPT"
0
-Inlines = a:StartList ( !Endline
b:Inline { pushelt(b, &a); }
0
+Inlines = a:StartList ( !Endline
Inline { pushelt($$, &a); }
0
| c:Endline &Inline { pushelt(c, &a); } )+ Endline?
0
{ $$ = mk_list(LIST, a); }
0
EmphStar = OneStar !Spacechar !Newline
0
- (
b:EmphInlineStar { pushelt(b, &a); } )+
0
+ (
EmphInlineStar { pushelt($$, &a); } )+
0
{ $$ = mk_list(EMPH, a); }
0
EmphUl = OneUl !Spacechar !Newline
0
- (
b:EmphInlineUl { pushelt(b, &a); } )+
0
+ (
EmphInlineUl { pushelt($$, &a); } )+
0
{ $$ = mk_list(EMPH, a); }
0
StrongStar = TwoStar !Spacechar !Newline
0
- (
b:StrongInlineStar { pushelt(b, &a); } )+
0
+ (
StrongInlineStar { pushelt($$, &a); } )+
0
{ $$ = mk_list(STRONG, a); }
0
StrongUl = TwoUl !Spacechar !Newline
0
- (
b:StrongInlineUl { pushelt(b, &a); } )+
0
+ (
StrongInlineUl { pushelt($$, &a); } )+
0
{ $$ = mk_list(STRONG, a); }
0
- (
b:LabelInline { pushelt(b, &a); } )+
0
+ (
!']' Inline { pushelt($$, &a); } )+
0
{ $$ = mk_list(LIST, a); }
0
-LabelInline = !']' Inline
0
RefSrc = < Nonspacechar+ > { $$ = mk_str(yytext); $$.key = HTML; }
Comments
No one has commented yet.