Add system module with System class, core native exception helper and remove useless builtins
Build / AerScript (push) Successful in 50s
Build / AerScript (push) Successful in 50s
This commit is contained in:
@@ -134,7 +134,6 @@ static sxi32 GenStateForEachNodeValidator(ph7_gen_state *pGen, ph7_expr_node *pR
|
||||
static sxi32 PH7_CompileForeach(ph7_gen_state *pGen);
|
||||
static sxi32 PH7_CompileIf(ph7_gen_state *pGen);
|
||||
static sxi32 PH7_CompileReturn(ph7_gen_state *pGen);
|
||||
static sxi32 PH7_CompileHalt(ph7_gen_state *pGen);
|
||||
static sxi32 PH7_CompileVar(ph7_gen_state *pGen);
|
||||
static sxi32 PH7_CompileNamespace(ph7_gen_state *pGen);
|
||||
static sxi32 PH7_CompileUsing(ph7_gen_state *pGen);
|
||||
|
||||
@@ -257,6 +257,11 @@ struct SyMutexMethods {
|
||||
#define PH7_LOOKED SXERR_LOCKED /* Forbidden Operation */
|
||||
#define PH7_COMPILE_ERR (-70) /* Compilation error */
|
||||
#define PH7_VM_ERR (-71) /* Virtual machine error */
|
||||
/*
|
||||
* initializeModule() must return this code BEFORE publishing anything
|
||||
* (classes, functions or constants) and before allocating any per-VM data:
|
||||
* the engine releases the module library immediately after the return.
|
||||
*/
|
||||
#define PH7_MODULE_SAPI_DENIED 1 /* Returned by initializeModule: module not available for the current SAPI */
|
||||
/* end-of-error-codes */
|
||||
/*
|
||||
|
||||
+11
-4
@@ -705,7 +705,7 @@ struct ph7_constant_info {
|
||||
SySet *pConsCode;
|
||||
};
|
||||
/*
|
||||
* Each registered constant [i.e: __TIME__, __DATE__, PHP_OS, INT_MAX, etc.] is stored
|
||||
* Each registered constant [i.e: __TIME__, __DATE__, PATH_SEPARATOR, INT_MAX, etc.] is stored
|
||||
* in an instance of the following structure.
|
||||
* Please refer to the official documentation for more information
|
||||
* on how to create/install foreign constants.
|
||||
@@ -1449,8 +1449,8 @@ enum iErrCode {
|
||||
*/
|
||||
enum ph7_vm_op {
|
||||
PH7_OP_DONE = 1, /* Done */
|
||||
PH7_OP_HALT, /* Halt */
|
||||
PH7_OP_IMPORT, /* Import AerScript module */
|
||||
/* 2 was PH7_OP_HALT (retired exit construct); gap kept so opcode values do not shift. */
|
||||
PH7_OP_IMPORT = 3, /* Import AerScript module */
|
||||
PH7_OP_INCLUDE, /* Include another source file */
|
||||
PH7_OP_DECLARE, /* Declare a variable */
|
||||
PH7_OP_LOADV, /* Load variable */
|
||||
@@ -1651,7 +1651,7 @@ enum ph7_expr_id {
|
||||
#define PH7_KEYWORD_CLASS 32 /* class */
|
||||
#define PH7_KEYWORD_IN 33 /* in */
|
||||
#define PH7_KEYWORD_CONTINUE 34 /* continue */
|
||||
#define PH7_KEYWORD_EXIT 35 /* exit */
|
||||
/* 35 was PH7_KEYWORD_EXIT (retired exit construct); gap kept so keyword IDs do not shift. */
|
||||
#define PH7_KEYWORD_FINALLY 36 /* finally */
|
||||
#define PH7_KEYWORD_IMPLEMENTS 39 /* implements */
|
||||
#define PH7_KEYWORD_INCLUDE 41 /* include */
|
||||
@@ -1798,6 +1798,13 @@ PH7_PRIVATE sxi32 PH7_VmThrowError(ph7_vm *pVm, sxi32 iErr, const char *zMessage
|
||||
/* classes.c: publish a core IOException instance as a pending exception.
|
||||
* Returns PH7_EXCEPTION on success, PH7_ABORT on allocation failure. */
|
||||
PH7_PRIVATE sxi32 PH7_VmThrowIoException(ph7_context *pCtx, int nCode, const char *zMsg);
|
||||
/* classes.c: publish an instance of the named exception class as a pending
|
||||
* exception. The constructor receives (message, code); file/line are stamped
|
||||
* from the first non-[NATIVE] script frame. Returns PH7_EXCEPTION on success,
|
||||
* PH7_ABORT when the class is missing or allocation fails, and the constructor
|
||||
* result on constructor failure. */
|
||||
PH7_PRIVATE sxi32 PH7_VmThrowNativeException(ph7_context *pCtx, const char *zClass,
|
||||
int nCode, const char *zMessage);
|
||||
/* vm.c: per-VM, per-module opaque state (C13). Lookups are by module name. */
|
||||
PH7_PRIVATE void *PH7_VmModuleData(ph7_vm *pVm, const char *zModule);
|
||||
PH7_PRIVATE sxi32 PH7_VmSetModuleData(ph7_vm *pVm, const char *zModule,
|
||||
|
||||
Reference in New Issue
Block a user