Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison pygments_lexer_pseudocode2/algpseudocode.py @ 77:1a5e192aa950
Move popping states consistently more to the begin
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 30 Apr 2026 09:24:46 +0200 |
| parents | 27e12387154d |
| children | abb2e8c65d0f |
comparison
equal
deleted
inserted
replaced
| 76:27e12387154d | 77:1a5e192aa950 |
|---|---|
| 194 (r"(?i)\\(remark|rem)\b(.*)$", | 194 (r"(?i)\\(remark|rem)\b(.*)$", |
| 195 bygroups(op_symbol(Comment.Single), Comment.Single)), | 195 bygroups(op_symbol(Comment.Single), Comment.Single)), |
| 196 ], | 196 ], |
| 197 "entity-name": [ # may be multiline | 197 "entity-name": [ # may be multiline |
| 198 (r"[^\\}]+", Name.Entity), | 198 (r"[^\\}]+", Name.Entity), |
| 199 (r"\}", LexBase.op_ignore, "#pop"), | |
| 199 (r"\\\}", LexBase.op_fixed(Name.Entity, "}")), | 200 (r"\\\}", LexBase.op_fixed(Name.Entity, "}")), |
| 200 (r"\\\\", LexBase.op_fixed(Name.Entity, "\\")), | 201 (r"\\\\", LexBase.op_fixed(Name.Entity, "\\")), |
| 201 (r"\\", LexBase.op_fixed(Name.Entity, "\\")), | 202 (r"\\", LexBase.op_fixed(Name.Entity, "\\")), |
| 202 (r"\}", LexBase.op_ignore, "#pop"), | |
| 203 ], | 203 ], |
| 204 "entity-name-end": [ # may be multiline -- suppressed if no_end | 204 "entity-name-end": [ # may be multiline -- suppressed if no_end |
| 205 (r"[^\\}]+", op_opt_ignore(Name.Entity)), | 205 (r"[^\\}]+", op_opt_ignore(Name.Entity)), |
| 206 (r"\}", LexBase.op_ignore, "#pop"), | |
| 206 (r"\\\}", op_opt_ignore_or_fixed(Name.Entity, "}")), | 207 (r"\\\}", op_opt_ignore_or_fixed(Name.Entity, "}")), |
| 207 (r"\\\\", op_opt_ignore_or_fixed(Name.Entity, "\\")), | 208 (r"\\\\", op_opt_ignore_or_fixed(Name.Entity, "\\")), |
| 208 (r"\\", op_opt_ignore_or_fixed(Name.Entity, "\\")), | 209 (r"\\", op_opt_ignore_or_fixed(Name.Entity, "\\")), |
| 209 (r"\}", LexBase.op_ignore, "#pop"), | |
| 210 ], | 210 ], |
| 211 "expr": [ | 211 "expr": [ |
| 212 include("punctuation"), | 212 include("punctuation"), |
| 213 include("py-strings"), | 213 include("py-strings"), |
| 214 include("py-numbers"), | 214 include("py-numbers"), |
| 235 include("text-operators"), | 235 include("text-operators"), |
| 236 include("math-builtins"), | 236 include("math-builtins"), |
| 237 include("py-name"), | 237 include("py-name"), |
| 238 ], | 238 ], |
| 239 "text-in-expr": [ | 239 "text-in-expr": [ |
| 240 (r"[^\\}]+", Text), | 240 (r"[^\\}\n]+", Text), |
| 241 (r"\}", LexBase.op_ignore, "#pop"), | |
| 242 (r"\n", Whitespace), | |
| 241 (r"\\\}", LexBase.op_fixed(Text, "}")), | 243 (r"\\\}", LexBase.op_fixed(Text, "}")), |
| 242 (r"\\", LexBase.op_fixed(Text, "\\")), | 244 (r"\\", LexBase.op_fixed(Text, "\\")), |
| 243 (r"\}", LexBase.op_ignore, "#pop"), | |
| 244 ], | 245 ], |
| 245 "math-builtins": [ | 246 "math-builtins": [ |
| 246 (words(("sqrt", "pow", "cos", "sin", "tan", "arcos", "arcsin", | 247 (words(("sqrt", "pow", "cos", "sin", "tan", "arcos", "arcsin", |
| 247 "arctan", "arctan2", "mod", "exp", "ln", "log"), | 248 "arctan", "arctan2", "mod", "exp", "ln", "log"), |
| 248 prefix=r"(?<!\.)", | 249 prefix=r"(?<!\.)", |
