Skip to content

Commit a032b69

Browse files
committed
Sp? is redundant… [jgm/peg-markdown]
See jgm/peg-markdown@b220285
1 parent feacd19 commit a032b69

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

parser.leg

+4-4
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ Para = NonindentSpace a:Inlines BlankLine+
138138
Plain = a:Inlines
139139
{ $$ = a; $$.key = PLAIN }
140140

141-
AtxInline = !Newline !(Sp? '#'* Sp Newline) Inline
141+
AtxInline = !Newline !(Sp '#'* Sp Newline) Inline
142142

143143
AtxStart = &'#' < ( "######" | "#####" | "####" | "###" | "##" | "#" ) >
144144
{ $$ = p.mkElem(H1 + (len(yytext) - 1)) }
145145

146-
AtxHeading = s:AtxStart Sp? a:StartList ( AtxInline { a = cons($$, a) } )+ (Sp? '#'* Sp)? Newline
146+
AtxHeading = s:AtxStart Sp a:StartList ( AtxInline { a = cons($$, a) } )+ (Sp '#'* Sp)? Newline
147147
{ $$ = p.mkList(s.key, a)
148148
s = nil }
149149

@@ -154,11 +154,11 @@ SetextBottom1 = '='+ Newline
154154
SetextBottom2 = '-'+ Newline
155155

156156
SetextHeading1 = &(RawLine SetextBottom1)
157-
a:StartList ( !Endline Inline { a = cons($$, a) } )+ Sp? Newline
157+
a:StartList ( !Endline Inline { a = cons($$, a) } )+ Sp Newline
158158
SetextBottom1 { $$ = p.mkList(H1, a) }
159159

160160
SetextHeading2 = &(RawLine SetextBottom2)
161-
a:StartList ( !Endline Inline { a = cons($$, a) } )+ Sp? Newline
161+
a:StartList ( !Endline Inline { a = cons($$, a) } )+ Sp Newline
162162
SetextBottom2 { $$ = p.mkList(H2, a) }
163163

164164
Heading = SetextHeading | AtxHeading

portid

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
af94d25475d3
1+
6b367c802475

0 commit comments

Comments
 (0)