First step to declare a variable with specified data type.
The build was successful.
Details
The build was successful.
Details
This commit is contained in:
parent
e6e59d299e
commit
241c7d8168
|
@ -5248,12 +5248,10 @@ static const LangConstruct aLangConstruct[] = {
|
||||||
{ PH7_KEYWORD_RETURN, PH7_CompileReturn }, /* return statement */
|
{ PH7_KEYWORD_RETURN, PH7_CompileReturn }, /* return statement */
|
||||||
{ PH7_KEYWORD_SWITCH, PH7_CompileSwitch }, /* Switch statement */
|
{ PH7_KEYWORD_SWITCH, PH7_CompileSwitch }, /* Switch statement */
|
||||||
{ PH7_KEYWORD_DO, PH7_CompileDoWhile }, /* do{ }while(); statement */
|
{ PH7_KEYWORD_DO, PH7_CompileDoWhile }, /* do{ }while(); statement */
|
||||||
{ PH7_KEYWORD_STATIC, PH7_CompileStatic }, /* static statement */
|
|
||||||
{ PH7_KEYWORD_EXIT, PH7_CompileHalt }, /* exit language construct */
|
{ PH7_KEYWORD_EXIT, PH7_CompileHalt }, /* exit language construct */
|
||||||
{ PH7_KEYWORD_TRY, PH7_CompileTry }, /* try statement */
|
{ PH7_KEYWORD_TRY, PH7_CompileTry }, /* try statement */
|
||||||
{ PH7_KEYWORD_THROW, PH7_CompileThrow }, /* throw statement */
|
{ PH7_KEYWORD_THROW, PH7_CompileThrow }, /* throw statement */
|
||||||
{ PH7_KEYWORD_CONST, PH7_CompileConstant }, /* const statement */
|
{ PH7_KEYWORD_CONST, PH7_CompileConstant }, /* const statement */
|
||||||
{ PH7_KEYWORD_VAR, PH7_CompileVar }, /* var statement */
|
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
* Return a pointer to the global scope handler routine associated
|
* Return a pointer to the global scope handler routine associated
|
||||||
|
@ -5291,23 +5289,29 @@ static ProcLangConstruct PH7_GenStateGetStatementHandler(
|
||||||
SyToken *pLookahead /* Look-ahead token */
|
SyToken *pLookahead /* Look-ahead token */
|
||||||
) {
|
) {
|
||||||
sxu32 n = 0;
|
sxu32 n = 0;
|
||||||
for(;;) {
|
if((nKeywordID & PH7_KEYWORD_TYPEDEF) != 0) {
|
||||||
if(n >= SX_ARRAYSIZE(aLangConstruct)) {
|
return PH7_CompileVar;
|
||||||
break;
|
} else if(nKeywordID == PH7_KEYWORD_STATIC) {
|
||||||
}
|
if(pLookahead && (pLookahead->nType & PH7_TK_OP)) {
|
||||||
if(aLangConstruct[n].nID == nKeywordID) {
|
const ph7_expr_op *pOp = (const ph7_expr_op *)pLookahead->pUserData;
|
||||||
if(nKeywordID == PH7_KEYWORD_STATIC && pLookahead && (pLookahead->nType & PH7_TK_OP)) {
|
if(pOp && pOp->iOp == EXPR_OP_DC /*::*/) {
|
||||||
const ph7_expr_op *pOp = (const ph7_expr_op *)pLookahead->pUserData;
|
/* 'static' (class context),return null */
|
||||||
if(pOp && pOp->iOp == EXPR_OP_DC /*::*/) {
|
return 0;
|
||||||
/* 'static' (class context),return null */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* Return a pointer to the handler.
|
|
||||||
*/
|
|
||||||
return aLangConstruct[n].xConstruct;
|
|
||||||
}
|
}
|
||||||
n++;
|
return PH7_CompileStatic;
|
||||||
|
} else {
|
||||||
|
for(;;) {
|
||||||
|
if(n >= SX_ARRAYSIZE(aLangConstruct)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(aLangConstruct[n].nID == nKeywordID) {
|
||||||
|
/* Return a pointer to the handler.
|
||||||
|
*/
|
||||||
|
return aLangConstruct[n].xConstruct;
|
||||||
|
}
|
||||||
|
n++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* Not a language construct */
|
/* Not a language construct */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1618,6 +1618,8 @@ enum ph7_expr_id {
|
||||||
#define PH7_KEYWORD_CALLBACK 0x80000 /* callback: MUST BE A POWER OF TWO */
|
#define PH7_KEYWORD_CALLBACK 0x80000 /* callback: MUST BE A POWER OF TWO */
|
||||||
#define PH7_KEYWORD_RESOURCE 0x100000 /* resource: MUST BE A POWER OF TWO */
|
#define PH7_KEYWORD_RESOURCE 0x100000 /* resource: MUST BE A POWER OF TWO */
|
||||||
#define PH7_KEYWORD_MIXED 0x200000 /* mixed: MUST BE A POWER OF TWO */
|
#define PH7_KEYWORD_MIXED 0x200000 /* mixed: MUST BE A POWER OF TWO */
|
||||||
|
|
||||||
|
#define PH7_KEYWORD_TYPEDEF (PH7_KEYWORD_VOID|PH7_KEYWORD_CHAR|PH7_KEYWORD_BOOL|PH7_KEYWORD_INT|PH7_KEYWORD_FLOAT|PH7_KEYWORD_STRING|PH7_KEYWORD_OBJECT|PH7_KEYWORD_CALLBACK|PH7_KEYWORD_RESOURCE|PH7_KEYWORD_MIXED)
|
||||||
/* JSON encoding/decoding related definition */
|
/* JSON encoding/decoding related definition */
|
||||||
enum json_err_code {
|
enum json_err_code {
|
||||||
JSON_ERROR_NONE = 0, /* No error has occurred. */
|
JSON_ERROR_NONE = 0, /* No error has occurred. */
|
||||||
|
|
Loading…
Reference in New Issue