diff options
Diffstat (limited to 'src/lj_errmsg.h')
-rw-r--r-- | src/lj_errmsg.h | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/src/lj_errmsg.h b/src/lj_errmsg.h new file mode 100644 index 00000000..03abd59b --- /dev/null +++ b/src/lj_errmsg.h | |||
@@ -0,0 +1,134 @@ | |||
1 | /* | ||
2 | ** VM error messages. | ||
3 | ** Copyright (C) 2005-2009 Mike Pall. See Copyright Notice in luajit.h | ||
4 | */ | ||
5 | |||
6 | /* This file may be included multiple times with different ERRDEF macros. */ | ||
7 | |||
8 | /* Basic error handling. */ | ||
9 | ERRDEF(ERRMEM, "not enough memory") | ||
10 | ERRDEF(ERRERR, "error in error handling") | ||
11 | |||
12 | /* Allocations. */ | ||
13 | ERRDEF(STROV, "string length overflow") | ||
14 | ERRDEF(UDATAOV, "userdata length overflow") | ||
15 | ERRDEF(STKOV, "stack overflow") | ||
16 | ERRDEF(STKOVM, "stack overflow (%s)") | ||
17 | ERRDEF(TABOV, "table overflow") | ||
18 | |||
19 | /* Table indexing. */ | ||
20 | ERRDEF(NANIDX, "table index is NaN") | ||
21 | ERRDEF(NILIDX, "table index is nil") | ||
22 | ERRDEF(NEXTIDX, "invalid key to " LUA_QL("next")) | ||
23 | |||
24 | /* Metamethod resolving. */ | ||
25 | ERRDEF(BADCALL, "attempt to call a %s value") | ||
26 | ERRDEF(BADOPRT, "attempt to %s %s " LUA_QS " (a %s value)") | ||
27 | ERRDEF(BADOPRV, "attempt to %s a %s value") | ||
28 | ERRDEF(BADCMPT, "attempt to compare %s with %s") | ||
29 | ERRDEF(BADCMPV, "attempt to compare two %s values") | ||
30 | ERRDEF(GETLOOP, "loop in gettable") | ||
31 | ERRDEF(SETLOOP, "loop in settable") | ||
32 | ERRDEF(OPCALL, "call") | ||
33 | ERRDEF(OPINDEX, "index") | ||
34 | ERRDEF(OPARITH, "perform arithmetic on") | ||
35 | ERRDEF(OPCAT, "concatenate") | ||
36 | ERRDEF(OPLEN, "get length of") | ||
37 | |||
38 | /* Type checks. */ | ||
39 | ERRDEF(BADSELF, "calling " LUA_QS " on bad self (%s)") | ||
40 | ERRDEF(BADARG, "bad argument #%d to " LUA_QS " (%s)") | ||
41 | ERRDEF(BADTYPE, "%s expected, got %s") | ||
42 | ERRDEF(BADVAL, "invalid value") | ||
43 | ERRDEF(NOVAL, "value expected") | ||
44 | ERRDEF(NOCORO, "coroutine expected") | ||
45 | ERRDEF(NOTABN, "nil or table expected") | ||
46 | ERRDEF(NOLFUNC, "Lua function expected") | ||
47 | ERRDEF(NOFUNCL, "function or level expected") | ||
48 | ERRDEF(NOSFT, "string/function/table expected") | ||
49 | ERRDEF(NOPROXY, "boolean or proxy expected") | ||
50 | ERRDEF(FORINIT, LUA_QL("for") " initial value must be a number") | ||
51 | ERRDEF(FORLIM, LUA_QL("for") " limit must be a number") | ||
52 | ERRDEF(FORSTEP, LUA_QL("for") " step must be a number") | ||
53 | |||
54 | /* C API checks. */ | ||
55 | ERRDEF(NOENV, "no calling environment") | ||
56 | ERRDEF(CYIELD, "attempt to yield across C-call boundary") | ||
57 | ERRDEF(BADLU, "bad light userdata pointer") | ||
58 | ERRDEF(NOGCMM, "bad action while in __gc metamethod") | ||
59 | |||
60 | /* Standard library function errors. */ | ||
61 | ERRDEF(ASSERT, "assertion failed!") | ||
62 | ERRDEF(PROTMT, "cannot change a protected metatable") | ||
63 | ERRDEF(UNPACK, "too many results to unpack") | ||
64 | ERRDEF(RDRSTR, "reader function must return a string") | ||
65 | ERRDEF(PRTOSTR, LUA_QL("tostring") " must return a string to " LUA_QL("print")) | ||
66 | ERRDEF(IDXRNG, "index out of range") | ||
67 | ERRDEF(BASERNG, "base out of range") | ||
68 | ERRDEF(LVLRNG, "level out of range") | ||
69 | ERRDEF(INVLVL, "invalid level") | ||
70 | ERRDEF(INVOPT, "invalid option") | ||
71 | ERRDEF(INVOPTM, "invalid option " LUA_QS) | ||
72 | ERRDEF(INVFMT, "invalid format") | ||
73 | ERRDEF(SETFENV, LUA_QL("setfenv") " cannot change environment of given object") | ||
74 | ERRDEF(CORUN, "cannot resume running coroutine") | ||
75 | ERRDEF(CODEAD, "cannot resume dead coroutine") | ||
76 | ERRDEF(COSUSP, "cannot resume non-suspended coroutine") | ||
77 | ERRDEF(TABINS, "wrong number of arguments to " LUA_QL("insert")) | ||
78 | ERRDEF(TABCAT, "invalid value (%s) at index %d in table for " LUA_QL("concat")) | ||
79 | ERRDEF(TABSORT, "invalid order function for sorting") | ||
80 | ERRDEF(IOCLFL, "attempt to use a closed file") | ||
81 | ERRDEF(IOSTDCL, "standard file is closed") | ||
82 | ERRDEF(OSUNIQF, "unable to generate a unique filename") | ||
83 | ERRDEF(OSDATEF, "field " LUA_QS " missing in date table") | ||
84 | ERRDEF(STRDUMP, "cannot dump functions") | ||
85 | ERRDEF(STRSLC, "string slice too long") | ||
86 | ERRDEF(STRPATB, "missing " LUA_QL("[") " after " LUA_QL("%f") " in pattern") | ||
87 | ERRDEF(STRPATC, "invalid pattern capture") | ||
88 | ERRDEF(STRPATE, "malformed pattern (ends with " LUA_QL("%") ")") | ||
89 | ERRDEF(STRPATM, "malformed pattern (missing " LUA_QL("]") ")") | ||
90 | ERRDEF(STRPATU, "unbalanced pattern") | ||
91 | ERRDEF(STRCAPI, "invalid capture index") | ||
92 | ERRDEF(STRCAPN, "too many captures") | ||
93 | ERRDEF(STRCAPU, "unfinished capture") | ||
94 | ERRDEF(STRFMTO, "invalid option " LUA_QL("%%%c") " to " LUA_QL("format")) | ||
95 | ERRDEF(STRFMTR, "invalid format (repeated flags)") | ||
96 | ERRDEF(STRFMTW, "invalid format (width or precision too long)") | ||
97 | ERRDEF(STRGSRV, "invalid replacement value (a %s)") | ||
98 | ERRDEF(BADMODN, "name conflict for module " LUA_QS) | ||
99 | ERRDEF(NOJIT, "JIT compiler permanently disabled") | ||
100 | ERRDEF(JITOPT, "unknown or malformed optimization flag " LUA_QS) | ||
101 | |||
102 | /* Lexer/parser errors. */ | ||
103 | ERRDEF(XNEAR, "%s near " LUA_QS) | ||
104 | ERRDEF(XELEM, "lexical element too long") | ||
105 | ERRDEF(XLINES, "chunk has too many lines") | ||
106 | ERRDEF(XLEVELS, "chunk has too many syntax levels") | ||
107 | ERRDEF(XNUMBER, "malformed number") | ||
108 | ERRDEF(XLSTR, "unfinished long string") | ||
109 | ERRDEF(XLCOM, "unfinished long comment") | ||
110 | ERRDEF(XSTR, "unfinished string") | ||
111 | ERRDEF(XESC, "escape sequence too large") | ||
112 | ERRDEF(XLDELIM, "invalid long string delimiter") | ||
113 | ERRDEF(XBCLOAD, "cannot load Lua bytecode") | ||
114 | ERRDEF(XTOKEN, LUA_QS " expected") | ||
115 | ERRDEF(XJUMP, "control structure too long") | ||
116 | ERRDEF(XSLOTS, "function or expression too complex") | ||
117 | ERRDEF(XLIMM, "main function has more than %d %s") | ||
118 | ERRDEF(XLIMF, "function at line %d has more than %d %s") | ||
119 | ERRDEF(XMATCH, LUA_QS " expected (to close " LUA_QS " at line %d)") | ||
120 | ERRDEF(XFIXUP, "function too long for return fixup") | ||
121 | ERRDEF(XPARAM, "<name> or " LUA_QL("...") " expected") | ||
122 | ERRDEF(XAMBIG, "ambiguous syntax (function call x new statement)") | ||
123 | ERRDEF(XFUNARG, "function arguments expected") | ||
124 | ERRDEF(XSYMBOL, "unexpected symbol") | ||
125 | ERRDEF(XDOTS, "cannot use " LUA_QL("...") " outside a vararg function") | ||
126 | ERRDEF(XSYNTAX, "syntax error") | ||
127 | ERRDEF(XBREAK, "no loop to break") | ||
128 | ERRDEF(XFOR, LUA_QL("=") " or " LUA_QL("in") " expected") | ||
129 | |||
130 | #undef ERRDEF | ||
131 | |||
132 | /* Detecting unused error messages: | ||
133 | awk -F, '/^ERRDEF/ { gsub(/ERRDEF./, ""); printf "grep -q LJ_ERR_%s *.[ch] || echo %s\n", $1, $1}' lj_errmsg.h | sh | ||
134 | */ | ||