summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-06-13Fixups for newline-escaping behavior.Tim Foley
This is really messy and I'm not entirely happy with the result, but at least we handle a couple more corner cases.
2017-06-12Merge pull request #4 from tfoleyNV/escaped-newlinesTim Foley
Escaped newlines
2017-06-12Add test case for escaped newlines.Tim Foley
This also serves as a regression test for the recent preprocessor bug fix.
2017-06-12Lexer: handle escaped newlinesTim Foley
This is mostly to allow for the idiomatic style of defining a multi-line macro in C: #define FOO(a,b) \ x(a) \ y(b) \ /* end */ The handling is reasonably general: in the lexer whenever we need to consume or "peek" the next code point, we check if we are at the start of a backslash-newline sequence, and if so we skip past that to find what we were looking for. However, the way I'm handling things right now there is no step taken to "clean" a token and remove the backslash or newline from its value, so downstream code that actually inspects token values will probably break if users start putting escaped newlines in the middle of names. We can fix that issue when (if) it comes up.
2017-06-12Preprocessor: fix bug with multi-argument macros.Tim Foley
There was a subtle bug when a function-like macro with multiple arguments expands to use the arguments one after the other: #define FOO(a,b) a b FOO(int, x); During expansion, the input streams look something like (using `.` to represent the cursor): // macro invocation: FOO(int, x) . ; // macro expansion of `FOO(int, x)` a . b // macro argument `a` int . That is, we are at the end of the first argument's tokens. When "peeking" the next token, we correctly work up the list of active streams until we find one that isn't at its end, and that gives us the token `b`. But then we need to look up `b` in an appropriate environment to find what it is bound to. Each of the streams above has an environment asociated with it, and in particular, `b` is only defined in the middle environment, because that is where the macro arguments were registered. The simple fix here is to make the lookup logic for finding an environment follow the same logic as finding the next token. A more complete fix down the line could involve getting rid of the approach of allowing an input stream to be "active" but at its end. I believe this was originally required to handle some error cases in directives, where we'd want to keep the input stream for one file active until we are done parsing a full directive from it (e.g., if a directive is on the last line of the file). Now that we generate an explicit "end of directive" token, that may not be required.
2017-06-12Merge pull request #3 from tfoleyNV/rename-testsTim Foley
Rename tests from `*.spire` to `*.slang`
2017-06-12Rename tests from `*.spire` to `*.slang`Tim Foley
Many of the existing test cases were being skipped on accident, because their file names used `.spire` and the test tool was now looking for `.slang`
2017-06-12Merge pull request #2 from tfoleyNV/glsl-render-testTim Foley
GLSL: get GLSL limping in `render-test`
2017-06-12GLSL: get GLSL limping in `render-test`Tim Foley
The test case that is there right now is nominally a cross-compilation test, but for right now it uses the preprocessor to present completely different code for HLSL and GLSL compilation. This change is really just fleshing out the OpenGL side of `render-test` enough that it can produce images using OpenGL to enable further testing.
2017-06-12Merge pull request #1 from tfoleyNV/appveyor-build-versionTim Foley
AppVeyor: try to produce a better build version
2017-06-12AppVeyor: PowerShell requires `elseif` not `else if`Tim Foley
2017-06-12AppVeyor: Try to fix errors in `appveyor.yml`Tim Foley
- Also add link to build "badge" so that I can more easily watch build status.
2017-06-12AppVeyor: try to produce a better build versionTim Foley
I don't want to have to try and manually keep a version number in `appveyor.yml` up to date with any versioning for releases, etc. This change tries to derive a reasonable version name from a Git tag, a pull request number, or a branch name (in that order). I then append the AppVeyor build number to the end to try to ensure that we always have something unique (which is a requirement for AppVeyor).
2017-06-09AppVeyor: Try to clone submodules, and add badgeTim Foley
- Add an `install` step that tries to update our submodules (just `glslang` at the moment) - Try to add a "badge" image to the main `README.md`
2017-06-09appveyor: Add initial appveyor.ymlTim Foley
2017-06-09Build: more fixes to get `msbuild` to work from command line.Tim Foley
All of this is just related to cruft left over from the old project setup.
2017-06-09Fix: Remove some old project references.Tim Foley
There were some dead project references lying around after the Spire->Slang rename, that don't affect builds from inside Visual Studio, but seem to break stand-alone build with `msbuild`.
2017-06-09glslang: Fixups for buildTim Foley
Some files seem to have been removed since I last sync'ed the glslang code.
2017-06-09Add submodule for `glslang`Tim Foley
This is currently required for GLSL->SPIR-V compilation and related tests.
2017-06-09Initial import of code.Tim Foley
2017-06-09Initial commitTim Foley