<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/preprocessor/define-redefine.slang, 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>2017-10-09T20:38:33+00:00</updated>
<entry>
<title>Preprocessor: fix `undef` and redefinition (#204)</title>
<updated>2017-10-09T20:38:33+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2017-10-09T20:38:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=06b2192aa2bb6698c863388c5d085ba5b1f28374'/>
<id>urn:sha1:06b2192aa2bb6698c863388c5d085ba5b1f28374</id>
<content type='text'>
* Preprocessor: fix `undef` and redefinition

The logic for `undef` directives was failing to suppress macro expansion when reading the name to un-define, and so it wasn't actually working at all. We didn't notice this because we didn't have a test case, and users hadn't tried it.

The logic for `define` had a similar bug, which meant that any attempt to define an already-defined macro would fail with a cryptic error, rather than raising the intended warning.

Test cases have been added for both issues, along with the fixes.

* fixup: add expected output for tests added
</content>
</entry>
</feed>
