mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
Hide internal nodes from stack trace
This commit is contained in:
parent
5ff178b54c
commit
68a109391f
30 changed files with 120 additions and 26 deletions
|
|
@ -68,7 +68,7 @@ local Environment = ast.abstract.Runtime {
|
|||
variables = nil, -- Table of { {identifier} = variable metadata, ... }
|
||||
|
||||
partial = nil, -- { [name string] = true, ... }
|
||||
undefine = nil, -- { [name string] = true, ... }
|
||||
undefine = nil, -- { [name string] = true, ... } - variable present here will not be looked up in parent env
|
||||
export = nil, -- bool
|
||||
|
||||
init = function(self, state, parent, partial_names, is_export)
|
||||
|
|
@ -186,16 +186,6 @@ local Environment = ast.abstract.Runtime {
|
|||
return self:_get_variable(state, identifier):set(state, val)
|
||||
end,
|
||||
|
||||
-- returns a list {[symbol]=val,...} of all exported variables (evaluated) in the current strict layer
|
||||
-- TODO currently unused
|
||||
list_exported = function(self, state)
|
||||
assert(self.export, "not an export scope layer")
|
||||
local r = {}
|
||||
for _, vm in self.variables:iter(state) do
|
||||
r[vm.symbol] = vm:get(state)
|
||||
end
|
||||
return r
|
||||
end,
|
||||
-- return the depth of the environmenet, i.e. the number of parents
|
||||
depth = function(self)
|
||||
local d = 0
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ local unpack = table.unpack or unpack
|
|||
local PartialScope
|
||||
PartialScope = ast.abstract.Node {
|
||||
type = "partial scope",
|
||||
hide_in_stacktrace = true,
|
||||
|
||||
expression = nil,
|
||||
definitions = nil, -- {[sym]=value,...}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ local ast = require("anselme.ast")
|
|||
local Quote
|
||||
Quote = ast.abstract.Node {
|
||||
type = "quote",
|
||||
hide_in_stacktrace = true,
|
||||
|
||||
expression = nil,
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ local Return
|
|||
|
||||
local ReturnBoundary = ast.abstract.Node {
|
||||
type = "return boundary",
|
||||
hide_in_stacktrace = true,
|
||||
|
||||
expression = nil,
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ local translation_manager
|
|||
|
||||
local Translatable = ast.abstract.Node {
|
||||
type = "translatable",
|
||||
hide_in_stacktrace = true,
|
||||
|
||||
expression = nil,
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,12 @@ local function cutoff_text(str)
|
|||
return str
|
||||
end
|
||||
local function format_error(state, node, message)
|
||||
if node.hide_in_stacktrace then
|
||||
return message
|
||||
else
|
||||
local ctx = cutoff_text(node:format(state)) -- get some context code around error
|
||||
return fmt("%{red}%s%{reset}\n\t↳ from %{underline}%s%{reset} in %s: %{dim}%s", message, node.source, node.type, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
-- traverse helpers
|
||||
|
|
@ -58,6 +62,7 @@ Node = class {
|
|||
type = "node",
|
||||
source = "?",
|
||||
mutable = false,
|
||||
hide_in_stacktrace = false,
|
||||
|
||||
-- abstract class
|
||||
-- must be redefined
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
| {}"1,2,3,4,5: " {}"*[1, 2, 3, 4, 5]" {}"" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31mcancel merge[0m
|
||||
↳ from [4mtest/tests/checkpoint merging mutable value.ans:24:6[0m in call: [2merror("cancel merge")[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:l = *[1, 2]…[0m
|
||||
--# post run check #--
|
||||
--- text ---
|
||||
| {}"1,2,3,4: " {}"*[1, 2, 3, 4]" {}"" |
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
| {}"4: " {}"4" {}"" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31mcancel merge[0m
|
||||
↳ from [4mtest/tests/checkpoint merging variable.ans:24:6[0m in call: [2merror("cancel merge")[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:l = 1…[0m
|
||||
--# post run check #--
|
||||
--- text ---
|
||||
| {}"3: " {}"3" {}"" |
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
--- text ---
|
||||
| {}"" {}"42" {}"" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31m[0m[31mno variable "y" defined in closure[0m
|
||||
[0m[31m[0m[31m[0m[31mno variable "y" defined in closure[0m
|
||||
↳ from [4mtest/tests/closure define nested.ans:12:4[0m in call: [2mf . "y"[0m[0m
|
||||
↳ from [4mtest/tests/closure define nested.ans:12:1[0m in text interpolation: [2m| {f . "y"} |[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:f = ($() _)…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31mtrying to change the value of constant a[0m
|
||||
↳ from [4mtest/tests/constant variable.ans:5:3[0m in assignment: [2ma = 52[0m[0m
|
||||
↳ from [4m?[0m in block: [2m::a = 3…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -5,5 +5,7 @@
|
|||
| {}"" {}"type(\"kg\", 12)" {}"" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31mtype check failure for weigh; 32 does not satisfy $(x) type(x) == t[0m
|
||||
↳ from [4mtest/tests/constrained variable assignement.ans:9:7[0m in assignment: [2mweigh = 32[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:weigh::is("kg") = type(5, "kg")…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31ma is already defined in the current scope[0m
|
||||
↳ from [4mtest/tests/define override function.ans:4:4[0m in definition: [2m:a = 2[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:a = ($() _)…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31mcan't add an overload variant to non-overloadable variable a defined in the same scope[0m
|
||||
[0m[31m[0m[31mcan't add an overload variant to non-overloadable variable a defined in the same scope[0m
|
||||
↳ from [4mtest/tests/define override variable.ans:3:1[0m in definition: [2m:a = ($() _)[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:a = 2…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31ma is already defined in the current scope[0m
|
||||
↳ from [4mtest/tests/define override.ans:3:4[0m in definition: [2m:a = 2[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:a = 5…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -5,6 +5,9 @@
|
|||
--- text ---
|
||||
| {}"" {}"42" {}"" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31m[0m[31midentifier "z" is undefined in branch cf017f8a-7c86-4871-109af-6658231331e6[0m
|
||||
[0m[31m[0m[31m[0m[31midentifier "z" is undefined in branch cf017f8a-7c86-4871-109af-6658231331e6[0m
|
||||
↳ from [4mtest/tests/exported variable nested.ans:12:3[0m in identifier: [2mz[0m[0m
|
||||
↳ from [4mtest/tests/exported variable nested.ans:12:1[0m in text interpolation: [2m| {z} |[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:f = ($() _)…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31mcan't call function $(a, b) _: expected 2 arguments, received 1[0m
|
||||
↳ from [4mtest/tests/function args arity check fail.ans:4:2[0m in call: [2mf("ok")[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:f = ($(a, b) _)…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31ma function with parameters (a, b) is already defined in the overload[0m
|
||||
↳ from [4mtest/tests/function conflict.ans:5:1[0m in definition: [2m:f = ($(a, b) 0)[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:f = ($(a, b) 0)…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -7,5 +7,7 @@
|
|||
[0m[31m[0m[31mcan't call overload overload<($(name::($(x) type(x) == t)) _), ($(name::($(x) type(x) == t)) _)>: no function match (type("nope", 5)), possible functions were:
|
||||
• (name::($(x) type(x) == t)): type check failure for parameter name in function (name::($(x) type(x) == t))
|
||||
• (name::($(x) type(x) == t)): type check failure for parameter name in function (name::($(x) type(x) == t))[0m
|
||||
↳ from [4mtest/tests/function custom type dispatch error.ans:14:2[0m in call: [2ma(type(5, "nope"))[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:french name = "french name"…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31m[0m[31midentifier "b" is undefined in branch cf017f8a-7c86-4871-109af-6658231331e6[0m
|
||||
[0m[31m[0m[31m[0m[31midentifier "b" is undefined in branch cf017f8a-7c86-4871-109af-6658231331e6[0m
|
||||
↳ from [4mtest/tests/function scope wrong.ans:4:7[0m in identifier: [2mb[0m[0m
|
||||
↳ from [4mtest/tests/function scope wrong.ans:4:1[0m in text interpolation: [2m| a: {b} |[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:a = ($() _)…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -1,11 +1,14 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31m[0m[31mcan't call overload overload<($(s::($(x) type(x) == t), k::($(x) <lua function>)) = val; _), ($(s::($(x) type(x) == t), k::($(x) <lua function>)) = val; _), ($(s::($(x) type(x) == t), k::($(x) <lua function>)) _), ($(c::($(x) <lua function>), s::($(x) <lua function>)) = v; <lua function>), ($(c::($(x) <lua function>), s::($(x) <lua function>)) = v; <lua function>), ($(c::($(x) <lua function>), s::($(x) <lua function>)) <lua function>)>: no function match (overload<($(b) _), ($(x) _), ($() _)>, "a"), possible functions were:
|
||||
[0m[31m[0m[31m[0m[31mcan't call overload overload<($(s::($(x) type(x) == t), k::($(x) <lua function>)) = val; _), ($(s::($(x) type(x) == t), k::($(x) <lua function>)) = val; _), ($(s::($(x) type(x) == t), k::($(x) <lua function>)) _), ($(c::($(x) <lua function>), s::($(x) <lua function>)) = v; <lua function>), ($(c::($(x) <lua function>), s::($(x) <lua function>)) = v; <lua function>), ($(c::($(x) <lua function>), s::($(x) <lua function>)) <lua function>)>: no function match (overload<($(b) _), ($(x) _), ($() _)>, "a"), possible functions were:
|
||||
• (s::($(x) type(x) == t), k::($(x) <lua function>)) = val: expected 3 arguments, received 2
|
||||
• (s::($(x) type(x) == t), k::($(x) <lua function>)) = val: expected 3 arguments, received 2
|
||||
• (s::($(x) type(x) == t), k::($(x) <lua function>)): type check failure for parameter s in function (s::($(x) type(x) == t), k::($(x) <lua function>))
|
||||
• (c::($(x) <lua function>), s::($(x) <lua function>)) = v: expected 3 arguments, received 2
|
||||
• (c::($(x) <lua function>), s::($(x) <lua function>)) = v: expected 3 arguments, received 2
|
||||
• (c::($(x) <lua function>), s::($(x) <lua function>)): type check failure for parameter c in function (c::($(x) <lua function>), s::($(x) <lua function>))[0m
|
||||
↳ from [4mtest/tests/function separate variable from variants.ans:10:4[0m in call: [2mf . "a"[0m[0m
|
||||
↳ from [4mtest/tests/function separate variable from variants.ans:10:1[0m in text interpolation: [2m| {f . "a"} = 2 |[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:f = ($() _)…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -3,5 +3,7 @@
|
|||
[0m[31m[0m[31mcan't call overload overload<($(a::($(x) <lua function>)) _), ($(x::($(x) <lua function>)) _)>: more than one function match (5), matching functions were at least (specificity 1.3):
|
||||
• (x::($(x) <lua function>))
|
||||
• (a::($(x) <lua function>))[0m
|
||||
↳ from [4mtest/tests/function type dispatch ambigous.ans:7:3[0m in call: [2mfn(5)[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:fn = ($(x::number) _)…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -11,5 +11,7 @@
|
|||
| {}"" {}"*[3, 12, 99]" {}"" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31mlist index out of bounds[0m
|
||||
↳ from [4mtest/tests/list assignement.ans:21:6[0m in call: [2mx(5) = 0[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:x = *[1, 2]…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -8,6 +8,9 @@
|
|||
--- text ---
|
||||
| {}"" {}"3" {}" == " {}"3" {}"" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31m[0m[31mtuple index out of bounds[0m
|
||||
[0m[31m[0m[31m[0m[31mtuple index out of bounds[0m
|
||||
↳ from [4mtest/tests/list index.ans:11:4[0m in call: [2mx(-4)[0m[0m
|
||||
↳ from [4mtest/tests/list index.ans:11:1[0m in text interpolation: [2m| {x(-4)} |[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:x = [1, 2, 3]…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -1,6 +1,19 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mabort[0m
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mabort[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:14:7[0m in call: [2merror("abort")[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:3:1[0m in block: [2minsert(a, b)…[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:3:18[0m in call: [2m_[0m[0m
|
||||
↳ from [4mscript.ans:30:6[0m in call: [2mfn![0m[0m
|
||||
↳ from [4mscript.ans:28:3[0m in block: [2mresumed from = ()…[0m[0m
|
||||
↳ from [4mscript.ans:28:7[0m in call: [2melse![0m[0m
|
||||
↳ from [4mscript.ans:24:2[0m in block: [2mif(fn . "current checkpoint")…[0m[0m
|
||||
↳ from [4mscript.ans:24:9[0m in call: [2m_[0m[0m
|
||||
↳ from [4mscript.ans:38:9[0m in call: [2mvalue(s)![0m[0m
|
||||
↳ from [4mscript.ans:37:1[0m in block: [2mvalue(s)![0m[0m
|
||||
↳ from [4mscript.ans:37:20[0m in call: [2m_[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error bis.ans:19:2[0m in call: [2mf![0m[0m
|
||||
↳ from [4m?[0m in block: [2m:a = *[1]…[0m
|
||||
--# post run check #--
|
||||
--- text ---
|
||||
| {}"[1,[2,3]]: " {}"*[1, *[2, 3]]" {}"" |
|
||||
|
|
|
|||
|
|
@ -1,6 +1,19 @@
|
|||
--# run #--
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mabort[0m
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mabort[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error.ans:14:7[0m in call: [2merror("abort")[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error.ans:3:1[0m in block: [2minsert(a, b)…[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error.ans:3:18[0m in call: [2m_[0m[0m
|
||||
↳ from [4mscript.ans:30:6[0m in call: [2mfn![0m[0m
|
||||
↳ from [4mscript.ans:28:3[0m in block: [2mresumed from = ()…[0m[0m
|
||||
↳ from [4mscript.ans:28:7[0m in call: [2melse![0m[0m
|
||||
↳ from [4mscript.ans:24:2[0m in block: [2mif(fn . "current checkpoint")…[0m[0m
|
||||
↳ from [4mscript.ans:24:9[0m in call: [2m_[0m[0m
|
||||
↳ from [4mscript.ans:38:9[0m in call: [2mvalue(s)![0m[0m
|
||||
↳ from [4mscript.ans:37:1[0m in block: [2mvalue(s)![0m[0m
|
||||
↳ from [4mscript.ans:37:20[0m in call: [2m_[0m[0m
|
||||
↳ from [4mtest/tests/merge nested mutable error.ans:19:2[0m in call: [2mf![0m[0m
|
||||
↳ from [4m?[0m in block: [2m:a = *[1]…[0m
|
||||
--# post run check #--
|
||||
--- text ---
|
||||
| {}"[1,[2,3]]: " {}"*[1, *[2, 3]]" {}"" |
|
||||
|
|
|
|||
|
|
@ -14,7 +14,17 @@
|
|||
--- text ---
|
||||
| {}"CHECK 2" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:32:7[0m in call: [2merror("t")[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:8[0m in call: [2m_[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:19:4[0m in call: [2mf(t)[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:15:2[0m in block: [2m| REC |…[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:15:4[0m in call: [2mif(n < 1)[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:7:8[0m in call: [2m_[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable bis error.ans:41:2[0m in call: [2mf(l)[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:x = *[99]…[0m
|
||||
--# post run check #--
|
||||
--- text ---
|
||||
| {}"AFTER ERROR" |
|
||||
|
|
|
|||
|
|
@ -10,7 +10,17 @@
|
|||
--- text ---
|
||||
| {}"CHECK" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:23:7[0m in call: [2merror("t")[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:8[0m in call: [2m_[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:17:4[0m in call: [2mf(t)[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:13:2[0m in block: [2m| REC |…[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:13:4[0m in call: [2mif(n < 1)[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:5:8[0m in call: [2m_[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable error.ans:32:2[0m in call: [2mf(l)[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:l = *[1]…[0m
|
||||
--# post run check #--
|
||||
--- text ---
|
||||
| {}"AFTER ERROR" |
|
||||
|
|
|
|||
|
|
@ -14,7 +14,17 @@
|
|||
--- text ---
|
||||
| {}"CHECK 2" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
||||
[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31m[0m[31mt[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:34:7[0m in call: [2merror("t")[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:8[0m in call: [2m_[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:19:4[0m in call: [2mf(t)[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:15:2[0m in block: [2m| REC |…[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:15:4[0m in call: [2mif(n < 1)[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:1[0m in block: [2minsert(t, len(l) + 1)…[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:7:8[0m in call: [2m_[0m[0m
|
||||
↳ from [4mtest/tests/scope checkpoint mutable ter error.ans:43:2[0m in call: [2mf(l)[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:x = *[99]…[0m
|
||||
--# post run check #--
|
||||
--- text ---
|
||||
| {}"AFTER ERROR" |
|
||||
|
|
|
|||
|
|
@ -6,5 +6,7 @@
|
|||
| {}"d=" {}"2" {}" (2)" |
|
||||
--- error ---
|
||||
[0m[31m[0m[31mtrying to change the value of constant d[0m
|
||||
↳ from [4mtest/tests/symbol alias constant.ans:12:3[0m in assignment: [2md = 5[0m[0m
|
||||
↳ from [4m?[0m in block: [2m:l = *[1, 2, 3]…[0m
|
||||
--# saved #--
|
||||
{}
|
||||
|
|
@ -47,8 +47,6 @@ local function run_loop(run_state, out)
|
|||
elseif e == "return" then
|
||||
table.insert(out, data:format(run_state))
|
||||
run_state:merge()
|
||||
elseif e == "error" then
|
||||
table.insert(out, (tostring(data):gsub("\n%s*↳[^\n]*", ""))) -- traceback change every day and a half due to AST changes. TODO: only keep ast layers relevant for the user
|
||||
else
|
||||
table.insert(out, tostring(data))
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue