Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (17 sloc) 518 Bytes
module MediaWiki
syntax WikiText = WikiSymbol* wss;
syntax WikiSymbol
= MWWord w
| WikiLink wl;
syntax WikiLink
= simple: "[[" PageName destination "]]"
| barred: "[[" PageName destination "|" MWWord+ description "]]"
;
lexical MWWord
= ![\ \t\n\r\[\]]+ !>> ![\ \t\n\r\[\]]
;
// http://en.wikipedia.org/wiki/Wikipedia:Naming_conventions_(technical_restrictions)#Forbidden_characters
lexical PageName
= ![#\<\>\[\]|{}\t\n\r]+ !>> ![#\<\>\[\]|{}\t\n\r]
;
layout MediaWiki = [\ \t\n\r]* !>> [\ \t\n\r];