Debian Codegraph @

examples/pint/pint_parser/defaults.py

raw symbols SCIP
1 from __future__ import annotations
2
3 from dataclasses import dataclass
4
5 import flexparser.flexparser as fp
6
7 from . import common
8
9
10 @dataclass(frozen=True)
11 class BeginDefaults(fp.ParsedStatement):
12 """Being of a defaults directive.
13
14 @defaults
15 """
16
17 @classmethod
18 def from_string(cls, s: str) -> fp.NullableParsedResult[BeginDefaults]:
19 if s.strip() == "@defaults":
20 return cls()
21 return None
22
23
24 @dataclass(frozen=True)
25 class DefaultsDefinition(common.DirectiveBlock):
26 """Directive to store values.
27
28 @defaults
29 system = mks
30 @end
31
32 See Equality and Comment for more parsing related information.
33 """