omlish 0.0.0.dev445__py3-none-any.whl → 0.0.0.dev446__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.
Potentially problematic release.
This version of omlish might be problematic. Click here for more details.
- omlish/__about__.py +2 -2
- omlish/formats/json/stream/lexing.py +45 -23
- omlish/lang/imports/capture.py +3 -0
- {omlish-0.0.0.dev445.dist-info → omlish-0.0.0.dev446.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev445.dist-info → omlish-0.0.0.dev446.dist-info}/RECORD +9 -9
- {omlish-0.0.0.dev445.dist-info → omlish-0.0.0.dev446.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev445.dist-info → omlish-0.0.0.dev446.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev445.dist-info → omlish-0.0.0.dev446.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev445.dist-info → omlish-0.0.0.dev446.dist-info}/top_level.txt +0 -0
omlish/__about__.py
CHANGED
|
@@ -3,7 +3,6 @@ TODO:
|
|
|
3
3
|
- max buf size
|
|
4
4
|
- max recursion depth
|
|
5
5
|
- mark start pos of tokens, currently returning end
|
|
6
|
-
- _do_string inner loop optimization somehow
|
|
7
6
|
"""
|
|
8
7
|
import dataclasses as dc
|
|
9
8
|
import io
|
|
@@ -343,33 +342,56 @@ class JsonStreamLexer(GenMachine[str, Token]):
|
|
|
343
342
|
while True:
|
|
344
343
|
c: str | None = None
|
|
345
344
|
|
|
346
|
-
|
|
347
|
-
if
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
345
|
+
while True:
|
|
346
|
+
if char_in_str is not None:
|
|
347
|
+
if char_in_str_pos >= char_in_str_len:
|
|
348
|
+
char_in_str = None
|
|
349
|
+
continue
|
|
350
|
+
|
|
351
|
+
skip_to = char_in_str_len
|
|
352
|
+
if (qp := char_in_str.find(q, char_in_str_pos)) >= 0 and qp < skip_to:
|
|
353
|
+
skip_to = qp
|
|
354
|
+
if (sp := char_in_str.find('\\', char_in_str_pos)) >= 0 and sp < skip_to:
|
|
355
|
+
skip_to = sp
|
|
356
|
+
|
|
357
|
+
if skip_to != char_in_str_pos:
|
|
358
|
+
ofs += skip_to - char_in_str_pos
|
|
359
|
+
if (np := char_in_str.rfind('\n', char_in_str_pos, skip_to)) >= 0:
|
|
360
|
+
line += char_in_str.count('\n', char_in_str_pos, skip_to)
|
|
361
|
+
col = np - char_in_str_pos
|
|
362
|
+
else:
|
|
363
|
+
col += skip_to - char_in_str_pos
|
|
364
|
+
buf.write(char_in_str[char_in_str_pos:skip_to])
|
|
365
|
+
|
|
366
|
+
if skip_to >= char_in_str_len:
|
|
367
|
+
char_in_str = None
|
|
368
|
+
continue
|
|
369
|
+
char_in_str_pos = skip_to
|
|
370
|
+
|
|
353
371
|
c = char_in_str[char_in_str_pos]
|
|
354
372
|
char_in_str_pos += 1
|
|
355
|
-
else:
|
|
356
|
-
char_in_str = None
|
|
357
373
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
374
|
+
if c is None:
|
|
375
|
+
try:
|
|
376
|
+
c = (yield None)
|
|
377
|
+
except GeneratorExit:
|
|
378
|
+
restore_state()
|
|
379
|
+
self._raise('Unexpected end of input')
|
|
380
|
+
|
|
381
|
+
if len(c) > 1:
|
|
382
|
+
char_in_str = c
|
|
383
|
+
char_in_str_len = len(char_in_str)
|
|
384
|
+
char_in_str_pos = 0
|
|
385
|
+
c = None
|
|
386
|
+
continue
|
|
364
387
|
|
|
365
|
-
if
|
|
366
|
-
|
|
367
|
-
char_in_str_len = len(char_in_str)
|
|
368
|
-
char_in_str_pos = 1
|
|
369
|
-
c = c[0]
|
|
388
|
+
if c is None:
|
|
389
|
+
raise JsonStreamError
|
|
370
390
|
|
|
371
|
-
|
|
372
|
-
|
|
391
|
+
if c and len(c) != 1:
|
|
392
|
+
raise JsonStreamError(c)
|
|
393
|
+
|
|
394
|
+
break
|
|
373
395
|
|
|
374
396
|
ofs += 1
|
|
375
397
|
|
omlish/lang/imports/capture.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
omlish/.omlish-manifests.json,sha256=FLw7xkPiSXuImZgqSP8BwrEib2R1doSzUPLUkc-QUIA,8410
|
|
2
|
-
omlish/__about__.py,sha256=
|
|
2
|
+
omlish/__about__.py,sha256=8r90y0nduA_a3W7mllnllThp_MJ9YW_OIny1z_qo-PE,3613
|
|
3
3
|
omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
|
|
4
4
|
omlish/c3.py,sha256=ZNIMl1kwg3qdei4DiUrJPQe5M81S1e76N-GuNSwLBAE,8683
|
|
5
5
|
omlish/cached.py,sha256=MLap_p0rdGoDIMVhXVHm1tsbcWobJF0OanoodV03Ju8,542
|
|
@@ -267,7 +267,7 @@ omlish/formats/json/backends/ujson.py,sha256=U3iOlAURfiCdXbiNlXfIjDdtJDbDaLZsSuZ
|
|
|
267
267
|
omlish/formats/json/stream/__init__.py,sha256=LoYSkdUX3lkQ4g9JB_F6YOeexlOEporKW8bW8tv3YXg,859
|
|
268
268
|
omlish/formats/json/stream/building.py,sha256=QAQaTyXuw9vkfhvzWIh_DSlypD1-HgzO855Dgz3_wFM,2517
|
|
269
269
|
omlish/formats/json/stream/errors.py,sha256=c8M8UAYmIZ-vWZLeKD2jMj4EDCJbr9QR8Jq_DyHjujQ,43
|
|
270
|
-
omlish/formats/json/stream/lexing.py,sha256=
|
|
270
|
+
omlish/formats/json/stream/lexing.py,sha256=FeO7sjCQ6HHBj7VJIwkSxMPUneG1KqDyN-zuACdE_rw,17384
|
|
271
271
|
omlish/formats/json/stream/parsing.py,sha256=bnTaYcCMRh0i_mByQgq4qtVf53zJnmjPvUDwJ7-zL64,7154
|
|
272
272
|
omlish/formats/json/stream/rendering.py,sha256=E5SXMGcbBtgtUYYznTPZFHD4tmV_X7K3MK50V11ESRk,3611
|
|
273
273
|
omlish/formats/json/stream/utils.py,sha256=vX69i90DVCjAAAohpiLgsT3ZinFS_cYUfneTvx-3dxU,4959
|
|
@@ -448,7 +448,7 @@ omlish/lang/classes/simple.py,sha256=3AJSs-plVg2flq4SC6I39LxP0nBaB241puv3D5YCP5I
|
|
|
448
448
|
omlish/lang/classes/virtual.py,sha256=J4y-uiv1RaP2rfFeptXqQ1a4MRek0TMlAFFraO_lzhs,3397
|
|
449
449
|
omlish/lang/imports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
450
450
|
omlish/lang/imports/_capture.cc,sha256=jAKW9pOV3ER4Vzd-aywmAeOxbv-b_jNdaxAaVdxfueg,2261
|
|
451
|
-
omlish/lang/imports/capture.py,sha256=
|
|
451
|
+
omlish/lang/imports/capture.py,sha256=0uud2HvBPig3rWqjhLXtSK30vXtKggxFTYDDD9Ab0Gg,21710
|
|
452
452
|
omlish/lang/imports/conditional.py,sha256=R-E47QD95mMonPImWlrde3rnJrFKCCkYz71c94W05sc,1006
|
|
453
453
|
omlish/lang/imports/lazy.py,sha256=Eefs9hkj5surMdwgxX_Q3BOqPcox10v0sKT5rKIQknc,808
|
|
454
454
|
omlish/lang/imports/proxy.py,sha256=wlXJrl1GiXQ-t5cO_aJLqp1mr_Erl4oMk4uySkkK7bg,6516
|
|
@@ -820,9 +820,9 @@ omlish/typedvalues/marshal.py,sha256=AtBz7Jq-BfW8vwM7HSxSpR85JAXmxK2T0xDblmm1HI0
|
|
|
820
820
|
omlish/typedvalues/of_.py,sha256=UXkxSj504WI2UrFlqdZJbu2hyDwBhL7XVrc2qdR02GQ,1309
|
|
821
821
|
omlish/typedvalues/reflect.py,sha256=PAvKW6T4cW7u--iX80w3HWwZUS3SmIZ2_lQjT65uAyk,1026
|
|
822
822
|
omlish/typedvalues/values.py,sha256=ym46I-q2QJ_6l4UlERqv3yj87R-kp8nCKMRph0xQ3UA,1307
|
|
823
|
-
omlish-0.0.0.
|
|
824
|
-
omlish-0.0.0.
|
|
825
|
-
omlish-0.0.0.
|
|
826
|
-
omlish-0.0.0.
|
|
827
|
-
omlish-0.0.0.
|
|
828
|
-
omlish-0.0.0.
|
|
823
|
+
omlish-0.0.0.dev446.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
|
824
|
+
omlish-0.0.0.dev446.dist-info/METADATA,sha256=Zhu90LCm4EDjA39rcv3L-_QPuvZB_pBFlTzdQVJ8UuE,19003
|
|
825
|
+
omlish-0.0.0.dev446.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
826
|
+
omlish-0.0.0.dev446.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
|
|
827
|
+
omlish-0.0.0.dev446.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
|
828
|
+
omlish-0.0.0.dev446.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|