mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
The previous system needed to store of the scope and full AST to build a Resumable object, which means that if persisted, updating the resumable script will have no effect. The new system instead uses an anchor token and does not require any information besides the anchor name.
17 lines
579 B
Lua
17 lines
579 B
Lua
local infix = require("parser.expression.secondary.infix.infix")
|
|
|
|
local operator_priority = require("common").operator_priority
|
|
|
|
local ast = require("ast")
|
|
local Call, Identifier, ArgumentTuple, ParameterTuple, Function = ast.Call, ast.Identifier, ast.ArgumentTuple, ast.ParameterTuple, ast.Function
|
|
|
|
return infix {
|
|
operator = "|>",
|
|
identifier = "_|>_",
|
|
priority = operator_priority["_|>_"],
|
|
|
|
build_ast = function(self, left, right)
|
|
right = Function:new(ParameterTuple:new(), right)
|
|
return Call:new(Identifier:new(self.identifier), ArgumentTuple:new(left, right))
|
|
end
|
|
}
|