Update our parse errors to match latest illuaminate

We've been out-of-date for a while now, as we needed to update
lua_menhir to work with lrgrep 3.

 - Better handling of standalone names/expressions - we now correctly
   handle lists of names.

 - Handle missing commas in tables in a few more places.
This commit is contained in:
Jonathan Coates committed 2024-02-08 19:22:14 +00:00
1 parent f14cb2a3d1
commit d2896473f2
5 files changed
+305 -146

No files matched your search

+4
View File
@@ -105,6 +105,10 @@
/projects/core/src/main/resources/data/computercraft/lua/rom/apis/turtle/turtle.lua)
(linters -var:deprecated))
;; Suppress unused variable warnings in the parser.
(at /projects/core/src/main/resources/data/computercraft/lua/rom/modules/main/cc/internal/syntax/parser.lua
(linters -var:unused))
(at /projects/core/src/test/resources/test-rom
; We should still be able to test deprecated members.
(linters -var:deprecated)
@@ -453,32 +453,53 @@ function errors.local_function_dot(local_start, local_end, dot_start, dot_end)
}
end
--[[- A statement of the form `x.y z`
--[[- A statement of the form `x.y`
@tparam number token The token id.
@tparam number pos The position right after this name.
@return The resulting parse error.
]]
function errors.standalone_name(pos)
expect(1, pos, "number")
function errors.standalone_name(token, pos)
expect(1, token, "number")
expect(2, pos, "number")
return {
"Unexpected symbol after name.",
"Unexpected " .. token_names[token] .. " after name.",
annotate(pos),
"Did you mean to assign this or call it as a function?",
}
end
--[[- A statement of the form `x.y, z`
@tparam number token The token id.
@tparam number pos The position right after this name.
@return The resulting parse error.
]]
function errors.standalone_names(token, pos)
expect(1, token, "number")
expect(2, pos, "number")
return {
"Unexpected " .. token_names[token] .. " after name.",
annotate(pos),
"Did you mean to assign this?",
}
end
--[[- A statement of the form `x.y`. This is similar to [`standalone_name`], but
when the next token is on another line.
@tparam number token The token id.
@tparam number pos The position right after this name.
@return The resulting parse error.
]]
function errors.standalone_name_call(pos)
expect(1, pos, "number")
function errors.standalone_name_call(token, pos)
expect(1, token, "number")
expect(2, pos, "number")
return {
"Unexpected symbol after variable.",
"Unexpected " .. token_names[token] .. " after name.",
annotate(pos + 1, "Expected something before the end of the line."),
"Tip: Use " .. code("()") .. " to call with no arguments.",
}
@@ -63,8 +63,8 @@ Errors are extracted from the current parse state in a two-stage process:
the user.
This process is performed by a tiny register-based virtual machine. The bytecode
for this machine is stored in `error_program`, and the accompanying transition
table in `error_tbl`.
for this machine is stored in `error_message_program`, and the accompanying
transition table in `error_message_table`.
It would be more efficient to use tables here (`string.byte` is 2-3x slower than
a table lookup) or even define the DFA as a Lua program, however this approach
@@ -74,174 +74,207 @@ See https://github.com/let-def/lrgrep/ (namely ./support/lrgrep_runtime.ml) for
more information.
]]
local function is_same_line(context, previous, token)
local function is_same_line(context, previous, token, token_start)
local prev_line = context.get_pos(previous)
local tok_line = context.get_pos(token.s)
return prev_line == tok_line and token.v ~= tokens.EOF
local tok_line = context.get_pos(token_start)
return prev_line == tok_line and token ~= tokens.EOF
end
local function line_end_position(context, previous, token)
if is_same_line(context, previous, token) then
return token.s
else
return previous + 1
end
end
local expr_tokens = {}
for _, v in pairs { tokens.STRING, tokens.NUMBER, tokens.TRUE, tokens.FALSE, tokens.NIL } do
expr_tokens[v] = true
end
local error_messages = {
function(context, stack, stack_n, regs, token)
-- parse_errors.mlyl, line 26
if token.v == tokens.EQUALS then
return errors.table_key_equals(token.s, token.e)
end
local error_message = {
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
if token == tokens.EQUALS then
-- parse_errors.mlyl, line 13
return errors.table_key_equals(_startloc_token_, _endloc_token_)
end
end,
function(context, stack, stack_n, regs, token)
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
if token == tokens.EQUALS then
-- parse_errors.mlyl, line 17
return errors.use_double_equals(_startloc_token_, _endloc_token_)
end
end,
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
if token == tokens.STRING or token == tokens.NUMBER or token == tokens.TRUE or token == tokens.FALSE or token == tokens.NIL or token == tokens.OSQUARE or token == tokens.OPAREN or token == tokens.IDENT then
local _startloc_last_ = stack[regs[1] + 1]
local _endloc_last_ = stack[regs[2] + 2]
-- parse_errors.mlyl, line 21
return errors.missing_table_comma(token, _startloc_token_, _endloc_token_, _endloc_last_)
end
end,
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
if token == tokens.CPAREN then
local comma = stack[regs[1]]
local _startloc_comma_ = stack[regs[1] + 1]
local _endloc_comma_ = stack[regs[1] + 2]
-- parse_errors.mlyl, line 28
return errors.trailing_call_comma(_startloc_comma_, _endloc_comma_, _startloc_token_, _endloc_token_)
end
end,
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
local open_ = stack[regs[1]]
local _startloc_open__ = stack[regs[1] + 1]
local _endloc_open__ = stack[regs[1] + 2]
-- parse_errors.mlyl, line 34
if token.v == tokens.EQUALS then
return errors.use_double_equals(token.s, token.e)
end
return errors.unclosed_brackets(_startloc_open__, _endloc_open__, token, _startloc_token_, _endloc_token_)
end,
function(context, stack, stack_n, regs, token)
-- parse_errors.mlyl, line 42
if expr_tokens[token.v] then
return errors.missing_table_comma(token.v, token.s, token.e, stack[stack_n + 2])
end
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
local start = stack[regs[1]]
local _startloc_start_ = stack[regs[1] + 1]
local _endloc_start_ = stack[regs[1] + 2]
-- parse_errors.mlyl, line 37
return errors.unclosed_label(_startloc_start_, _endloc_start_, token, _startloc_token_, _endloc_token_)
end,
function(context, stack, stack_n, regs, token)
local comma = { s = stack[regs[2] + 1], e = stack[regs[2] + 2] }
-- parse_errors.mlyl, line 52
if token.v == tokens.CPAREN then
return errors.trailing_call_comma(comma.s, comma.e, token.s, token.e)
end
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
if token == tokens.DOT then
local local_ = stack[regs[1]]
local _startloc_local__ = stack[regs[1] + 1]
local _endloc_local__ = stack[regs[1] + 2]
-- parse_errors.mlyl, line 41
return errors.local_function_dot(_startloc_local__, _endloc_local__, _startloc_token_, _endloc_token_)
end
end,
function(context, stack, stack_n, regs, token)
local lp = { s = stack[regs[2] + 1], e = stack[regs[2] + 2] }
-- parse_errors.mlyl, line 60
return errors.unclosed_brackets(lp.s, lp.e, token.v, token.s, token.e)
end,
function(context, stack, stack_n, regs, token)
local lp = { s = stack[regs[2] + 1], e = stack[regs[2] + 2] }
-- parse_errors.mlyl, line 62
return errors.unclosed_brackets(lp.s, lp.e, token.v, token.s, token.e)
end,
function(context, stack, stack_n, regs, token)
local lp = { s = stack[regs[2] + 1], e = stack[regs[2] + 2] }
-- parse_errors.mlyl, line 64
return errors.unclosed_brackets(lp.s, lp.e, token.v, token.s, token.e)
end,
function(context, stack, stack_n, regs, token)
local lp = { s = stack[regs[2] + 1], e = stack[regs[2] + 2] }
-- parse_errors.mlyl, line 66
return errors.unclosed_label(lp.s, lp.e, token.v, token.s, token.e)
end,
function(context, stack, stack_n, regs, token)
local loc = { s = stack[regs[2] + 1], e = stack[regs[2] + 2] }
-- parse_errors.mlyl, line 71
if token.v == tokens.DOT then
return errors.local_function_dot(loc.s, loc.e, token.s, token.e)
end
end,
function(context, stack, stack_n, regs, token)
-- parse_errors.mlyl, line 79
local end_pos = stack[stack_n + 2] -- Hack to get the last position
if is_same_line(context, end_pos, token) then
return errors.standalone_name(token.s)
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
local _startloc_expr_ = stack[regs[1] + 1]
local _endloc_expr_ = stack[regs[2] + 2]
local if_ = stack[regs[3]]
local _startloc_if__ = stack[regs[3] + 1]
local _endloc_if__ = stack[regs[3] + 2]
-- parse_errors.mlyl, line 45
local start
if is_same_line(context, _endloc_expr_, token, _startloc_token_) then
start = _startloc_token_
else
return errors.standalone_name_call(end_pos)
start = _endloc_expr_ + 1
end
return errors.expected_then(_startloc_if__, _endloc_if__, start)
end,
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
local start = stack[regs[1]]
local _startloc_start_ = stack[regs[1] + 1]
local _endloc_start_ = stack[regs[1] + 2]
-- parse_errors.mlyl, line 64
return errors.expected_end(_startloc_start_, _endloc_start_, token, _startloc_token_, _endloc_token_)
end,
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
local func = stack[regs[1]]
local _startloc_func_ = stack[regs[1] + 1]
local _endloc_func_ = stack[regs[1] + 2]
local loc = stack[regs[2]]
local _startloc_loc_ = stack[regs[2] + 1]
local _endloc_loc_ = stack[regs[2] + 2]
-- parse_errors.mlyl, line 68
return errors.expected_end(_startloc_loc_, _endloc_func_, token, _startloc_token_, _endloc_token_)
end,
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
local _startloc_x_ = stack[regs[1] + 1]
local _endloc_x_ = stack[regs[2] + 2]
-- parse_errors.mlyl, line 72
if not is_same_line(context, _endloc_x_, token, _startloc_token_) then
return errors.standalone_name_call(token, _endloc_x_)
end
end,
function(context, stack, stack_n, regs, token)
local start = { s = stack[regs[2] + 1], e = stack[regs[2] + 2] }
-- parse_errors.mlyl, line 90
return errors.expected_then(start.s, start.e, line_end_position(context, stack[stack_n + 2], token))
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
-- parse_errors.mlyl, line 79
return errors.standalone_name(token, _startloc_token_)
end,
function(context, stack, stack_n, regs, token)
local start = { s = stack[regs[2] + 1], e = stack[regs[2] + 2] }
-- parse_errors.mlyl, line 118
return errors.expected_end(start.s, start.e, token.v, token.s, token.e)
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
-- parse_errors.mlyl, line 82
return errors.standalone_names(token, _startloc_token_)
end,
function(context, stack, stack_n, regs, token)
local func = { s = stack[regs[2] + 1], e = stack[regs[2] + 2] }
local loc = { s = stack[regs[3] + 1], e = stack[regs[3] + 2] }
-- parse_errors.mlyl, line 122
return errors.expected_end(loc.s, func.e, token.v, token.s, token.e)
end,
function(context, stack, stack_n, regs, token)
-- parse_errors.mlyl, line 126
if token.v == tokens.END then
return errors.unexpected_end(token.s, token.e)
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
-- parse_errors.mlyl, line 86
if token == tokens.END then
return errors.unexpected_end(_startloc_token_, _endloc_token_)
elseif token ~= tokens.EOF then
return errors.expected_statement(token.v, token.s, token.e)
return errors.expected_statement(token, _startloc_token_, _endloc_token_)
end
end,
function(context, stack, stack_n, regs, token)
-- parse_errors.mlyl, line 136
return errors.expected_function_args(token.v, token.s, token.e)
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
-- parse_errors.mlyl, line 96
return errors.expected_function_args(token, _startloc_token_, _endloc_token_)
end,
function(context, stack, stack_n, regs, token)
-- parse_errors.mlyl, line 140
return errors.expected_expression(token.v, token.s, token.e)
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
-- parse_errors.mlyl, line 100
return errors.expected_expression(token, _startloc_token_, _endloc_token_)
end,
function(context, stack, stack_n, regs, token)
-- parse_errors.mlyl, line 144
return errors.expected_var(token.v, token.s, token.e)
function(context, stack, stack_n, regs, token, _startloc_token_, _endloc_token_)
-- parse_errors.mlyl, line 104
return errors.expected_var(token, _startloc_token_, _endloc_token_)
end,
}
local error_program_start, error_program = 491, "\6\1\0\3\0072\0\3\7\186\0\3\7\168\0\3\7\160\0\3\7\152\0\3\7\141\0\3\7\127\0\3\7u\0\3\7d\0\3\7W\0\1\0\3\7C\0\3\7;\0\1\0\3\0072\0\3\7*\0\3\7\"\0\3\7\"\0\3\7\"\0\3\7\"\0\3\7\"\0\3\7\n\0\3\7\n\0\3\7\"\0\3\7\26\0\3\7\18\0\3\7\18\0\3\7\18\0\3\7\n\0\3\7\2\0\3\6\232\0\3\6\224\0\3\6\216\0\3\6\208\0\3\6\200\0\3\6\22\0\3\6\190\0\3\6\186\0\3\6\175\0\3\6#\0\3\6\31\0\3\6\23\0\3\1\246\0\3\6\22\0\3\6\16\0\3\6\n\0\3\6\4\0\3\5\255\0\3\5\245\0\3\5\237\0\3\5\226\0\3\5\193\0\3\5\188\0\1\0\3\5\183\0\1\0\3\5\178\0\3\5\165\0\3\5\154\0\3\4\235\0\3\2\29\0\3\0048\0\3\3\155\0\3\3\147\0\3\3\143\0\3\3\135\0\3\3w\0\3\3\139\0\3\3\135\0\3\3\135\0\3\3\131\0\3\3\127\0\3\2\249\0\3\3{\0\3\2\234\0\3\2\234\0\3\3w\0\3\3p\0\3\2\234\0\3\2\249\0\3\2\234\0\3\2\234\0\3\2\234\0\3\2\234\0\3\2\241\0\3\2\234\0\3\2\234\0\3\2\234\0\3\2\234\0\3\2a\0\3\2)\0\3\2U\0\3\2Y\0\3\2)\0\3\2U\0\3\2U\0\3\2Q\0\3\2M\0\3\2I\0\3\2%\0\3\2=\0\3\2E\0\3\0029\0\3\2A\0\3\2=\0\3\0029\0\3\0025\0\3\0021\0\3\2-\0\3\2)\0\3\2%\0\3\2!\0\3\2\29\0\3\2\25\0\3\2\21\0\3\2\21\0\3\2\17\0\3\2\r\0\3\2\t\0\3\2\t\0\3\1\255\0\3\2\5\0\3\1\255\0\3\1\246\0\5\0\0\3\5\250\0\3\7\197\0\5\0\15\1\0\3\5\178\0\1\0\3\5\178\0\3\7\197\0\3\7\205\0\3\7\205\0\3\2\r\0\3\7\214\0\3\7\218\0\3\5\188\0\3\7\222\0\3\2A\0\3\8\2\0\3\5\226\0\3\2-\0\3\0021\0\3\2%\0\3\2)\0\3\2U\0\3\2Q\0\3\2E\0\3\8\t\0\3\0029\0\3\2=\0\3\8\2\0\3\2-\0\5\0\5\1\0\3\5\178\0\1\0\3\8\149\0\3\8\133\0\1\0\3\8|\0\1\0\3\8s\0\1\0\3\8j\0\3\8b\0\3\8Z\0\3\8Z\0\3\8Z\0\3\8Z\0\3\8Z\0\3\8B\0\3\8B\0\3\8Z\0\3\8R\0\3\8J\0\3\8J\0\3\8J\0\3\8B\0\3\8:\0\3\0082\0\3\8*\0\3\8*\0\3\8\"\0\3\8\26\0\3\8\18\0\3\2\234\0\3\2\234\0\3\2\234\0\3\3\135\0\5\0\196\3\8\r\0\3\3w\0\3\8\166\0\5\0\8\3\t.\0\1\0\3\8\149\0\3\8\133\0\1\0\3\8|\0\1\0\3\8s\0\1\0\3\8j\0\3\8b\0\3\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2, "\0\0\203\1\0\147\2\0\0\3\0\199\0\0\0\5\1[\0\0\0\7\1W\0\0\0\t\0\211\0\0\0\11\1S\0\0\0\r\1O\0\0\0\15\0\231\16\0\227\17\0\191\18\0\217\19\1\231\20\0\167\21\1\227\22\0\0\23\0\239\24\1\223\25\0\183\26\1\183\27\1\219\28\0\11\29\0'\30\1K\31\1G \1C!\0\151\"\1?#\1;$\0017\22\1\242&\0013'\1/\0\0\0)\1+*\1'+\1#,\0\27\0\0\0.\0o\0\0\0000\0k\0\0\0002\0g\0\0\0004\0c\0\0\0006\0_\0\0\0008\0[\0\0\0:\0W\0\0\0<\0S\0\0\0>\0O\0\0\0@\0K\0\0\0B\0G\0\0\0D\0C\0\0\0F\0?\0\0\0H\0;I\0\251J\0\217K\1_L\0+M\0wN\0\183O\1\31P\0sQ\0\0R\0\247S\0\0T\0\0U\1\27V\1\23W\1\19X\1\15Y\1\11Z\0\27[\0\0T\2\245]\0\131^\0\223_\1\215`\1\211a\1\207b\1\203c\0\243a\3\151e\0\127f\0#g\0\179h\1\7i\0\31j\1\3k\0\255l\0\135m\0\7n\0'o\1\179p\1\175q\1\171r\1\167s\1\163t\0\203u\0\147q\2]w\0{x\0\0y\0\187z\0001{\0\23|\0'}\1\159~\0\159\127\1\155a\5\161\129\1\151\130\0\187\131\0\155x\6\27\133\0\135\134\0\19\135\0\147\136\0\139\137\1\147a\7`\139\0\135\140\0\15\141\0\143\142\0005\143\0'\144\1\143\145\0\235\146\1\139\147\0\187\148\0\163\149\0\191\150\0\0\151\1\199\152\0\0\153\1\195\154\0\23\155\0'\156\1\135\157\0\187\158\0\171\28\7O\160\0\135\149\7\137\162\0\135\163\0\7\164\0'\165\1\131\134\6\182\167\0\135\168\0\7\169\0'\170\1\127\171\0\0\140\6\182\173\0\0\174\0\7\175\0'\176\1{\177\0\0\178\0\175\179\1w\180\0\1\181\0'\182\1s\183\1o\184\1k\185\0\0\186\0\207a\7\201\188\1g\189\0\187\190\1\191\191\1\187\192\0\195\193\1c\194\0\0\195\0\0\196\0\0\197\0\0\198\0\0\3\0\0x\tE\132\6\194\6\2\218\149\t]\8\2\128\t\2j\n\2z\138\6\194\12\2\222J\t\211\14\2\226\17\n\ta\n\30\0\0\0\0\0\0\0\0\0\0\0\0J\6\240\0\0\0J\n+" .. ("\0"):rep(39) .. "%\2z\0\0\0\0\0\0(\2\230\0\0\0\0\0\0\0\0\0m\7K-\2\186\0\0\0/\2\182\0\0\0001\2\178K\7\1823\2\174K\tz5\2\170\0\0\0007\2\166\0\0\0009\2\162{\7S;\2\158q\6\254=\2\154q\n9?\2\150\0\0\0A\2\146\0\0\0C\2\142\0\0\0E\2\138\0\0\0G\2\134\0\0\0\0\0\0J\2\128\128\6\250L\2\190\128\n5\8\3\22\t\3\0\n\3\16\0\0\0\0\0\0l\7\178\0\0\0l\tv\\\12\153\0\0\0\0\0\0\154\7S\0\0\0\0\0\0\\\2\214\0\0\0d\12\153\0\0\0\0\0\0a\2p\163\7K\0\0\0d\2\210\0\0\0\0\0\0\168\7K\129\7\182\0\0\0\129\tz%\3\16\0\0\0\174\7K\0\0\0\0\0\0\0\0\0q\2\206\0\0\0-\3P\28\5\204/\3Lv\2\2021\3Hz\n\0153\3D\128\12\1535\3@\0\0\0007\3<\0\0\0009\0038\128\2\198;\0034\0\0\0=\0030\132\2t?\3,\187\6\246A\3(\187\n1C\3$\138\2tE\3 \0\7\254G\3\28\0\0\0\0\0\0J\3\22\0\0\0L\3T\0\0\0\173\7\182\0\0\0\173\tz\0\0\0\0\0\0\159\12\153" .. ("\0"):rep(24) .. "\\\3l\188\7\182\0\0\0\188\tz\0\0\0a\3\6\28\7\232\0\0\0d\3h\196\7\182\0\0\0\196\tz\0\0\0\3\3\186\0\0\0\0\0\0\6\4\24\0\0\0\8\3\180\187\12\153\n\3\174q\3d\12\4\28\0\0\0\14\4 \187\2\194v\3`\189\0\0\18\3\190\0\0\0\0\0\0\0\0\0\22\0044\0\0\0\0\0\0\0\0\0\128\3\\\0\0\0\0\0\0\0\0\0\132\3\n\0\0\0t\0\0\0\0\0\0\0\0\0\0\0\138\3\n%\3\174\0\0\0{\5\216(\4$\0\0\0\0\0\0\0\0\0\0\0\0-\3\248\0\0\0/\3\244\0\0\0001\3\240\134\5\2123\3\236\0\0\0005\3\232\0\0\0007\3\228\140\5\2089\3\224\142\5\220;\3\220\0\0\0=\3\216\0\0\0?\3\212\0\0\0A\3\208\0\0\0C\3\204\0\0\0E\3\200\154\5\216G\3\196\0\0\0\0\0\0J\3\180\0\0\0L\3\252" .. ("\0"):rep(21) .. "t\7\254\187\3X" .. ("\0"):rep(15) .. "{\7\244\\\4\20\0\0\0\0\0\0\0\0\0\180\5\198\0\0\0\0\0\0\0\0\0d\4\16\0\0\0\134\7\240" .. ("\0"):rep(15) .. "\140\7\236\0\0\0\142\7\248\0\0\0\0\0\0q\4\12\0\0\0\28\t\139\0\0\0\0\0\0v\4\8\0\0\0x\4,y\3\164\154\7\244" .. ("\0"):rep(15) .. "\128\4\4\0\0\0\130\4(\0\0\0\132\3\168\0\0\0\3\4_\0\0\0\0\0\0\6\4\199\138\3\168\8\4Y\t\4?\n\4S\0\0\0\12\4\203\0\0\0\14\4\207\0\0\0\147\3\164\180\7\226\18\4i\8\11%\t\11\15\n\11\31\22\4\231\0\0\0\0\0\0\0\0\0\157" .. ("\0"):rep(32) .. "%\4S\0\0\0\0\0\0(\4\211\0\0\0\0\0\0\0\0\0\0\0\0-\4\163\0\0\0/\4\159%\11\0311\4\155\0\0\0003\4\151\0\0\0005\4\147\0\0\0007\4\143\187\4\0009\4\139\189\0040;\4\135\0\0\0=\4\131\0\0\0?\4\127\0\0\0A\4{\0\0\0C\4w\0\0\0E\4s\0\0\0G\4ot\0\0\0\0\0J\4Y\0\0\0L\4\167\0\0\0\0\0\0{\t\151\0\0\0Q\4\195\0\0\0S\0\0\0\0\0J\11%\0\0\0L\11+\0\0\0\0\0\0\134\t\147\0\0\0\\\4\191\0\0\0\0\0\0\0\0\0\140\t\143a\4E\142\t\155\0\0\0d\4\187\0\0\0\0\0\0\\\11C\0\0\0\0\0\0\0\0\0\0\0\0a\11\21\0\0\0\154\t\151d\11?\0\0\0q\4\183\0\0\0\0\0\0\0\0\0\0\0\0v\4\179\0\0\0x\4\223y\4I\0\0\0\0\0\0q\11;\0\0\0\0\0\0\0\0\0\128\4\175v\0117\130\4\219\0\0\0\132\4M\0\0\0\0\0\0\0\0\0\180\t\133\0\0\0\138\4M\128\0113\0\0\0\0\0\0\0\0\0\132\11\25\0\0\0\145\4\215\0\0\0\147\4I\0\0\0\138\11\25\0\0\0\0\0\0\6\5v\0\0\0\8\5\12\t\4\242\n\5\6\157\0\0\12\5z\0\0\0\14\5~\0\0\0\0\0\0\0\0\0\18\5\24\0\0\0\0\0\0\0\0\0\22\5\150" .. ("\0"):rep(24) .. "\177\4c" .. ("\0"):rep(15) .. "%\5\6\0\0\0\0\0\0(\5\130\187\4\171\0\0\0\189\4\227\0\0\0-\5R\0\0\0/\5N\0\0\0001\5J\0\0\0003\5F\187\11/5\5B\0\0\0007\5>\0\0\0009\5:\0\0\0;\0056\0\0\0=\0052\0\0\0?\5.\0\0\0A\5*\0\0\0C\5&\0\0\0E\5\"\0\0\0G\5\30\0\0\0\0\0\0J\5\12\0\0\0L\5V\0\0\0\0\0\0\0\0\0\0\0\0Q\5r\0\0\0S" .. ("\0"):rep(26) .. "\\\5n\0\0\0\0\0\0\0\0\0\0\0\0a\4\248\0\0\0\0\0\0d\5j" .. ("\0"):rep(36) .. "q\5f\0\0\0\0\0\0\0\0\0\0\0\0v\5b\0\0\0x\5\142y\4\252" .. ("\0"):rep(18) .. "\128\5^\0\0\0\130\5\138\0\0\0\132\5" .. ("\0"):rep(16) .. "\138\5" .. ("\0"):rep(19) .. "\145\5\134\0\0\0\147\4Line truncated
local error_message_program_start, error_message_program = 3845, "\7\1\0\8\0\1\2\1\4\19@\0\1\2\8\0\1\2\1\4\17<\0\1\0\8\0\1\2\1\4\19@\0\1\2\8\0\1\2\1\4\18\168\0\1\0\8\0\1\2\1\4\19@\0\8\0\1\2\1\4\18O\0\8\0\1\2\1\4\18\4\0\8\0\1\2\1\4\17\135\0\8\0\1\2\1\4\17\230\0\8\0\1\2\1\4\18\214\0\8\0\1\2\1\4\18\241\0\8\0\1\2\1\4\18\241\0\2\3\1\2\2\0\1\2\8\0\1\2\1\4\18o\0\8\0\1\2\1\4\17\247\0\4\18%\0\4\18%\0\4\17z\0\1\0\4\16\168\0\4\18%\0\1\0\4\16\168\0\4\18%\0\4\18%\0\4\17z\0\1\0\4\16\168\0\4\18%\0\1\0\4\16\168\0\4\17\1\0\4\17\199\0\1\3\1\2\1\1\1\0\4\15:\0\4\17\199\0\1\3\1\2\1\1\1\0\4\15:\0\4\17\199\0\1\0\4\17\19\0\4\17\199\0\1\3\1\2\1\1\1\0\4\15:\0\4\17\199\0\1\3\1\2\1\1\1\0\4\15:\0\4\17\199\0\1\5\1\4\1\3\1\2\1\1\1\0\4\15\n\0\1\5\1\4\1\3\1\2\1\1\1\0\4\15\18\0\4\18C\0\1\0\4\16\239\0\4\16\1\0\4\18I\0\4\16z\0\1\3\1\2\1\1\1\0\4\16r\0\1\3\1\2\1\1\1\0\4\15:\0\1\3\1\2\1\1\1\0\4\15:\0\1\5\1\4\1\3\1\2\1\1\1\0\4\16G\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\4\17\199\0\1\5\1\4\1\3\1\2\1\1\1\0\4\18?\0\1\0\4\17\19\0\1\0\4\18X\0\1\5\1\4\1\3\1\2\1\1\1\0\4\18;\0\4\17\199\0\4\18\0\0\4\18\0\0\4\17\199\0\1\5\1\4\1\3\1\2\1\1\1\0\4\17\178\0\1\5\1\4\1\3\1\2\1\1\1\0\4\17\174\0\4\16%\0\4\17\131\0\4\16\198\0\4\18\223\0\4\0178\0\4\17\1\0\4\17\199\0\4\18I\0\4\17`\0\4\17\199\0\4\18I\0\4\17\199\0\4\17l\0\4\17`\0\4\17\199\0\4\17l\0\1\0\4\17\182\0\4\16\228\0\1\5\1\4\1\3\1\2\1\1\1\0\4\16\150\0\4\18I\0\4\16\224\0\4\16\224\0\4\17\131\0\4\18I\0\4\17\199\0\4\16%\0\4\17\222\0\4\17\199\0\4\16%\0\4\17\226\0\4\17\199\0\4\16%\0\4\17\214\0\4\17X\0\1\0\4\17\182\0\4\17X\0\4\16\198\0\4\17\199\0\4\18I\0\4\17\199\0\4\15B\0\1\0\4\19@\0\1\2\4\17<\0\1\0\4\19@\0\4\15B\0\4\15B\0\1\0\4\19@\0\4\18\206\0\4\19\12\0\4\19\30\0\4\19\30\0\4\19\30\0\4\19\21\0\4\19\3\0\4\19\12\0\4\19\12\0\4\19\3\0\4\19\3\0\4\19\3\0\4\19\3\0\4\19\3\0\4\18\250\0\1\0\4\19@\0\4\19/\0\4\18\4\0\4\17\135\0\4\17\230\0\4\18\214\0\4\17+\0\4\17+\0\2\3\1\2\2\0\1\2\4\18o\0\4\17\247\0\4\15B\0\1\0\4\19@\0\1\2\4\17<\0\1\0\4\19@\0\4\15B\0\4\15B\0\1\0\4\16\143\0\4\16\133\0\1\0\4\19@\0\4\18\206\0\4\19\12\0\4\19\30\0\4\19\30\0\4\19\30\0\4\19\21\0\4\19\3\0\4\19\12\0\4\19\12\0\4\19\3\0\4\19\3\0\4\19\3\0\4\19\3\0\4\19\3\0\4\18\250\0\1\0\4\19@\0\4\19/\0\4\19<\0\4\18\4\0\4\17\135\0\4\17\230\0\4\18\214\0\4\17+\0\4\16\198\0\4\16Y\0\4\17+\0\4\16\164\0\2\3\1\2\2\0\1\2\4\18o\0\4\16\198\0\4\16Y\0\1\0\4\16\232\0\4\17\247\0\4\19Z\0\4\16\133\0\4\15:\0\1\0\4\19@\0\1\2\4\17<\0\1\0\4\19@\0\4\15:\0\4\15:\0\4\15\"\0\1\0\4\19@\0\4\19'\0\4\18\159\0\4\18\177\0\4\18\177\0\4\18\177\0\4\18\168\0\4\18f\0\4\18\159\0\4\18\159\0\4\18f\0\4\18f\0\4\18f\0\4\18f\0\4\18f\0\4\18\197\0\1\0\4\19@\0\4\18O\0\4\0187\0\4\18\4\0\4\17\135\0\4\17\230\0\4\18\214\0\4\18\241\0\4\18\241\0\2\3\1\2\2\0\1\2\4\18o\0\4\15\"\0\4\17\247\0\4\0187\0\4\17\243\0\4\17\243\0\4\17\243\0\1\0\8\0\1\2\1\4\19@\0\1\2\8\0\1\2\1\4\17<\0\1\0\8\0\1\2\1\4\19@\0\1\2\8\0\1\2\1\4\19\21\0\1\0\8\0\1\2\1\4\19@\0\8\0\1\2\1\4\19/\0\8\0\1\2\1\4\18\4\0\8\0\1\2\1\4\17\135\0\8\0\1\2\1\4\17\230\0\8\0\1\2\1\4\18\214\0\8\0\1\2\1\4\17+\0\8\0\1\2\1\4\17+\0\2\3\1\2\2\0\1\2\8\0\1\2\1\4\18o\0\8\0\1\2\1\4\17\247\0\4\15:\0\1\0\4\19@\0\1\2\4\17<\0\1\0\4\19@\0\4\15:\0\4\15:\0\1\0\4\19@\0\4\19'\0\4\18\159\0\4\18\177\0\4\18\177\0\4\18\177\0\4\18\168\0\4\18f\0\4\18\159\0\4\18\159\0\4\18f\0\4\18f\0\4\18f\0\4\18f\0\4\18f\0\4\18\197\0\1\0\4\19@\0\4\18O\0\4\18\4\0\4\17\135\0\4\17\230\0\4\18\214\0\4\18\241\0\4\18\241\0\2\3\1\2\2\0\1\2\4\18o\0\4\17\247\0\4\16\198\0\4\18\142\0\4\18\131\0\4\16\202\0\1\0\4\16~\0\2\5\1\2\4\0\4\16\206\0\4\15B\0\1\0\4\19@\0\1\2\4\17<\0\1\0\4\19@\0\4\15B\0\4\15B\0\1\0\4\19@\0\4\18\206\0\4\19\12\0\4\19\30\0\4\19\30\0\4\19\30\0\4\19\21\0\4\19\3\0\4\19\12\0\4\19\12\0\4\19\3\0\4\19\3\0\4\19\3\0\4\19\3\0\4\19\3\0\4\18\250\0\1\0\4\19@\0\4\19/\0\4\18\4\0\4\17\135\0\4\17\230\0\4\18\214\0\4\17+\0\4\17+\0\2\3\1\2\2\0\1\2\4\18o\0\4\17\247\0\4\19Z\0\2\5\1\2\4\0\4\16\206\0\4\15B\0\1\0\4\19@\0\1\2\4\17<\0\1\0\4\19@\0\4\15B\0\4\15B\0\1\0\4\16\143\0\4\16\133\0\1\0\4\19@\0\4\18\206\0\4\19\12\0\4\19\30\0\4\19\30\0\4\19\30\0\4\19\21\0\4\19\3\0\4\19\12\0\4\19\12\0\4\19\3\0\4\19\3\0\4\19\3\0\4\19\3\0\4\19\3\0\4\18\250\0\1\0\4\19@\0\4\19/\0\4\19<\0\4\18\4\0\4\17\135\0\4\17\230\0\4\18\214\0\4\17+\0\4\16\198\0\4\16Y\0\4\17+\0\4\16\164\0\2\3\1\2\2\0\1\2\4\18o\0\4\16\198\0\4\16Y\0\1\0\4\16\232\0\4\17\247\0\4\19Z\0\4\18\0\0\1\0\4\17\12\0\1\0\8\0\1\2\1\4\19@\0\1\2\8\0\1\2\1\4\17<\0\1\0\8\0\1\2\1\4\19@\0\1\2\8\0\1\2\1\4\19\12\0\1\2\8\0\1\2\1\4\19\21\0\1\2\8\0\1\2\1\4\19\3\0\1\2\8\0\1\2\1\4\19\12\0\1\2\8\0\1\2\1\4\19\12\0\1\2\8\0\1\2\1\4\19\3\0\1\2\8\0\1\2\1\4\19\3\0\1\2\8\0\1\2\1\4\19\3\0\1\2\8\0\1\2\1\4\19\3\0\1\2\8\0\1\2\1\4\19\3\0\1\2\8\0\1\2\1\4\18\250\0\1\0\8\0\1\2\1\4\19@\0\8\0\1\2\1\4\19/\0\8\0\1\2\1\4\18\4\0\8\0\1\2\1\4\17\135\0\8\0\1\2\1\4\17\230\0\8\0\1\2\1\4\18\214\0\8\0\1\2\1\4\17+\0\8\0\1\2\1\4\17+\0\2\3\1\2\2\0\1\2\8\0\1\2\1\4\18o\0\8\0\1\2\1\4\17\247\0\1\0\8\0\1\2\1\4\19@\0\1\2\8\0\1\2Line truncated
local error_message_table = "\1\2\0\0\0\1\0\201\1\0\145\0\0\0\0\0\0\5\0\205\6\0\209\7\0\221\8\0\225\t\0\237\n\0\241\11\0\247\12\0\251\r\1\7\14\1\11\15\1\23\16\1\27\17\1+\18\1;\19\1?\20\1E\5\6\5\0\0\0\23\1I\0\0\0\23\4!\0\0\0\27\1M\0\0\0\0\0\0\29\0\145\31\1Q \1]!\1i\0\0\0\0\0\0\0\0\0%\1u&\1\133\0\0\0\0\0\0)\1\137\0\0\0\0\0\0\0\0\0\1\0\173.\1\141\0\0\0000\1\145\0\0\0002\1\149\0\0\0004\1\153\0\0\0006\1\157\0\0\0008\1\161\0\0\0:\1\165\0\0\0<\1\169\0\0\0>\1\173\0\0\0@\1\177\0\0\0B\1\181\0\0\0D\1\185\0\0\0F\1\189\0\0\0H\1\193\29\0\173J\1\197K\1\213\0\0\0M\1\219\0\0\0\0\0\0P\1\225\0\0\0K\r\155" .. ("\0"):rep(15) .. "U\4\195\0\0\0\0\0\0\0\0\0\0\0\0]\1\241\0\0\0\0\0\0`\1\245a\1\249\0\0\0\0\0\0\0\0\0e\1\253b\7s\0\0\0\0\0\0i\2\1\0\0\0k\2\17b\r\159\0\0\0n\2!K\r\137p\2%q\2)r\2-\0\0\0t\0021u\0025u\0\149w\0029\0\0\0y\2=z\2=\0\0\0K\14?|\0\149~\2Ay\5\245{\5\249\129\2Ey\7w\131\2I\0\0\0\133\2M\0\0\0\135\2Q\135\0\153\0\0\0\138\2U\139\2Y\0\0\0\141\2]\141\0\153\143\2a\143\0\157\145\2g\146\2k\0\0\0\148\2{\0\0\0r\r\143\0\0\0\152\2\127\0\0\0\154\2\131\150\5\253\155\0\163\157\2\135\158\2\139\0\0\0\160\2\143u\0\177\162\2\143r\14E\164\2\147\129\r\147\166\2\151\167\2\155|\0\177\169\2\159\162\6\1\171\2\163\0\0\0\173\2\167\0\0\0\175\2\171\0\0\0\177\2\175\129\14I\135\0\181\180\2\179\181\2\183\181\0\167\183\2\189\184\2\193\141\0\181\4\6\171\143\0\185\188\2\197\7\6\181\190\2\201\t\6\185\n\6\191\11\6\197\174\4\207\r\6\203\196\2\205\15\6\207\174\4\203\155\0\191\174\4\199\19\6\211\t\12S\n\12^\11\12i\23\6\217\0\0\0\0\0\0n\14Q" .. ("\0"):rep(33) .. "&\6\221\0\0\0\0\0\0)\6\227\188\r\151\181\0\195\0\0\0\0\0\0.\6\231\0\0\0000\6\235&\12i2\6\239\135\14U4\6\243\0\0\0006\6\247\188\14M8\6\251\141\14U:\6\255\143\14Y<\7\3\0\0\0>\7\7\0\0\0@\7\0116\12tB\7\15\0\0\0D\7\19\0\0\0F\7\23\0\0\0H\7\27\0\0\0\0\0\0K\7\31\0\0\0M\7%\0\0\0\0\0\0\164\14_\0\0\0R\7)H\12\127T\0\0\169\14_K\12\138\0\0\0M\12\149\0\0\0\0\0\0\175\14_\0\0\0]\7-\0\0\0\0\0\0\0\0\0\181\14cb\0071\0\0\0\0\0\0e\0075\0\0\0\0\0\0]\12\158\0\0\0\0\0\0\0\0\0\0\0\0b\12\167\0\0\0\0\0\0e\12\176\0\0\0r\0079\0\0\0\0\0\0\0\0\0\0\0\0w\7=\0\0\0y\7Az\7E\0\0\0\0\0\0r\12\185\0\0\0\0\0\0\0\0\0\129\7Iw\12\194\131\7M\0\0\0\133\7Q" .. ("\0"):rep(15) .. "\139\7Q\129\12\203\0\0\0\0\0\0\0\0\0\133\12\212\0\0\0\146\7]\0\0\0\148\7a\0\0\0\139\12\212\0\0\0\0\0\0\7\3c\0\0\0\t\3g\n\3m\11\3s\158\0\0\r\3y\0\0\0\15\3}\0\0\0\0\0\0\0\0\0\19\3\129\0\0\0\0\0\0\0\0\0\23\3\135" .. ("\0"):rep(24) .. "\178\7e" .. ("\0"):rep(15) .. "&\3\139\0\0\0\0\0\0)\3\145\188\7k\0\0\0\190\7o\0\0\0.\3\149\0\0\0000\3\153\0\0\0002\3\157\0\0\0004\3\161\188\12\2296\3\165\0\0\0008\3\169\0\0\0:\3\173\0\0\0<\3\177\0\0\0>\3\181\0\0\0@\3\185\0\0\0B\3\189\0\0\0D\3\193\0\0\0F\3\197\0\0\0H\3\201\0\0\0\0\0\0K\3\205\0\0\0M\3\211\0\0\0\0\0\0\0\0\0\0\0\0R\3\215\0\0\0T" .. ("\0"):rep(26) .. "]\3\219\0\0\0\0\0\0\0\0\0\0\0\0b\3\223\0\0\0\0\0\0e\3\227" .. ("\0"):rep(36) .. "r\3\231\0\0\0\0\0\0\0\0\0\0\0\0w\3\235\0\0\0y\3\239z\3\243" .. ("\0"):rep(18) .. "\129\3\247\0\0\0\131\3\251\7\4%\133\3\255\t\4)\n\4/\11\0045\0\0\0\r\4;\139\3\255\15\4?" .. ("\0"):rep(15) .. "\146\4\11\0\0\0\148\4\15" .. ("\0"):rep(27) .. "\158\0\0\0\0\0\0\0\0$\4C\0\0\0&\4G\0\0\0\0\0\0)\4M\0\0\0\0\0\0\0\0\0\0\0\0.\4Q\0\0\0000\4U\0\0\0002\4Y\0\0\0004\4]\178\4\0196\4a\0\0\0008\4e\0\0\0:\4i\0\0\0<\4m\0\0\0>\4q\188\4\25@\4u\190\4\29B\4y\0\0\0D\4}\0\0\0F\4\129\0\0\0H\4\133\0\0\0\0\0\0K\4\137\0\0\0M\4\143" .. ("\0"):rep(21) .. "U\4\147" .. ("\0"):rep(21) .. "]\4\151\0\0\0\0\0\0\0\0\0\0\0\0b\4\155\0\0\0\4\14ie\4\159\0\0\0\7\14s\0\0\0\t\14w\n\14}\11\14\131\0\0\0\r\14\137\0\0\0\15\14\141\0\0\0\0\0\0r\4\163\0\0\0\0\0\0\0\0\0\0\0\0w\4\167" .. ("\0"):rep(27) .. "\129\4\171\0\0\0\0\0\0\0\0\0\133\4\175&\14\145\0\0\0\0\0\0)\14\151\0\0\0\139\4\175\0\0\0\0\0\0.\14\155\0\0\0000\14\159\0\0\0002\14\163\0\0\0004\14\167\0\0\0006\14\171\0\0\0008\14\175\0\0\0:\14\179\0\0\0<\14\183\0\0\0>\14\187\0\0\0@\14\191\0\0\0B\14\195\0\0\0D\14\199\0\0\0F\14\203\0\0\0H\14\207\0\0\0\0\0\0K\14\211\4\6\11M\14\217\0\0\0\7\6\21\0\0\0\t\6\25\n\6\31\11\6%\0\0\0\r\6+\0\0\0\15\6/\0\0\0\0\0\0\186\4\187\0\0\0\188\4\191]\14\221\0\0\0\0\0\0\0\0\0\0\0\0b\14\225\0\0\0\0\0\0e\14\229" .. ("\0"):rep(24) .. "&\0063\0\0\0\0\0\0)\0069r\14\233\0\0\0\0\0\0\0\0\0.\6=w\14\2370\6A\0\0\0002\6E\0\0\0004\6I\0\0\0006\6M\0\0\0008\6Q\129\14\241:\6U\0\0\0<\6Y\133\14\245>\6]\0\0\0@\6a\0\0\0B\6e\139\14\245D\6i\0\0\0F\6m\0\0\0H\6q\0\0\0\0\0\0K\6u\0\0\0M\6{" .. ("\0"):rep(45) .. "]\6\127\0\0\0\0\0\0\0\0\0\0\0\0b\6\131\0\0\0\4\r\163e\6\135\0\0\0\7\r\173\0\0\0\t\r\177\n\r\183\11\r\189\0\0\0\r\r\195\0\0\0\15\r\199\0\0\0\0\0\0r\6\139\0\0\0\188\15\1\0\0\0\190\0\0w\6\143" .. ("\0"):rep(27) .. "\129\6\147\0\0\0\0\0\0\0\0\0\133\6\151&\r\203\0\0\0\0\0\0)\r\209\0\0\0\139\6\151\0\0\0\0\0\0.\r\213\0\0\0000\r\217\0\0\0002\r\221\0\0\0004\r\225\0\0\0006\r\229\0\0\0008\r\233\0\0\0:\r\237\0\0\0<\r\241\0\0\0>\r\245\0\0\0@\r\249\0\0\0B\r\253\0\0\0D\14\1\0\0\0F\14\5\0\0\0H\14\t\0\0\0\0\0\0K\14\r\0\0\0M\14\19\0\0\0\7\5c\0\0\0\t\5g\n\5m\11\5s\0\0\0\r\5y\0\0\0\15\5}\0\0\0\0\0\0\0\0\0\0\0\0\188\6\163]\1Line truncated
local function handle_error(context, stack, stack_n, token, token_start, token_end)
-- Run our error handling virtual machine.
local pc, top, registers, messages = error_program_start, stack_n, {}, {}
local pc, top, registers, messages = error_message_program_start, stack_n, {}, {}
while true do
local instruction = error_program:byte(pc + 1)
if instruction == 1 then -- Store
registers[error_program:byte(pc + 2) + 1] = top
local instruction = error_message_program:byte(pc + 1)
if instruction == 1 then -- Store(reg:8b)
local reg = error_message_program:byte(pc + 2)
registers[reg + 1] = top
pc = pc + 2
elseif instruction == 2 then -- Move
registers[error_program:byte(pc + 2) + 1] = registers[error_program:byte(pc + 3) + 1]
elseif instruction == 2 then -- Move(r1:8b, r2:8b)
local r1 = error_message_program:byte(pc + 2)
local r2 = error_message_program:byte(pc + 3)
registers[r2 + 1] = registers[r1 + 1]
pc = pc + 3
elseif instruction == 3 then -- Pop one item from the stack and jump
elseif instruction == 3 then -- Clear(reg:8b)
local reg = error_message_program:byte(pc + 2)
registers[reg + 1] = nil
pc = pc + 2
elseif instruction == 4 then -- Yield (Pop one item from the stack and jump)
-- TODO: Add support for interpret_last. Do we need this?
if top > 1 then top = top - 3 end
pc = get_int(error_program, pc + 1, 3)
elseif instruction == 4 then -- Accept
local clause, _, count = error_program:byte(pc + 2, pc + 4)
local accept = { clause + 1 }
for i = 1, count do accept[i + 1] = registers[count - i + 1] end
pc = get_int(error_message_program, pc + 1, 3)
elseif instruction == 5 then -- Accept
local clause = get_int(error_message_program, pc + 1, 2)
local priority, arity = error_message_program:byte(pc + 4, pc + 5)
local accept = { clause = clause + 1, priority = priority }
for i = 1, arity do accept[i] = registers[error_message_program:byte(pc + 5 + i) + 1] end
messages[#messages + 1] = accept
pc = pc + 4
elseif instruction == 5 then -- Match
local hi, lo = error_program:byte(pc + 2, pc + 3)
pc = pc + 5 + arity
elseif instruction == 6 then -- Match(index:24b)
local index = get_int(error_message_program, pc + 1, 3)
local lr1 = stack[top] - 1
local offset = (hi * 256 + lo + lr1) * (error_tbl_ks + error_tbl_vs)
if offset + error_tbl_ks + error_tbl_vs <= #error_tbl and
get_int(error_tbl, offset, error_tbl_ks) == lr1 then
pc = get_int(error_tbl, offset + error_tbl_ks, error_tbl_vs)
local ksize, vsize = error_message_table:byte(1, 2)
local offset = 2 + (index + lr1) * (ksize + vsize)
if offset + 4 + ksize <= #error_message_table and
get_int(error_message_table, offset, ksize) == lr1 + 1 then
pc = get_int(error_message_table, offset + ksize, vsize)
else
pc = pc + 3
pc = pc + 4
end
elseif instruction == 6 then -- Halt
elseif instruction == 7 then -- Halt
break
elseif instruction == 8 then -- Priority(clause:16b, p1:8b, p2:8b)
local clause = get_int(error_message_program, pc + 1, 2)
local p1, p2 = error_message_program:byte(pc + 3, pc + 5)
for i = 1, #messages do
local msg = messages[i]
if msg.clause == clause and msg.priority == p1 then msg.priority = p2 end
end
pc = pc + 5
else
error("Illegal instruction while handling errors " .. tostring(instruction))
end
end
-- Sort the list to ensure earlier patterns are used first.
table.sort(messages, function(a, b) return a[1] < b[1] end)
table.sort(messages, function(a, b)
if a.clause == b.clause then
return a.priority < b.priority
else
return a.clause < b.clause
end
end)
-- Then loop until we find an error message which actually works!
local t = { v = token, s = token_start, e = token_end }
for i = 1, #messages do
local action = messages[i]
local message = error_messages[action[1]](context, stack, stack_n, action, t)
local message = error_message[action.clause](context, stack, stack_n, action, token, token_start, token_end)
if message then
context.report(message)
return false
@@ -347,7 +347,7 @@ function ( xyz , while
```
```txt
Unexpected while.
Unexpected while. Expected a variable name.
|
1 | function ( xyz , while
| ^^^^^
@@ -483,11 +483,11 @@ xyz , xyz while
```
```txt
Unexpected symbol after name.
Unexpected while after name.
|
1 | xyz , xyz while
| ^
Did you mean to assign this or call it as a function?
Did you mean to assign this?
```
@@ -831,7 +831,7 @@ xyz while
```
```txt
Unexpected symbol after name.
Unexpected while after name.
|
1 | xyz while
| ^
@@ -858,7 +858,7 @@ xyz while
```
```txt
Unexpected symbol after name.
Unexpected while after name.
|
1 | xyz while
| ^
@@ -1056,7 +1056,7 @@ local while
```
```txt
Unexpected while.
Unexpected while. Expected a variable name.
|
1 | local while
| ^^^^^
@@ -1272,7 +1272,7 @@ repeat --[[eof]]
```
```txt
Unexpected end of file. Expected a statement.
Unexpected end of file. Expected a variable name.
|
2 | -- Line 1: 'until' expected near <eof> (program)
| ^
@@ -1389,7 +1389,7 @@ while
```
```txt
Unexpected while.
Unexpected while. Expected an expression.
|
1 | while
| ^^^^^
@@ -38,6 +38,20 @@ Unexpected = in expression.
Tip: Wrap the preceding expression in [ and ] to use it as a table key.
```
and also
```lua
return { x + 1 = 1 }
```
```txt
Unexpected = in expression.
|
1 | return { x + 1 = 1 }
| ^
Tip: Wrap the preceding expression in [ and ] to use it as a table key.
```
Note this doesn't occur if this there's already a table key here:
```lua
@@ -102,6 +116,7 @@ Unexpected end of file. Are you missing a closing bracket?
```
## Missing commas in tables
We try to detect missing commas in tables, and print an appropriate error message.
```lua
return { 1 2 }
@@ -129,6 +144,39 @@ Unexpected number in table.
1 | return { 1, 2 3 }
| ^ Are you missing a comma here?
```
This also works with table keys.
```lua
print({ x = 1 y = 2 })
```
```txt
Unexpected identifier in table.
|
1 | print({ x = 1 y = 2 })
| ^
|
1 | print({ x = 1 y = 2 })
| ^ Are you missing a comma here?
```
```lua
print({ ["x"] = 1 ["y"] = 2 })
```
```txt
Unexpected [ in table.
|
1 | print({ ["x"] = 1 ["y"] = 2 })
| ^
|
1 | print({ ["x"] = 1 ["y"] = 2 })
| ^ Are you missing a comma here?
```
We gracefully handle the case where we are actually missing a closing brace.
```lua
print({ 1, )
```
@@ -172,7 +220,7 @@ local _ = 1
```
```txt
Unexpected symbol after variable.
Unexpected local after name.
|
1 | term.clear
| ^ Expected something before the end of the line.
@@ -186,7 +234,7 @@ x 1
```
```txt
Unexpected symbol after name.
Unexpected number after name.
|
1 | x 1
| ^
@@ -200,13 +248,41 @@ term.clear
```
```txt
Unexpected symbol after variable.
Unexpected end of file after name.
|
1 | term.clear
| ^ Expected something before the end of the line.
Tip: Use () to call with no arguments.
```
When we've got a list of variables, we only suggest assigning it.
```lua
term.clear, foo
```
```txt
Unexpected end of file after name.
|
1 | term.clear, foo
| ^
Did you mean to assign this?
```
And when we've got a partial expression, we only suggest calling it.
```lua
(a + b)
```
```txt
Unexpected end of file after name.
|
1 | (a + b)
| ^ Expected something before the end of the line.
Tip: Use () to call with no arguments.
```
## If statements
For if statements, we say when we expected the `then` keyword.
@@ -425,7 +501,7 @@ goto 2
```
```txt
Unexpected symbol after name.
Unexpected number after name.
|
1 | goto 2
| ^
@@ -460,6 +536,31 @@ Unexpected end of file.
| ^
```
## Missing function arguments
We provide an error message for missing arguments in function definitions:
```lua
function f
```
```txt
Unexpected end of file. Expected ( to start function arguments.
|
1 | function f
| ^
```
```lua
return function
```
```txt
Unexpected end of file. Expected ( to start function arguments.
|
1 | return function
| ^
```
# Function calls
## Additional commas