1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 08:39:30 +00:00

[language] flush literals are now --- instead of empty lines

Empty lines could lead to unexpected flushes, for example when calling another function where empty lines are used for code presentation.
This commit is contained in:
Étienne Fildadut 2024-04-30 23:00:14 +02:00
parent 5836eb2a1d
commit 13ce7a2efa
122 changed files with 68 additions and 418 deletions

View file

@ -1,7 +1,7 @@
local expression_to_ast = require("anselme.parser.expression.to_ast")
local ast = require("anselme.ast")
local PartialScope, Block, Flush, Call, Identifier = ast.PartialScope, ast.Block, ast.Flush, ast.Call, ast.Identifier
local PartialScope, Block, Call, Identifier = ast.PartialScope, ast.Block, ast.Call, ast.Identifier
local function block(source, options, str)
local start_source = source:clone()
@ -15,7 +15,6 @@ local function block(source, options, str)
local current_level = levels[#levels]
local rem = str
local last_line_empty
while rem:match("^\n") do
local line = source:consume(rem:match("^(\n)(.*)$"))
local new_indentation = utf8.len(line:match("^([ \t]*)"))
@ -23,7 +22,6 @@ local function block(source, options, str)
-- (consecutive empty lines are merged into one)
if line:match("^\n") then
rem = line
last_line_empty = true
elseif line:match("[^%s]") then
-- raise indentation
if new_indentation > current_level.indentation then
@ -48,17 +46,13 @@ local function block(source, options, str)
s, exp, rem = pcall(expression_to_ast, source, options, line)
if not s then error(("invalid expression in block: %s"):format(exp), 0) end
-- single implicit _: line was empty (e.g. single comment in the line)
-- single implicit _: line was effectively empty (e.g. single comment in the line)
if Call:is(exp) and not exp.explicit and Identifier:is(exp.func) and exp.func.name == "_" then
exp = Flush:new()
end
-- skip, empty line
else
-- add line
if last_line_empty then
current_level.block:add(Flush:new())
last_line_empty = nil
end
current_level.block:add(exp)
end
else -- end-of-file
rem = ""
end

View file

@ -0,0 +1,16 @@
local primary = require("anselme.parser.expression.primary.primary")
local ast = require("anselme.ast")
local Flush = ast.Flush
return primary {
match = function(self, str)
return str:match("^%-%-%-")
end,
parse = function(self, source, options, str)
local start_source = source:clone()
local rem = source:consume(str:match("^(%-%-%-)(.-)$"))
return Flush:new():set_source(start_source), rem
end
}

View file

@ -19,6 +19,7 @@ local primaries = {
r("implicit_block_identifier"),
r("tuple"),
r("struct"),
r("flush"),
-- prefixes
r("prefix.semicolon"),

View file

@ -76,6 +76,6 @@ return class {
end,
-- keep flushing until nothing is left (a flush may re-fill the buffer during its execution)
complete_flush = function(self, state)
while state.scope:get(last_event_type_identifier):to_lua(state) do self:flush(state) end
while state.scope:get(last_event_type_identifier):truthy() do self:flush(state) end
end
}

View file

@ -15,8 +15,7 @@ Anselme files are UTF-8 encoded text files.
Anselme will try to parse the file as a block expression. A block is a list of expression, each on a separate line.
Each line can be prefixed with indentation, consisting of spaces or tabs. The number of spaces or tabs is the indentation level. Lines with a higher level of indentation than the previous line will create a new block; this new block will be evaluated wherever the `_` block identifier appear in the previous line.
TODO Empty lines
Empty lines are ignored with regard to indentation.
```
1 // expression on line 1
@ -397,7 +396,7 @@ fn(| Text) // the text literal is not automatically called when it is not the ma
Return values consist of a an arbitrary value.
When a return value appear as one of the lines of a block, the block is stopped and immediately return the return value.
When a return value is returned by one of the lines of a block, the block is stopped and immediately return the return value.
When a return value is returned from a function call, the value associated with the return value is returned instead.

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"4" {}" = " {}"4" {}" = 4" |
--- text ---
| {}"" {}"12" {}" = " {}"12" {}" = 12" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"3" {}"" |
--- text ---
| {}"" {}"4" {}"" |
--- return ---
()

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"Hello" |
--- text ---
| {}"Hello" |
--- text ---
| {}"Wor" {}"ld" |
--- return ---
()

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"" {}"-3" {}"" |
--- text ---
| {}"" {}"heh minus lol" {}"" |
--- text ---
| {}"" {}"generic minus" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"3" {}"" |
--- return ---
()

View file

@ -1,11 +1,8 @@
--# run #--
--- text ---
| {}"" {}"{1:1, 2:2, 3:4, 4:6}" {}"" |
--- text ---
| {}"" {}"{1:1, 2:2, 3:4, 4:6}" {}"" |
--- text ---
| {}"" {}"{}" {}"" |
--- text ---
| {}"" {}"{1:1, 2:2, 3:4, 4:3, 5:9, 6:6}" {}"" |
--- return ---
()

View file

@ -1,11 +1,8 @@
--# run #--
--- text ---
| {}"" {}"[1, 2, 4, 6]" {}"" |
--- text ---
| {}"" {}"[1, 2, 4, 6]" {}"" |
--- text ---
| {}"" {}"[]" {}"" |
--- text ---
| {}"" {}"[1, 2, 4, 3, 9, 6]" {}"" |
--- return ---
()

View file

@ -4,40 +4,27 @@
| {}"x" |
--- text ---
| {}"d" |
--- text ---
| {}"From p checkpoint:" |
| {}"a" |
--- text ---
| {}"c" |
--- text ---
| {}"d" |
--- text ---
| {}"From q checkpoint:" |
| {}"b" |
--- text ---
| {}"c" |
--- text ---
| {}"d" |
--- text ---
| {}"From q checkpoint again:" |
| {}"b" |
--- text ---
| {}"c" |
--- text ---
| {}"d" |
--- text ---
| {}"Go to p again by setting checkpoint manually:" |
| {}"a" |
--- text ---
| {}"c" |
--- text ---
| {}"d" |
--- text ---
| {}"From q again:" |
| {}"b" |
--- text ---
| {}"c" |
--- text ---
| {}"d" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"1,2: " {}"*[1, 2]" {}"" |
--- text ---
| {}"1,2,3: " {}"*[1, 2, 3]" {}"" |
--- text ---
| {}"1,2,3,4: " {}"*[1, 2, 3, 4]" {}"" |
@ -9,7 +8,7 @@
| {}"1,2,3,4,5: " {}"*[1, 2, 3, 4, 5]" {}"" |
--- error ---
cancel merge
↳ from test/tests/checkpoint merging mutable value.ans:24:6 in call: error("cancel merge")
↳ from test/tests/checkpoint merging mutable value.ans:25:6 in call: error("cancel merge")
↳ from test/tests/checkpoint merging mutable value.ans:1:1 in block: :l = *[1, 2]…
--# post run check #--
--- text ---

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"1: " {}"1" {}"" |
--- text ---
| {}"2: " {}"2" {}"" |
--- text ---
| {}"3: " {}"3" {}"" |

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"Seen: " {}"2" {}"" |
--- text ---
| {}"Reached: " {}"1" {}"" |
--- return ---
()

View file

@ -2,7 +2,6 @@
--- text ---
| {}"" {}"5" {}" = 5" |
| {}"" {}"8" {}" = 8" |
--- text ---
| {}"" {}"4" {}" = 4" |
| {}"" {}"7" {}" = 7" |
--- return ---

View file

@ -1,6 +1,4 @@
--# run #--
--- text ---
| {}"before: " {}"2" {}"" |
--# parallel script #--
--- text ---
| {}"parallel: " {}"5" {}"" |
@ -8,13 +6,15 @@
()
--# main script #--
--- text ---
| {}"after: " {}"2" {}"" |
| {}"before: " {}"2" {}"" |
--# parallel script #--
--- text ---
| {}"parallel: " {}"2" {}"" |
--- return ---
()
--# main script #--
--- text ---
| {}"after: " {}"2" {}"" |
--- return ---
()
--# saved #--

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"a " {}"b" {}" c" |
--- text ---
| {}"a " {}"()" {}" c" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"*[3]" {}"" |
--- text ---
| {}"" {}"*[3, 52]" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"type(5, \"kg\")" {}"" |
--- text ---
| {}"" {}"type(12, \"kg\")" {}"" |
--- error ---
can not set weigh = 32; $(x) type(x) == t value check failed

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"type(5, \"kg\")" {}"" |
--- text ---
| {}"" {}"12" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"3" {}"" |
--- text ---
| {}"" {}"4" {}"" |
--- return ---
()

View file

@ -1,25 +1,15 @@
--# run #--
--- text ---
| {}"false = " {}"false" {}"" |
--- text ---
| {}"false = " {}"false" {}"" |
--- text ---
| {}"true = " {}"true" {}"" |
--- text ---
| {}"false = " {}"false" {}"" |
--- text ---
| {}"false = " {}"false" {}"" |
--- text ---
| {}"false = " {}"false" {}"" |
--- text ---
| {}"false = " {}"false" {}"" |
--- text ---
| {}"true = " {}"true" {}"" |
--- text ---
| {}"false = " {}"false" {}"" |
--- text ---
| {}"true = " {}"true" {}"" |
--- text ---
| {}"true = " {}"true" {}"" |
--- return ---
()

View file

@ -2,7 +2,6 @@
--- text ---
| {}"kk" |
| {}"ko" |
--- text ---
| {}"" {}"42" {}"" |
--- error ---
identifier "z" is undefined in branch test/tests/exported variable nested.ans - run

View file

@ -1,11 +1,8 @@
--# run #--
--- text ---
| {}"" {}"3" {}"" |
--- text ---
| {}"" {}"4" {}"" |
--- text ---
| {}"" {}"3" {}"" |
--- text ---
| {}"" {}"3.142" {}"" |
--- return ---
()

View file

@ -6,7 +6,6 @@
| {}"" {}"3" {}"" |
| {}"" {}"4" {}"" |
| {}"" {}"5" {}"" |
--- text ---
| {}"-" |
| {}"" {}"2" {}"" |
| {}"" {}"3" {}"" |
@ -14,22 +13,17 @@
| {}"" {}"5" {}"" |
| {}"" {}"6" {}"" |
| {}"" {}"7" {}"" |
--- text ---
| {}"-" |
| {}"" {}"2" {}"" |
| {}"" {}"5" {}"" |
--- text ---
| {}"-" |
| {}"" {}"4" {}"" |
| {}"" {}"3" {}"" |
| {}"" {}"2" {}"" |
| {}"" {}"1" {}"" |
| {}"" {}"0" {}"" |
--- text ---
| {}"-" |
--- text ---
| {}"-" |
--- text ---
| {}"-" |
| {}"" {}"4" {}"" |
--- return ---

View file

@ -1,13 +1,9 @@
--# run #--
--- text ---
| {}"" {}"5" {}"" |
--- text ---
| {}"v=" {}"50" {}"" |
--- text ---
| {}"" {}"50" {}"" |
--- text ---
| {}"v2=" {}"ok" {}"" |
--- text ---
| {}"" {}"3" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"pierre" {}" is french" |
--- text ---
| {}"" {}"idk" {}" is esperanto" |
--- error ---
can't call overload a: no function match arguments (value), possible functions were:

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"" {}"bob" {}" is english or generic" |
--- text ---
| {}"" {}"pierre" {}" is french" |
--- text ---
| {}"" {}"idk" {}" is english or generic" |
--- return ---
()

View file

@ -1,13 +1,9 @@
--# run #--
--- text ---
| {}"a" |
--- text ---
| {}"b" |
--- text ---
| {}"c" |
--- text ---
| {}"a" |
--- text ---
| {}"b" |
--- return ---
()

View file

@ -1,13 +1,9 @@
--# run #--
--- text ---
| {}"" {}"25" {}" = " {}"25" {}"" |
--- text ---
| {}"" {}"4" {}" = " {}"4" {}"" |
--- text ---
| {}"" {}"14" {}" == 14" |
--- text ---
| {}"" {}"32" {}" == 32" |
--- text ---
| {}"" {}"49" {}" == 49" |
--- return ---
()

View file

@ -1,19 +1,12 @@
--# run #--
--- text ---
| {}"local:" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"upvalue:" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"2" {}"" |
--- text ---
| {}"" {}"3" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"a" |
--- text ---
| {}"x" |
--- return ---
()

View file

@ -1,13 +1,9 @@
--# run #--
--- text ---
| {}"a" |
--- text ---
| {}"b" |
--- text ---
| {}"c" |
--- text ---
| {}"c" |
--- text ---
| {}"c" |
--- return ---
()

View file

@ -1,13 +1,9 @@
--# run #--
--- text ---
| {}"c" |
--- text ---
| {}"a" |
--- text ---
| {}"b" |
--- text ---
| {}"c" |
--- text ---
| {}"a" |
--- return ---
()

View file

@ -1,63 +1,34 @@
--# run #--
--- text ---
| {}"new list each time:" |
--- text ---
| {}"start: " {}"*[]" {}"" |
--- text ---
| {}"before recursion " {}"1" {}": " {}"*[1]" {}"" |
--- text ---
| {}"start: " {}"*[]" {}"" |
--- text ---
| {}"before recursion " {}"2" {}": " {}"*[2]" {}"" |
--- text ---
| {}"start: " {}"*[]" {}"" |
--- text ---
| {}"before recursion " {}"3" {}": " {}"*[3]" {}"" |
--- text ---
| {}"start: " {}"*[]" {}"" |
--- text ---
| {}"before recursion " {}"4" {}": " {}"*[4]" {}"" |
--- text ---
| {}"start: " {}"*[]" {}"" |
--- text ---
| {}"before recursion " {}"5" {}": " {}"*[5]" {}"" |
--- text ---
| {}"after recursion " {}"4" {}": " {}"*[4]" {}"" |
--- text ---
| {}"after recursion " {}"3" {}": " {}"*[3]" {}"" |
--- text ---
| {}"after recursion " {}"2" {}": " {}"*[2]" {}"" |
--- text ---
| {}"after recursion " {}"1" {}": " {}"*[1]" {}"" |
--- text ---
| {}"pass list:" |
--- text ---
| {}"start: " {}"*[]" {}"" |
--- text ---
| {}"before recursion " {}"1" {}": " {}"*[1]" {}"" |
--- text ---
| {}"start: " {}"*[1]" {}"" |
--- text ---
| {}"before recursion " {}"2" {}": " {}"*[1, 2]" {}"" |
--- text ---
| {}"start: " {}"*[1, 2]" {}"" |
--- text ---
| {}"before recursion " {}"3" {}": " {}"*[1, 2, 3]" {}"" |
--- text ---
| {}"start: " {}"*[1, 2, 3]" {}"" |
--- text ---
| {}"before recursion " {}"4" {}": " {}"*[1, 2, 3, 4]" {}"" |
--- text ---
| {}"start: " {}"*[1, 2, 3, 4]" {}"" |
--- text ---
| {}"before recursion " {}"5" {}": " {}"*[1, 2, 3, 4, 5]" {}"" |
--- text ---
| {}"after recursion " {}"4" {}": " {}"*[1, 2, 3, 4, 5]" {}"" |
--- text ---
| {}"after recursion " {}"3" {}": " {}"*[1, 2, 3, 4, 5]" {}"" |
--- text ---
| {}"after recursion " {}"2" {}": " {}"*[1, 2, 3, 4, 5]" {}"" |
--- text ---
| {}"after recursion " {}"1" {}": " {}"*[1, 2, 3, 4, 5]" {}"" |
--- return ---
()

View file

@ -1,59 +1,32 @@
--# run #--
--- text ---
| {}"depth 1:" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}">" {}" depth 2, unscoped:" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}">" {}" depth 2, scoped:" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}">" {}" depth 2, unscoped:" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}">" {}" depth 2, scoped:" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}">" {}" depth 2, unscoped:" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}">" {}" depth 2, scoped:" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- return ---
()

View file

@ -1,31 +1,18 @@
--# run #--
--- text ---
| {}"start: " {}"1" {}"" |
--- text ---
| {}"before recursion " {}"1" {}": " {}"2" {}"" |
--- text ---
| {}"start: " {}"1" {}"" |
--- text ---
| {}"before recursion " {}"2" {}": " {}"2" {}"" |
--- text ---
| {}"start: " {}"1" {}"" |
--- text ---
| {}"before recursion " {}"3" {}": " {}"2" {}"" |
--- text ---
| {}"start: " {}"1" {}"" |
--- text ---
| {}"before recursion " {}"4" {}": " {}"2" {}"" |
--- text ---
| {}"start: " {}"1" {}"" |
--- text ---
| {}"before recursion " {}"5" {}": " {}"2" {}"" |
--- text ---
| {}"after recursion " {}"4" {}": " {}"2" {}"" |
--- text ---
| {}"after recursion " {}"3" {}": " {}"2" {}"" |
--- text ---
| {}"after recursion " {}"2" {}": " {}"2" {}"" |
--- text ---
| {}"after recursion " {}"1" {}": " {}"2" {}"" |
--- return ---
()

View file

@ -1,19 +1,12 @@
--# run #--
--- text ---
| {}"paren:" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"no paren:" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"plopheh" {}"" |
--- text ---
| {}"" {}"4" {}"" |
--- return ---
()

View file

@ -1,11 +1,8 @@
--# run #--
--- text ---
| {}"a" |
--- text ---
| {}"x" |
--- text ---
| {}"a" |
--- text ---
| {}"" {}"gs" {}"" |
| {}"" {}"gn" {}"" |
| {}"" {}"gs" {}"" |

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"a" |
--- text ---
| {}"x" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"ok" {}"" |
--- text ---
| {}"" {}"ok" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"ok" |
--- text ---
| {}"ok2" |
--- return ---
()

View file

@ -1,13 +1,9 @@
--# run #--
--- text ---
| {}"" {}"8" {}" = 8" |
--- text ---
| {}"" {}"12" {}" = 12" |
--- text ---
| {}"" {}"6.28" {}" = 2pi" |
--- text ---
| {}"" {}"0.125" {}" = 0.125" |
--- text ---
| {}"" {}"2.1" {}" = 2.1" |
--- return ---
()

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"" {}"42" {}"" |
--- text ---
| {}"" {}"42" {}"" |
--- text ---
| {}"" {}"42" {}"" |
--- return ---
()

View file

@ -1,9 +1,8 @@
--# run #--
--- text ---
| {}"before: " {}"2" {}"" |
--- interrupt ---
nil
--- text ---
| {}"before: " {}"2" {}"" |
| {}"in interrupt: " {}"2" {}"" |
--- return ---
()

View file

@ -1,9 +1,8 @@
--# run #--
--- text ---
| {}"before: " {}"2" {}"" |
--- interrupt ---
nil
--- text ---
| {}"before: " {}"2" {}"" |
| {}"in interrupt: " {}"2" {}"" |
--- return ---
()

View file

@ -1,9 +1,8 @@
--# run #--
--- text ---
| {}"before: " {}"2" {}"" |
--- interrupt ---
nil
--- text ---
| {}"before: " {}"2" {}"" |
| {}"in interrupt: " {}"2" {}"" |
--- return ---
()

View file

@ -1,6 +1,4 @@
--# run #--
--- text ---
| {}"before: " {}"2" {}"" |
--- interrupt ---
nil
--# saved #--

View file

@ -3,27 +3,20 @@
| {}"a" |
| {}"b" |
| {}"" {}"()" {}" = a b ()" |
--- text ---
| {}"b" |
| {}"" {}"()" {}" = b ()" |
--- text ---
| {}"a" |
| {}"a" |
| {}"" {}"1" {}" = a a 1" |
--- text ---
| {}"b" |
| {}"" {}"()" {}" = b ()" |
--- text ---
| {}"a" |
| {}"" {}"1" {}" = a 1" |
--- text ---
| {}"b" |
| {}"a" |
| {}"" {}"1" {}" = b a 1" |
--- text ---
| {}"a" |
| {}"" {}"1" {}" = a 1" |
--- text ---
| {}"b" |
| {}"b" |
| {}"" {}"()" {}" = b b ()" |

View file

@ -1,13 +1,9 @@
--# run #--
--- text ---
| {}"" {}"*[1, 2]" {}"" |
--- text ---
| {}"" {}"*[3, 2]" {}"" |
--- text ---
| {}"" {}"*[3, 5]" {}"" |
--- text ---
| {}"" {}"*[3, 12]" {}"" |
--- text ---
| {}"" {}"*[3, 12, 99]" {}"" |
--- error ---
list index out of bounds

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"3" {}"" |
--- text ---
| {}"" {}"3" {}"" |
--- return ---
()

View file

@ -1,11 +1,8 @@
--# run #--
--- text ---
| {}"" {}"[1, 2, 3]" {}"" |
--- text ---
| {}"" {}"1" {}" == " {}"1" {}"" |
--- text ---
| {}"" {}"2" {}" == " {}"2" {}"" |
--- text ---
| {}"" {}"3" {}" == " {}"3" {}"" |
--- error ---
tuple index out of bounds

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"" {}"*[1, 2, 3]" {}"" |
--- text ---
| {}"" {}"*[1, 2, 3, 4]" {}"" |
--- text ---
| {}"" {}"*[1, 5, 2, 3, 4]" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"4" {}"" |
--- text ---
| {}"" {}"4" {}"" |
--- return ---
()

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"" {}"*[1, 2, 3, 4, 5]" {}"" |
--- text ---
| {}"" {}"*[1, 2, 3, 4]" {}"" |
--- text ---
| {}"" {}"*[1, 3, 4]" {}"" |
--- return ---
()

View file

@ -5,34 +5,25 @@
| {}"" {}"12" {}"" |
| {}"" {}"0.87" {}"" |
| {}"" {}"39.12" {}"" |
--- text ---
| {}"strings:" |
| {}"" {}"foo" {}"" |
--- text ---
| {}"tuple:" |
| {}"" {}"[4, 8, 9]" {}"" |
--- text ---
| {}"struct:" |
| {}"" {}"{1:9, 2:8, 7:4}" {}"" |
--- text ---
| {}"symbols:" |
| {}"" {}":ab" {}"" |
--- text ---
| {}"anchor:" |
| {}"" {}"#jdfe" {}"" |
| {}"" {}"#foo bar" {}"" |
--- text ---
| {}"boolean:" |
| {}"" {}"false" {}"" |
| {}"" {}"true" {}"" |
--- text ---
| {}"nil:" |
| {}"" {}"()" {}"" |
--- text ---
| {}"pair:" |
| {}"" {}"6:8" {}"" |
| {}"" {}"\"d\":[]" {}"" |
--- text ---
| {}"function:" |
| {}"" {}"$() 12" {}"" |
| {}"" {}"$(x) x" {}"" |

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"3" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"3" {}"" |
--- return ---
()

View file

@ -1,21 +1,13 @@
--# run #--
--- text ---
| {}"" {}"*{1:1, 2:2}" {}"" |
--- text ---
| {}"" {}"()" {}"" |
--- text ---
| {}"" {}"*{1:3, 2:2}" {}"" |
--- text ---
| {}"" {}"()" {}"" |
--- text ---
| {}"" {}"*{\"foo\":\"a\", 1:3, 2:2}" {}"" |
--- text ---
| {}"" {}"()" {}"" |
--- text ---
| {}"" {}"*{\"bar\":\"b\", \"foo\":\"a\", 1:3, 2:2}" {}"" |
--- text ---
| {}"" {}"()" {}"" |
--- text ---
| {}"" {}"*{\"bar\":\"b\", \"foo\":\"c\", 1:3, 2:2}" {}"" |
--- return ---
()

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"x=" {}"*{1:4}" {}"" |
--- text ---
| {}"1=" {}"true" {}"" |
--- text ---
| {}"a(x)=" {}"4" {}"" |
--- text ---
| {}"a(x)=" {}"4" {}"" |
@ -11,7 +9,6 @@
| {}"a(x)=" {}"4" {}"" |
--- text ---
| {}"a(x)=" {}"4" {}"" |
--- text ---
| {}"no=" {}"()" {}"" |
--- return ---
()

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"" {}"{\"ahah\":23, \"k\":23, 3:12}" {}" == " {}"{" {}"3=12, ahah=23, k=23}" |
--- text ---
| {}"" {}"12" {}" == 12" |
--- text ---
| {}"" {}"23" {}" == 23" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"yes" |
--- text ---
| {}"ye" |
| {}"da" |
--- return ---

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"foo" {}"" |
--- text ---
| {}"" {}"barr" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"[\"test\":1, 3:\"p\", \"test\":\"foo\", \"ho\":\"ah\", \"test\":\"test\"]" {}"" |
--- text ---
| {}"" {}"[\"name\":1, 3:\"p\", \"test\":\"foo\", \"ho\":\"ah\", \"name\":\"test\"]" {}"" |
--- return ---
()

View file

@ -3,11 +3,9 @@
| {}"Force run from checkpoint:" |
| {}"a" |
| {}"b" |
--- text ---
| {}"From checkpoint:" |
| {}"a" |
| {}"b" |
--- text ---
| {}"Force no checkpoint:" |
| {}"x" |
--- text ---

View file

@ -4,11 +4,9 @@
| {}"x" |
--- text ---
| {}"b" |
--- text ---
| {}"From checkpoint:" |
| {}"a" |
| {}"b" |
--- text ---
| {}"Force no checkpoint:" |
| {}"x" |
--- text ---

View file

@ -1,11 +1,8 @@
--# run #--
--- text ---
| {}"" {}"[1, 2, 4, 6]" {}"" |
--- text ---
| {}"" {}"[1, 2, 4, 6]" {}"" |
--- text ---
| {}"" {}"()" {}"" |
--- text ---
| {}"" {}"[1, 2, 4, 3, 9, 6]" {}"" |
--- return ---
()

View file

@ -1,11 +1,8 @@
--# run #--
--- text ---
| {}"pouet=" {}"7" {}" (7)" |
--- text ---
| {}"d=" {}"7" {}" (7)" |
--- text ---
| {}"d=" {}"9" {}" (9)" |
--- text ---
| {}"pouet=" {}"9" {}" (9)" |
--- return ---
()

View file

@ -8,7 +8,6 @@
--- text ---
| {}"boum" |
| {}"h " {}"8" {}"" |
--- text ---
| {}"<<>>" |
| {}"a" |
--- choice ---
@ -22,14 +21,12 @@
| {}"f" |
| {}"g" |
| {}"h " {}"8" {}"" |
--- text ---
| {}"<<>>" |
| {}"c" |
| {}"d" |
| {}"e" |
| {}"f" |
| {}"g" |
--- text ---
| {}"h " {}"8" {}"" |
--- return ---
()

View file

@ -4,33 +4,23 @@
| {}"x" |
--- text ---
| {}"d" |
--- text ---
| {}"From p checkpoint:" |
| {}"a" |
--- text ---
| {}"c" |
--- text ---
| {}"d" |
--- text ---
| {}"From q checkpoint:" |
| {}"b" |
--- text ---
| {}"c" |
--- text ---
| {}"d" |
--- text ---
| {}"From q checkpoint again:" |
| {}"b" |
--- text ---
| {}"c" |
--- text ---
| {}"d" |
--- text ---
| {}"Force p checkpoint:" |
| {}"a" |
--- text ---
| {}"c" |
--- text ---
| {}"d" |
--- return ---
()

View file

@ -3,17 +3,11 @@
| {"a":"a"}"a" |
--- text ---
| {"a":"a", "b":"b", "x":"x"}"c" |
--- text ---
| {"a":"a"}"d" |
--- text ---
| {}"e" |
--- text ---
| {"a":"a", "b":"b", "c":"c", "x":"x"}"b" |
--- text ---
| {"a":"a", "b":"b", "x":"x"}"c" |
--- text ---
| {"a":"a"}"d" |
--- text ---
| {}"e" |
--- return ---
()

View file

@ -1,11 +1,8 @@
--# run #--
--- text ---
| {}"x" |
--- text ---
| {}"x" |
--- text ---
| {}"y" |
--- text ---
| {}"x" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"50" {}" = 50" |
--- text ---
| {}"" {}"3" {}" = 3" |
--- return ---
()

View file

@ -1,17 +1,13 @@
--# run #--
--- text ---
| {}"f1: " {}"*[1, *[99], 3]" {}" " {}"*[1, *[99], 3]" {}"" |
--- text ---
| {}"CHECK" |
--- text ---
| {}"REC" |
--- text ---
| {}"f1: " {}"*[1, *[99], 3, 4]" {}" " {}"*[1, *[99], 3, 4]" {}"" |
--- text ---
| {}"CHECK" |
--- text ---
| {}"f2: " {}"*[1, *[99], 3, 4]" {}"" |
--- text ---
| {}"CHECK 2" |
--- error ---
t
@ -28,7 +24,6 @@
--# post run check #--
--- text ---
| {}"AFTER ERROR" |
--- text ---
| {}"l: " {}"*[1, *[99], 3, 4]" {}"" |
--- return ---
()

View file

@ -1,33 +1,23 @@
--# run #--
--- text ---
| {}"f1: " {}"*[1, *[99], 3]" {}" " {}"*[1, *[99], 3]" {}"" |
--- text ---
| {}"CHECK" |
--- text ---
| {}"REC" |
--- text ---
| {}"f1: " {}"*[1, *[99], 3, 4]" {}" " {}"*[1, *[99], 3, 4]" {}"" |
--- text ---
| {}"CHECK" |
--- text ---
| {}"f2: " {}"*[1, *[99], 3, 4]" {}"" |
--- text ---
| {}"CHECK 2" |
--- text ---
| {}"f3: " {}"*[1, *[99, 6], 3, 4, 5]" {}" " {}"*[1, *[99, 6], 3, 4, 5]" {}"" |
--- text ---
| {}"END REC" |
--- text ---
| {}"f2: " {}"*[1, *[99, 6], 3, 4, 5]" {}"" |
--- text ---
| {}"CHECK 2" |
--- text ---
| {}"f3: " {}"*[1, *[99, 6, 7], 3, 4, 5, 6]" {}" " {}"*[1, *[99, 6, 7], 3, 4, 5, 6]" {}"" |
--- text ---
| {}"FINAL" |
--- text ---
| {}"l: " {}"*[1, *[99, 6, 7], 3, 4, 5, 6]" {}"" |
--- text ---
| {}"x: " {}"*[99, 6, 7]" {}"" |
--- return ---
()

View file

@ -1,13 +1,10 @@
--# run #--
--- text ---
| {}"f1: " {}"*[1, 2]" {}" " {}"*[1, 2]" {}"" |
--- text ---
| {}"CHECK" |
--- text ---
| {}"REC" |
--- text ---
| {}"f1: " {}"*[1, 2, 3]" {}" " {}"*[1, 2, 3]" {}"" |
--- text ---
| {}"CHECK" |
--- error ---
t
@ -24,7 +21,6 @@
--# post run check #--
--- text ---
| {}"AFTER ERROR" |
--- text ---
| {}"l: " {}"*[1, 2, 3]" {}"" |
--- return ---
()

View file

@ -1,17 +1,13 @@
--# run #--
--- text ---
| {}"f1: " {}"*[1, *[99], 3]" {}" " {}"*[1, *[99], 3]" {}"" |
--- text ---
| {}"CHECK" |
--- text ---
| {}"REC" |
--- text ---
| {}"f1: " {}"*[1, *[99], 3, 4]" {}" " {}"*[1, *[99], 3, 4]" {}"" |
--- text ---
| {}"CHECK" |
--- text ---
| {}"f2: " {}"*[1, *[99, 12], 3, 4]" {}"" |
--- text ---
| {}"CHECK 2" |
--- error ---
t
@ -28,7 +24,6 @@
--# post run check #--
--- text ---
| {}"AFTER ERROR" |
--- text ---
| {}"l: " {}"*[1, *[99, 12], 3, 4]" {}"" |
--- return ---
()

View file

@ -1,33 +1,23 @@
--# run #--
--- text ---
| {}"f1: " {}"*[1, *[99], 3]" {}" " {}"*[1, *[99], 3]" {}"" |
--- text ---
| {}"CHECK" |
--- text ---
| {}"REC" |
--- text ---
| {}"f1: " {}"*[1, *[99], 3, 4]" {}" " {}"*[1, *[99], 3, 4]" {}"" |
--- text ---
| {}"CHECK" |
--- text ---
| {}"f2: " {}"*[1, *[99, 12], 3, 4]" {}"" |
--- text ---
| {}"CHECK 2" |
--- text ---
| {}"f3: " {}"*[1, *[99, 12, 6], 3, 4, 5]" {}" " {}"*[1, *[99, 12, 6], 3, 4, 5]" {}"" |
--- text ---
| {}"END REC" |
--- text ---
| {}"f2: " {}"*[1, *[99, 12, 6, 12], 3, 4, 5]" {}"" |
--- text ---
| {}"CHECK 2" |
--- text ---
| {}"f3: " {}"*[1, *[99, 12, 6, 12, 7], 3, 4, 5, 6]" {}" " {}"*[1, *[99, 12, 6, 12, 7], 3, 4, 5, 6]" {}"" |
--- text ---
| {}"FINAL" |
--- text ---
| {}"l: " {}"*[1, *[99, 12, 6, 12, 7], 3, 4, 5, 6]" {}"" |
--- text ---
| {}"x: " {}"*[99, 12, 6, 12, 7]" {}"" |
--- return ---
()

View file

@ -1,23 +1,16 @@
--# run #--
--- text ---
| {}"f1: " {}"*[1, 2]" {}" " {}"*[1, 2]" {}"" |
--- text ---
| {}"CHECK" |
--- text ---
| {}"REC" |
--- text ---
| {}"f1: " {}"*[1, 2, 3]" {}" " {}"*[1, 2, 3]" {}"" |
--- text ---
| {}"CHECK" |
--- text ---
| {}"f2: " {}"*[1, 2, 3, 4]" {}"" |
--- text ---
| {}"END REC" |
--- text ---
| {}"f2: " {}"*[1, 2, 3, 4, 5]" {}"" |
--- text ---
| {}"FINAL" |
--- text ---
| {}"l: " {}"*[1, 2, 3, 4, 5]" {}"" |
--- return ---
()

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"a: " {}"0" {}"" |
--- text ---
| {}"a: " {}"1" {}"" |
--- text ---
| {}"a: " {}"2" {}"" |
--- return ---
()

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"" {}"43" {}"" |
--- text ---
| {}"" {}"[2, \"\", 5]" {}"" |
--- text ---
| {}"" {}"*{\"f\":\"b\", 1:2, 2:\"\", 3:\"ok\"}" {}"" |
--- return ---
()

View file

@ -1,11 +1,8 @@
--# run #--
--- text ---
| {}"expression " {}"a" {}"" |
--- text ---
| {}"quote " {}"\"" {}"" |
--- text ---
| {}"other codes " {}"\n" {}" " {}"\" {}" " {}"\t" {}" " {}"{" {}"braces}" |
--- text ---
| {}"" {}"escaping expressions abc and {stuff} \ and quotes \"" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"2" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- return ---
()

View file

@ -2,7 +2,6 @@
--- text ---
| {}"c=" {}"2" {}" (2)" |
| {}"l=" {}"*[1, 2, 3]" {}" (*[1,2,3])" |
--- text ---
| {}"d=" {}"2" {}" (2)" |
--- error ---
can not set d = 5; constant value check failed

View file

@ -2,7 +2,6 @@
--- text ---
| {}"c=" {}"2" {}" (2)" |
| {}"l=" {}"*[1, 2, 3]" {}" (*[1,2,3])" |
--- text ---
| {}"c=" {}"5" {}" (5)" |
| {}"l=" {}"*[1, 5, 3]" {}" (*[1,5,3])" |
--- return ---

View file

@ -2,7 +2,6 @@
--- text ---
| {}"c=" {}"2" {}" (2)" |
| {}"l=" {}"*[1, 2, 3]" {}" (*[1,2,3])" |
--- text ---
| {}"c=" {}"5" {}" (5)" |
| {}"l=" {}"*[1, 5, 3]" {}" (*[1,5,3])" |
--- return ---

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"a " {1:5}"" {1:5}"b" {1:5}"" {}" c" |
--- text ---
| {2:2}"a " {1:5, 2:2}"" {1:5, 2:2}"b" {1:5, 2:2}"" {2:2}" c" |
--- return ---
()

View file

@ -2,7 +2,6 @@
--- text ---
| {}"a" |
| {}"b c" |
--- text ---
| {}"a" |
| {}"b c" |
--- return ---

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"a" |
--- text ---
| {}"b c" |
--- return ---
()

View file

@ -1,13 +1,9 @@
--# run #--
--- text ---
| {}"expression " {}"{" {}"a}" |
--- text ---
| {}"quote " {}"\"" {}"" |
--- text ---
| {}"other codes " {}"\n" {}" " {}"\" {}" " {}"\t" {}"" |
--- text ---
| {}"decorators " {}"#" {}" tag " {}"~" {}" condition " {}"$" {}" fn" |
--- text ---
| {}"sub " {}"[" {}"text]" |
--- return ---
()

View file

@ -6,7 +6,6 @@
--- text ---
| {}"ok" |
| {}"Press " {}"()" {}" to jump." |
--- text ---
| {1:1}"left" |
--- choice ---
=> | {}"Surprise choice!" |

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"Hello" |
--- text ---
| {}"Bonjour" |
--- text ---
| {}"Hello" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"" {}"Hello" {}"" |
--- text ---
| {}"" {}"Bonjour" {}"" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"Hello" |
--- text ---
| {}"Bonjour" |
--- return ---
()

View file

@ -1,7 +1,6 @@
--# run #--
--- text ---
| {}"Hello" |
--- text ---
| {}"Bonjour" |
--- return ---
()

View file

@ -1,9 +1,7 @@
--# run #--
--- text ---
| {}"" {}"-5" {}"" |
--- text ---
| {}"" {}"minus lol" {}"" |
--- text ---
| {}"" {}"generic minus" {}"" |
--- return ---
()

View file

@ -1,17 +1,11 @@
--# run #--
--- text ---
| {}"" {}"0" {}"" |
--- text ---
| {}"" {}"1" {}"" |
--- text ---
| {}"" {}"2" {}"" |
--- text ---
| {}"" {}"3" {}"" |
--- text ---
| {}"" {}"4" {}"" |
--- text ---
| {}"" {}"5" {}"" |
--- text ---
| {}"ok" |
--- return ---
()

Some files were not shown because too many files have changed in this diff Show more