Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison pygments_lexer_pseudocode2/lexers/algpseudocode.py @ 282:90946f87d77d
Rename RE group "character" -> "characters"
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 20 May 2026 17:28:22 +0200 |
| parents | ee512932d603 |
| children | 5eba722df93e |
comparison
equal
deleted
inserted
replaced
| 281:ee512932d603 | 282:90946f87d77d |
|---|---|
| 224 # Be more error friendly | 224 # Be more error friendly |
| 225 toktype = Generic.Error | 225 toktype = Generic.Error |
| 226 val = match.group() | 226 val = match.group() |
| 227 _logger.warning("Unhandled explicit token type: %s", val) | 227 _logger.warning("Unhandled explicit token type: %s", val) |
| 228 else: | 228 else: |
| 229 val = match.group("character") | 229 val = match.group("characters") |
| 230 yield match.start(), toktype, val | 230 yield match.start(), toktype, val |
| 231 if ctx: | 231 if ctx: |
| 232 ctx.pos = match.end() | 232 ctx.pos = match.end() |
| 233 | 233 |
| 234 tokens = { | 234 tokens = { |
| 491 # All these REs are CASE-SENSITIVE! | 491 # All these REs are CASE-SENSITIVE! |
| 492 | 492 |
| 493 # Multiple characters possible, but no escaping! | 493 # Multiple characters possible, but no escaping! |
| 494 (r"""\\ttx\-(?P<type>[a-zA-Z0-9_-]+?)""" | 494 (r"""\\ttx\-(?P<type>[a-zA-Z0-9_-]+?)""" |
| 495 r"""(?P<sep>[/?.,:;%|=*+!\\$~"'#@_-])""" | 495 r"""(?P<sep>[/?.,:;%|=*+!\\$~"'#@_-])""" |
| 496 r"""(?P<character>(.|\n)+?)(?P=sep)""", | 496 r"""(?P<characters>(.|\n)+?)(?P=sep)""", |
| 497 op_explicit_tokentype), | 497 op_explicit_tokentype), |
| 498 (r"\\ttx\-(?P<type>[a-zA-Z0-9_-]+?)\{(?P<character>[^}]+?)\}", | 498 (r"\\ttx\-(?P<type>[a-zA-Z0-9_-]+?)\{(?P<characters>[^}]+?)\}", |
| 499 op_explicit_tokentype), | 499 op_explicit_tokentype), |
| 500 (r"\\ttx\-(?P<type>[a-zA-Z0-9_-]+?)\((?P<character>[^)]+?)\)", | 500 (r"\\ttx\-(?P<type>[a-zA-Z0-9_-]+?)\((?P<characters>[^)]+?)\)", |
| 501 op_explicit_tokentype), | 501 op_explicit_tokentype), |
| 502 (r"\\ttx\-(?P<type>[a-zA-Z0-9_-]+?)<(?P<character>[^>]+?)>", | 502 (r"\\ttx\-(?P<type>[a-zA-Z0-9_-]+?)<(?P<characters>[^>]+?)>", |
| 503 op_explicit_tokentype), | 503 op_explicit_tokentype), |
| 504 (r"\\ttx\-(?P<type>[a-zA-Z0-9_-]+?)\[(?P<character>[^\]]+?)\]", | 504 (r"\\ttx\-(?P<type>[a-zA-Z0-9_-]+?)\[(?P<characters>[^\]]+?)\]", |
| 505 op_explicit_tokentype), | 505 op_explicit_tokentype), |
| 506 | 506 |
| 507 # Every character is possible: no escaping needed! | 507 # Every character is possible: no escaping needed! |
| 508 (r"\\tt-(?P<type>[^/]+?)/(?P<character>(?:.|\n))", | 508 (r"\\tt-(?P<type>[^/]+?)/(?P<characters>(?:.|\n))", |
| 509 op_explicit_tokentype), | 509 op_explicit_tokentype), |
| 510 ], | 510 ], |
| 511 } | 511 } |
| 512 | 512 |
| 513 def __init__(self, **options): | 513 def __init__(self, **options): |
