Improve support for functions #1

This commit is contained in:
Bartłomiej Pluta
2019-07-04 02:09:24 +02:00
parent c8ff5ce38f
commit 6390ac20de
31 changed files with 514 additions and 328 deletions

View File

@@ -1,4 +1,4 @@
class RuntimeException(Exception):
def __init__(self, pos, msg):
posStr = "" if pos is None else f"[line {pos[0]+1}, col {pos[1]+1}]"
self.msg = f"Syntax error {posStr}:\n{msg}"
posStr = "" if pos is None else f" [line {pos[0]+1}, col {pos[1]+1}]"
self.msg = f"Runtime error{posStr}:\n{msg}"

View File

@@ -1,4 +1,4 @@
class SyntaxException(Exception):
def __init__(self, pos, msg):
posStr = "" if pos is None else f"[line {pos[0]+1}, col {pos[1]+1}]"
self.msg = f"Syntax error {posStr}:\n{msg}"
posStr = "" if pos is None else f" [line {pos[0]+1}, col {pos[1]+1}]"
self.msg = f"Syntax error{posStr}:\n{msg}"