fix: use input string in task 2
This commit is contained in:
@@ -7,7 +7,7 @@ from tokenizer import tokenize
|
||||
|
||||
from math_objects import Token, Integer, Operator
|
||||
|
||||
equation: str = "1+0-1/(0+2)"# input()
|
||||
equation: str = input()
|
||||
|
||||
if not equation.strip():
|
||||
raise SyntaxError("Пустая строка")
|
||||
|
||||
@@ -28,6 +28,6 @@ def tokenize(string: str) -> Iterable[Token]:
|
||||
elif c == " ":
|
||||
pass
|
||||
else:
|
||||
raise SyntaxError()
|
||||
raise SyntaxError(f"Недопустимый символ: {c}")
|
||||
if buffer:
|
||||
yield Integer.create_from_string(_take_buffer())
|
||||
|
||||
Reference in New Issue
Block a user