Introduced ParserInput
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from core.builtin_concepts import BuiltinConcepts
|
||||
from core.sheerka.services.SheerkaExecute import ParserInput
|
||||
from parsers.BaseParser import BaseParser
|
||||
|
||||
|
||||
@@ -10,12 +11,10 @@ class EmptyStringParser(BaseParser):
|
||||
def __init__(self, **kwargs):
|
||||
BaseParser.__init__(self, "EmptyString", 90)
|
||||
|
||||
def parse(self, context, parser_input):
|
||||
def parse(self, context, parser_input: ParserInput):
|
||||
sheerka = context.sheerka
|
||||
|
||||
if isinstance(parser_input, str) and parser_input.strip() == "" or \
|
||||
isinstance(parser_input, list) and parser_input == [] or \
|
||||
parser_input is None:
|
||||
if parser_input.is_empty():
|
||||
ret = sheerka.ret(self.name, True, sheerka.new(
|
||||
BuiltinConcepts.PARSER_RESULT,
|
||||
parser=self,
|
||||
|
||||
Reference in New Issue
Block a user