From 31293d61d3ec80198eab2439ec937d7ba37f6722 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Tue, 27 Jun 2017 10:24:25 -0700 Subject: Allow for re-export of an `import` declaration If module `A.slang` contains `__exported __import B;` then any declarations from `B.slang` will be visible to any client code that does `__import A;`. This allows a user to make a single "umbrella" file that encompases a bunch of code files. Note that this really only affects scoping during Slang compilation/checking; at code generation time everything always gets emitted as raw HLSL/GLSL so that names will be visible whether we want them to be or not. --- source/slang/parser.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/parser.cpp') diff --git a/source/slang/parser.cpp b/source/slang/parser.cpp index 8edc3a122..1d843c821 100644 --- a/source/slang/parser.cpp +++ b/source/slang/parser.cpp @@ -619,6 +619,9 @@ namespace Slang CASE(__prefix, PrefixModifier); CASE(__postfix, PostfixModifier); + // Modifier to apply to `import` that should be re-exported + CASE(__exported, ExportedModifier); + #undef CASE else if (AdvanceIf(parser, "__intrinsic_op")) -- cgit v1.2.3