r6885 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r6884‎ | r6885 | r6886 >
Date:10:53, 29 December 2004
Author:magnus_manske
Status:old
Tags:
Comment:
attempt for linktrail (broken)
Modified paths:
  • /trunk/flexbisonparse/parsetree.c (modified) (history)
  • /trunk/flexbisonparse/wikilex.l (modified) (history)
  • /trunk/flexbisonparse/wikiparse.y (modified) (history)

Diff [purge]

Index: trunk/flexbisonparse/wikiparse.y
@@ -36,7 +36,7 @@
3737 textelement textelementnoboit textelementnobold textelementnoital textelementinlink
3838 textnoboit textnobold textnoital textinlink textorempty zeroormorenewlines
3939 zeroormorenewlinessave textintbl textelementintbl textintmpl textelementintmpl
40 - template templatevar tablecaption
 40+ template templatevar tablecaption linktrail linktrailtext
4141 TEXT EXTENSION
4242 %type <ad> ATTRIBUTE
4343 %type <num> HEADING ENDHEADING EQUALS ATTRAPO ATTRQ
@@ -46,7 +46,7 @@
4747 NEWLINE PRELINE LISTBULLET LISTNUMBERED LISTIDENT HEADING ENDHEADING APO5 APO3 APO2 TABLEBEGIN
4848 TABLECELL TABLEHEAD TABLEROW TABLEEND TABLECAPTION ATTRIBUTE EQUALS ATTRAPO ATTRQ
4949 OPENPENTUPLECURLY CLOSEPENTUPLECURLY OPENTEMPLATEVAR CLOSETEMPLATEVAR OPENTEMPLATE
50 - CLOSETEMPLATE
 50+ CLOSETEMPLATE LINKTRAIL
5151
5252 %start article
5353
@@ -136,21 +136,28 @@
137137 | listseries LISTNUMBERED { debugf ("listseries#6 "); $$ = nodeAddChild ($1, newNode (ListNumbered)); }
138138 | listseries LISTIDENT { debugf ("listseries#6 "); $$ = nodeAddChild ($1, newNode (ListIdent)); }
139139
140 -linketc : OPENDBLSQBR textinlink CLOSEDBLSQBR
 140+/* THIS IS BROKEN BEYOND BELIEF! */
 141+linktrailtext : linktrailtext LINKTRAIL { $$ = $1 ; }
 142+ | LINKTRAIL { }
 143+
 144+linktrail : CLOSEDBLSQBR linktrailtext { $$ = $2 } /* Don't know how to handle the trail; ignored so far */
 145+ | CLOSEDBLSQBR {}
 146+
 147+linketc : OPENDBLSQBR textinlink linktrail
141148 { debugf ("linketc#1 "); $$ = nodeAddChild (newNodeI (LinkEtc, 0), nodeAddChild (newNode (LinkTarget), $2)); }
142 - | OPENDBLSQBR textinlink PIPE CLOSEDBLSQBR
 149+ | OPENDBLSQBR textinlink PIPE linktrail
143150 { debugf ("linketc#2 "); $$ = nodeAddChild (newNodeI (LinkEtc, 1), nodeAddChild (newNode (LinkTarget), $2)); }
144 - | OPENDBLSQBR textinlink pipeseries CLOSEDBLSQBR
 151+ | OPENDBLSQBR textinlink pipeseries linktrail
145152 { debugf ("linketc#3 "); $$ = nodeAddChild2 (newNodeI (LinkEtc, 0), nodeAddChild (newNode (LinkTarget), $2), $3); }
146 - | OPENDBLSQBR textinlink pipeseries PIPE CLOSEDBLSQBR
 153+ | OPENDBLSQBR textinlink pipeseries PIPE linktrail
147154 { debugf ("linketc#4 "); $$ = nodeAddChild2 (newNodeI (LinkEtc, 1), nodeAddChild (newNode (LinkTarget), $2), $3); }
148 - | OPENLINK textinlink CLOSEDBLSQBR
 155+ | OPENLINK textinlink linktrail
149156 { debugf ("linketc#5 "); $$ = nodeAddChild (newNodeI (LinkEtc, 2), nodeAddChild (newNode (LinkTarget), $2)); }
150 - | OPENLINK textinlink PIPE CLOSEDBLSQBR
 157+ | OPENLINK textinlink PIPE linktrail
151158 { debugf ("linketc#6 "); $$ = nodeAddChild (newNodeI (LinkEtc, 3), nodeAddChild (newNode (LinkTarget), $2)); }
152 - | OPENLINK textinlink pipeseries CLOSEDBLSQBR
 159+ | OPENLINK textinlink pipeseries linktrail
153160 { debugf ("linketc#7 "); $$ = nodeAddChild2 (newNodeI (LinkEtc, 2), nodeAddChild (newNode (LinkTarget), $2), $3); }
154 - | OPENLINK textinlink pipeseries PIPE CLOSEDBLSQBR
 161+ | OPENLINK textinlink pipeseries PIPE linktrail
155162 { debugf ("linketc#8 "); $$ = nodeAddChild2 (newNodeI (LinkEtc, 3), nodeAddChild (newNode (LinkTarget), $2), $3); }
156163 /* ... and now everything again with the CLOSEDBLSQBR missing,
157164 * to take care of invalid mark-up. */
Index: trunk/flexbisonparse/wikilex.l
@@ -128,6 +128,7 @@
129129 <inattributeapo>\'" "* { BEGIN (attributes); yylval.num = yyleng-1; debuglex2 ("ATTRAPO(%d) ", yyleng-1); return ATTRAPO; }
130130 <inattributeq>\"" "* { BEGIN (attributes); yylval.num = yyleng-1; debuglex2 ("ATTRQ(%d) ", yyleng-1); return ATTRQ; }
131131
 132+[a-z] { COMMONTOKENS; debuglex ("LINKTRAIL "); return LINKTRAIL; }
132133 "\[\[:" { COMMONTOKENS; debuglex ("OPENLINK "); return OPENLINK; }
133134 "\[\[" { COMMONTOKENS; debuglex ("OPENDBLSQBR "); return OPENDBLSQBR; }
134135 "\]\]" { COMMONTOKENS; debuglex ("CLOSEDBLSQBR "); return CLOSEDBLSQBR; }
Index: trunk/flexbisonparse/parsetree.c
@@ -898,3 +898,4 @@
899899 outputXMLHelper (node);
900900 return fb_get_buffer();
901901 }
 902+

Status & tagging log