I can define and eval BNF definitions
This commit is contained in:
@@ -2,7 +2,6 @@ from core.builtin_concepts import BuiltinConcepts
|
||||
from parsers.BaseParser import BaseParser, Node, ErrorNode
|
||||
from dataclasses import dataclass
|
||||
import ast
|
||||
import copy
|
||||
import logging
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@@ -57,10 +56,10 @@ class PythonParser(BaseParser):
|
||||
Parse Python scripts
|
||||
"""
|
||||
|
||||
def __init__(self, source="<undef>"):
|
||||
def __init__(self, **kwargs):
|
||||
|
||||
BaseParser.__init__(self, "PythonParser")
|
||||
self.source = source
|
||||
self.source = kwargs.get("source", "<undef>")
|
||||
|
||||
def parse(self, context, text):
|
||||
text = text if isinstance(text, str) else self.get_text_from_tokens(text)
|
||||
|
||||
Reference in New Issue
Block a user