jscript: Store expression type in expression_t.
This commit is contained in:
parent
fe9cb0c266
commit
8b66110e51
|
@ -291,9 +291,71 @@ typedef struct {
|
|||
} u;
|
||||
} exprval_t;
|
||||
|
||||
typedef enum {
|
||||
EXPR_COMMA,
|
||||
EXPR_OR,
|
||||
EXPR_AND,
|
||||
EXPR_BOR,
|
||||
EXPR_BXOR,
|
||||
EXPR_BAND,
|
||||
EXPR_INSTANCEOF,
|
||||
EXPR_IN,
|
||||
EXPR_ADD,
|
||||
EXPR_SUB,
|
||||
EXPR_MUL,
|
||||
EXPR_DIV,
|
||||
EXPR_MOD,
|
||||
EXPR_DELETE,
|
||||
EXPR_VOID,
|
||||
EXPR_TYPEOF,
|
||||
EXPR_MINUS,
|
||||
EXPR_PLUS,
|
||||
EXPR_POSTINC,
|
||||
EXPR_POSTDEC,
|
||||
EXPR_PREINC,
|
||||
EXPR_PREDEC,
|
||||
EXPR_EQ,
|
||||
EXPR_EQEQ,
|
||||
EXPR_NOTEQ,
|
||||
EXPR_NOTEQEQ,
|
||||
EXPR_LESS,
|
||||
EXPR_LESSEQ,
|
||||
EXPR_GREATER,
|
||||
EXPR_GREATEREQ,
|
||||
EXPR_BITNEG,
|
||||
EXPR_LOGNEG,
|
||||
EXPR_LSHIFT,
|
||||
EXPR_RSHIFT,
|
||||
EXPR_RRSHIFT,
|
||||
EXPR_ASSIGN,
|
||||
EXPR_ASSIGNLSHIFT,
|
||||
EXPR_ASSIGNRSHIFT,
|
||||
EXPR_ASSIGNRRSHIFT,
|
||||
EXPR_ASSIGNADD,
|
||||
EXPR_ASSIGNSUB,
|
||||
EXPR_ASSIGNMUL,
|
||||
EXPR_ASSIGNDIV,
|
||||
EXPR_ASSIGNMOD,
|
||||
EXPR_ASSIGNAND,
|
||||
EXPR_ASSIGNOR,
|
||||
EXPR_ASSIGNXOR,
|
||||
EXPR_COND,
|
||||
EXPR_ARRAY,
|
||||
EXPR_MEMBER,
|
||||
EXPR_NEW,
|
||||
EXPR_CALL,
|
||||
EXPR_THIS,
|
||||
EXPR_FUNC,
|
||||
EXPR_IDENT,
|
||||
EXPR_ARRAYLIT,
|
||||
EXPR_PROPVAL,
|
||||
EXPR_LITERAL
|
||||
} expression_type_t;
|
||||
|
||||
typedef HRESULT (*expression_eval_t)(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*);
|
||||
|
||||
struct _expression_t {
|
||||
expression_type_t type;
|
||||
expression_eval_t eval;
|
||||
};
|
||||
|
||||
|
@ -396,67 +458,6 @@ typedef struct {
|
|||
prop_val_t *property_list;
|
||||
} property_value_expression_t;
|
||||
|
||||
typedef enum {
|
||||
EXPR_COMMA,
|
||||
EXPR_OR,
|
||||
EXPR_AND,
|
||||
EXPR_BOR,
|
||||
EXPR_BXOR,
|
||||
EXPR_BAND,
|
||||
EXPR_INSTANCEOF,
|
||||
EXPR_IN,
|
||||
EXPR_ADD,
|
||||
EXPR_SUB,
|
||||
EXPR_MUL,
|
||||
EXPR_DIV,
|
||||
EXPR_MOD,
|
||||
EXPR_DELETE,
|
||||
EXPR_VOID,
|
||||
EXPR_TYPEOF,
|
||||
EXPR_MINUS,
|
||||
EXPR_PLUS,
|
||||
EXPR_POSTINC,
|
||||
EXPR_POSTDEC,
|
||||
EXPR_PREINC,
|
||||
EXPR_PREDEC,
|
||||
EXPR_EQ,
|
||||
EXPR_EQEQ,
|
||||
EXPR_NOTEQ,
|
||||
EXPR_NOTEQEQ,
|
||||
EXPR_LESS,
|
||||
EXPR_LESSEQ,
|
||||
EXPR_GREATER,
|
||||
EXPR_GREATEREQ,
|
||||
EXPR_BITNEG,
|
||||
EXPR_LOGNEG,
|
||||
EXPR_LSHIFT,
|
||||
EXPR_RSHIFT,
|
||||
EXPR_RRSHIFT,
|
||||
EXPR_ASSIGN,
|
||||
EXPR_ASSIGNLSHIFT,
|
||||
EXPR_ASSIGNRSHIFT,
|
||||
EXPR_ASSIGNRRSHIFT,
|
||||
EXPR_ASSIGNADD,
|
||||
EXPR_ASSIGNSUB,
|
||||
EXPR_ASSIGNMUL,
|
||||
EXPR_ASSIGNDIV,
|
||||
EXPR_ASSIGNMOD,
|
||||
EXPR_ASSIGNAND,
|
||||
EXPR_ASSIGNOR,
|
||||
EXPR_ASSIGNXOR,
|
||||
EXPR_COND,
|
||||
EXPR_ARRAY,
|
||||
EXPR_MEMBER,
|
||||
EXPR_NEW,
|
||||
EXPR_CALL,
|
||||
EXPR_THIS,
|
||||
EXPR_FUNC,
|
||||
EXPR_IDENT,
|
||||
EXPR_ARRAYLIT,
|
||||
EXPR_PROPVAL,
|
||||
EXPR_LITERAL
|
||||
} expression_type_t;
|
||||
|
||||
HRESULT function_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
|
||||
HRESULT conditional_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
|
||||
HRESULT array_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -1369,6 +1369,7 @@ static void *new_expression(parser_ctx_t *ctx, expression_type_t type, size_t si
|
|||
{
|
||||
expression_t *ret = parser_alloc(ctx, size ? size : sizeof(*ret));
|
||||
|
||||
ret->type = type;
|
||||
ret->eval = expression_eval_table[type];
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue