summaryrefslogtreecommitdiff
path: root/slang.h
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-11-27 16:33:28 -0800
committerGitHub <noreply@github.com>2017-11-27 16:33:28 -0800
commit31993854b164fb6e19e449b7be550b1e48297ef5 (patch)
tree42e8f1542e2773288fec546a2e0dac20cbc0e83f /slang.h
parent109ee8aae399042fba6ea71e43e5ee2d441288dd (diff)
Cleanups (#298)
* Rename `lower.{h,cpp}` to `ast-legalize.{h,cpp}` This pass isn't really performing lowering akin to `lower-to-ir.{h,cpp}` so the file name is misleading. By renaming this pass we emphasize its role as an AST-related pass. Also update the comment at the top of `ast-legalize.h` to reflect the intended purpose of this pass in a world where we have the IR up and running. * Allow `import` as an alias for `__import` The use of double underscores to mark our new syntax has so far had two purposes: 1. It helps identify syntax that isn't meant to be exposed to users in its current form (e.g., `__generic` gets a double underscore because we want users to have a more pleasant surface syntax for generics that they write). This rationale doesn't apply to `__import`, which is a major language feature that users need to interact with. 2. It helps avoid the problem where the compiler treats something as a keyword that isn't supposed to be reserved in HLSL/GLSL and so causes existing user code to fail to parse (e.g., when the user tries to write a function called `import`). This no longer matters because we look up almost all of our keywords using the existing lexical scoping in the language (so the user can shadow almost any keyword with a local declaration). So, neither of the original two reasons applies to `__import`, and it makes sense to expose it as `import`. Doing so is a one-line change.
Diffstat (limited to 'slang.h')
-rw-r--r--slang.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/slang.h b/slang.h
index 30808a242..82e0aab22 100644
--- a/slang.h
+++ b/slang.h
@@ -1142,6 +1142,7 @@ namespace slang
#include "source/core/slang-string.cpp"
#include "source/core/stream.cpp"
#include "source/core/text-io.cpp"
+#include "source/slang/ast-legalize.cpp"
#include "source/slang/bytecode.cpp"
#include "source/slang/diagnostics.cpp"
#include "source/slang/dxc-support.cpp"
@@ -1157,7 +1158,6 @@ namespace slang
#include "source/slang/preprocessor.cpp"
#include "source/slang/profile.cpp"
#include "source/slang/lookup.cpp"
-#include "source/slang/lower.cpp"
#include "source/slang/lower-to-ir.cpp"
#include "source/slang/check.cpp"
#include "source/slang/compiler.cpp"