Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
annotate pygments_lexer_pseudocode2/bases.py @ 34:1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 21 Apr 2026 19:40:08 +0200 |
| parents | db1bc740a201 |
| children | a3151d837258 |
| rev | line source |
|---|---|
|
33
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
1 # -*- coding: utf-8 -*- |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
2 # :- |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
3 # SPDX-FileCopyrightText: © 2026 Franz Glasner |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
4 # SPDX-License-Identifier: MIT |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
5 # :- |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
6 r"""Some common bases for the lexers.""" |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
7 |
|
34
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
8 __all__ = ["LexBase"] |
|
33
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
9 |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
10 |
|
34
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
11 from pygments.lexer import RegexLexer, combined, bygroups, include |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
12 from pygments.token import Number, String |
|
33
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
13 |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
14 |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
15 class LexBase(RegexLexer): |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
16 |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
17 """A base that defines some common lexer states. |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
18 |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
19 Default flags are not important. |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
20 |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
21 """ |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
22 |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
23 # |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
24 # SPDX-SnippetBegin |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
25 # SPDX-License-Identifier: BSD-2-Clause |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
26 # SPDX-SnippetCopyrightText: Copyright 2006-2023 by the Pygments team |
|
34
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
27 # |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
28 def py_innerstring_rules(ttype): |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
29 return [ |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
30 # the old style '%s' % (...) string formatting (still valid in Py3) |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
31 (r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?' |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
32 '[hlL]?[E-GXc-giorsaux%]', String.Interpol), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
33 # the new style '{}'.format(...) string formatting |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
34 (r'\{' |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
35 r'((\w+)((\.\w+)|(\[[^\]]+\]))*)?' # field name |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
36 r'(\![sra])?' # conversion |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
37 r'(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?' |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
38 r'\}', String.Interpol), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
39 # |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
40 # backslashes, quotes and formatting signs must be parsed |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
41 # one at a time |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
42 # |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
43 (r'[^\\\'"%{\n]+', ttype), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
44 (r'[\'"\\]', ttype), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
45 # unhandled string formatting sign |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
46 (r'%|(\{{1,2})', ttype) |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
47 # newlines are an error (use "nl" state) |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
48 ] |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
49 # SPDX-SnippetEnd |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
50 |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
51 tokens = { |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
52 # |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
53 # These states are borrowed from Pygment's Python lexer. |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
54 # Their names have been prefixed with `py-'. |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
55 # |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
56 # SPDX-SnippetBegin |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
57 # SPDX-License-Identifier: BSD-2-Clause |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
58 # SPDX-SnippetCopyrightText: Copyright 2006-2023 by the Pygments team |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
59 # |
|
33
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
60 'py-numbers': [ |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
61 (r'(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)' |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
62 r'([eE][+-]?\d(?:_?\d)*)?', Number.Float), |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
63 (r'\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?', Number.Float), |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
64 (r'0[oO](?:_?[0-7])+', Number.Oct), |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
65 (r'0[bB](?:_?[01])+', Number.Bin), |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
66 (r'0[xX](?:_?[a-fA-F0-9])+', Number.Hex), |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
67 (r'\d(?:_?\d)*', Number.Integer), |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
68 ], |
|
34
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
69 'py-strings': [ |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
70 # non-raw strings |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
71 ('([uU]?)(""")', bygroups(String.Affix, String.Double), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
72 combined('py-stringescape', 'py-tdqs')), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
73 ("([uU]?)(''')", bygroups(String.Affix, String.Single), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
74 combined('py-stringescape', 'py-tsqs')), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
75 ('([uU]?)(")', bygroups(String.Affix, String.Double), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
76 combined('py-stringescape', 'py-dqs')), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
77 ("([uU]?)(')", bygroups(String.Affix, String.Single), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
78 combined('py-stringescape', 'py-sqs')), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
79 # non-raw bytes |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
80 ('([bB])(""")', bygroups(String.Affix, String.Double), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
81 combined('py-bytesescape', 'py-tdqs')), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
82 ("([bB])(''')", bygroups(String.Affix, String.Single), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
83 combined('py-bytesescape', 'py-tsqs')), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
84 ('([bB])(")', bygroups(String.Affix, String.Double), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
85 combined('py-bytesescape', 'py-dqs')), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
86 ("([bB])(')", bygroups(String.Affix, String.Single), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
87 combined('py-bytesescape', 'py-sqs')), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
88 ], |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
89 'py-stringescape': [ |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
90 (r'\\(N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})', String.Escape), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
91 include('py-bytesescape') |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
92 ], |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
93 'py-bytesescape': [ |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
94 (r'\\([\\abfnrtv"\']|\n|x[a-fA-F0-9]{2}|[0-7]{1,3})', |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
95 String.Escape) |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
96 ], |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
97 'py-dqs': [ |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
98 (r'"', String.Double, '#pop'), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
99 (r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
100 include('py-strings-double') |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
101 ], |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
102 'py-sqs': [ |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
103 (r"'", String.Single, '#pop'), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
104 (r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
105 include('py-strings-single') |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
106 ], |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
107 'py-tdqs': [ |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
108 (r'"""', String.Double, '#pop'), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
109 include('py-strings-double'), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
110 (r'\n', String.Double) |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
111 ], |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
112 'py-tsqs': [ |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
113 (r"'''", String.Single, '#pop'), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
114 include('py-strings-single'), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
115 (r'\n', String.Single) |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
116 ], |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
117 'py-strings-single': py_innerstring_rules(String.Single), |
|
1f741934205e
Begin a new Pseudocode lexer using numbers and strings from Python
Franz Glasner <fzglas.hg@dom66.de>
parents:
33
diff
changeset
|
118 'py-strings-double': py_innerstring_rules(String.Double), |
|
33
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
119 # SPDX-SnippetEnd |
|
db1bc740a201
FIX: ADD: Forgotten bases.py.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
120 } |
