Files
ServerSync/lib/pygments/lexers/__pycache__/grammar_notation.cpython-314.pyc

100 lines
7.5 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
<00> <0C>ik<00><00><><00>Rt^RIHtHtHtHtHtHt^RIH t H
t
H t H t H t HtHtHtHtHt.R Ot!RR]4t!RR]4t!R R]4t!R
R]4tR #) z<>
pygments.lexers.grammar_notation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for grammar notations like BNF.
:copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
)<06>
RegexLexer<EFBFBD>bygroups<70>include<64>this<69>using<6E>words)
<EFBFBD>Comment<6E>Keyword<72>Literal<61>Name<6D>Number<65>Operator<6F> Punctuation<6F>String<6E>Text<78>
Whitespace<EFBFBD>BnfLexer<65> AbnfLexer<65> JsgfLexer<65>PegLexerc<00>|<00>]tRt^tRtRtR.tR.tR.tRt Rt
RR ] !] ] P] 43R
]3R ]3R ]3./tR tR#)ra<>
This lexer is for grammar notations which are similar to
original BNF.
In order to maximize a number of targets of this lexer,
let's decide some designs:
* We don't distinguish `Terminal Symbol`.
* We do assume that `NonTerminal Symbol` are always enclosed
with arrow brackets.
* We do assume that `NonTerminal Symbol` may include
any printable characters except arrow brackets and ASCII 0x20.
This assumption is for `RBNF <http://www.rfc-base.org/txt/rfc-5511.txt>`_.
* We do assume that target notation doesn't support comment.
* We don't distinguish any operators and punctuation except
`::=`.
Though these decision making might cause too minimal highlighting
and you might be disappointed, but it is reasonable for us.
<EFBFBD>BNF<4E>bnfz*.bnfz
text/x-bnfz6https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form<72>2.1<EFBFBD>rootz(<)([ -;=?-~]+)(>)z::=z[^<>:]+<2B>.<2E>N)<13>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__<5F>name<6D>aliases<65> filenames<65> mimetypes<65>url<72> version_addedrrr <00>Classr r<00>tokens<6E>__static_attributes__r<00><00>G/tmp/pip-target-qd_sq_1j/lib/python/pygments/lexers/grammar_notation.pyrrsq<00><00><08>2 <11>D<EFBFBD><14>g<EFBFBD>G<EFBFBD><18> <09>I<EFBFBD><1D><0E>I<EFBFBD>
B<EFBFBD>C<EFBFBD><19>M<EFBFBD> <0F> "<22> <15>k<EFBFBD>4<EFBFBD>:<3A>:<3A>{<7B> ;<3B> =<3D><14>X<EFBFBD> <1E><18><14> <1E> <11>4<EFBFBD>L<EFBFBD>

<EFBFBD> <06>Fr+c<00><><00>]tRt^BtRtRtRtR.tR.tR.t Rt
Rt RR ] P3R
]3R ]3R ]3R ]3R]3R]3R]3R]3R]3R]3R]3]!] RR7]3R]P&3R]3R]3R]3R]3./tRtR#)rz^
Lexer for IETF 7405 ABNF.
(Updates `5234 <http://www.ietf.org/rfc/rfc5234.txt>`_) grammars.
<EFBFBD>ABNFz#http://www.ietf.org/rfc/rfc7405.txt<78>abnfz*.abnfz text/x-abnfrrz;.*$z(%[si])?"[^"]*"z%b[01]+\-[01]+\bz%b[01]+(\.[01]+)*\bz%d[0-9]+\-[0-9]+\bz%d[0-9]+(\.[0-9]+)*\bz%x[0-9a-fA-F]+\-[0-9a-fA-F]+\bz!%x[0-9a-fA-F]+(\.[0-9a-fA-F]+)*\bz\b[0-9]+\*[0-9]+z
\b[0-9]+\*z\b[0-9]+<2B>\*<2A>\b<><01>suffixz[a-zA-Z][a-zA-Z0-9-]*\bz(=/|=|/)z[\[\]()]<5D>\s+rrN)<10>ALPHA<48>BIT<49>CHAR<41>CR<43>CRLF<4C>CTL<54>DIGIT<49>DQUOTE<54>HEXDIG<49>HTAB<41>LF<4C>LWSP<53>OCTET<45>SP<53>VCHAR<41>WSP)rrrr r!r"r&r#r$r%r'<00> _core_rulesr<00>Singler
r rr r r(rrrr)r*rr+r,rrBs<><00><00><08> <12>D<EFBFBD>
/<2F>C<EFBFBD><15>h<EFBFBD>G<EFBFBD><19>
<EFBFBD>I<EFBFBD><1E><0F>I<EFBFBD><19>M<EFBFBD><1E>K<EFBFBD> <0F> <14>g<EFBFBD>n<EFBFBD>n<EFBFBD> %<25> <20><17> )<29>!<21>'<27> *<2A> #<23>W<EFBFBD> -<2D>#<23>G<EFBFBD> ,<2C> %<25>w<EFBFBD> /<2F>/<2F><07> 8<> 1<>7<EFBFBD> ;<3B>!<21>(<28> +<2B> <1A>H<EFBFBD> %<25> <18>(<28> #<23> <12>H<EFBFBD> <1D><13>;<3B>u<EFBFBD> -<2D>w<EFBFBD> 7<>(<28><14><1A><1A> 4<><19>(<28> #<23><19>+<2B> &<26><14>Z<EFBFBD> <20> <11>4<EFBFBD>L<EFBFBD>S*
<EFBFBD>,<06>Fr+c<00><00>]tRt^<5E>tRtRtRtR.tR.t.R4Ot Rt
R] !R4] !R 4.RR
] PR 3R ] P3R ] P3.R R] P3R]3R]3R]3R]P(3R]P,R3R]P.R3]!R5RR7]P43R]P4R3R]!]]P:]43R]R3R]3. RR]P,R3R ]P>3R!]P,3.RR"]P.R3R ]P>3R#]P.3.RR]R3R]3R$]3R%]P@3.RR&]R3R']3R]3R(]!]P@]]43R)]PB3.R R*] PR3R+]!]] P]] PD]]#!]$R,R-743R.]!] P] PD43R/] P3.R,R0]!]] P43] !R 4R1] P3./ t%R2t&R3#)6rz&
For JSpeech Grammar Format grammars.
<EFBFBD>JSGFzhttps://www.w3.org/TR/jsgf/<2F>jsgfz*.jsgfz2.2r<00>commentsz non-commentsz
/\*\*(?!/)zdocumentation commentz/\*[\w\W]*?\*/z//.*$z \A#JSGF[^;]*r4<00>;z [=|()\[\]*+]z/[^/]+/<2F>"<22>stringz\{<7B>tagr1r2z grammar\bz grammar namez(<)(NULL|VOID)(>)<29><<3C>rulenamez\w+|[^\s;=|()\[\]*+/"{<\w]+z#popz\\.z[^\\"]+z\}z[^\\}]+<2B>\.z[^;\s.]+<2B>>r0z([^.>]+)(\s*)(\.)z[^.>]+z\*/zH^(\s*)(\*?)(\s*)(@(?:example|see))(\s+)([\w\W]*?(?=(?:^\s*\*?\s*@|\*/)))<29>example)<01>statez(^\s*\*?\s*)(@\S*)z[^*\n@]+|\w|\Wz (\n\s*)(\*)rrN)zapplication/jsgfzapplication/x-jsgfz text/jsgf)<02>import<72>public)'rrrr r!r"r&r#r$r%r'rr<00> MultilinerF<00>Preprocrrr r <00>Floatr<00>Double<6C>Otherrr <00>Reservedrr <00>Builtinr<00>Escape<70> Namespace<63>Constant<6E>Specialrrr)r*rr+r,rr<00>s<><00><00><08> <12>D<EFBFBD>
'<27>C<EFBFBD><15>h<EFBFBD>G<EFBFBD><19>
<EFBFBD>I<EFBFBD>G<>I<EFBFBD><19>M<EFBFBD> <0F> <13>J<EFBFBD> <1F> <13>N<EFBFBD> #<23>
<EFBFBD> <13> <1A>G<EFBFBD>-<2D>-<2D>/F<> G<> <1E><07> 1<> 1<> 2<> <15>w<EFBFBD>~<7E>~<7E> &<26>
<EFBFBD>
<17> <1C>g<EFBFBD>o<EFBFBD>o<EFBFBD> .<2E> <13>Z<EFBFBD> <20> <11>;<3B> <1F> <1C>h<EFBFBD> '<27> <17><16><1C><1C> &<26> <11>6<EFBFBD>=<3D>=<3D>(<28> +<2B> <12>F<EFBFBD>L<EFBFBD>L<EFBFBD>%<25> (<28> <12>'<27><05> 6<><07>8H<38>8H<38> I<> <19>7<EFBFBD>+<2B>+<2B>^<5E> <<3C> !<21> <15>k<EFBFBD>4<EFBFBD><<3C><<3C><1B> =<3D> ?<3F> <11>;<3B>
<EFBFBD> +<2B> +<2B>T<EFBFBD> 2<>
<EFBFBD> <11> <11>6<EFBFBD>=<3D>=<3D>&<26> )<29> <13>V<EFBFBD>]<5D>]<5D> #<23> <17><16><1D><1D> '<27>
<EFBFBD>
<0E> <12>F<EFBFBD>L<EFBFBD>L<EFBFBD>&<26> )<29> <13>V<EFBFBD>]<5D>]<5D> #<23> <17><16><1C><1C> &<26>
<EFBFBD>
<17> <11>;<3B><06> '<27> <13>Z<EFBFBD> <20> <12>K<EFBFBD> <20> <18>$<24>.<2E>.<2E> )<29> 
<EFBFBD> <13> <11>;<3B><06> '<27> <12>K<EFBFBD> <20> <13>Z<EFBFBD> <20> !<21>8<EFBFBD>D<EFBFBD>N<EFBFBD>N<EFBFBD>D<EFBFBD>+<2B>#N<> O<> <16><04> <0A> <0A> &<26> 
<EFBFBD> <20> <13>W<EFBFBD>&<26>&<26><06> /<2F>2<> <15>j<EFBFBD>'<27>"3<>"3<>Z<EFBFBD><17><1F><1F> <20>%<25><04>I<EFBFBD>"><3E>@<01> A<01>#<23> <15>g<EFBFBD>'<27>'<27><17><1F><1F> 9<> ;<3B> <1E><07> 1<> 1<> 2<> "
<EFBFBD> <12> <1B>X<EFBFBD>j<EFBFBD>'<27>2C<32>2C<32>D<> E<> <13>N<EFBFBD> #<23> <11>7<EFBFBD>$<24>$<24> %<25>
<EFBFBD>u?<06>Fr+c <00><><00>]tRt^<5E>tRtRtRtR.tR.tR.t Rt
RR ] P3R
] 3R ]3R ]3R ]!]]]43R]P$3R]P3R]P(3R]3. /tRtR#)ru<>
This lexer is for Parsing Expression Grammars (PEG).
Various implementations of PEG have made different decisions
regarding the syntax, so let's try to be accommodating:
* `<-`, `←`, `:`, and `=` are all accepted as rule operators.
* Both `|` and `/` are choice operators.
* `^`, `↑`, and `~` are cut operators.
* A single `a-z` character immediately before a string, or
multiple `a-z` characters following a string, are part of the
string (e.g., `r"..."` or `"..."ilmsuxa`).
<EFBFBD>PEGz#https://bford.info/pub/lang/peg.pdf<64>pegz*.pegz
text/x-pegz2.6rz#.*$u<-|[←:=/|&!?*+^↑~]z[()]rQz (\[)([^\]]*(?:\\.[^\]\\]*)*)(\])z$[a-z]?"[^"\\]*(?:\\.[^"\\]*)*"[a-z]*z$[a-z]?'[^'\\]*(?:\\.[^'\\]*)*'[a-z]*u#[^\s<←:=/|&!?*+\^↑~()\[\]"\'#]+rrN)rrrr r!r"r&r#r$r%r'rrFr rr rrrZr r(rr)r*rr+r,rr<00>s<><00><00><08>" <11>D<EFBFBD>
/<2F>C<EFBFBD><14>g<EFBFBD>G<EFBFBD><18> <09>I<EFBFBD><1D><0E>I<EFBFBD><19>M<EFBFBD> <0F> <14>g<EFBFBD>n<EFBFBD>n<EFBFBD> %<25>'<27><08> 1<><15>k<EFBFBD> "<22><13>G<EFBFBD> <1C>1<> <15>k<EFBFBD>6<EFBFBD>;<3B> 7<> 9<>5<>f<EFBFBD>m<EFBFBD>m<EFBFBD> D<> 4<>f<EFBFBD>m<EFBFBD>m<EFBFBD> D<>4<>T<EFBFBD>Z<EFBFBD>Z<EFBFBD> @<40><12>4<EFBFBD>L<EFBFBD>3
<EFBFBD><06>Fr+N)rrrr)r!<00>pygments.lexerrrrrrr<00>pygments.tokenrr r
r r r rrrr<00>__all__rrrrrr+r,<00><module>rhs^<00><01><04>M<01>L<>4<>4<>4<> =<3D><07>-<06>z<EFBFBD>-<06>`?<06>
<EFBFBD>?<06>DJ<06>
<EFBFBD>J<06>Z5<06>z<EFBFBD>5r+