summaryrefslogtreecommitdiff
path: root/src/glsl/glcpp
AgeCommit message (Collapse)Author
2010-08-18glcpp: Refresh autogenerated lexer.Kenneth Graunke
2010-08-18glcpp: Add basic #line support (adapted from the main compiler).Kenneth Graunke
2010-08-17glcpp: Refresh generated files.Carl Worth
After a recent change to glcpp-parse.y (adding "redefined macro" error).
2010-08-17glcpp: Add support for "redefined macro" error.Carl Worth
Carefully avoiding printing any error when the new definition matches the existing definition. This fixes the recently-added 088-redefine-macro-legitimate.c and 089-redefine-macro-error.c tests as well as glsparsertest/preprocess1 in piglit.
2010-08-17glcpp: Add two new tests for testing redefined macros.Carl Worth
The specification says that redefining a macro is an error, unless the new definitions is identical to the old one, (identical replacement lists but ignoring differing amounts of whitespace).
2010-08-17glcpp: Allow standalone glcpp to accept a filename as first argument.Carl Worth
This is useful for debugging the preprocessor.
2010-08-17glcpp: Fix 064-version.c expected result to track recent change.Carl Worth
In commit 6be3a8b70af4ba4fa4d037d54ecf6d5f055edbc9, the #version directive was fixed to stop generating a spurious newline. Here we simply update the expected result for the single test which includes a #version directive.
2010-08-17glcpp: Regenerated glcpp-lex.c from previous commit.Carl Worth
The previous commit changed glcpp-lex.l so we commit the resulting generated file here.
2010-08-17glcpp: Don't include the newline when discarding single-line commentsCarl Worth
Matching the newline here meant having to do some redundant work here, (incrementing line number, resetting column number, and returning a NEWLINE token), that could otherwise simply be left to the existing rule which matches a newline. Worse, when the comment rule matches the newline as well, the parser can lookahead and see a token for something that should actually be skipped. For example, in a case like this: #if 0 // comment here fail #else win #endif Both fail and win appear in the output, (not that the condition is being evaluated incorrectly---merely that one token after the comment's newline was being lexed/parse regardless of the condition). This commit fixes the above test case, (which is also remarkably similar to 087-if-comments which now passes).
2010-08-17glcpp: Add testcase for #if handling bug that breaks Savage2.Eric Anholt
2010-08-16glcpp: Refresh autogenerated lexer and parser.Kenneth Graunke
2010-08-16glcpp: Remove spurious newline generated by #version handling.Kenneth Graunke
This was causing line numbering to be off by one. The newline comes from the NEWLINE token at the end of the line; there's no need to insert one.
2010-08-14Revert "glsl2: Use stdint.h instead of inttypes.h"José Fonseca
This reverts commit a77a6bc008b3146c56431fa520a00e1f8dfa3938.
2010-08-13glsl2: Refresh autogenerated bison parser.Kenneth Graunke
2010-08-13Fix an MSVC build error (bugzilla 29570).Vinson Lee
2010-08-13glsl2: Use stdint.h instead of inttypes.hIan Romanick
2010-08-13glsl2: Commit generated file changed by previous commitIan Romanick
2010-08-13glsl2: Use --nounistd to fix MSVC buildIan Romanick
Also remove the --never-interactive command line option for the preprocessor lexer. This was already done for main compiler lexer.
2010-08-13glsl2: Include string.h in preprocessorJakob Bornecrantz
2010-08-12glsl2: Commit generated file changed by previous commitIan Romanick
2010-08-12glsl2: Add missing include of string.hIan Romanick
Makes the build happy on non-GCC platforms.
2010-08-11glcpp: Fix "unterminated if" diagnostic.Carl Worth
This was previously being appended to the output string *after* a copy of the supposedly final string was made and handed to the caller. So the diagnostic was never actually visible to the user. We fix this by moving the check for an unterminated #if from glcpp_parser_destroy to the calling function, preprocess. This fixes the test case 083-unterminated-if.c.
2010-08-11glccp: Regenerate glcpp-parse.cCarl Worth
Due to a recent change to glcpp-parse.y.
2010-08-11glcpp: Add an explicit diagnostic for #if with no expression.Carl Worth
This is more clear than the previously-generated diagnostic which was something confusing like "enexpected newline". This change makse test 080-if-witout-expression.c now pass.
2010-08-11glcpp: Reword diagnostic for #elif with no expressionCarl Worth
Rather than telling the user what to fix, the standard convention is to describe what the detected problem is. With this change, test 081-elif-without-expression now passes.
2010-08-11glcpp: Add several tests for diagnostics.Carl Worth
Which are proving to be useful since some of these tests are not yet acting as desired, (in particular, the unterminated if test is not generating any diagnostic).
2010-08-11glcpp: Regenerate glcpp-lex.cCarl Worth
After a recent change to glcpp-lex.l
2010-08-11glcpp: Initialize line and column numbers to 1, not 0.Carl Worth
Error messages make more sense this way since the convention is for the first line of a file to be numbered from 1, rather than 0.
2010-08-11glcpp-test: Capture the stderr output of the preprocessor.Carl Worth
This allows writing tests that verify diagnostics from the preprocessor.
2010-08-11glsl2: move declarations before codeBrian Paul
2010-08-11glcpp: Clean up intermediate file when test suite is interrupted.Carl Worth
The glcpp-test script was leaving around bogus *.valgrind-errors files if a valgrind test was interrupted.
2010-08-11glcpp: Regenerate glcpp-parse.cCarl Worth
After a recent change to glcpp-parse.y
2010-08-11glcpp: Additional fixes for not evaluating skipped #if/#elif expressions.Carl Worth
This adds a couple of test cases to expand our coverage of invalid #if and being skipped, (either by being nested inside an #if/#elif that evaluates to zero or by being after an #if/#elif that evaluates to non-zero).
2010-08-10glcpp/tests: Commit forgotten file 074-elif-undef.c.expected.Kenneth Graunke
2010-08-10glcpp: Discard output of cmp when running the test suite.Carl Worth
We're already using the return-value of cmp to print either PASS or FAIL and in the case of failure, we're subsequently running and showing the output of diff. So any warnings/errors from cmp itself are not actually needed, and can be quite confusing.
2010-08-10glcpp: Fix expected result for the 064-version.c test.Carl Worth
Commit d4a04f315560704bf1103df0b93723e468725df7 caused this test case to produce an additional blank line, which is otherwise harmless, but does need to be reflected in the .expected file for the test to pass.
2010-08-10glcpp: Regnerate glcpp-parse.c and glcpp-parse.hCarl Worth
After making a minor change to the .y file.
2010-08-10glcpp: Initialize location structure at beginning of parse.Carl Worth
Since we have a custom structure for YYLTYPE locations, we need to use an %initial-action directive to avoid triggering use of uninitialized memory when, for example, printing error messages. We apparently don't yet have a test case that allowed valgrind to find this bug for us, but valgrind found a similar problem in the other parser, so we fix this one as well.
2010-08-04glcpp: Ignore #if and #elif expressions when skipping.Kenneth Graunke
Fixes glcpp test cases 073 and 074, as well as piglit test xonotic-vs-generic-diffuse.vert.
2010-08-04glcpp/tests: Add a corollary to testcase 073 for testing #elif.Kenneth Graunke
2010-08-04glcpp/tests: Fix 073-if-in-ifdef.c to use #ifdef, not #if.Kenneth Graunke
The original intention was to use #ifdef.
2010-08-04glcpp: Refactor HASH_IF and HASH_ELIF expansion to reuse code.Kenneth Graunke
2010-08-04glcpp: Refresh autogenerated lexer and parser.Kenneth Graunke
2010-08-04glcpp: Remove xtalloc wrappers in favor of plain talloc.Kenneth Graunke
Calling exit() on a memory failure probably made sense for the standalone preprocessor, but doesn't seem too appealing as part of the GL library. Also, we don't use it in the main compiler.
2010-08-02glsl2: Give the path within src/mesa/ for headers instead of relying on -I.Aras Pranckevicius
2010-08-01glcpp: Add a testcase for the failure in compiling xonotic's shader.Eric Anholt
gcc and mesa master agree that this is OK.
2010-07-30glcpp: Don't look for backslashes before the beginning of the string.Kenneth Graunke
Fixes a valgrind error.
2010-07-28glsl2: Actually fix glsl-version-define.Eric Anholt
2010-07-28glcpp: Add __VERSION__ define to the current language version.Eric Anholt
Fixes: glsl-version-define glsl-version-define-110 glsl-version-define-120
2010-07-28glcpp: Print integer tokens as decimal, not hex.Eric Anholt