-
-
Save titsuki/ed10656d585a8c8cdf50787291c241ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grammar Infobox::Grammar { | |
token TOP { <infobox> .+ } | |
token infobox { '{{Infobox' <.ws> <name> \n <propertylist> '}}' } | |
token name { <-[\n]>+ } | |
token propertylist { | |
[ | |
| <property> \n | |
| \n | |
]+ | |
} | |
token property { | |
[ | |
| '|' <key=.key-content> '=' <value=.value-content-list> | |
| '|' <key=.key-content> '=' # (#4) | |
] | |
} | |
token key-content { <-[=\n]>+ } | |
token value-content-list { | |
[ | |
| <value-content> <br> # (#6) | |
| <value-content> | |
| <br> | |
]+ | |
} | |
token value-content-list-nl { # (#1) | |
[ | |
| <value-content> <br> # (#7) | |
| <value-content> | |
| <br> | |
]+ % \n | |
} | |
token value-content { | |
[ | |
| <anchortext> | |
| <weblink> | |
| <rawtext> | |
| <template> | |
| <delimiter> | |
| <sup> | |
]+ | |
} | |
token br { # (#5) | |
[ | |
| '<br />' | |
| '<br/>' | |
| '<br>' | |
] | |
} | |
token template { | |
[ | |
| '{{' <-[\n]>+? '}}' | |
| '{{nowrap' '|' <value-content-list> '}}' # (#3) | |
| '{{Plainlist' '|' \n <value-content-list-nl> \n '}}' # (#2) | |
] | |
} | |
token anchortext { '[[' <-[\n]>+? ']]' } | |
token weblink { '[' <-[\n]>+? ']' } | |
token rawtext { <-[\|\[\]\n、\,\<\>\}\{]>+ } | |
token delimiter { [ '、' | ',' | ' ' ] } | |
token sup { '<sup>' <-[\n]>+? '</sup>'} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment