From d222889d19ff57eda999269d22da6915daedc839 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 29 Jan 2019 13:27:20 -0800 Subject: Fix core.meta.slang Escaped expression cannot start with '('. --- source/slang/core.meta.slang | 6 +++--- source/slang/core.meta.slang.h | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang index 50a4cbf96..54dfc6127 100644 --- a/source/slang/core.meta.slang +++ b/source/slang/core.meta.slang @@ -1289,9 +1289,9 @@ attribute_syntax [__readNone] : ReadNoneAttribute; enum AttributeTargets { - Struct = $((int) UserDefinedAttributeTargets::Struct), - Var = $((int) UserDefinedAttributeTargets::Var), - Function = $((int) UserDefinedAttributeTargets::Function), + Struct = $( (int) UserDefinedAttributeTargets::Struct), + Var = $( (int) UserDefinedAttributeTargets::Var), + Function = $( (int) UserDefinedAttributeTargets::Function), }; __attributeTarget(StructDecl) attribute_syntax [AttributeUsage(target : AttributeTargets)] : AttributeUsageAttribute; \ No newline at end of file diff --git a/source/slang/core.meta.slang.h b/source/slang/core.meta.slang.h index 746e75bd9..f0671396d 100644 --- a/source/slang/core.meta.slang.h +++ b/source/slang/core.meta.slang.h @@ -1307,12 +1307,18 @@ SLANG_RAW("attribute_syntax [__readNone] : ReadNoneAttribute;\n") SLANG_RAW("\n") SLANG_RAW("enum AttributeTargets\n") SLANG_RAW("{\n") - - sb << "Struct = " << (int)UserDefinedAttributeTargets::Struct << ", "; - sb << "Var = " << (int)UserDefinedAttributeTargets::Var << ", "; - sb << "Function = " << (int)UserDefinedAttributeTargets::Function; - -SLANG_RAW("\n") +SLANG_RAW(" Struct = ") +SLANG_SPLICE( (int) UserDefinedAttributeTargets::Struct +) +SLANG_RAW(",\n") +SLANG_RAW(" Var = ") +SLANG_SPLICE( (int) UserDefinedAttributeTargets::Var +) +SLANG_RAW(",\n") +SLANG_RAW(" Function = ") +SLANG_SPLICE( (int) UserDefinedAttributeTargets::Function +) +SLANG_RAW(",\n") SLANG_RAW("};\n") SLANG_RAW("__attributeTarget(StructDecl)\n") SLANG_RAW("attribute_syntax [AttributeUsage(target : AttributeTargets)] : AttributeUsageAttribute;") -- cgit v1.2.3