<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/bugs/import-with-error.slang.expected, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2021-06-06T16:27:19+00:00</updated>
<entry>
<title>Include a "stack trace" with nested-import errors (#1872)</title>
<updated>2021-06-06T16:27:19+00:00</updated>
<author>
<name>T. Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2021-06-06T16:27:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=688d5fa6eb2c7f5281e50ace1401737479911ebc'/>
<id>urn:sha1:688d5fa6eb2c7f5281e50ace1401737479911ebc</id>
<content type='text'>
* Include a "stack trace" with nested-import errors

When errors occur in nested `#include` files it is often helpful to have a "stack trace" / traceback of the `#include` chain that led from a root translation unit to the file with an error.

This change implements a similar feature for `import`s.

It is worth noting that `import`s don't really *require* this kind of compiler support the way `#include`s do because the intention is that the meaning of an `import`ed file does not depend on the order or nesting of `import`s. As such, when trying to *fix* an error in an `import`ed file, you usually don't care how it came to be `import`ed into your shaders.

The use case here is somebody adapting a large body of Slang code to use in a different codebase, such that they have certain `.slang` files they don't actually intend to have compile correctly, and they want to be able to diagnose how they came to include those files when/if they cause problems.

The actual feature implementation is pretty simple because we already track a stack of active `import`s so that we can detect and diagnose recursive `import`s. This change simply changes the disagnostics when there is an error in imported code so that instead of just noting the inner-most `import` site it lists all the `import` sites that were active at the time.

The change includes a test case to confirm that the behavior works (at least for the case of a parse error).

* fixup: test outputs

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;
Co-authored-by: jsmall-nvidia &lt;jsmall@nvidia.com&gt;</content>
</entry>
<entry>
<title>Diagnostic location highlighting (#1700)</title>
<updated>2021-02-12T19:31:56+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2021-02-12T19:31:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=369279e91dde1b056d8d0e3bb83e7ba3f96321af'/>
<id>urn:sha1:369279e91dde1b056d8d0e3bb83e7ba3f96321af</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* WIP: First pass in supporting output of line error information.

* Add support for lexing to better be able to indicate SourceLocation information.

* Fix lexer usage in DiagnosticSink in C++ extractor.

* Update diagnostics tests to have line location info.

* Fixed test expected output that now have source location information in them.

* Better handling of tab.

* Fix test expected results for tabbing change.

* DiagnosticLexer -&gt; DiagnosticSink::SourceLocationLexer
Added line continuation tests.

* Fix typo.

* Added String::appendRepeatedChar

* Change to rerun tests.

Co-authored-by: Tim Foley &lt;tfoleyNV@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Stop compilation when a imported module contains errors. (#440)</title>
<updated>2018-03-12T18:02:28+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2018-03-12T18:02:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e08f0c6ea0552a2d626294c718cd4409f437ba10'/>
<id>urn:sha1:e08f0c6ea0552a2d626294c718cd4409f437ba10</id>
<content type='text'>
* Stop compilation when a important module contains errors.

* Fixup test cases
</content>
</entry>
<entry>
<title>Fix handling of errors in imported modules (#387)</title>
<updated>2018-01-26T23:30:23+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-01-26T23:30:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=06f0effb848c6b938e03da8a61e44b3d032380e8'/>
<id>urn:sha1:06f0effb848c6b938e03da8a61e44b3d032380e8</id>
<content type='text'>
* Fix handling of errors in imported modules

- If a semantic error is detected in an imported module, then don't try to generate IR code for it

- Also, if a module (transitively) imports itself, then report that as an error
  - The way I'm checking for this is a bit hacky (I'm adding the module to the map of loaded modules, but in an "unfinished" state, and then using that unfinished state to detect the import of a module already being imported).

This isn't a 100% complete solution for any of the related problems, but it improves the user experience for the common case.

* Remove #import test.

The feature is slated to be removed, so it isn't worth fixing up this test case.
</content>
</entry>
</feed>
