revert lex.ll parse.yy stdlib.ispc to state when all constants are floats

This commit is contained in:
Evghenii
2013-09-13 16:02:53 +02:00
parent 9861375f0c
commit 36886971e3
3 changed files with 4 additions and 38 deletions

View File

@@ -149,8 +149,7 @@ struct ForeachDimension {
%union {
uint64_t intVal;
float floatVal;
double doubleVal;
float floatVal;
std::string *stringVal;
const char *constCharPtr;
@@ -186,7 +185,7 @@ struct ForeachDimension {
%token TOKEN_INT64_CONSTANT TOKEN_UINT64_CONSTANT
%token TOKEN_INT32DOTDOTDOT_CONSTANT TOKEN_UINT32DOTDOTDOT_CONSTANT
%token TOKEN_INT64DOTDOTDOT_CONSTANT TOKEN_UINT64DOTDOTDOT_CONSTANT
%token TOKEN_FLOAT_CONSTANT TOKEN_DOUBLE_CONSTANT TOKEN_STRING_C_LITERAL
%token TOKEN_FLOAT_CONSTANT TOKEN_STRING_C_LITERAL
%token TOKEN_IDENTIFIER TOKEN_STRING_LITERAL TOKEN_TYPE_NAME TOKEN_NULL
%token TOKEN_PTR_OP TOKEN_INC_OP TOKEN_DEC_OP TOKEN_LEFT_OP TOKEN_RIGHT_OP
%token TOKEN_LE_OP TOKEN_GE_OP TOKEN_EQ_OP TOKEN_NE_OP
@@ -328,11 +327,7 @@ primary_expression
}
| TOKEN_FLOAT_CONSTANT {
$$ = new ConstExpr(AtomicType::UniformFloat->GetAsConstType(),
yylval.floatVal, @1);
}
| TOKEN_DOUBLE_CONSTANT {
$$ = new ConstExpr(AtomicType::UniformDouble->GetAsConstType(),
yylval.doubleVal, @1);
(float)yylval.floatVal, @1);
}
| TOKEN_TRUE {
$$ = new ConstExpr(AtomicType::UniformBool->GetAsConstType(), true, @1);