mapres 3.dev11__tar.gz → 3.dev12__tar.gz
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-3.dev11/src/mapres.egg-info → mapres-3.dev12}/PKG-INFO +1 -1
- {mapres-3.dev11 → mapres-3.dev12}/pyproject.toml +1 -1
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/tokenizer.py +10 -27
- {mapres-3.dev11 → mapres-3.dev12/src/mapres.egg-info}/PKG-INFO +1 -1
- {mapres-3.dev11 → mapres-3.dev12}/LICENSE +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/README.md +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/setup.cfg +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/__init__.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/ast.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/cache.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/datamap.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/evaluator.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/exceptions.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/layers.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/maps/__init__.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/maps/color.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/maps/time.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/parser.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres/resolver.py +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres.egg-info/SOURCES.txt +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres.egg-info/dependency_links.txt +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres.egg-info/requires.txt +0 -0
- {mapres-3.dev11 → mapres-3.dev12}/src/mapres.egg-info/top_level.txt +0 -0
|
@@ -4,25 +4,18 @@ from enum import Enum, auto
|
|
|
4
4
|
class TokenType(Enum):
|
|
5
5
|
TEXT = auto()
|
|
6
6
|
IDENT = auto()
|
|
7
|
-
|
|
8
7
|
COLON_OPEN = auto()
|
|
9
8
|
COLON_CLOSE = auto()
|
|
10
|
-
|
|
11
9
|
BRACE_OPEN = auto()
|
|
12
10
|
BRACE_CLOSE = auto()
|
|
13
|
-
|
|
14
11
|
DOLLAR_OPEN = auto()
|
|
15
12
|
DOLLAR_CLOSE = auto()
|
|
16
|
-
|
|
17
13
|
ANGLE_OPEN = auto()
|
|
18
14
|
ANGLE_CLOSE = auto()
|
|
19
|
-
|
|
20
15
|
PIPE_OPEN = auto()
|
|
21
16
|
PIPE_CLOSE = auto()
|
|
22
|
-
|
|
23
17
|
PERCENT_OPEN = auto()
|
|
24
18
|
PERCENT_CLOSE = auto()
|
|
25
|
-
|
|
26
19
|
LPAREN = auto()
|
|
27
20
|
RPAREN = auto()
|
|
28
21
|
|
|
@@ -45,12 +38,9 @@ class Tokenizer:
|
|
|
45
38
|
self.i = 0
|
|
46
39
|
self.n = len(text)
|
|
47
40
|
self.tokens = []
|
|
48
|
-
|
|
49
|
-
# state for single-char paired delimiters
|
|
50
41
|
self.in_pipe = False
|
|
51
42
|
self.in_percent = False
|
|
52
43
|
self.in_colon = False
|
|
53
|
-
self.escaped = False
|
|
54
44
|
|
|
55
45
|
def peek(self, k=0):
|
|
56
46
|
idx = self.i + k
|
|
@@ -78,33 +68,26 @@ class Tokenizer:
|
|
|
78
68
|
while self.i < self.n:
|
|
79
69
|
ch = self.peek()
|
|
80
70
|
|
|
81
|
-
# ESCAPES
|
|
82
71
|
if self.match(r'\:'):
|
|
83
|
-
buf.append(':'); self.advance(2);
|
|
72
|
+
buf.append(':'); self.advance(2); continue
|
|
84
73
|
if self.match(r'\<'):
|
|
85
|
-
buf.append('<'); self.advance(2);
|
|
74
|
+
buf.append('<'); self.advance(2); continue
|
|
86
75
|
if self.match(r'\>'):
|
|
87
|
-
buf.append('>'); self.advance(2);
|
|
76
|
+
buf.append('>'); self.advance(2); continue
|
|
88
77
|
if self.match(r'\%'):
|
|
89
|
-
buf.append('%'); self.advance(2);
|
|
78
|
+
buf.append('%'); self.advance(2); continue
|
|
90
79
|
if self.match(r'\$'):
|
|
91
|
-
buf.append('$'); self.advance(2);
|
|
80
|
+
buf.append('$'); self.advance(2); continue
|
|
92
81
|
if self.match(r'\{'):
|
|
93
|
-
buf.append('{'); self.advance(2);
|
|
82
|
+
buf.append('{'); self.advance(2); continue
|
|
94
83
|
if self.match(r'\}'):
|
|
95
|
-
buf.append('}'); self.advance(2);
|
|
84
|
+
buf.append('}'); self.advance(2); continue
|
|
96
85
|
if self.match(r'\|'):
|
|
97
|
-
buf.append('|'); self.advance(2);
|
|
86
|
+
buf.append('|'); self.advance(2); continue
|
|
98
87
|
if self.match(r'\('):
|
|
99
|
-
buf.append('('); self.advance(2);
|
|
88
|
+
buf.append('('); self.advance(2); continue
|
|
100
89
|
if self.match(r'\)'):
|
|
101
|
-
buf.append(')'); self.advance(2);
|
|
102
|
-
|
|
103
|
-
if self.escaped:
|
|
104
|
-
buf.append(ch)
|
|
105
|
-
self.escaped = False
|
|
106
|
-
self.advance()
|
|
107
|
-
continue
|
|
90
|
+
buf.append(')'); self.advance(2); continue
|
|
108
91
|
|
|
109
92
|
if self.match("{{"):
|
|
110
93
|
flush_text()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|