✨
This commit is contained in:
@@ -69,7 +69,7 @@ class DataRangeArray(BaseBox):
|
||||
content_string = rep_join([self.from_value, self.to_value])
|
||||
return f"RangeArray([{content_string}])"
|
||||
|
||||
def eval(self, vtable, ftable, modules):
|
||||
def eval(self, *_):
|
||||
content = list(range(self.from_value.eval(), self.to_value.eval()))
|
||||
return content
|
||||
|
||||
|
||||
22
main.py
22
main.py
@@ -2,23 +2,13 @@ from lexer import Lexer
|
||||
from parser import Parser
|
||||
|
||||
text_input = """
|
||||
VOCA FORS
|
||||
|
||||
DESIGNA correct UT FORTIS_NUMERUS I C
|
||||
DESIGNA gvess UT NULLUS
|
||||
|
||||
DUM FALSITAS FACE {
|
||||
DESIGNA gvess UT AUDI_NUMERUS
|
||||
SI gvess MINUS correct TUNC {
|
||||
DICE "Too low!"
|
||||
} ALUID SI gvess PLUS correct TUNC {
|
||||
DICE "Too high!"
|
||||
} ALUID {
|
||||
ERUMPE
|
||||
}
|
||||
DEFINI invoca i UT {
|
||||
REDI i
|
||||
}
|
||||
|
||||
DICE "You guessed correctly!"
|
||||
DESIGNA invoca UT I
|
||||
|
||||
DICE (INVOCA invoca invoca)
|
||||
"""
|
||||
|
||||
lexer = Lexer().get_lexer()
|
||||
@@ -28,7 +18,7 @@ parser = pg.get_parser()
|
||||
|
||||
tokens = lexer.lex(text_input)
|
||||
#for token in tokens:
|
||||
# print(token)
|
||||
# print(token)
|
||||
|
||||
x = parser.parse(tokens)
|
||||
#print(x)
|
||||
|
||||
Reference in New Issue
Block a user