mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 00:59:31 +00:00
Replace checkpoint system
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.
This commit is contained in:
parent
c4636343b4
commit
56ed6c912b
21 changed files with 217 additions and 234 deletions
|
|
@ -3,7 +3,7 @@ local infix = require("parser.expression.secondary.infix.infix")
|
|||
local operator_priority = require("common").operator_priority
|
||||
|
||||
local ast = require("ast")
|
||||
local Call, Identifier, ArgumentTuple, ResumeParentFunction, ParameterTuple, Function = ast.Call, ast.Identifier, ast.ArgumentTuple, ast.ResumeParentFunction, ast.ParameterTuple, ast.Function
|
||||
local Call, Identifier, ArgumentTuple, ParameterTuple, Function = ast.Call, ast.Identifier, ast.ArgumentTuple, ast.ParameterTuple, ast.Function
|
||||
|
||||
return infix {
|
||||
operator = "|>",
|
||||
|
|
@ -11,7 +11,7 @@ return infix {
|
|||
priority = operator_priority["_|>_"],
|
||||
|
||||
build_ast = function(self, left, right)
|
||||
right = Function:new(ParameterTuple:new(), ResumeParentFunction:new(right))
|
||||
right = Function:new(ParameterTuple:new(), right)
|
||||
return Call:new(Identifier:new(self.identifier), ArgumentTuple:new(left, right))
|
||||
end
|
||||
}
|
||||
|
|
|
|||
9
parser/expression/secondary/infix/resume.lua
Normal file
9
parser/expression/secondary/infix/resume.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
local infix_quote_right = require("parser.expression.secondary.infix.infix_quote_right")
|
||||
|
||||
local operator_priority = require("common").operator_priority
|
||||
|
||||
return infix_quote_right {
|
||||
operator = "~>",
|
||||
identifier = "_~>_",
|
||||
priority = operator_priority["_~>_"]
|
||||
}
|
||||
|
|
@ -8,10 +8,11 @@ local secondaries = {
|
|||
-- binary infix operators
|
||||
-- 1
|
||||
r("infix.semicolon"),
|
||||
r("infix.translate"),
|
||||
-- 2
|
||||
r("infix.tuple"),
|
||||
r("infix.tag"),
|
||||
r("infix.translate"),
|
||||
r("infix.resume"),
|
||||
-- 4
|
||||
r("infix.while"),
|
||||
r("infix.if"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue