Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Commit

Permalink
Interpreter was not passing token to error when calling a statement
Browse files Browse the repository at this point in the history
  • Loading branch information
SK1Y101 committed Apr 2, 2021
1 parent 1bd8d2a commit d3f73be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions ExampleCode/Assignment/ArrayTest.skiy
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ print(a.get(0))
a.set(0, "hello world!")
print(a)

print(a.get(0))
print(a.get(-1))
var b = array(1, 1, 2, 3, 5, 8)

print(b.get(10))
/// Expected output:
5. ///
2 changes: 1 addition & 1 deletion PySkiylia/Interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def CallExpr(self, expr):
#return and call the callable
if expr.callee.name.lexeme in self.primitives:
return callee.call(self, args, expr.callee.name)
return callee.call(self, args)
return callee.call(self, args, expr.callee.name)

#define how our interpreter handles classes
def ClassStmt(self, stmt):
Expand Down

0 comments on commit d3f73be

Please sign in to comment.