Skip to content
Snippets Groups Projects
Commit 09e9182d authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

Minor cleaonup.

parent cebb493d
No related branches found
No related tags found
No related merge requests found
......@@ -85,6 +85,7 @@ from typing import (
)
from dataclasses import dataclass
import sys
ws = name('ws', tag('ws', many(line_comment('#') | space)))
......@@ -92,19 +93,18 @@ ws = name('ws', tag('ws', many(line_comment('#') | space)))
F = TypeVar('F', bound=Callable[..., object])
# TODO replace this decorator with
# from typing import override
# once the target python version is changed to 3.12
if sys.version_info >= (3, 12):
from typing import override
else:
def override(f: F) -> F:
"""
Return function unchanged.
def override(f: F) -> F:
"""
Return function unchanged.
Placeholder @override annotator if the actual annotation isn't
implemented in the current python version.
"""
return f
Placeholder @override annotator if the actual annotation isn't
implemented in the current python version.
"""
return f
logger = logging.getLogger(__name__)
......@@ -318,7 +318,7 @@ class ParserFormatter(Serializer[ParseDirective]):
Note that the delimiting "${" and "}" should be handled
outside this procedure.
"""
parser = ws
parser: ParseDirective = ws
match item:
case PuppetAccess(PuppetVar(name), _):
parser &= optional(s('$')) & name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment