diff options
| author | Georg Brandl <georg@python.org> | 2021-01-18 21:24:00 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2021-01-18 22:08:36 +0100 |
| commit | 2a3d3a7d5b9c60dedf6638d876161d9563faebcf (patch) | |
| tree | 809c0b4a686db98f5954afa1944404cd9652c6b2 /tests/lexers/bnf | |
| parent | f0445be718da83541ea3401aad882f3937147263 (diff) | |
| download | pygments-git-examplefiles.tar.gz | |
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/bnf')
| -rw-r--r-- | tests/lexers/bnf/example.txt | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/tests/lexers/bnf/example.txt b/tests/lexers/bnf/example.txt new file mode 100644 index 00000000..989fbf87 --- /dev/null +++ b/tests/lexers/bnf/example.txt @@ -0,0 +1,149 @@ +---input--- +; This examples from WikiPedia <https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form>. + + <postal-address> ::= <name-part> <street-address> <zip-part> + + <name-part> ::= <personal-part> <last-name> <opt-suffix-part> <EOL> + | <personal-part> <name-part> + + <personal-part> ::= <initial> "." | <first-name> + + <street-address> ::= <house-num> <street-name> <opt-apt-num> <EOL> + + <zip-part> ::= <town-name> "," <state-code> <ZIP-code> <EOL> + + <opt-suffix-part> ::= "Sr." | "Jr." | <roman-numeral> | "" + <opt-apt-num> ::= <apt-num> | "" + +---tokens--- +'; This examples from WikiPedia ' Text +'<' Punctuation +'https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form' Name.Class +'>' Punctuation +'.\n\n ' Text +'<' Punctuation +'postal-address' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'name-part' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'street-address' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'zip-part' Name.Class +'>' Punctuation +'\n\n ' Text +'<' Punctuation +'name-part' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'personal-part' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'last-name' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'opt-suffix-part' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'EOL' Name.Class +'>' Punctuation +'\n | ' Text +'<' Punctuation +'personal-part' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'name-part' Name.Class +'>' Punctuation +'\n\n ' Text +'<' Punctuation +'personal-part' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'initial' Name.Class +'>' Punctuation +' "." | ' Text +'<' Punctuation +'first-name' Name.Class +'>' Punctuation +'\n\n ' Text +'<' Punctuation +'street-address' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'house-num' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'street-name' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'opt-apt-num' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'EOL' Name.Class +'>' Punctuation +'\n\n ' Text +'<' Punctuation +'zip-part' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'town-name' Name.Class +'>' Punctuation +' "," ' Text +'<' Punctuation +'state-code' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'ZIP-code' Name.Class +'>' Punctuation +' ' Text +'<' Punctuation +'EOL' Name.Class +'>' Punctuation +'\n\n ' Text +'<' Punctuation +'opt-suffix-part' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' "Sr." | "Jr." | ' Text +'<' Punctuation +'roman-numeral' Name.Class +'>' Punctuation +' | ""\n ' Text +'<' Punctuation +'opt-apt-num' Name.Class +'>' Punctuation +' ' Text +'::=' Operator +' ' Text +'<' Punctuation +'apt-num' Name.Class +'>' Punctuation +' | ""\n' Text |
