Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison pygments_lexer_pseudocode2/lexers/algpseudocode.py @ 211:33a722c8ae17
"text-in-expr" hat the very same regexps as "text-statement": remove "text-in-expr"
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 13 May 2026 21:22:33 +0200 |
| parents | a4317957148b |
| children | 18553f595b34 |
comparison
equal
deleted
inserted
replaced
| 210:ae0f6dda6e49 | 211:33a722c8ae17 |
|---|---|
| 362 include("escaped-string-start"), | 362 include("escaped-string-start"), |
| 363 include("py-strings"), | 363 include("py-strings"), |
| 364 include("py-numbers"), | 364 include("py-numbers"), |
| 365 (r"(?i)\\(call|name)[ \t]*(\{)", LexBase.op_ignore, "entity-name"), | 365 (r"(?i)\\(call|name)[ \t]*(\{)", LexBase.op_ignore, "entity-name"), |
| 366 (r"(?i)\\gets\b", op_gets), | 366 (r"(?i)\\gets\b", op_gets), |
| 367 (r"(?i)\\text[ \t]*\{", LexBase.op_ignore, "text-in-expr"), | 367 (r"(?i)\\text[ \t]*\{", LexBase.op_ignore, "text-statement"), |
| 368 include("explicit-tokentype"), | 368 include("explicit-tokentype"), |
| 369 include("remark"), | 369 include("remark"), |
| 370 include("keyword-constants"), | 370 include("keyword-constants"), |
| 371 include("word-operators"), | 371 include("word-operators"), |
| 372 include("math-builtins"), | 372 include("math-builtins"), |
| 379 include("escaped-string-start"), | 379 include("escaped-string-start"), |
| 380 include("py-strings"), | 380 include("py-strings"), |
| 381 include("py-numbers"), | 381 include("py-numbers"), |
| 382 (r"(?i)\\(call|name)[ \t]*(\{)", LexBase.op_ignore, "entity-name"), | 382 (r"(?i)\\(call|name)[ \t]*(\{)", LexBase.op_ignore, "entity-name"), |
| 383 (r"(?i)\\gets\b", op_gets), | 383 (r"(?i)\\gets\b", op_gets), |
| 384 (r"(?i)\\text[ \t]*\{", LexBase.op_ignore, "text-in-expr"), | 384 (r"(?i)\\text[ \t]*\{", LexBase.op_ignore, "text-statement"), |
| 385 include("explicit-tokentype"), | 385 include("explicit-tokentype"), |
| 386 include("remark"), | 386 include("remark"), |
| 387 include("keyword-constants"), | 387 include("keyword-constants"), |
| 388 include("word-operators"), | 388 include("word-operators"), |
| 389 include("math-builtins"), | 389 include("math-builtins"), |
| 399 include("unicode-other"), | 399 include("unicode-other"), |
| 400 (r"[^\S\n]+", Text), | 400 (r"[^\S\n]+", Text), |
| 401 (r".", Error), | 401 (r".", Error), |
| 402 ], | 402 ], |
| 403 "text-statement": [ # like block but default to text-mode | 403 "text-statement": [ # like block but default to text-mode |
| 404 (r"[^\\}\n]+", Text), | |
| 405 (r"\}", LexBase.op_ignore, "#pop"), | |
| 406 (r"\n", Whitespace), | |
| 407 (r"\\\}", LexBase.op_fixed(Text, "}")), | |
| 408 (r"(?i)\\expr(?:ession)?[ \t]*\{", | |
| 409 LexBase.op_ignore, | |
| 410 "block-expr"), | |
| 411 include("explicit-tokentype"), | |
| 412 include("remark"), | |
| 413 (r"\\\\", LexBase.op_fixed(Text, "\\")), | |
| 414 (r"\\", LexBase.op_fixed(Text, "\\")), # in text-mode: leave Text | |
| 415 (r".", Error), | |
| 416 ], | |
| 417 "text-in-expr": [ | |
| 418 (r"[^\\}\n]+", Text), | 404 (r"[^\\}\n]+", Text), |
| 419 (r"\}", LexBase.op_ignore, "#pop"), | 405 (r"\}", LexBase.op_ignore, "#pop"), |
| 420 (r"\n", Whitespace), | 406 (r"\n", Whitespace), |
| 421 (r"\\\}", LexBase.op_fixed(Text, "}")), | 407 (r"\\\}", LexBase.op_fixed(Text, "}")), |
| 422 (r"(?i)\\expr(?:ession)?[ \t]*\{", | 408 (r"(?i)\\expr(?:ession)?[ \t]*\{", |
