File tree Expand file tree Collapse file tree 1 file changed +0
-47
lines changed
Expand file tree Collapse file tree 1 file changed +0
-47
lines changed Original file line number Diff line number Diff line change 33from __future__ import annotations
44
55import json
6- import re
76from typing import TYPE_CHECKING
87from typing import Callable
98from typing import Dict
5150
5251# ruff: noqa: D102
5352
54- INVALID_NAME_SELECTOR_CHARS = [
55- "\x00 " ,
56- "\x01 " ,
57- "\x02 " ,
58- "\x03 " ,
59- "\x04 " ,
60- "\x05 " ,
61- "\x06 " ,
62- "\x07 " ,
63- "\x08 " ,
64- "\t " ,
65- "\n " ,
66- "\x0b " ,
67- "\x0c " ,
68- "\r " ,
69- "\x0e " ,
70- "\x0f " ,
71- "\x10 " ,
72- "\x11 " ,
73- "\x12 " ,
74- "\x13 " ,
75- "\x14 " ,
76- "\x15 " ,
77- "\x16 " ,
78- "\x17 " ,
79- "\x18 " ,
80- "\x19 " ,
81- "\x1a " ,
82- "\x1b " ,
83- "\x1c " ,
84- "\x1d " ,
85- "\x1e " ,
86- "\x1f " ,
87- ]
88-
8953
9054class Parser :
9155 """A JSONPath expression parser bound to a `JSONPathEnvironment`."""
@@ -138,11 +102,6 @@ class Parser:
138102 ]
139103 )
140104
141- _INVALID_NAME_SELECTOR_CHARS = f"[{ '' .join (INVALID_NAME_SELECTOR_CHARS )} ]"
142- RE_INVALID_NAME_SELECTOR = re .compile (
143- rf'(?:(?!(?<!\\)"){ _INVALID_NAME_SELECTOR_CHARS } )'
144- )
145-
146105 def __init__ (self , * , env : JSONPathEnvironment ) -> None :
147106 self .env = env
148107
@@ -329,12 +288,6 @@ def parse_bracketed_selection(self, stream: TokenStream) -> List[JSONPathSelecto
329288 TokenType .DOUBLE_QUOTE_STRING ,
330289 TokenType .SINGLE_QUOTE_STRING ,
331290 ):
332- if self .RE_INVALID_NAME_SELECTOR .search (stream .current .value ):
333- raise JSONPathSyntaxError (
334- f"invalid name selector { stream .current .value !r} " ,
335- token = stream .current ,
336- )
337-
338291 selectors .append (
339292 NameSelector (
340293 env = self .env ,
You can’t perform that action at this time.
0 commit comments