omextra 0.0.0.dev494__py3-none-any.whl → 0.0.0.dev495__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.
- omextra/text/abnf/__init__.py +17 -4
- omextra/text/abnf/_dataclasses.py +438 -0
- omextra/text/abnf/base.py +49 -82
- omextra/text/abnf/core.py +5 -5
- omextra/text/abnf/docs/__init__.py +0 -0
- omextra/text/abnf/docs/rfc5234.txt +893 -0
- omextra/text/abnf/docs/rfc7405.txt +221 -0
- omextra/text/abnf/internal.py +32 -0
- omextra/text/abnf/meta.py +37 -36
- omextra/text/abnf/ops.py +276 -0
- omextra/text/abnf/parsing.py +212 -0
- omextra/text/abnf/utils.py +4 -9
- omextra/text/abnf/visitors.py +8 -8
- {omextra-0.0.0.dev494.dist-info → omextra-0.0.0.dev495.dist-info}/METADATA +2 -2
- {omextra-0.0.0.dev494.dist-info → omextra-0.0.0.dev495.dist-info}/RECORD +19 -13
- omextra/text/abnf/parsers.py +0 -343
- {omextra-0.0.0.dev494.dist-info → omextra-0.0.0.dev495.dist-info}/WHEEL +0 -0
- {omextra-0.0.0.dev494.dist-info → omextra-0.0.0.dev495.dist-info}/entry_points.txt +0 -0
- {omextra-0.0.0.dev494.dist-info → omextra-0.0.0.dev495.dist-info}/licenses/LICENSE +0 -0
- {omextra-0.0.0.dev494.dist-info → omextra-0.0.0.dev495.dist-info}/top_level.txt +0 -0
omextra/text/abnf/__init__.py
CHANGED
|
@@ -16,14 +16,27 @@ TODO:
|
|
|
16
16
|
- greedily compile regexes
|
|
17
17
|
- error reporting
|
|
18
18
|
- codegen
|
|
19
|
+
- fix_ws problem
|
|
20
|
+
- auto? no, need to keep lines / offsets accurate for errors
|
|
21
|
+
- relax CRLF rule by default?
|
|
19
22
|
"""
|
|
23
|
+
from omlish import dataclasses as _dc # noqa
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
_dc.init_package(
|
|
27
|
+
globals(),
|
|
28
|
+
codegen=True,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
##
|
|
20
33
|
|
|
21
34
|
|
|
22
35
|
from .base import ( # noqa
|
|
23
36
|
Match,
|
|
24
37
|
longest_match,
|
|
25
38
|
|
|
26
|
-
|
|
39
|
+
Op,
|
|
27
40
|
|
|
28
41
|
Rule,
|
|
29
42
|
Grammar,
|
|
@@ -48,7 +61,7 @@ from .meta import ( # noqa
|
|
|
48
61
|
parse_grammar,
|
|
49
62
|
)
|
|
50
63
|
|
|
51
|
-
from .
|
|
64
|
+
from .ops import ( # noqa
|
|
52
65
|
Literal,
|
|
53
66
|
StringLiteral,
|
|
54
67
|
CaseInsensitiveStringLiteral,
|
|
@@ -59,8 +72,8 @@ from .parsers import ( # noqa
|
|
|
59
72
|
concat,
|
|
60
73
|
|
|
61
74
|
Repeat,
|
|
62
|
-
Option,
|
|
63
75
|
repeat,
|
|
76
|
+
option,
|
|
64
77
|
|
|
65
78
|
Either,
|
|
66
79
|
either,
|
|
@@ -75,5 +88,5 @@ from .utils import ( # noqa
|
|
|
75
88
|
|
|
76
89
|
parse_rules,
|
|
77
90
|
|
|
78
|
-
|
|
91
|
+
fix_ws,
|
|
79
92
|
)
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
# @omlish-generated
|
|
2
|
+
# type: ignore
|
|
3
|
+
# ruff: noqa
|
|
4
|
+
# flake8: noqa
|
|
5
|
+
import dataclasses
|
|
6
|
+
import reprlib
|
|
7
|
+
import types
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
##
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
REGISTRY = {}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _register(**kwargs):
|
|
17
|
+
def inner(fn):
|
|
18
|
+
REGISTRY[kwargs['plan_repr']] = (kwargs, fn)
|
|
19
|
+
return fn
|
|
20
|
+
return inner
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
##
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@_register(
|
|
27
|
+
plan_repr=(
|
|
28
|
+
"Plans(tup=(CopyPlan(fields=('s',)), EqPlan(fields=('s',)), FrozenPlan(fields=('s',), allow_dynamic_dunder_attr"
|
|
29
|
+
"s=False), HashPlan(action='add', fields=('s',), cache=False), InitPlan(fields=(InitPlan.Field(name='s', annota"
|
|
30
|
+
"tion=OpRef(name='init.fields.0.annotation'), default=None, default_factory=None, init=True, override=False, fi"
|
|
31
|
+
"eld_type=FieldType.INSTANCE, coerce=None, validate=None, check_type=None),), self_param='self', std_params=('s"
|
|
32
|
+
"',), kw_only_params=(), frozen=True, slots=False, post_init_params=None, init_fns=(), validate_fns=()), ReprPl"
|
|
33
|
+
"an(fields=(ReprPlan.Field(name='s', kw_only=False, fn=None),), id=False, terse=False, default_fn=None)))"
|
|
34
|
+
),
|
|
35
|
+
plan_repr_sha1='30a5dd74853303d917aae5f67d4e7189615d1440',
|
|
36
|
+
op_ref_idents=(
|
|
37
|
+
'__dataclass__init__fields__0__annotation',
|
|
38
|
+
),
|
|
39
|
+
cls_names=(
|
|
40
|
+
('omextra.text.abnf', 'MetaGrammarRuleMatchVisitor.QuotedString'),
|
|
41
|
+
('omextra.text.abnf', 'MetaGrammarRuleMatchVisitor.RuleName'),
|
|
42
|
+
),
|
|
43
|
+
)
|
|
44
|
+
def _process_dataclass__30a5dd74853303d917aae5f67d4e7189615d1440():
|
|
45
|
+
def _process_dataclass(
|
|
46
|
+
*,
|
|
47
|
+
__dataclass__cls,
|
|
48
|
+
__dataclass__init__fields__0__annotation,
|
|
49
|
+
__dataclass__FieldFnValidationError, # noqa
|
|
50
|
+
__dataclass__FieldTypeValidationError, # noqa
|
|
51
|
+
__dataclass__FnValidationError, # noqa
|
|
52
|
+
__dataclass__FrozenInstanceError=dataclasses.FrozenInstanceError, # noqa
|
|
53
|
+
__dataclass__FunctionType=types.FunctionType, # noqa
|
|
54
|
+
__dataclass__HAS_DEFAULT_FACTORY=dataclasses._HAS_DEFAULT_FACTORY, # noqa
|
|
55
|
+
__dataclass__MISSING=dataclasses.MISSING, # noqa
|
|
56
|
+
__dataclass__None=None, # noqa
|
|
57
|
+
__dataclass__TypeError=TypeError, # noqa
|
|
58
|
+
__dataclass___recursive_repr=reprlib.recursive_repr, # noqa
|
|
59
|
+
__dataclass__isinstance=isinstance, # noqa
|
|
60
|
+
__dataclass__object_setattr=object.__setattr__, # noqa
|
|
61
|
+
__dataclass__property=property, # noqa
|
|
62
|
+
):
|
|
63
|
+
def __copy__(self):
|
|
64
|
+
if self.__class__ is not __dataclass__cls:
|
|
65
|
+
raise TypeError(self)
|
|
66
|
+
return __dataclass__cls( # noqa
|
|
67
|
+
s=self.s,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
__copy__.__qualname__ = f"{__dataclass__cls.__qualname__}.__copy__"
|
|
71
|
+
if '__copy__' in __dataclass__cls.__dict__:
|
|
72
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __copy__ in class {__dataclass__cls.__name__}")
|
|
73
|
+
setattr(__dataclass__cls, '__copy__', __copy__)
|
|
74
|
+
|
|
75
|
+
def __eq__(self, other):
|
|
76
|
+
if self is other:
|
|
77
|
+
return True
|
|
78
|
+
if self.__class__ is not other.__class__:
|
|
79
|
+
return NotImplemented
|
|
80
|
+
return (
|
|
81
|
+
self.s == other.s
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
__eq__.__qualname__ = f"{__dataclass__cls.__qualname__}.__eq__"
|
|
85
|
+
if '__eq__' in __dataclass__cls.__dict__:
|
|
86
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __eq__ in class {__dataclass__cls.__name__}")
|
|
87
|
+
setattr(__dataclass__cls, '__eq__', __eq__)
|
|
88
|
+
|
|
89
|
+
__dataclass___setattr_frozen_fields = {
|
|
90
|
+
's',
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
def __setattr__(self, name, value):
|
|
94
|
+
if (
|
|
95
|
+
type(self) is __dataclass__cls
|
|
96
|
+
or name in __dataclass___setattr_frozen_fields
|
|
97
|
+
):
|
|
98
|
+
raise __dataclass__FrozenInstanceError(f"cannot assign to field {name!r}")
|
|
99
|
+
super(__dataclass__cls, self).__setattr__(name, value)
|
|
100
|
+
|
|
101
|
+
__setattr__.__qualname__ = f"{__dataclass__cls.__qualname__}.__setattr__"
|
|
102
|
+
if '__setattr__' in __dataclass__cls.__dict__:
|
|
103
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __setattr__ in class {__dataclass__cls.__name__}")
|
|
104
|
+
setattr(__dataclass__cls, '__setattr__', __setattr__)
|
|
105
|
+
|
|
106
|
+
__dataclass___delattr_frozen_fields = {
|
|
107
|
+
's',
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
def __delattr__(self, name):
|
|
111
|
+
if (
|
|
112
|
+
type(self) is __dataclass__cls
|
|
113
|
+
or name in __dataclass___delattr_frozen_fields
|
|
114
|
+
):
|
|
115
|
+
raise __dataclass__FrozenInstanceError(f"cannot delete field {name!r}")
|
|
116
|
+
super(__dataclass__cls, self).__delattr__(name)
|
|
117
|
+
|
|
118
|
+
__delattr__.__qualname__ = f"{__dataclass__cls.__qualname__}.__delattr__"
|
|
119
|
+
if '__delattr__' in __dataclass__cls.__dict__:
|
|
120
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __delattr__ in class {__dataclass__cls.__name__}")
|
|
121
|
+
setattr(__dataclass__cls, '__delattr__', __delattr__)
|
|
122
|
+
|
|
123
|
+
def __hash__(self):
|
|
124
|
+
return hash((
|
|
125
|
+
self.s,
|
|
126
|
+
))
|
|
127
|
+
|
|
128
|
+
__hash__.__qualname__ = f"{__dataclass__cls.__qualname__}.__hash__"
|
|
129
|
+
setattr(__dataclass__cls, '__hash__', __hash__)
|
|
130
|
+
|
|
131
|
+
def __init__(
|
|
132
|
+
self,
|
|
133
|
+
s: __dataclass__init__fields__0__annotation,
|
|
134
|
+
) -> __dataclass__None:
|
|
135
|
+
__dataclass__object_setattr(self, 's', s)
|
|
136
|
+
|
|
137
|
+
__init__.__qualname__ = f"{__dataclass__cls.__qualname__}.__init__"
|
|
138
|
+
if '__init__' in __dataclass__cls.__dict__:
|
|
139
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __init__ in class {__dataclass__cls.__name__}")
|
|
140
|
+
setattr(__dataclass__cls, '__init__', __init__)
|
|
141
|
+
|
|
142
|
+
@__dataclass___recursive_repr()
|
|
143
|
+
def __repr__(self):
|
|
144
|
+
parts = []
|
|
145
|
+
parts.append(f"s={self.s!r}")
|
|
146
|
+
return (
|
|
147
|
+
f"{self.__class__.__qualname__}("
|
|
148
|
+
f"{', '.join(parts)}"
|
|
149
|
+
f")"
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
__repr__.__qualname__ = f"{__dataclass__cls.__qualname__}.__repr__"
|
|
153
|
+
if '__repr__' in __dataclass__cls.__dict__:
|
|
154
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __repr__ in class {__dataclass__cls.__name__}")
|
|
155
|
+
setattr(__dataclass__cls, '__repr__', __repr__)
|
|
156
|
+
|
|
157
|
+
return _process_dataclass
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
@_register(
|
|
161
|
+
plan_repr=(
|
|
162
|
+
"Plans(tup=(CopyPlan(fields=('lo', 'hi')), EqPlan(fields=('lo', 'hi')), FrozenPlan(fields=('lo', 'hi'), allow_d"
|
|
163
|
+
"ynamic_dunder_attrs=False), HashPlan(action='add', fields=('lo', 'hi'), cache=False), InitPlan(fields=(InitPla"
|
|
164
|
+
"n.Field(name='lo', annotation=OpRef(name='init.fields.0.annotation'), default=None, default_factory=None, init"
|
|
165
|
+
"=True, override=False, field_type=FieldType.INSTANCE, coerce=None, validate=None, check_type=None), InitPlan.F"
|
|
166
|
+
"ield(name='hi', annotation=OpRef(name='init.fields.1.annotation'), default=None, default_factory=None, init=Tr"
|
|
167
|
+
"ue, override=False, field_type=FieldType.INSTANCE, coerce=None, validate=None, check_type=None)), self_param='"
|
|
168
|
+
"self', std_params=('lo', 'hi'), kw_only_params=(), frozen=True, slots=False, post_init_params=(), init_fns=(),"
|
|
169
|
+
" validate_fns=()), ReprPlan(fields=(ReprPlan.Field(name='lo', kw_only=False, fn=None), ReprPlan.Field(name='hi"
|
|
170
|
+
"', kw_only=False, fn=None)), id=False, terse=False, default_fn=None)))"
|
|
171
|
+
),
|
|
172
|
+
plan_repr_sha1='9104a51696bc4129d13d616118c0f732322e677c',
|
|
173
|
+
op_ref_idents=(
|
|
174
|
+
'__dataclass__init__fields__0__annotation',
|
|
175
|
+
'__dataclass__init__fields__1__annotation',
|
|
176
|
+
),
|
|
177
|
+
cls_names=(
|
|
178
|
+
('omextra.text.abnf', 'RangeLiteral.Range'),
|
|
179
|
+
),
|
|
180
|
+
)
|
|
181
|
+
def _process_dataclass__9104a51696bc4129d13d616118c0f732322e677c():
|
|
182
|
+
def _process_dataclass(
|
|
183
|
+
*,
|
|
184
|
+
__dataclass__cls,
|
|
185
|
+
__dataclass__init__fields__0__annotation,
|
|
186
|
+
__dataclass__init__fields__1__annotation,
|
|
187
|
+
__dataclass__FieldFnValidationError, # noqa
|
|
188
|
+
__dataclass__FieldTypeValidationError, # noqa
|
|
189
|
+
__dataclass__FnValidationError, # noqa
|
|
190
|
+
__dataclass__FrozenInstanceError=dataclasses.FrozenInstanceError, # noqa
|
|
191
|
+
__dataclass__FunctionType=types.FunctionType, # noqa
|
|
192
|
+
__dataclass__HAS_DEFAULT_FACTORY=dataclasses._HAS_DEFAULT_FACTORY, # noqa
|
|
193
|
+
__dataclass__MISSING=dataclasses.MISSING, # noqa
|
|
194
|
+
__dataclass__None=None, # noqa
|
|
195
|
+
__dataclass__TypeError=TypeError, # noqa
|
|
196
|
+
__dataclass___recursive_repr=reprlib.recursive_repr, # noqa
|
|
197
|
+
__dataclass__isinstance=isinstance, # noqa
|
|
198
|
+
__dataclass__object_setattr=object.__setattr__, # noqa
|
|
199
|
+
__dataclass__property=property, # noqa
|
|
200
|
+
):
|
|
201
|
+
def __copy__(self):
|
|
202
|
+
if self.__class__ is not __dataclass__cls:
|
|
203
|
+
raise TypeError(self)
|
|
204
|
+
return __dataclass__cls( # noqa
|
|
205
|
+
lo=self.lo,
|
|
206
|
+
hi=self.hi,
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
__copy__.__qualname__ = f"{__dataclass__cls.__qualname__}.__copy__"
|
|
210
|
+
if '__copy__' in __dataclass__cls.__dict__:
|
|
211
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __copy__ in class {__dataclass__cls.__name__}")
|
|
212
|
+
setattr(__dataclass__cls, '__copy__', __copy__)
|
|
213
|
+
|
|
214
|
+
def __eq__(self, other):
|
|
215
|
+
if self is other:
|
|
216
|
+
return True
|
|
217
|
+
if self.__class__ is not other.__class__:
|
|
218
|
+
return NotImplemented
|
|
219
|
+
return (
|
|
220
|
+
self.lo == other.lo and
|
|
221
|
+
self.hi == other.hi
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
__eq__.__qualname__ = f"{__dataclass__cls.__qualname__}.__eq__"
|
|
225
|
+
if '__eq__' in __dataclass__cls.__dict__:
|
|
226
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __eq__ in class {__dataclass__cls.__name__}")
|
|
227
|
+
setattr(__dataclass__cls, '__eq__', __eq__)
|
|
228
|
+
|
|
229
|
+
__dataclass___setattr_frozen_fields = {
|
|
230
|
+
'lo',
|
|
231
|
+
'hi',
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
def __setattr__(self, name, value):
|
|
235
|
+
if (
|
|
236
|
+
type(self) is __dataclass__cls
|
|
237
|
+
or name in __dataclass___setattr_frozen_fields
|
|
238
|
+
):
|
|
239
|
+
raise __dataclass__FrozenInstanceError(f"cannot assign to field {name!r}")
|
|
240
|
+
super(__dataclass__cls, self).__setattr__(name, value)
|
|
241
|
+
|
|
242
|
+
__setattr__.__qualname__ = f"{__dataclass__cls.__qualname__}.__setattr__"
|
|
243
|
+
if '__setattr__' in __dataclass__cls.__dict__:
|
|
244
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __setattr__ in class {__dataclass__cls.__name__}")
|
|
245
|
+
setattr(__dataclass__cls, '__setattr__', __setattr__)
|
|
246
|
+
|
|
247
|
+
__dataclass___delattr_frozen_fields = {
|
|
248
|
+
'lo',
|
|
249
|
+
'hi',
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
def __delattr__(self, name):
|
|
253
|
+
if (
|
|
254
|
+
type(self) is __dataclass__cls
|
|
255
|
+
or name in __dataclass___delattr_frozen_fields
|
|
256
|
+
):
|
|
257
|
+
raise __dataclass__FrozenInstanceError(f"cannot delete field {name!r}")
|
|
258
|
+
super(__dataclass__cls, self).__delattr__(name)
|
|
259
|
+
|
|
260
|
+
__delattr__.__qualname__ = f"{__dataclass__cls.__qualname__}.__delattr__"
|
|
261
|
+
if '__delattr__' in __dataclass__cls.__dict__:
|
|
262
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __delattr__ in class {__dataclass__cls.__name__}")
|
|
263
|
+
setattr(__dataclass__cls, '__delattr__', __delattr__)
|
|
264
|
+
|
|
265
|
+
def __hash__(self):
|
|
266
|
+
return hash((
|
|
267
|
+
self.lo,
|
|
268
|
+
self.hi,
|
|
269
|
+
))
|
|
270
|
+
|
|
271
|
+
__hash__.__qualname__ = f"{__dataclass__cls.__qualname__}.__hash__"
|
|
272
|
+
setattr(__dataclass__cls, '__hash__', __hash__)
|
|
273
|
+
|
|
274
|
+
def __init__(
|
|
275
|
+
self,
|
|
276
|
+
lo: __dataclass__init__fields__0__annotation,
|
|
277
|
+
hi: __dataclass__init__fields__1__annotation,
|
|
278
|
+
) -> __dataclass__None:
|
|
279
|
+
__dataclass__object_setattr(self, 'lo', lo)
|
|
280
|
+
__dataclass__object_setattr(self, 'hi', hi)
|
|
281
|
+
self.__post_init__()
|
|
282
|
+
|
|
283
|
+
__init__.__qualname__ = f"{__dataclass__cls.__qualname__}.__init__"
|
|
284
|
+
if '__init__' in __dataclass__cls.__dict__:
|
|
285
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __init__ in class {__dataclass__cls.__name__}")
|
|
286
|
+
setattr(__dataclass__cls, '__init__', __init__)
|
|
287
|
+
|
|
288
|
+
@__dataclass___recursive_repr()
|
|
289
|
+
def __repr__(self):
|
|
290
|
+
parts = []
|
|
291
|
+
parts.append(f"lo={self.lo!r}")
|
|
292
|
+
parts.append(f"hi={self.hi!r}")
|
|
293
|
+
return (
|
|
294
|
+
f"{self.__class__.__qualname__}("
|
|
295
|
+
f"{', '.join(parts)}"
|
|
296
|
+
f")"
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
__repr__.__qualname__ = f"{__dataclass__cls.__qualname__}.__repr__"
|
|
300
|
+
if '__repr__' in __dataclass__cls.__dict__:
|
|
301
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __repr__ in class {__dataclass__cls.__name__}")
|
|
302
|
+
setattr(__dataclass__cls, '__repr__', __repr__)
|
|
303
|
+
|
|
304
|
+
return _process_dataclass
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
@_register(
|
|
308
|
+
plan_repr=(
|
|
309
|
+
"Plans(tup=(CopyPlan(fields=('min', 'max')), EqPlan(fields=('min', 'max')), FrozenPlan(fields=('min', 'max'), a"
|
|
310
|
+
"llow_dynamic_dunder_attrs=False), HashPlan(action='add', fields=('min', 'max'), cache=False), InitPlan(fields="
|
|
311
|
+
"(InitPlan.Field(name='min', annotation=OpRef(name='init.fields.0.annotation'), default=OpRef(name='init.fields"
|
|
312
|
+
".0.default'), default_factory=None, init=True, override=False, field_type=FieldType.INSTANCE, coerce=None, val"
|
|
313
|
+
"idate=None, check_type=None), InitPlan.Field(name='max', annotation=OpRef(name='init.fields.1.annotation'), de"
|
|
314
|
+
"fault=OpRef(name='init.fields.1.default'), default_factory=None, init=True, override=False, field_type=FieldTy"
|
|
315
|
+
"pe.INSTANCE, coerce=None, validate=None, check_type=None)), self_param='self', std_params=('min', 'max'), kw_o"
|
|
316
|
+
"nly_params=(), frozen=True, slots=False, post_init_params=(), init_fns=(), validate_fns=())))"
|
|
317
|
+
),
|
|
318
|
+
plan_repr_sha1='3dce49e08774c707abbc7a6513e35ccdc43001c9',
|
|
319
|
+
op_ref_idents=(
|
|
320
|
+
'__dataclass__init__fields__0__annotation',
|
|
321
|
+
'__dataclass__init__fields__0__default',
|
|
322
|
+
'__dataclass__init__fields__1__annotation',
|
|
323
|
+
'__dataclass__init__fields__1__default',
|
|
324
|
+
),
|
|
325
|
+
cls_names=(
|
|
326
|
+
('omextra.text.abnf', 'Repeat.Times'),
|
|
327
|
+
),
|
|
328
|
+
)
|
|
329
|
+
def _process_dataclass__3dce49e08774c707abbc7a6513e35ccdc43001c9():
|
|
330
|
+
def _process_dataclass(
|
|
331
|
+
*,
|
|
332
|
+
__dataclass__cls,
|
|
333
|
+
__dataclass__init__fields__0__annotation,
|
|
334
|
+
__dataclass__init__fields__0__default,
|
|
335
|
+
__dataclass__init__fields__1__annotation,
|
|
336
|
+
__dataclass__init__fields__1__default,
|
|
337
|
+
__dataclass__FieldFnValidationError, # noqa
|
|
338
|
+
__dataclass__FieldTypeValidationError, # noqa
|
|
339
|
+
__dataclass__FnValidationError, # noqa
|
|
340
|
+
__dataclass__FrozenInstanceError=dataclasses.FrozenInstanceError, # noqa
|
|
341
|
+
__dataclass__FunctionType=types.FunctionType, # noqa
|
|
342
|
+
__dataclass__HAS_DEFAULT_FACTORY=dataclasses._HAS_DEFAULT_FACTORY, # noqa
|
|
343
|
+
__dataclass__MISSING=dataclasses.MISSING, # noqa
|
|
344
|
+
__dataclass__None=None, # noqa
|
|
345
|
+
__dataclass__TypeError=TypeError, # noqa
|
|
346
|
+
__dataclass___recursive_repr=reprlib.recursive_repr, # noqa
|
|
347
|
+
__dataclass__isinstance=isinstance, # noqa
|
|
348
|
+
__dataclass__object_setattr=object.__setattr__, # noqa
|
|
349
|
+
__dataclass__property=property, # noqa
|
|
350
|
+
):
|
|
351
|
+
def __copy__(self):
|
|
352
|
+
if self.__class__ is not __dataclass__cls:
|
|
353
|
+
raise TypeError(self)
|
|
354
|
+
return __dataclass__cls( # noqa
|
|
355
|
+
min=self.min,
|
|
356
|
+
max=self.max,
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
__copy__.__qualname__ = f"{__dataclass__cls.__qualname__}.__copy__"
|
|
360
|
+
if '__copy__' in __dataclass__cls.__dict__:
|
|
361
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __copy__ in class {__dataclass__cls.__name__}")
|
|
362
|
+
setattr(__dataclass__cls, '__copy__', __copy__)
|
|
363
|
+
|
|
364
|
+
def __eq__(self, other):
|
|
365
|
+
if self is other:
|
|
366
|
+
return True
|
|
367
|
+
if self.__class__ is not other.__class__:
|
|
368
|
+
return NotImplemented
|
|
369
|
+
return (
|
|
370
|
+
self.min == other.min and
|
|
371
|
+
self.max == other.max
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
__eq__.__qualname__ = f"{__dataclass__cls.__qualname__}.__eq__"
|
|
375
|
+
if '__eq__' in __dataclass__cls.__dict__:
|
|
376
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __eq__ in class {__dataclass__cls.__name__}")
|
|
377
|
+
setattr(__dataclass__cls, '__eq__', __eq__)
|
|
378
|
+
|
|
379
|
+
__dataclass___setattr_frozen_fields = {
|
|
380
|
+
'min',
|
|
381
|
+
'max',
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
def __setattr__(self, name, value):
|
|
385
|
+
if (
|
|
386
|
+
type(self) is __dataclass__cls
|
|
387
|
+
or name in __dataclass___setattr_frozen_fields
|
|
388
|
+
):
|
|
389
|
+
raise __dataclass__FrozenInstanceError(f"cannot assign to field {name!r}")
|
|
390
|
+
super(__dataclass__cls, self).__setattr__(name, value)
|
|
391
|
+
|
|
392
|
+
__setattr__.__qualname__ = f"{__dataclass__cls.__qualname__}.__setattr__"
|
|
393
|
+
if '__setattr__' in __dataclass__cls.__dict__:
|
|
394
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __setattr__ in class {__dataclass__cls.__name__}")
|
|
395
|
+
setattr(__dataclass__cls, '__setattr__', __setattr__)
|
|
396
|
+
|
|
397
|
+
__dataclass___delattr_frozen_fields = {
|
|
398
|
+
'min',
|
|
399
|
+
'max',
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
def __delattr__(self, name):
|
|
403
|
+
if (
|
|
404
|
+
type(self) is __dataclass__cls
|
|
405
|
+
or name in __dataclass___delattr_frozen_fields
|
|
406
|
+
):
|
|
407
|
+
raise __dataclass__FrozenInstanceError(f"cannot delete field {name!r}")
|
|
408
|
+
super(__dataclass__cls, self).__delattr__(name)
|
|
409
|
+
|
|
410
|
+
__delattr__.__qualname__ = f"{__dataclass__cls.__qualname__}.__delattr__"
|
|
411
|
+
if '__delattr__' in __dataclass__cls.__dict__:
|
|
412
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __delattr__ in class {__dataclass__cls.__name__}")
|
|
413
|
+
setattr(__dataclass__cls, '__delattr__', __delattr__)
|
|
414
|
+
|
|
415
|
+
def __hash__(self):
|
|
416
|
+
return hash((
|
|
417
|
+
self.min,
|
|
418
|
+
self.max,
|
|
419
|
+
))
|
|
420
|
+
|
|
421
|
+
__hash__.__qualname__ = f"{__dataclass__cls.__qualname__}.__hash__"
|
|
422
|
+
setattr(__dataclass__cls, '__hash__', __hash__)
|
|
423
|
+
|
|
424
|
+
def __init__(
|
|
425
|
+
self,
|
|
426
|
+
min: __dataclass__init__fields__0__annotation = __dataclass__init__fields__0__default,
|
|
427
|
+
max: __dataclass__init__fields__1__annotation = __dataclass__init__fields__1__default,
|
|
428
|
+
) -> __dataclass__None:
|
|
429
|
+
__dataclass__object_setattr(self, 'min', min)
|
|
430
|
+
__dataclass__object_setattr(self, 'max', max)
|
|
431
|
+
self.__post_init__()
|
|
432
|
+
|
|
433
|
+
__init__.__qualname__ = f"{__dataclass__cls.__qualname__}.__init__"
|
|
434
|
+
if '__init__' in __dataclass__cls.__dict__:
|
|
435
|
+
raise __dataclass__TypeError(f"Cannot overwrite attribute __init__ in class {__dataclass__cls.__name__}")
|
|
436
|
+
setattr(__dataclass__cls, '__init__', __init__)
|
|
437
|
+
|
|
438
|
+
return _process_dataclass
|