https://github.com/shader-slang/slang
Revision f6cb66feab3439f41ca87cb307f69b49654883ab authored by Tim Foley on 26 June 2017, 17:52:31 UTC, committed by Tim Foley on 26 June 2017, 19:17:49 UTC
Previously the code checked for a duplicate `#import` using a data structure attached to the compile request, but this would fail for nested imports.
It also wouldn't work for a combination of `#import` and `__import`.

This change makes it so that we instead track a set of already-imported modules in the semantic checking visitor, which is instantiated once per translation unit.
We also key this set on the actual module (AST) imported, rather than on path/name/whatever, so hopefully it will be robust to the same thing getting imported multiple ways.
1 parent 6e99b81
History
Tip revision: f6cb66feab3439f41ca87cb307f69b49654883ab authored by Tim Foley on 26 June 2017, 17:52:31 UTC
Check for re-import at translation-unit level
Tip revision: f6cb66f
File Mode Size
build
examples
external
source
tests
tools
.gitignore -rw-r--r-- 247 bytes
.gitmodules -rw-r--r-- 107 bytes
LICENSE -rw-r--r-- 1.1 KB
README.md -rw-r--r-- 1.5 KB
appveyor.yml -rw-r--r-- 1.5 KB
slang.h -rw-r--r-- 28.6 KB
slang.sln -rw-r--r-- 6.3 KB
test.bat -rw-r--r-- 1.4 KB

README.md

back to top