diff --git a/verified_cogen/args.py b/verified_cogen/args.py index 1759be2..29a8e05 100644 --- a/verified_cogen/args.py +++ b/verified_cogen/args.py @@ -102,9 +102,7 @@ def get_default_parser(): parser.add_argument( "--output-logging", help="Print logs to standard output", default=False ) - parser.add_argument( - "--parser", help="Parser for rewriting", default="identParser" - ) + parser.add_argument("--parser", help="Parser for rewriting", default="identParser") return parser diff --git a/verified_cogen/runners/parsers/identParser.py b/verified_cogen/runners/parsers/identParser.py index f9ad382..fbc7671 100644 --- a/verified_cogen/runners/parsers/identParser.py +++ b/verified_cogen/runners/parsers/identParser.py @@ -2,9 +2,8 @@ class IdentParser(Parser): - def __init__(self): super().__init__() - def parse(self, text : str) -> str: - return text \ No newline at end of file + def parse(self, text: str) -> str: + return text diff --git a/verified_cogen/runners/parsers/jsonParser.py b/verified_cogen/runners/parsers/jsonParser.py index cf6216f..64946b0 100644 --- a/verified_cogen/runners/parsers/jsonParser.py +++ b/verified_cogen/runners/parsers/jsonParser.py @@ -3,9 +3,8 @@ class JsonParser(Parser): - def __init__(self): super().__init__() def parse(self, text: str) -> str: - return json.loads(text)["code"].replace("\\n", "\n") \ No newline at end of file + return json.loads(text)["code"].replace("\\n", "\n") diff --git a/verified_cogen/runners/parsers/parser.py b/verified_cogen/runners/parsers/parser.py index 54c737c..d58c7eb 100644 --- a/verified_cogen/runners/parsers/parser.py +++ b/verified_cogen/runners/parsers/parser.py @@ -1,6 +1,7 @@ from abc import abstractmethod from typing import Any + class Parser: _instance = None @@ -15,6 +16,7 @@ def __init__(self, *args: list[Any], **kwargs: dict[str, Any]): ... @abstractmethod def parse(self, text: str) -> str: ... + class ParserDatabase: _instance = None parsers: dict[str, Parser] = dict()