Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
clean up grammar by using <-[class]>
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Mar 30, 2009
1 parent e83a324 commit 66cf8ef
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/parser/grammar.pg
Expand Up @@ -237,7 +237,7 @@ token Str {
}

token EscapedChar {
'\\' <!Newline> (.)
'\\' (<-[\n]>)
{*}
}

Expand Down Expand Up @@ -394,17 +394,15 @@ token AutoLink {
}

token AutoLinkUrl {
'<' ( <[A..Za..z]>+ '://' [ <!Newline> <!_Gt> . ]+ ) '>'
'<' ( <[A..Za..z]>+ '://' <-[>\n]>+ ) '>'
{*}
}

token AutoLinkEmail {
'<' ( <[\-.A..Za..z0..9_]>+ '@' [ <!Newline> <!_Gt> . ]+ ) '>'
'<' ( <[\-.A..Za..z0..9_]>+ '@' <-[>\n]>+ ) '>'
{*}
}

token _Gt { '>' }

token Reference {
<.NonindentSpace> <!_EmptyLabel> <Label> ':' <.Spnl> <RefSrc> <.Spnl> <RefTitle> <.BlankLine>*
{*}
Expand Down Expand Up @@ -509,14 +507,10 @@ token RawHtml {
token BlankLine { <.Sp> <.Newline> {*} }

token Quoted {
| <._Quote> [ <!_Quote> . ]* <._Quote>
| <._Apos> [ <!_Apos> . ]* <._Apos>
| '"' <-["]>* '"'
| '\'' <-[']>* '\''
}

token _Quote { '"' }

token _Apos { '\'' }

token HtmlAttribute {
<._HtmlName> <.Spnl> [ '=' <.Spnl> [ <.Quoted> | <.Nonspacechar>+] ]? <.Spnl>
}
Expand Down

0 comments on commit 66cf8ef

Please sign in to comment.