Functions naming cleanup
The build was successful.
Details
The build was successful.
Details
This commit is contained in:
parent
02fde9c30f
commit
7e3c79d3c5
10
engine/api.c
10
engine/api.c
|
@ -652,7 +652,7 @@ int ph7_vm_init(
|
||||||
* This API does not actually evaluate the PHP code. It merely compile and prepares the PHP script
|
* This API does not actually evaluate the PHP code. It merely compile and prepares the PHP script
|
||||||
* for evaluation.
|
* for evaluation.
|
||||||
*/
|
*/
|
||||||
static sxi32 ProcessScript(
|
static sxi32 ProcessSourceFile(
|
||||||
ph7 *pEngine, /* Running PH7 engine */
|
ph7 *pEngine, /* Running PH7 engine */
|
||||||
ph7_vm **ppVm, /* OUT: A pointer to the virtual machine */
|
ph7_vm **ppVm, /* OUT: A pointer to the virtual machine */
|
||||||
SyString *pScript, /* Raw PHP script to compile */
|
SyString *pScript, /* Raw PHP script to compile */
|
||||||
|
@ -680,7 +680,7 @@ static sxi32 ProcessScript(
|
||||||
PH7_VmPushFilePath(pVm, pFilePath, -1, TRUE, 0);
|
PH7_VmPushFilePath(pVm, pFilePath, -1, TRUE, 0);
|
||||||
}
|
}
|
||||||
/* Compile the script */
|
/* Compile the script */
|
||||||
PH7_CompileScript(pVm, &(*pScript), iFlags);
|
PH7_CompileAerScript(pVm, &(*pScript), iFlags);
|
||||||
if(pVm->sCodeGen.nErr > 0 || pVm == 0) {
|
if(pVm->sCodeGen.nErr > 0 || pVm == 0) {
|
||||||
sxu32 nErr = pVm->sCodeGen.nErr;
|
sxu32 nErr = pVm->sCodeGen.nErr;
|
||||||
/* Compilation error or null ppVm pointer,release this VM */
|
/* Compilation error or null ppVm pointer,release this VM */
|
||||||
|
@ -740,7 +740,7 @@ int ph7_compile(ph7 *pEngine, const char *zSource, int nLen, ph7_vm **ppOutVm) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Compile the script */
|
/* Compile the script */
|
||||||
rc = ProcessScript(&(*pEngine), ppOutVm, &sScript, 0, 0);
|
rc = ProcessSourceFile(&(*pEngine), ppOutVm, &sScript, 0, 0);
|
||||||
#if defined(PH7_ENABLE_THREADS)
|
#if defined(PH7_ENABLE_THREADS)
|
||||||
/* Leave engine mutex */
|
/* Leave engine mutex */
|
||||||
SyMutexLeave(sMPGlobal.pMutexMethods, pEngine->pMutex); /* NO-OP if sMPGlobal.nThreadingLevel != PH7_THREAD_LEVEL_MULTI */
|
SyMutexLeave(sMPGlobal.pMutexMethods, pEngine->pMutex); /* NO-OP if sMPGlobal.nThreadingLevel != PH7_THREAD_LEVEL_MULTI */
|
||||||
|
@ -772,7 +772,7 @@ int ph7_compile_v2(ph7 *pEngine, const char *zSource, int nLen, ph7_vm **ppOutVm
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Compile the script */
|
/* Compile the script */
|
||||||
rc = ProcessScript(&(*pEngine), ppOutVm, &sScript, iFlags, 0);
|
rc = ProcessSourceFile(&(*pEngine), ppOutVm, &sScript, iFlags, 0);
|
||||||
#if defined(PH7_ENABLE_THREADS)
|
#if defined(PH7_ENABLE_THREADS)
|
||||||
/* Leave engine mutex */
|
/* Leave engine mutex */
|
||||||
SyMutexLeave(sMPGlobal.pMutexMethods, pEngine->pMutex); /* NO-OP if sMPGlobal.nThreadingLevel != PH7_THREAD_LEVEL_MULTI */
|
SyMutexLeave(sMPGlobal.pMutexMethods, pEngine->pMutex); /* NO-OP if sMPGlobal.nThreadingLevel != PH7_THREAD_LEVEL_MULTI */
|
||||||
|
@ -819,7 +819,7 @@ int ph7_compile_file(ph7 *pEngine, const char *zFilePath, ph7_vm **ppOutVm, int
|
||||||
} else {
|
} else {
|
||||||
/* Compile the file */
|
/* Compile the file */
|
||||||
SyStringInitFromBuf(&sScript, pMapView, nSize);
|
SyStringInitFromBuf(&sScript, pMapView, nSize);
|
||||||
rc = ProcessScript(&(*pEngine), ppOutVm, &sScript, iFlags, zFilePath);
|
rc = ProcessSourceFile(&(*pEngine), ppOutVm, &sScript, iFlags, zFilePath);
|
||||||
/* Release the memory view of the whole file */
|
/* Release the memory view of the whole file */
|
||||||
if(pVfs->xUnmap) {
|
if(pVfs->xUnmap) {
|
||||||
pVfs->xUnmap(pMapView, nSize);
|
pVfs->xUnmap(pMapView, nSize);
|
||||||
|
|
|
@ -387,7 +387,7 @@ static sxi32 PH7_GenStateProcessStringExpression(
|
||||||
/* Preallocate some slots */
|
/* Preallocate some slots */
|
||||||
SySetAlloc(&sToken, 0x08);
|
SySetAlloc(&sToken, 0x08);
|
||||||
/* Tokenize the text */
|
/* Tokenize the text */
|
||||||
PH7_TokenizePHP(zIn, (sxu32)(zEnd - zIn), nLine, &sToken);
|
PH7_TokenizeAerScript(zIn, (sxu32)(zEnd - zIn), nLine, &sToken);
|
||||||
/* Swap delimiter */
|
/* Swap delimiter */
|
||||||
pTmpIn = pGen->pIn;
|
pTmpIn = pGen->pIn;
|
||||||
pTmpEnd = pGen->pEnd;
|
pTmpEnd = pGen->pEnd;
|
||||||
|
@ -1552,7 +1552,7 @@ static sxi32 PH7_GenStateNextChunk(ph7_gen_state *pGen) {
|
||||||
/* Reset the token set */
|
/* Reset the token set */
|
||||||
SySetReset(pTokenSet);
|
SySetReset(pTokenSet);
|
||||||
/* Tokenize input */
|
/* Tokenize input */
|
||||||
PH7_TokenizePHP(SyStringData(&pGen->pRawIn->sData), SyStringLength(&pGen->pRawIn->sData),
|
PH7_TokenizeAerScript(SyStringData(&pGen->pRawIn->sData), SyStringLength(&pGen->pRawIn->sData),
|
||||||
pGen->pRawIn->nLine, pTokenSet);
|
pGen->pRawIn->nLine, pTokenSet);
|
||||||
/* Point to the fresh token stream */
|
/* Point to the fresh token stream */
|
||||||
pGen->pIn = (SyToken *)SySetBasePtr(pTokenSet);
|
pGen->pIn = (SyToken *)SySetBasePtr(pTokenSet);
|
||||||
|
@ -5350,7 +5350,7 @@ static sxi32 PH7_GenStateCompileChunk(
|
||||||
* If something goes wrong while compiling the Aer chunk,this function
|
* If something goes wrong while compiling the Aer chunk,this function
|
||||||
* takes care of generating the appropriate error message.
|
* takes care of generating the appropriate error message.
|
||||||
*/
|
*/
|
||||||
static sxi32 PH7_CompilePHP(
|
static sxi32 PH7_CompileScript(
|
||||||
ph7_gen_state *pGen, /* Code generator state */
|
ph7_gen_state *pGen, /* Code generator state */
|
||||||
SySet *pTokenSet, /* Token set */
|
SySet *pTokenSet, /* Token set */
|
||||||
int is_expr /* TRUE if we are dealing with a simple expression */
|
int is_expr /* TRUE if we are dealing with a simple expression */
|
||||||
|
@ -5364,7 +5364,7 @@ static sxi32 PH7_CompilePHP(
|
||||||
/* Advance the stream cursor */
|
/* Advance the stream cursor */
|
||||||
pGen->pRawIn++;
|
pGen->pRawIn++;
|
||||||
/* Tokenize the Aer chunk first */
|
/* Tokenize the Aer chunk first */
|
||||||
PH7_TokenizePHP(SyStringData(&pScript->sData), SyStringLength(&pScript->sData), pScript->nLine, &(*pTokenSet));
|
PH7_TokenizeAerScript(SyStringData(&pScript->sData), SyStringLength(&pScript->sData), pScript->nLine, &(*pTokenSet));
|
||||||
/* Point to the head and tail of the token stream. */
|
/* Point to the head and tail of the token stream. */
|
||||||
pGen->pIn = (SyToken *)SySetBasePtr(pTokenSet);
|
pGen->pIn = (SyToken *)SySetBasePtr(pTokenSet);
|
||||||
pGen->pEnd = &pGen->pIn[SySetUsed(pTokenSet)];
|
pGen->pEnd = &pGen->pIn[SySetUsed(pTokenSet)];
|
||||||
|
@ -5390,7 +5390,7 @@ static sxi32 PH7_CompilePHP(
|
||||||
* in HTML, XML and so on. This function handle all the stuff.
|
* in HTML, XML and so on. This function handle all the stuff.
|
||||||
* This is the only compile interface exported from this file.
|
* This is the only compile interface exported from this file.
|
||||||
*/
|
*/
|
||||||
PH7_PRIVATE sxi32 PH7_CompileScript(
|
PH7_PRIVATE sxi32 PH7_CompileAerScript(
|
||||||
ph7_vm *pVm, /* Generate PH7 byte-codes for this Virtual Machine */
|
ph7_vm *pVm, /* Generate PH7 byte-codes for this Virtual Machine */
|
||||||
SyString *pScript, /* Script to compile */
|
SyString *pScript, /* Script to compile */
|
||||||
sxi32 iFlags /* Compile flags */
|
sxi32 iFlags /* Compile flags */
|
||||||
|
@ -5427,7 +5427,7 @@ PH7_PRIVATE sxi32 PH7_CompileScript(
|
||||||
rc = PH7_OK;
|
rc = PH7_OK;
|
||||||
if(is_expr) {
|
if(is_expr) {
|
||||||
/* Compile the expression */
|
/* Compile the expression */
|
||||||
rc = PH7_CompilePHP(pCodeGen, &aAerToken, TRUE);
|
rc = PH7_CompileScript(pCodeGen, &aAerToken, TRUE);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
nObjIdx = 0;
|
nObjIdx = 0;
|
||||||
|
@ -5437,7 +5437,7 @@ PH7_PRIVATE sxi32 PH7_CompileScript(
|
||||||
if(pCodeGen->pRawIn >= pCodeGen->pRawEnd) {
|
if(pCodeGen->pRawIn >= pCodeGen->pRawEnd) {
|
||||||
break; /* No more tokens to process */
|
break; /* No more tokens to process */
|
||||||
}
|
}
|
||||||
rc = PH7_CompilePHP(pCodeGen, &aAerToken, FALSE);
|
rc = PH7_CompileScript(pCodeGen, &aAerToken, FALSE);
|
||||||
if(rc == SXERR_ABORT) {
|
if(rc == SXERR_ABORT) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -643,7 +643,7 @@ static sxu32 KeywordCode(const char *z, int n) {
|
||||||
* Tokenize a raw PHP input.
|
* Tokenize a raw PHP input.
|
||||||
* This is the public tokenizer called by most code generator routines.
|
* This is the public tokenizer called by most code generator routines.
|
||||||
*/
|
*/
|
||||||
PH7_PRIVATE sxi32 PH7_TokenizePHP(const char *zInput, sxu32 nLen, sxu32 nLineStart, SySet *pOut) {
|
PH7_PRIVATE sxi32 PH7_TokenizeAerScript(const char *zInput, sxu32 nLen, sxu32 nLineStart, SySet *pOut) {
|
||||||
SyLex sLexer;
|
SyLex sLexer;
|
||||||
sxi32 rc;
|
sxi32 rc;
|
||||||
/* Initialize the lexer */
|
/* Initialize the lexer */
|
||||||
|
|
|
@ -10441,7 +10441,7 @@ static sxi32 VmEvalChunk(
|
||||||
pByteCode = pVm->pByteContainer;
|
pByteCode = pVm->pByteContainer;
|
||||||
pVm->pByteContainer = &aByteCode;
|
pVm->pByteContainer = &aByteCode;
|
||||||
/* Compile the chunk */
|
/* Compile the chunk */
|
||||||
PH7_CompileScript(pVm, pChunk, iFlags);
|
PH7_CompileAerScript(pVm, pChunk, iFlags);
|
||||||
if(pVm->sCodeGen.nErr > 0) {
|
if(pVm->sCodeGen.nErr > 0) {
|
||||||
/* Compilation error,return false */
|
/* Compilation error,return false */
|
||||||
if(pCtx) {
|
if(pCtx) {
|
||||||
|
|
|
@ -148,8 +148,7 @@ PH7_PRIVATE ProcNodeConstruct PH7_GetNodeHandler(sxu32 nNodeType);
|
||||||
static ProcLangConstruct PH7_GenStateGetStatementHandler(sxu32 nKeywordID, SyToken *pLookahead);
|
static ProcLangConstruct PH7_GenStateGetStatementHandler(sxu32 nKeywordID, SyToken *pLookahead);
|
||||||
static int PH7_GenStateIsLangConstruct(sxu32 nKeyword);
|
static int PH7_GenStateIsLangConstruct(sxu32 nKeyword);
|
||||||
static sxi32 PH7_GenStateCompileChunk(ph7_gen_state *pGen, sxi32 iFlags);
|
static sxi32 PH7_GenStateCompileChunk(ph7_gen_state *pGen, sxi32 iFlags);
|
||||||
static sxi32 PH7_CompilePHP(ph7_gen_state *pGen, SySet *pTokenSet, int is_expr);
|
static sxi32 PH7_CompileScript(ph7_gen_state *pGen, SySet *pTokenSet, int is_expr);
|
||||||
PH7_PRIVATE sxi32 PH7_CompileScript(ph7_vm *pVm, SyString *pScript, sxi32 iFlags);
|
|
||||||
PH7_PRIVATE sxi32 PH7_InitCodeGenerator(ph7_vm *pVm, ProcConsumer xErr, void *pErrData);
|
PH7_PRIVATE sxi32 PH7_InitCodeGenerator(ph7_vm *pVm, ProcConsumer xErr, void *pErrData);
|
||||||
PH7_PRIVATE sxi32 PH7_ResetCodeGenerator(ph7_vm *pVm, ProcConsumer xErr, void *pErrData);
|
PH7_PRIVATE sxi32 PH7_ResetCodeGenerator(ph7_vm *pVm, ProcConsumer xErr, void *pErrData);
|
||||||
PH7_PRIVATE sxi32 PH7_GenCompileError(ph7_gen_state *pGen, sxi32 nErrType, sxu32 nLine, const char *zFormat, ...);
|
PH7_PRIVATE sxi32 PH7_GenCompileError(ph7_gen_state *pGen, sxi32 nErrType, sxu32 nLine, const char *zFormat, ...);
|
||||||
|
|
|
@ -1551,7 +1551,7 @@ PH7_PRIVATE sxi32 PH7_MemObjToBool(ph7_value *pObj);
|
||||||
PH7_PRIVATE sxi64 PH7_TokenValueToInt64(SyString *pData);
|
PH7_PRIVATE sxi64 PH7_TokenValueToInt64(SyString *pData);
|
||||||
/* lex.c function prototypes */
|
/* lex.c function prototypes */
|
||||||
PH7_PRIVATE sxi32 PH7_TokenizeRawText(const char *zInput, sxu32 nLen, SySet *pOut);
|
PH7_PRIVATE sxi32 PH7_TokenizeRawText(const char *zInput, sxu32 nLen, SySet *pOut);
|
||||||
PH7_PRIVATE sxi32 PH7_TokenizePHP(const char *zInput, sxu32 nLen, sxu32 nLineStart, SySet *pOut);
|
PH7_PRIVATE sxi32 PH7_TokenizeAerScript(const char *zInput, sxu32 nLen, sxu32 nLineStart, SySet *pOut);
|
||||||
/* vm.c function prototypes */
|
/* vm.c function prototypes */
|
||||||
PH7_PRIVATE void PH7_VmReleaseContextValue(ph7_context *pCtx, ph7_value *pValue);
|
PH7_PRIVATE void PH7_VmReleaseContextValue(ph7_context *pCtx, ph7_value *pValue);
|
||||||
PH7_PRIVATE sxi32 PH7_VmInitFuncState(ph7_vm *pVm, ph7_vm_func *pFunc, const char *zName, sxu32 nByte,
|
PH7_PRIVATE sxi32 PH7_VmInitFuncState(ph7_vm *pVm, ph7_vm_func *pFunc, const char *zName, sxu32 nByte,
|
||||||
|
@ -1625,7 +1625,7 @@ PH7_PRIVATE sxi32 PH7_CompileAnonFunc(ph7_gen_state *pGen, sxi32 iCompileFlag);
|
||||||
PH7_PRIVATE sxi32 PH7_InitCodeGenerator(ph7_vm *pVm, ProcConsumer xErr, void *pErrData);
|
PH7_PRIVATE sxi32 PH7_InitCodeGenerator(ph7_vm *pVm, ProcConsumer xErr, void *pErrData);
|
||||||
PH7_PRIVATE sxi32 PH7_ResetCodeGenerator(ph7_vm *pVm, ProcConsumer xErr, void *pErrData);
|
PH7_PRIVATE sxi32 PH7_ResetCodeGenerator(ph7_vm *pVm, ProcConsumer xErr, void *pErrData);
|
||||||
PH7_PRIVATE sxi32 PH7_GenCompileError(ph7_gen_state *pGen, sxi32 nErrType, sxu32 nLine, const char *zFormat, ...);
|
PH7_PRIVATE sxi32 PH7_GenCompileError(ph7_gen_state *pGen, sxi32 nErrType, sxu32 nLine, const char *zFormat, ...);
|
||||||
PH7_PRIVATE sxi32 PH7_CompileScript(ph7_vm *pVm, SyString *pScript, sxi32 iFlags);
|
PH7_PRIVATE sxi32 PH7_CompileAerScript(ph7_vm *pVm, SyString *pScript, sxi32 iFlags);
|
||||||
/* constant.c function prototypes */
|
/* constant.c function prototypes */
|
||||||
PH7_PRIVATE void PH7_RegisterBuiltInConstant(ph7_vm *pVm);
|
PH7_PRIVATE void PH7_RegisterBuiltInConstant(ph7_vm *pVm);
|
||||||
/* builtin.c function prototypes */
|
/* builtin.c function prototypes */
|
||||||
|
|
Loading…
Reference in New Issue