added support for "d"-suffix

This commit is contained in:
egaburov
2013-09-16 15:54:32 +02:00
parent ec5cbb8117
commit e2a91e6de5
3 changed files with 39 additions and 4 deletions

View File

@@ -149,7 +149,8 @@ struct ForeachDimension {
%union {
uint64_t intVal;
float floatVal;
float floatVal;
double doubleVal;
std::string *stringVal;
const char *constCharPtr;
@@ -185,7 +186,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_STRING_C_LITERAL
%token TOKEN_FLOAT_CONSTANT TOKEN_DOUBLE_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
@@ -327,7 +328,11 @@ primary_expression
}
| TOKEN_FLOAT_CONSTANT {
$$ = new ConstExpr(AtomicType::UniformFloat->GetAsConstType(),
(float)yylval.floatVal, @1);
yylval.floatVal, @1);
}
| TOKEN_DOUBLE_CONSTANT {
$$ = new ConstExpr(AtomicType::UniformDouble->GetAsConstType(),
yylval.doubleVal, @1);
}
| TOKEN_TRUE {
$$ = new ConstExpr(AtomicType::UniformBool->GetAsConstType(), true, @1);