Files
intellecton/venv/lib/python3.12/site-packages/pygments/__pycache__/scanner.cpython-312.pyc
T

76 lines
4.6 KiB
Plaintext
Raw Normal View History

Ë
j ãó:dZddlZGdde«ZGdd«Zy)a
pygments.scanner
~~~~~~~~~~~~~~~~
This library implements a regex based scanner. Some languages
like Pascal are easy to parse but have some keywords that
depend on the context. Because of this it's impossible to lex
that just by using a regular expression lexer like the
`RegexLexer`.
Have a look at the `DelphiLexer` to get an idea of how to use
this scanner.
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
éNcóeZdZdZy)Ú EndOfTextzZ
Raise if end of text is reached and the user
tried to call a match function.
N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__©óúS/home/antigravity/intellecton/venv/lib/python3.12/site-packages/pygments/scanner.pyrrsòr
rcóbeZdZdZd
dZdZeeej«ZdZdZdZ dZ
dZ y ) ÚScannerzp
Simple scanner
All method patterns are regular expression strings (not
compiled expressions!)
có†||_t|«|_d|_d|_||_d|_d|_i|_y)z{
:param text: The text which should be scanned
:param flags: default regular expression flags
rN) ÚdataÚlenÚ data_lengthÚ start_posÚposÚflagsÚlastÚmatchÚ _re_cache)ÚselfÚtextrs r Ú__init__zScanner.__init__#sAð
ˆŒ ܘt›9ˆÔ؈ŒØˆŒØˆŒ
؈Œ ؈Œ
؈r
có4|j|jk\S)z.`True` if the scanner reached the end of text.)rr©rs r Úeosz Scanner.eos1sàx‰x˜4×+r
có
|jr
t«||jvr-tj||j
«|j|<|j|j
|j|j«S)z“
Apply `pattern` on the current position and return
the match object. (Doesn't touch pos). Use this for
lookahead.
) rrrÚreÚcompilerrrr©rÚpatterns r Úcheckz
Scanner.check6s`ð 8Š8Ü“+Ð Ø ˜$Ÿ.™.Ñ (Ü&(§j¡j°¸$¿*¹*Ó&EˆDN‰N˜ ~‰~˜&×,¨T¯Y©Y¸¿¹ÓAr
có(|j|«duS)zdApply a pattern on the current position and check
if it patches. Doesn't touch pos.
N)r#r!s r Útestz Scanner.testBsðz‰z˜"¨$Ð.r
có²|jr
t«||jvr-tj||j
«|j|<|j |_|j|j
|j|j«}|y|j«|_ |j«|_ |j«|_y)a
Scan the text for the given pattern and update pos/match
and related fields. The return value is a boolean that
indicates if the pattern matched. The matched value is
stored on the instance as ``match``, the last value is
stored as ``last``. ``start_pos`` is the position of the
pointer before the pattern was matched, ``pos`` is the
end position.
FT)rrrrr rrrrrÚstartrÚendÚgroup)rr"Úms r Úscanz Scanner.scanHð 8Š8Ü“+Ð Ø ˜$Ÿ.™.Ñ (Ü&(§j¡j°¸$¿*¹*Ó&EˆDN‰N˜ —JŒ Ø N‰N˜7Ñ )¨$¯)©)°T·X±XÓ Ø ˆ9ØØŸˆŒØ—5‘5“7ˆŒØ—W‘W“YˆŒ
Ør
có&|jd«y)zScan exactly one char.ú.N)r+rs r Úget_charzScanner.get_char_s
à #r
cóbd|jj|j|jfzS)Nz
<%s %d/%d>)Ú __class__rrrrs r Ú__repr__zScanner.__repr__cs1ØØ N‰N× H‰HØ × Ñ ð
ñ
ð
r
N)r) rrrrrrÚpropertyr#r%r+r.r1r r
r r
r
s=ñó ò Ÿ Ó
$€Cò
Bò ò.ó
r