Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison pygments_lexer_pseudocode2/algpseudocode.py @ 80:f487f0d322a5
Move "expr-in-braces" up to "expr".
Because the blocks are similar make them neighbours.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 30 Apr 2026 09:51:30 +0200 |
| parents | abb2e8c65d0f |
| children | 6d8b813fb296 |
comparison
equal
deleted
inserted
replaced
| 79:c14e5fd4d193 | 80:f487f0d322a5 |
|---|---|
| 225 include("remark"), | 225 include("remark"), |
| 226 include("text-operators"), | 226 include("text-operators"), |
| 227 include("math-builtins"), | 227 include("math-builtins"), |
| 228 include("py-name"), | 228 include("py-name"), |
| 229 ], | 229 ], |
| 230 "block-expr": [ # somewhat similar to "root" | |
| 231 (r"\}", LexBase.op_ignore, "#pop"), | |
| 232 (r"\n", Whitespace), | |
| 233 include("expr-in-braces"), | |
| 234 (r"\\\\", LexBase.op_fixed(Text, "\\")), | |
| 235 (r"\\", LexBase.op_fixed(Text, "\\")), | |
| 236 (r"\s+", Text), | |
| 237 ], | |
| 238 "text-statement": [ # like block but default to text-mode | |
| 239 (r"[^\\}\n]+", Text), | |
| 240 (r"\}", LexBase.op_ignore, "#pop"), | |
| 241 (r"\n", Whitespace), | |
| 242 (r"\\\}", LexBase.op_fixed(Text, "}")), | |
| 243 (r"(?i)\\expr(?:ession)?\s*\{", | |
| 244 LexBase.op_ignore, | |
| 245 "block-expr"), | |
| 246 include("remark"), | |
| 247 (r"\\\\", LexBase.op_fixed(Text, "\\")), | |
| 248 (r"\\", LexBase.op_fixed(Text, "\\")), | |
| 249 ], | |
| 250 "expr-in-braces": [ | 230 "expr-in-braces": [ |
| 251 include("punctuation-in-braces"), | 231 include("punctuation-in-braces"), |
| 252 include("py-strings"), | 232 include("py-strings"), |
| 253 include("py-numbers"), | 233 include("py-numbers"), |
| 254 (r"(?i)\\text\s*\{", LexBase.op_ignore, "text-in-expr"), | 234 (r"(?i)\\text\s*\{", LexBase.op_ignore, "text-in-expr"), |
| 255 include("remark"), | 235 include("remark"), |
| 256 include("text-operators"), | 236 include("text-operators"), |
| 257 include("math-builtins"), | 237 include("math-builtins"), |
| 258 include("py-name"), | 238 include("py-name"), |
| 239 ], | |
| 240 "block-expr": [ # somewhat similar to "root" | |
| 241 (r"\}", LexBase.op_ignore, "#pop"), | |
| 242 (r"\n", Whitespace), | |
| 243 include("expr-in-braces"), | |
| 244 (r"\\\\", LexBase.op_fixed(Text, "\\")), | |
| 245 (r"\\", LexBase.op_fixed(Text, "\\")), | |
| 246 (r"\s+", Text), | |
| 247 ], | |
| 248 "text-statement": [ # like block but default to text-mode | |
| 249 (r"[^\\}\n]+", Text), | |
| 250 (r"\}", LexBase.op_ignore, "#pop"), | |
| 251 (r"\n", Whitespace), | |
| 252 (r"\\\}", LexBase.op_fixed(Text, "}")), | |
| 253 (r"(?i)\\expr(?:ession)?\s*\{", | |
| 254 LexBase.op_ignore, | |
| 255 "block-expr"), | |
| 256 include("remark"), | |
| 257 (r"\\\\", LexBase.op_fixed(Text, "\\")), | |
| 258 (r"\\", LexBase.op_fixed(Text, "\\")), | |
| 259 ], | 259 ], |
| 260 "text-in-expr": [ | 260 "text-in-expr": [ |
| 261 (r"[^\\}\n]+", Text), | 261 (r"[^\\}\n]+", Text), |
| 262 (r"\}", LexBase.op_ignore, "#pop"), | 262 (r"\}", LexBase.op_ignore, "#pop"), |
| 263 (r"\n", Whitespace), | 263 (r"\n", Whitespace), |
