mapres 3.dev25__tar.gz → 3.dev27__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.dev25/src/mapres.egg-info → mapres-3.dev27}/PKG-INFO +1 -1
- {mapres-3.dev25 → mapres-3.dev27}/pyproject.toml +1 -1
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/__init__.py +9 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/resolver.py +2 -2
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/tokenizer.py +15 -14
- mapres-3.dev27/src/mapres/utils.py +5 -0
- {mapres-3.dev25 → mapres-3.dev27/src/mapres.egg-info}/PKG-INFO +1 -1
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres.egg-info/SOURCES.txt +1 -0
- {mapres-3.dev25 → mapres-3.dev27}/LICENSE +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/README.md +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/setup.cfg +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/ast.py +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/cache.py +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/datamap.py +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/evaluator.py +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/exceptions.py +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/layers.py +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/maps/__init__.py +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/maps/color.py +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/maps/time.py +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres/parser.py +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres.egg-info/dependency_links.txt +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres.egg-info/requires.txt +0 -0
- {mapres-3.dev25 → mapres-3.dev27}/src/mapres.egg-info/top_level.txt +0 -0
|
@@ -10,6 +10,7 @@ except PackageNotFoundError:
|
|
|
10
10
|
from .resolver import MapResolver, res, setGlobalMaps
|
|
11
11
|
from .datamap import DataMap, datamap, syntax
|
|
12
12
|
from .layers import Layer, LayerStack
|
|
13
|
+
from .utils import rprint
|
|
13
14
|
|
|
14
15
|
# maps
|
|
15
16
|
from .maps.color import ColorMap, ascii_colors, mc_colors, strip_colors
|
|
@@ -28,6 +29,10 @@ maps = SimpleNamespace(
|
|
|
28
29
|
time = time,
|
|
29
30
|
)
|
|
30
31
|
|
|
32
|
+
utils = SimpleNamespace(
|
|
33
|
+
rprint = rprint,
|
|
34
|
+
)
|
|
35
|
+
|
|
31
36
|
__all__ = [
|
|
32
37
|
# core modules
|
|
33
38
|
'MapResolver',
|
|
@@ -39,6 +44,9 @@ __all__ = [
|
|
|
39
44
|
'LayerStack',
|
|
40
45
|
'setGlobalMaps',
|
|
41
46
|
|
|
47
|
+
# utils
|
|
48
|
+
'rprint',
|
|
49
|
+
|
|
42
50
|
# maps
|
|
43
51
|
'ColorMap',
|
|
44
52
|
'ascii_colors',
|
|
@@ -49,4 +57,5 @@ __all__ = [
|
|
|
49
57
|
|
|
50
58
|
# namespaces
|
|
51
59
|
'maps',
|
|
60
|
+
'utils',
|
|
52
61
|
]
|
|
@@ -129,7 +129,7 @@ def setGlobalMaps(maps, *, priority=0):
|
|
|
129
129
|
_DEFAULT_RESOLVER.layers.add_layer(maps, priority=priority)
|
|
130
130
|
|
|
131
131
|
def res(text: str, **ctx) -> str:
|
|
132
|
-
|
|
132
|
+
'''
|
|
133
133
|
Simple global resolution.
|
|
134
|
-
|
|
134
|
+
'''
|
|
135
135
|
return _DEFAULT_RESOLVER.res(text, **ctx)
|
|
@@ -16,8 +16,9 @@ class TokenType(Enum):
|
|
|
16
16
|
PIPE_CLOSE = auto()
|
|
17
17
|
PERCENT_OPEN = auto()
|
|
18
18
|
PERCENT_CLOSE = auto()
|
|
19
|
-
LPAREN
|
|
20
|
-
|
|
19
|
+
# # LPAREN and RPAREN tokens were deprecated in mapres 3-dev.27 to fix a bug in the parser that caused it to fail on nested calls
|
|
20
|
+
# LPAREN = auto()
|
|
21
|
+
# RPAREN = auto()
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
class Token:
|
|
@@ -206,18 +207,18 @@ class Tokenizer:
|
|
|
206
207
|
self.advance()
|
|
207
208
|
continue
|
|
208
209
|
|
|
209
|
-
# --- parens ---
|
|
210
|
-
if ch == '(':
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
if ch == ')':
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
210
|
+
# # --- parens --- (This block was deprecated in mapres 3-dev.27)
|
|
211
|
+
# if ch == '(':
|
|
212
|
+
# flush_text()
|
|
213
|
+
# self.emit(TokenType.LPAREN)
|
|
214
|
+
# self.advance()
|
|
215
|
+
# continue
|
|
216
|
+
|
|
217
|
+
# if ch == ')':
|
|
218
|
+
# flush_text()
|
|
219
|
+
# self.emit(TokenType.RPAREN)
|
|
220
|
+
# self.advance()
|
|
221
|
+
# continue
|
|
221
222
|
|
|
222
223
|
# fallback TEXT
|
|
223
224
|
buf.append(ch)
|
|
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
|