3 ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h
6 /* This file may be included multiple times with different ERRDEF macros. */
8 /* Basic error handling. */
9 ERRDEF(ERRMEM
, "not enough memory")
10 ERRDEF(ERRERR
, "error in error handling")
11 ERRDEF(ERRCPP
, "C++ exception")
14 ERRDEF(STROV
, "string length overflow")
15 ERRDEF(UDATAOV
, "userdata length overflow")
16 ERRDEF(STKOV
, "stack overflow")
17 ERRDEF(STKOVM
, "stack overflow (%s)")
18 ERRDEF(TABOV
, "table overflow")
21 ERRDEF(NANIDX
, "table index is NaN")
22 ERRDEF(NILIDX
, "table index is nil")
23 ERRDEF(NEXTIDX
, "invalid key to " LUA_QL("next"))
25 /* Metamethod resolving. */
26 ERRDEF(BADCALL
, "attempt to call a %s value")
27 ERRDEF(BADOPRT
, "attempt to %s %s " LUA_QS
" (a %s value)")
28 ERRDEF(BADOPRV
, "attempt to %s a %s value")
29 ERRDEF(BADCMPT
, "attempt to compare %s with %s")
30 ERRDEF(BADCMPV
, "attempt to compare two %s values")
31 ERRDEF(GETLOOP
, "loop in gettable")
32 ERRDEF(SETLOOP
, "loop in settable")
33 ERRDEF(OPCALL
, "call")
34 ERRDEF(OPINDEX
, "index")
35 ERRDEF(OPARITH
, "perform arithmetic on")
36 ERRDEF(OPCAT
, "concatenate")
37 ERRDEF(OPLEN
, "get length of")
40 ERRDEF(BADSELF
, "calling " LUA_QS
" on bad self (%s)")
41 ERRDEF(BADARG
, "bad argument #%d to " LUA_QS
" (%s)")
42 ERRDEF(BADTYPE
, "%s expected, got %s")
43 ERRDEF(BADVAL
, "invalid value")
44 ERRDEF(NOVAL
, "value expected")
45 ERRDEF(NOCORO
, "coroutine expected")
46 ERRDEF(NOTABN
, "nil or table 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")
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")
60 ERRDEF(BADFPU
, "bad FPU precision (use D3DCREATE_FPU_PRESERVE with DirectX)")
63 /* Standard library function errors. */
64 ERRDEF(ASSERT
, "assertion failed!")
65 ERRDEF(PROTMT
, "cannot change a protected metatable")
66 ERRDEF(UNPACK
, "too many results to unpack")
67 ERRDEF(RDRSTR
, "reader function must return a string")
68 ERRDEF(PRTOSTR
, LUA_QL("tostring") " must return a string to " LUA_QL("print"))
69 ERRDEF(IDXRNG
, "index out of range")
70 ERRDEF(BASERNG
, "base out of range")
71 ERRDEF(LVLRNG
, "level out of range")
72 ERRDEF(INVLVL
, "invalid level")
73 ERRDEF(INVOPT
, "invalid option")
74 ERRDEF(INVOPTM
, "invalid option " LUA_QS
)
75 ERRDEF(INVFMT
, "invalid format")
76 ERRDEF(SETFENV
, LUA_QL("setfenv") " cannot change environment of given object")
77 ERRDEF(CORUN
, "cannot resume running coroutine")
78 ERRDEF(CODEAD
, "cannot resume dead coroutine")
79 ERRDEF(COSUSP
, "cannot resume non-suspended coroutine")
80 ERRDEF(TABINS
, "wrong number of arguments to " LUA_QL("insert"))
81 ERRDEF(TABCAT
, "invalid value (%s) at index %d in table for " LUA_QL("concat"))
82 ERRDEF(TABSORT
, "invalid order function for sorting")
83 ERRDEF(IOCLFL
, "attempt to use a closed file")
84 ERRDEF(IOSTDCL
, "standard file is closed")
85 ERRDEF(OSUNIQF
, "unable to generate a unique filename")
86 ERRDEF(OSDATEF
, "field " LUA_QS
" missing in date table")
87 ERRDEF(STRDUMP
, "unable to dump given function")
88 ERRDEF(STRSLC
, "string slice too long")
89 ERRDEF(STRPATB
, "missing " LUA_QL("[") " after " LUA_QL("%f") " in pattern")
90 ERRDEF(STRPATC
, "invalid pattern capture")
91 ERRDEF(STRPATE
, "malformed pattern (ends with " LUA_QL("%") ")")
92 ERRDEF(STRPATM
, "malformed pattern (missing " LUA_QL("]") ")")
93 ERRDEF(STRPATU
, "unbalanced pattern")
94 ERRDEF(STRCAPI
, "invalid capture index")
95 ERRDEF(STRCAPN
, "too many captures")
96 ERRDEF(STRCAPU
, "unfinished capture")
97 ERRDEF(STRFMTO
, "invalid option " LUA_QL("%%%c") " to " LUA_QL("format"))
98 ERRDEF(STRFMTR
, "invalid format (repeated flags)")
99 ERRDEF(STRFMTW
, "invalid format (width or precision too long)")
100 ERRDEF(STRGSRV
, "invalid replacement value (a %s)")
101 ERRDEF(BADMODN
, "name conflict for module " LUA_QS
)
103 ERRDEF(NOJIT
, "JIT compiler disabled, CPU does not support SSE2")
104 #elif defined(LJ_ARCH_NOJIT)
105 ERRDEF(NOJIT
, "no JIT compiler for this architecture (yet)")
107 ERRDEF(NOJIT
, "JIT compiler permanently disabled by build option")
109 ERRDEF(JITOPT
, "unknown or malformed optimization flag " LUA_QS
)
111 /* Lexer/parser errors. */
112 ERRDEF(XNEAR
, "%s near " LUA_QS
)
113 ERRDEF(XELEM
, "lexical element too long")
114 ERRDEF(XLINES
, "chunk has too many lines")
115 ERRDEF(XLEVELS
, "chunk has too many syntax levels")
116 ERRDEF(XNUMBER
, "malformed number")
117 ERRDEF(XLSTR
, "unfinished long string")
118 ERRDEF(XLCOM
, "unfinished long comment")
119 ERRDEF(XSTR
, "unfinished string")
120 ERRDEF(XESC
, "invalid escape sequence")
121 ERRDEF(XLDELIM
, "invalid long string delimiter")
122 ERRDEF(XTOKEN
, LUA_QS
" expected")
123 ERRDEF(XJUMP
, "control structure too long")
124 ERRDEF(XSLOTS
, "function or expression too complex")
125 ERRDEF(XLIMC
, "chunk has more than %d local variables")
126 ERRDEF(XLIMM
, "main function has more than %d %s")
127 ERRDEF(XLIMF
, "function at line %d has more than %d %s")
128 ERRDEF(XMATCH
, LUA_QS
" expected (to close " LUA_QS
" at line %d)")
129 ERRDEF(XFIXUP
, "function too long for return fixup")
130 ERRDEF(XPARAM
, "<name> or " LUA_QL("...") " expected")
131 ERRDEF(XAMBIG
, "ambiguous syntax (function call x new statement)")
132 ERRDEF(XFUNARG
, "function arguments expected")
133 ERRDEF(XSYMBOL
, "unexpected symbol")
134 ERRDEF(XDOTS
, "cannot use " LUA_QL("...") " outside a vararg function")
135 ERRDEF(XSYNTAX
, "syntax error")
136 ERRDEF(XBREAK
, "no loop to break")
137 ERRDEF(XFOR
, LUA_QL("=") " or " LUA_QL("in") " expected")
139 /* Bytecode reader errors. */
140 ERRDEF(BCFMT
, "cannot load incompatible bytecode")
141 ERRDEF(BCBAD
, "cannot load malformed bytecode")
142 ERRDEF(BCHEAD
, "attempt to load bytecode with extra header")
146 ERRDEF(FFI_INVTYPE
, "invalid C type")
147 ERRDEF(FFI_INVSIZE
, "size of C type is unknown or too large")
148 ERRDEF(FFI_BADSCL
, "bad storage class")
149 ERRDEF(FFI_DECLSPEC
, "declaration specifier expected")
150 ERRDEF(FFI_BADTAG
, "undeclared or implicit tag " LUA_QS
)
151 ERRDEF(FFI_REDEF
, "attempt to redefine " LUA_QS
)
152 ERRDEF(FFI_NUMPARAM
, "wrong number of type parameters")
153 ERRDEF(FFI_INITOV
, "too many initializers for " LUA_QS
)
154 ERRDEF(FFI_BADCONV
, "cannot convert " LUA_QS
" to " LUA_QS
)
155 ERRDEF(FFI_BADLEN
, "attempt to get length of " LUA_QS
)
156 ERRDEF(FFI_BADCONCAT
, "attempt to concatenate " LUA_QS
" and " LUA_QS
)
157 ERRDEF(FFI_BADARITH
, "attempt to perform arithmetic on " LUA_QS
" and " LUA_QS
)
158 ERRDEF(FFI_BADCOMP
, "attempt to compare " LUA_QS
" with " LUA_QS
)
159 ERRDEF(FFI_BADCALL
, LUA_QS
" is not callable")
160 ERRDEF(FFI_NUMARG
, "wrong number of arguments for function call")
161 ERRDEF(FFI_BADMEMBER
, LUA_QS
" has no member named " LUA_QS
)
162 ERRDEF(FFI_BADIDX
, LUA_QS
" cannot be indexed")
163 ERRDEF(FFI_BADIDXW
, LUA_QS
" cannot be indexed with " LUA_QS
)
164 ERRDEF(FFI_WRCONST
, "attempt to write to constant location")
165 ERRDEF(FFI_NODECL
, "missing declaration for symbol " LUA_QS
)
166 ERRDEF(FFI_BADCBACK
, "bad callback")
168 ERRDEF(FFI_CBACKOV
, "no support for callbacks on this OS")
170 ERRDEF(FFI_CBACKOV
, "too many callbacks")
172 ERRDEF(FFI_NYIPACKBIT
, "NYI: packed bit fields")
173 ERRDEF(FFI_NYICALL
, "NYI: cannot call this C function (yet)")
178 /* Detecting unused error messages:
179 awk -F, '/^ERRDEF/ { gsub(/ERRDEF./, ""); printf "grep -q LJ_ERR_%s *.[ch] || echo %s\n", $1, $1}' lj_errmsg.h | sh