Working on #48 : Added BaseExprParser and BaseNodeParser.py

This commit is contained in:
2021-03-10 21:09:09 +01:00
parent 998ea160be
commit 9c4991923e
18 changed files with 317 additions and 198 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ import core.utils
from core.builtin_concepts import BuiltinConcepts
from core.sheerka.services.SheerkaExecute import ParserInput
from core.tokenizer import TokenKind
from parsers.BaseParser import BaseParser, Node, ParsingError
from parsers.BaseParser import BaseParser, Node, ParsingError, BaseParserInputParser
log = logging.getLogger(__name__)
@@ -107,7 +107,7 @@ class PythonGetNamesVisitor(ast.NodeVisitor):
self.names.add(node.id)
class PythonParser(BaseParser):
class PythonParser(BaseParserInputParser):
"""
Parse Python scripts
"""
@@ -116,7 +116,7 @@ class PythonParser(BaseParser):
def __init__(self, **kwargs):
BaseParser.__init__(self, PythonParser.NAME, 50)
BaseParserInputParser.__init__(self, PythonParser.NAME, 50)
self.source = kwargs.get("source", "<undef>")
def parse(self, context, parser_input: ParserInput):