diff options
Diffstat (limited to 'source/slang/syntax.h')
| -rw-r--r-- | source/slang/syntax.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/slang/syntax.h b/source/slang/syntax.h index 81d6f8e01..05d3b6a79 100644 --- a/source/slang/syntax.h +++ b/source/slang/syntax.h @@ -437,15 +437,15 @@ namespace Slang // Try to extract a simple integer value from an `IntVal`. // This fill assert-fail if the object doesn't represent a literal value. - int GetIntVal(RefPtr<IntVal> val); + IntegerLiteralValue GetIntVal(RefPtr<IntVal> val); // Trivial case of a value that is just a constant integer class ConstantIntVal : public IntVal { public: - int value; + IntegerLiteralValue value; - ConstantIntVal(int value) + ConstantIntVal(IntegerLiteralValue value) : value(value) {} @@ -1188,7 +1188,7 @@ namespace Slang { auto constantVal = vecType->elementCount.As<ConstantIntVal>(); if (constantVal) - return constantVal->value; + return (int) constantVal->value; // TODO: what to do in this case? return 0; } @@ -1913,8 +1913,6 @@ namespace Slang virtual RefPtr<SyntaxNode> Accept(SyntaxVisitor * visitor) override; }; - typedef double FloatingPointLiteralValue; - class ConstantExpressionSyntaxNode : public ExpressionSyntaxNode { public: @@ -1930,8 +1928,8 @@ namespace Slang ConstantType ConstType; union { - int IntValue; - FloatingPointLiteralValue FloatValue; + IntegerLiteralValue integerValue; + FloatingPointLiteralValue floatingPointValue; }; String stringValue; virtual RefPtr<SyntaxNode> Accept(SyntaxVisitor * visitor) override; |
