Skip to content

Commit cf2524a

Browse files
committed
fixed loop
1 parent af1621d commit cf2524a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Classes/parser.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ def parseBlock():
2323
def parseCommand():
2424
result = None
2525

26-
if (Parser.tokens.actual.type == 'IDENTIFIER'):
26+
if (Parser.tokens.actual.type == "LINE_END"):
27+
Parser.tokens.selectNext()
28+
if (not result):
29+
result = NoOp()
30+
31+
elif (Parser.tokens.actual.type == 'IDENTIFIER'):
2732
iden = Parser.tokens.actual.value
2833
Parser.tokens.selectNext()
2934

@@ -47,10 +52,8 @@ def parseCommand():
4752
else:
4853
raise NameError("Expected Parenthesis")
4954

50-
if (Parser.tokens.actual.type == "LINE_END"):
51-
Parser.tokens.selectNext()
52-
if (not result):
53-
result = NoOp()
55+
else:
56+
raise NameError(f"Unexpected token {Parser.tokens.actual.type}")
5457

5558
return result
5659

0 commit comments

Comments
 (0)