Skip to content

Commit

Permalink
error, sad
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashvin-Ranjan committed Jun 4, 2021
1 parent 328a70c commit 81c89ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/run.n
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ let i: () -> () -> int = [] -> () -> int {
}
}

let ii: () -> int = i(())
let ii: () -> int = i()

print(ii())
6 changes: 6 additions & 0 deletions python/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,13 +789,17 @@ async def eval_expr(self, expr):
elif expr.data == "function_callback" or expr.data == "function_callback_pipe":
if expr.data == "function_callback":
function, *arguments = expr.children[0].children
if len(arguments) == 0:
arguemnts.append(())
else:
mainarg = expr.children[0]
function, *arguments = expr.children[1].children
arguments.append(mainarg)
arg_values = []
for arg in arguments:
arg_values.append(await self.eval_expr(arg))
if len(arg_values) == 0:
arg_values = ["unit"]
return await (await self.eval_expr(function)).run(arg_values)
elif expr.data == "or_expression":
left, _, right = expr.children
Expand Down Expand Up @@ -1308,6 +1312,8 @@ def type_check_expr(self, expr):
elif expr.data == "function_callback" or expr.data == "function_callback_pipe":
if expr.data == "function_callback":
function, *arguments = expr.children[0].children
if len(arguments) == 0:
arguments.append("unit")
else:
mainarg = expr.children[0]
function, *arguments = expr.children[1].children
Expand Down

0 comments on commit 81c89ed

Please sign in to comment.