mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 00:59:31 +00:00
Custom format for Typed and dispatch refactor
This commit is contained in:
parent
e222f0fb28
commit
91e1311560
8 changed files with 75 additions and 26 deletions
|
|
@ -26,8 +26,14 @@ Quote = ast.abstract.Node {
|
|||
fn(self.expression, ...)
|
||||
end,
|
||||
|
||||
call = function(self, state, args)
|
||||
assert(args.arity == 0, "Quote! does not accept arguments")
|
||||
dispatch = function(self, state, args)
|
||||
if args.arity == 0 then
|
||||
return self, args
|
||||
else
|
||||
return nil, "Quote! does not accept arguments"
|
||||
end
|
||||
end,
|
||||
call_dispatched = function(self, state, args)
|
||||
return self.expression:eval(state)
|
||||
end
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue