summaryrefslogtreecommitdiff
path: root/projects/hackc/classes.py
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-08-31 17:08:38 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-08-31 17:08:38 +0800
commit1328887bb78ba034fe3d496ad8029382c1ec678e (patch)
treef3b47fc3abaf9094184deacee3cae47317a2f0bd /projects/hackc/classes.py
parent482eed0ae339e977a618c4ab60525596426cf967 (diff)
hackc: Parser handles IndexError
Diffstat (limited to 'projects/hackc/classes.py')
-rw-r--r--projects/hackc/classes.py2
1 files changed, 0 insertions, 2 deletions
diff --git a/projects/hackc/classes.py b/projects/hackc/classes.py
index a8d446a..b300d98 100644
--- a/projects/hackc/classes.py
+++ b/projects/hackc/classes.py
@@ -61,8 +61,6 @@ class Class:
subroutines.append(subroutine)
t += dt
- if t == tokens_total:
- raise JackSyntaxError(f"Class {self.name} ends unexpectedly", tokens[-1])
end = tokens[t]
if end != RIGHT_BRACE:
raise JackSyntaxError(