<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/compiler-core/slang-lexer.h, 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>2025-05-06T17:56:18+00:00</updated>
<entry>
<title>Parse char literals as integers (#6989)</title>
<updated>2025-05-06T17:56:18+00:00</updated>
<author>
<name>Julius Ikkala</name>
<email>julius.ikkala@gmail.com</email>
</author>
<published>2025-05-06T17:56:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=cf8e75fae7702855b3d81ed11b2fb480c31a7fde'/>
<id>urn:sha1:cf8e75fae7702855b3d81ed11b2fb480c31a7fde</id>
<content type='text'>
* Parse char literals as integers

* Fix formatting

* Parse escaped chars correctly

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Implemented #pragma warning (#6748)</title>
<updated>2025-04-24T22:48:37+00:00</updated>
<author>
<name>Ronan</name>
<email>ro.cailleau@gmail.com</email>
</author>
<published>2025-04-24T22:48:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=5f632cd204b7a85f3a97b6c316c5a34f9fc8193e'/>
<id>urn:sha1:5f632cd204b7a85f3a97b6c316c5a34f9fc8193e</id>
<content type='text'>
* Implemented #pragma warning

Based on https://learn.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-170

* Make #pragma warning work with #includes.

- SourceLoc are not sorted by inclusion order.
- Construct a mapping from SourceLoc to "absolute locations" that are sorted by inclusion order (roughly represents a location in a raw file with all #include resolved).
- The absolute location can be used in the pragma warning timeline

* Added preprocessor #pragma warning tests.

- Fixed #pragma warning (push / pop) SourceLoc
- Fixed unused directiveLoc in #pragma warning parsing

* #pragma warning: Added some comments and fixed some typos

* Cleaned #pragma warning preprocessor implementation.

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Add Yet Another Source Code Generator (#6844)</title>
<updated>2025-04-17T19:40:53+00:00</updated>
<author>
<name>Theresa Foley</name>
<email>10618364+tangent-vector@users.noreply.github.com</email>
</author>
<published>2025-04-17T19:40:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=1e86f5657d38ae5bab0ced7dc17aeda48198fdd5'/>
<id>urn:sha1:1e86f5657d38ae5bab0ced7dc17aeda48198fdd5</id>
<content type='text'>
* Add Yet Another Source Code Generator

This change introduces an offline source code generation tool,
provisionally called `fiddle`. More information about the design of
the tool can be found in `tools/slang-fiddle/README.md`.

Yes... this is yet another code generator in a project that already
has too many. Yes, this could easily be a very obvious instnace of
[XKCD 927](https://xkcd.com/927/).

This change is part of a larger effort to change how the AST
types are being serialized, and the way code generation for them
is implemented.

Right now, the source code for the new tool is being checked in and
the relevant build step is enabled, just to make sure everything is
working as intended, but please note that this change does *not*
introduce any code in the repository that actually makes use of
the new generator. All of the AST-related reflection information that
feeds the current serialization system is still being generated using
`slang-cpp-extractor`.

The design of the new tool is primarily motivated by the new approach
to serialization that I'm implementing, and once that new approach
lands we should be able to deprecate the `slang-cpp-extractor`.

In addition, the new tool should in principle be able to handle
many of the kinds of code generation tasks that are currently being
implemented with other tools like `slang-generate` (used for the core
and glsl libraries). This tool should also be well suited to the task
of generating more of the code related to the IR instructions.

* format code

* Build fixes caught by CI

* Fix another warning coming from CI

* Another CI-caught fix

* Change bare 	hrows over to more proper abort execptions

* format code

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Conform non-suffixed integer literals (#5717)</title>
<updated>2024-12-03T21:40:09+00:00</updated>
<author>
<name>Darren Wihandi</name>
<email>65404740+fairywreath@users.noreply.github.com</email>
</author>
<published>2024-12-03T21:40:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=98cab6fa86c9e594fb69571cf1d864294b0aae45'/>
<id>urn:sha1:98cab6fa86c9e594fb69571cf1d864294b0aae45</id>
<content type='text'>
* Make non-suffixed integer literal type resolution conform to C

* Update integer literal tests

* Clean up integer literal implementation a bit

* Update docs on integer literals

* Clean up docs update

* Clean up docs update

* Add comment on INT64_MIN edge case

* Fixed failing test, fixed formatting and cleaned up code

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>format</title>
<updated>2024-10-29T06:49:26+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2024-10-29T06:49:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21'/>
<id>urn:sha1:f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21</id>
<content type='text'>
* format

* Minor test fixes

* enable checking cpp format in ci</content>
</entry>
<entry>
<title>C++ extractor parsing slang.h (#2162)</title>
<updated>2022-03-24T15:12:19+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2022-03-24T15:12:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e1a331a2e2945f2b90c00d0af4d1ba5f67dbd256'/>
<id>urn:sha1:e1a331a2e2945f2b90c00d0af4d1ba5f67dbd256</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* Split doc extractor such that can be used in C++ extractor.

* Compiles. Update the stdlib docs.

* Fix issue on release builds.

* Add support for extracting documentation to C++ extractor.

* Dump out markup.
Make enum value backing type take tokens.

* Node::Type -&gt; Node::Kind

* More improvements around Node::Type -&gt; Node::Kind

* Support for parsing callable types.

* Fix issue params for callable, and default value for variable.

* Add support for static.

* Improve handling parsing of contained types.

* Small improvements around template consumption.

* Improve dumping with markup/static.

* Small improvements around reflection.

* Add more flexible handling of markers.
Allow reflection without markers.

* Handling external "C"
unsigned/signed</content>
</entry>
<entry>
<title>Overhaul the preprocessor (#1849)</title>
<updated>2021-05-21T22:07:21+00:00</updated>
<author>
<name>T. Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2021-05-21T22:07:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=0389546b0b065303d3c6874891a9fab4428910b9'/>
<id>urn:sha1:0389546b0b065303d3c6874891a9fab4428910b9</id>
<content type='text'>
* Overhaul the preprocessor

The old Slang preprocessor was based on a simple mental model that tried to unify two parts of macro expansion:

* Scanning for macro invocations in a sequence of tokens

* Producing the expanded tokens for a macro expansion by substituting arguments into its body

The basic was that substitution of macro arguments into a macro definition is superficially similar to top-level macro expansion, just with an environment where the macro arguments act like `#define`s for the corresponding parameter names. That approach was "clever" and could conceivably have been extended to include a lot of advanced preprocessor features (e.g., a preprocessor-level `lambda` would be easy to support!), but it was basically impossible to make it correctly handle all the corner cases of the full C/C++ preprocessor.

The fundamental problem with the old approach was that it conflated the two parts of expansion listed above into one implementation, while the various special cases of the C/C++ preprocessor rely on treating the two cases very differently. The new approach here (which is somewhere between a refactor and a full rewrite of the preprocessor) changes things up in a few key ways:

* The abstraction still cares a lot about streams of tokens, but it now treats the top level streams (`InputFile`s) as fairly different from the lower-level streams (`InputStream`s)

* Macro expansion is handled as a dedicated type of stream that wraps another stream. This allows macro expansion to be applied to anything, and supports cases where multiple rounds of macro expansion are required by the spec.

* Macro *invocations* and the substitution of their arguments are now handled by a completely new system.

    * Macro arguments are no longer treated as if they were `#define`s

    * The macro body/definition is analyzed at definition time to detect various kinds of issues, and to derive a list of "ops" that make it easier to "play back" the definition at substitution time

* Token pasting and stringizing are now only handled in macro definitions (rather than being allowed anywhere), and their use cases are restricted to only those that make sense (e.g., you can't stringize anythign except a macro parameter, because anything else wouldn't make sense)

The key new types here are the `ExpansionInputStream` which handles scanning for macro invocations, and the `MacroInvocation` type, which handles playing back the macro body with substitutions.

The `ExpansionInputStream` is the easier of the two to understand. By refactoring it to use a single token of lookahead, the one major detail it had to deal with before (abandoning expansion of a function-like macro if the macro name was not followed by `(`) is significantly easier to manage.

The more subtle part is the `MacroInvocation` type, and most of the complexity there is around handling of token pasting, and the fact that either or both of the operands to a token paste might be empty.

Many of the test cases that exposed the problems in the preprocessor have been moved from `current-bugs` to `preprocessor` since they now work correctly.

* debugging: enable extractor command line dump

* fixup

* fixup</content>
</entry>
<entry>
<title>Fix lexer/preproc diagnose issue (#1806)</title>
<updated>2021-04-24T06:15:32+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2021-04-24T06:15:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=697017e6fae8c252638abc298ec1556de2e41314'/>
<id>urn:sha1:697017e6fae8c252638abc298ec1556de2e41314</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* Pass LexerFlags to all lexing functionality that may output a diagnostic.

* Add test for lexing disabling issue.

* Improve tests.

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Added compiler-core project (#1775)</title>
<updated>2021-04-01T17:39:11+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2021-04-01T17:39:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=fa31d21ba92669a521a7768467246918e3947e02'/>
<id>urn:sha1:fa31d21ba92669a521a7768467246918e3947e02</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* Split out compiler-core initially with just slang-source-loc.cpp

* More lexer, name, token to compiler-core.

* Split Lexer and Core diagnostics.

* Move slang-file-system to core.

* Add slang-file-system to core.

* More DownstreamCompiler into compiler-core

* Fix typo.

* Add compiler-core to bootstrap proj.

* Small fixes to premake

* For linux try with compiler-core

* Remove compiler-core from examples.

* Added NameConventionUtil to compiler-core

* Add global function to CharUtil to *hopefully* avoid linking issue.

* Hack to make linkage of CharUtil work on linux.</content>
</entry>
</feed>
