mapres 3.dev10__py3-none-any.whl → 3.dev11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mapres/tokenizer.py +17 -19
- {mapres-3.dev10.dist-info → mapres-3.dev11.dist-info}/METADATA +1 -1
- {mapres-3.dev10.dist-info → mapres-3.dev11.dist-info}/RECORD +6 -6
- {mapres-3.dev10.dist-info → mapres-3.dev11.dist-info}/WHEEL +0 -0
- {mapres-3.dev10.dist-info → mapres-3.dev11.dist-info}/licenses/LICENSE +0 -0
- {mapres-3.dev10.dist-info → mapres-3.dev11.dist-info}/top_level.txt +0 -0
mapres/tokenizer.py
CHANGED
|
@@ -50,6 +50,7 @@ class Tokenizer:
|
|
|
50
50
|
self.in_pipe = False
|
|
51
51
|
self.in_percent = False
|
|
52
52
|
self.in_colon = False
|
|
53
|
+
self.escaped = False
|
|
53
54
|
|
|
54
55
|
def peek(self, k=0):
|
|
55
56
|
idx = self.i + k
|
|
@@ -79,27 +80,32 @@ class Tokenizer:
|
|
|
79
80
|
|
|
80
81
|
# ESCAPES
|
|
81
82
|
if self.match(r'\:'):
|
|
82
|
-
buf.append(':'); self.advance(2); continue
|
|
83
|
+
buf.append(':'); self.advance(2); self.escaped = True; continue
|
|
83
84
|
if self.match(r'\<'):
|
|
84
|
-
buf.append('<'); self.advance(2); continue
|
|
85
|
+
buf.append('<'); self.advance(2); self.escaped = True; continue
|
|
85
86
|
if self.match(r'\>'):
|
|
86
|
-
buf.append('>'); self.advance(2); continue
|
|
87
|
+
buf.append('>'); self.advance(2); self.escaped = True; continue
|
|
87
88
|
if self.match(r'\%'):
|
|
88
|
-
buf.append('%'); self.advance(2); continue
|
|
89
|
+
buf.append('%'); self.advance(2); self.escaped = True; continue
|
|
89
90
|
if self.match(r'\$'):
|
|
90
|
-
buf.append('$'); self.advance(2); continue
|
|
91
|
+
buf.append('$'); self.advance(2); self.escaped = True; continue
|
|
91
92
|
if self.match(r'\{'):
|
|
92
|
-
buf.append('{'); self.advance(2); continue
|
|
93
|
+
buf.append('{'); self.advance(2); self.escaped = True; continue
|
|
93
94
|
if self.match(r'\}'):
|
|
94
|
-
buf.append('}'); self.advance(2); continue
|
|
95
|
+
buf.append('}'); self.advance(2); self.escaped = True; continue
|
|
95
96
|
if self.match(r'\|'):
|
|
96
|
-
buf.append('|'); self.advance(2); continue
|
|
97
|
+
buf.append('|'); self.advance(2); self.escaped = True; continue
|
|
97
98
|
if self.match(r'\('):
|
|
98
|
-
buf.append('('); self.advance(2); continue
|
|
99
|
+
buf.append('('); self.advance(2); self.escaped = True; continue
|
|
99
100
|
if self.match(r'\)'):
|
|
100
|
-
buf.append(')'); self.advance(2); continue
|
|
101
|
+
buf.append(')'); self.advance(2); self.escaped = True; continue
|
|
102
|
+
|
|
103
|
+
if self.escaped:
|
|
104
|
+
buf.append(ch)
|
|
105
|
+
self.escaped = False
|
|
106
|
+
self.advance()
|
|
107
|
+
continue
|
|
101
108
|
|
|
102
|
-
# DOUBLE BRACES {{value}}
|
|
103
109
|
if self.match("{{"):
|
|
104
110
|
flush_text()
|
|
105
111
|
self.emit(TokenType.BRACE_OPEN)
|
|
@@ -112,7 +118,6 @@ class Tokenizer:
|
|
|
112
118
|
self.advance(2)
|
|
113
119
|
continue
|
|
114
120
|
|
|
115
|
-
# DOLLARS ${value}
|
|
116
121
|
if self.match("${"):
|
|
117
122
|
flush_text()
|
|
118
123
|
self.emit(TokenType.DOLLAR_OPEN)
|
|
@@ -125,7 +130,6 @@ class Tokenizer:
|
|
|
125
130
|
self.advance()
|
|
126
131
|
continue
|
|
127
132
|
|
|
128
|
-
# ANGLES <value>
|
|
129
133
|
if self.match("<"):
|
|
130
134
|
flush_text()
|
|
131
135
|
self.emit(TokenType.ANGLE_OPEN)
|
|
@@ -138,7 +142,6 @@ class Tokenizer:
|
|
|
138
142
|
self.advance()
|
|
139
143
|
continue
|
|
140
144
|
|
|
141
|
-
# PIPES |value|
|
|
142
145
|
if self.match("|"):
|
|
143
146
|
flush_text()
|
|
144
147
|
if not self.in_pipe:
|
|
@@ -150,7 +153,6 @@ class Tokenizer:
|
|
|
150
153
|
self.advance()
|
|
151
154
|
continue
|
|
152
155
|
|
|
153
|
-
# PERCENTS %value%
|
|
154
156
|
if self.match("%"):
|
|
155
157
|
flush_text()
|
|
156
158
|
if not self.in_percent:
|
|
@@ -162,7 +164,6 @@ class Tokenizer:
|
|
|
162
164
|
self.advance()
|
|
163
165
|
continue
|
|
164
166
|
|
|
165
|
-
# COLONS :value:
|
|
166
167
|
if self.match(":"):
|
|
167
168
|
flush_text()
|
|
168
169
|
if not self.in_colon:
|
|
@@ -174,7 +175,6 @@ class Tokenizer:
|
|
|
174
175
|
self.advance()
|
|
175
176
|
continue
|
|
176
177
|
|
|
177
|
-
# PARENTHESES
|
|
178
178
|
if ch == "(":
|
|
179
179
|
flush_text()
|
|
180
180
|
self.emit(TokenType.LPAREN)
|
|
@@ -187,7 +187,6 @@ class Tokenizer:
|
|
|
187
187
|
self.advance()
|
|
188
188
|
continue
|
|
189
189
|
|
|
190
|
-
# IDENTIFIERS (with dots)
|
|
191
190
|
if ch.isalpha():
|
|
192
191
|
flush_text()
|
|
193
192
|
start = self.i
|
|
@@ -197,7 +196,6 @@ class Tokenizer:
|
|
|
197
196
|
self.emit(TokenType.IDENT, ident)
|
|
198
197
|
continue
|
|
199
198
|
|
|
200
|
-
# DEFAULT: TEXT
|
|
201
199
|
buf.append(ch)
|
|
202
200
|
self.advance()
|
|
203
201
|
|
|
@@ -7,12 +7,12 @@ mapres/exceptions.py,sha256=jirHKK5yCffSCWWkgZY_gTSIOaFCmXOe5NJJf60HeeQ,130
|
|
|
7
7
|
mapres/layers.py,sha256=sFc1eUOBg2BoB2cBXIleq8RMYcg5GZpUoCnGh-uKN6U,1380
|
|
8
8
|
mapres/parser.py,sha256=8XLCzYosvh81bN-Jddc1AM4w0X7bsHnBzmA8sq5_72w,4018
|
|
9
9
|
mapres/resolver.py,sha256=LOAnuNc1RW97eBXughkEPK90MntMSYa7yC8s1EJPVvA,3134
|
|
10
|
-
mapres/tokenizer.py,sha256=
|
|
10
|
+
mapres/tokenizer.py,sha256=zVztowsVTMJzb0my4p3ba-J4wh1Tyt1gdHIIscxfm6Q,5817
|
|
11
11
|
mapres/maps/__init__.py,sha256=lIRRfem1Fw4iynuwUQ7BY5qrC4fbJKxqLivao2_Dtm4,239
|
|
12
12
|
mapres/maps/color.py,sha256=noRTGFNo9xLl5YEhX0tttV6i_oDAiptXmRVnkr5EzwM,1348
|
|
13
13
|
mapres/maps/time.py,sha256=TyncycYoIGVZWps32qWlFy2a2hTayvZWVHu9uh2nid8,2050
|
|
14
|
-
mapres-3.
|
|
15
|
-
mapres-3.
|
|
16
|
-
mapres-3.
|
|
17
|
-
mapres-3.
|
|
18
|
-
mapres-3.
|
|
14
|
+
mapres-3.dev11.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
15
|
+
mapres-3.dev11.dist-info/METADATA,sha256=7XVIAYdOAvC8pPOj-vUb67hNpMa_pV2aDUq7Jzxyw-M,1476
|
|
16
|
+
mapres-3.dev11.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
17
|
+
mapres-3.dev11.dist-info/top_level.txt,sha256=5LMVQqJdtyjxfzv7wJBOZ-360m0Yc79w_-Y7s3n6cTw,7
|
|
18
|
+
mapres-3.dev11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|