Commit 9b18772c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Rename OP_long expression to OP_int.

parent d01d6294
...@@ -536,8 +536,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) ...@@ -536,8 +536,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr)
return push_instr_str(ctx, OP_string, ((string_expression_t*)expr)->value); return push_instr_str(ctx, OP_string, ((string_expression_t*)expr)->value);
case EXPR_SUB: case EXPR_SUB:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_sub); return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_sub);
case EXPR_ULONG: case EXPR_INT:
return push_instr_int(ctx, OP_long, ((int_expression_t*)expr)->value); return push_instr_int(ctx, OP_int, ((int_expression_t*)expr)->value);
case EXPR_XOR: case EXPR_XOR:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_xor); return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_xor);
default: default:
...@@ -779,7 +779,7 @@ static HRESULT compile_forto_statement(compile_ctx_t *ctx, forto_statement_t *st ...@@ -779,7 +779,7 @@ static HRESULT compile_forto_statement(compile_ctx_t *ctx, forto_statement_t *st
if(!push_instr(ctx, OP_val)) if(!push_instr(ctx, OP_val))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
}else { }else {
hres = push_instr_int(ctx, OP_long, 1); hres = push_instr_int(ctx, OP_int, 1);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
} }
......
...@@ -1315,7 +1315,7 @@ static HRESULT interp_string(exec_ctx_t *ctx) ...@@ -1315,7 +1315,7 @@ static HRESULT interp_string(exec_ctx_t *ctx)
return stack_push(ctx, &v); return stack_push(ctx, &v);
} }
static HRESULT interp_long(exec_ctx_t *ctx) static HRESULT interp_int(exec_ctx_t *ctx)
{ {
const LONG arg = ctx->instr->arg1.lng; const LONG arg = ctx->instr->arg1.lng;
VARIANT v; VARIANT v;
......
...@@ -335,7 +335,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) ...@@ -335,7 +335,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret)
if(use_int && (LONG)d == d) { if(use_int && (LONG)d == d) {
*(LONG*)ret = d; *(LONG*)ret = d;
return tLong; return tInt;
} }
r = exp>=0 ? d*pow(10, exp) : d/pow(10, -exp); r = exp>=0 ? d*pow(10, exp) : d/pow(10, -exp);
...@@ -376,7 +376,7 @@ static int parse_hex_literal(parser_ctx_t *ctx, LONG *ret) ...@@ -376,7 +376,7 @@ static int parse_hex_literal(parser_ctx_t *ctx, LONG *ret)
ctx->ptr++; ctx->ptr++;
*ret = l; *ret = l;
return tLong; return tInt;
} }
static void skip_spaces(parser_ctx_t *ctx) static void skip_spaces(parser_ctx_t *ctx)
......
...@@ -32,6 +32,7 @@ typedef enum { ...@@ -32,6 +32,7 @@ typedef enum {
EXPR_GTEQ, EXPR_GTEQ,
EXPR_IDIV, EXPR_IDIV,
EXPR_IMP, EXPR_IMP,
EXPR_INT,
EXPR_IS, EXPR_IS,
EXPR_LT, EXPR_LT,
EXPR_LTEQ, EXPR_LTEQ,
...@@ -49,7 +50,6 @@ typedef enum { ...@@ -49,7 +50,6 @@ typedef enum {
EXPR_OR, EXPR_OR,
EXPR_STRING, EXPR_STRING,
EXPR_SUB, EXPR_SUB,
EXPR_ULONG,
EXPR_XOR EXPR_XOR
} expression_type_t; } expression_type_t;
......
...@@ -97,7 +97,7 @@ static statement_t *link_statements(statement_t*,statement_t*); ...@@ -97,7 +97,7 @@ static statement_t *link_statements(statement_t*,statement_t*);
const_decl_t *const_decl; const_decl_t *const_decl;
case_clausule_t *case_clausule; case_clausule_t *case_clausule;
unsigned uint; unsigned uint;
LONG lng; LONG integer;
BOOL boolean; BOOL boolean;
double dbl; double dbl;
} }
...@@ -119,7 +119,7 @@ static statement_t *link_statements(statement_t*,statement_t*); ...@@ -119,7 +119,7 @@ static statement_t *link_statements(statement_t*,statement_t*);
%token <string> tNEXT tON tRESUME tGOTO %token <string> tNEXT tON tRESUME tGOTO
%token <string> tIdentifier tString %token <string> tIdentifier tString
%token <string> tDEFAULT tERROR tEXPLICIT tPROPERTY tSTEP %token <string> tDEFAULT tERROR tEXPLICIT tPROPERTY tSTEP
%token <lng> tLong %token <integer> tInt
%token <dbl> tDouble %token <dbl> tDouble
%type <statement> Statement SimpleStatement StatementNl StatementsNl StatementsNl_opt IfStatement Else_opt %type <statement> Statement SimpleStatement StatementNl StatementsNl StatementsNl_opt IfStatement Else_opt
...@@ -381,13 +381,13 @@ LiteralExpression ...@@ -381,13 +381,13 @@ LiteralExpression
| tNOTHING { $$ = new_expression(ctx, EXPR_NOTHING, 0); CHECK_ERROR; } | tNOTHING { $$ = new_expression(ctx, EXPR_NOTHING, 0); CHECK_ERROR; }
NumericLiteralExpression NumericLiteralExpression
: '0' { $$ = new_long_expression(ctx, EXPR_ULONG, 0); CHECK_ERROR; } : '0' { $$ = new_long_expression(ctx, EXPR_INT, 0); CHECK_ERROR; }
| tLong { $$ = new_long_expression(ctx, EXPR_ULONG, $1); CHECK_ERROR; } | tInt { $$ = new_long_expression(ctx, EXPR_INT, $1); CHECK_ERROR; }
| tDouble { $$ = new_double_expression(ctx, $1); CHECK_ERROR; } | tDouble { $$ = new_double_expression(ctx, $1); CHECK_ERROR; }
IntegerValue IntegerValue
: '0' { $$ = 0; } : '0' { $$ = 0; }
| tLong { $$ = $1; } | tInt { $$ = $1; }
PrimaryExpression PrimaryExpression
: '(' Expression ')' { $$ = new_unary_expression(ctx, EXPR_BRACKETS, $2); } : '(' Expression ')' { $$ = new_unary_expression(ctx, EXPR_BRACKETS, $2); }
......
...@@ -248,11 +248,11 @@ typedef enum { ...@@ -248,11 +248,11 @@ typedef enum {
X(idiv, 1, 0, 0) \ X(idiv, 1, 0, 0) \
X(imp, 1, 0, 0) \ X(imp, 1, 0, 0) \
X(incc, 1, ARG_BSTR, 0) \ X(incc, 1, ARG_BSTR, 0) \
X(int, 1, ARG_INT, 0) \
X(is, 1, 0, 0) \ X(is, 1, 0, 0) \
X(jmp, 0, ARG_ADDR, 0) \ X(jmp, 0, ARG_ADDR, 0) \
X(jmp_false, 0, ARG_ADDR, 0) \ X(jmp_false, 0, ARG_ADDR, 0) \
X(jmp_true, 0, ARG_ADDR, 0) \ X(jmp_true, 0, ARG_ADDR, 0) \
X(long, 1, ARG_INT, 0) \
X(lt, 1, 0, 0) \ X(lt, 1, 0, 0) \
X(lteq, 1, 0, 0) \ X(lteq, 1, 0, 0) \
X(mcall, 1, ARG_BSTR, ARG_UINT) \ X(mcall, 1, ARG_BSTR, ARG_UINT) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment