summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp
Commit message (Collapse)AuthorAgeFilesLines
* glcpp: Fix 064-version.c expected result to track recent change.Carl Worth2010-08-171-1/+0
| | | | | | 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.
* glcpp: Regenerated glcpp-lex.c from previous commit.Carl Worth2010-08-171-194/+203
| | | | | The previous commit changed glcpp-lex.l so we commit the resulting generated file here.
* glcpp: Don't include the newline when discarding single-line commentsCarl Worth2010-08-171-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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).
* glcpp: Add testcase for #if handling bug that breaks Savage2.Eric Anholt2010-08-172-0/+11
|
* glcpp: Refresh autogenerated lexer and parser.Kenneth Graunke2010-08-162-60/+44
|
* glcpp: Remove spurious newline generated by #version handling.Kenneth Graunke2010-08-162-4/+2
| | | | | | 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.
* Revert "glsl2: Use stdint.h instead of inttypes.h"José Fonseca2010-08-142-2/+2
| | | | This reverts commit a77a6bc008b3146c56431fa520a00e1f8dfa3938.
* glsl2: Refresh autogenerated bison parser.Kenneth Graunke2010-08-132-118/+125
|
* Fix an MSVC build error (bugzilla 29570).Vinson Lee2010-08-131-1/+1
|
* glsl2: Use stdint.h instead of inttypes.hIan Romanick2010-08-132-2/+2
|
* glsl2: Commit generated file changed by previous commitIan Romanick2010-08-131-55/+47
|
* glsl2: Use --nounistd to fix MSVC buildIan Romanick2010-08-131-0/+1
| | | | | Also remove the --never-interactive command line option for the preprocessor lexer. This was already done for main compiler lexer.
* glsl2: Include string.h in preprocessorJakob Bornecrantz2010-08-131-0/+1
|
* glsl2: Commit generated file changed by previous commitIan Romanick2010-08-121-0/+1
|
* glsl2: Add missing include of string.hIan Romanick2010-08-121-107/+108
| | | | Makes the build happy on non-GCC platforms.
* glcpp: Fix "unterminated if" diagnostic.Carl Worth2010-08-114-4/+8
| | | | | | | | | | | 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.
* glccp: Regenerate glcpp-parse.cCarl Worth2010-08-111-376/+393
| | | | Due to a recent change to glcpp-parse.y.
* glcpp: Add an explicit diagnostic for #if with no expression.Carl Worth2010-08-112-1/+14
| | | | | | | 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.
* glcpp: Reword diagnostic for #elif with no expressionCarl Worth2010-08-113-3/+2
| | | | | | 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.
* glcpp: Add several tests for diagnostics.Carl Worth2010-08-1120-0/+72
| | | | | | 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).
* glcpp: Regenerate glcpp-lex.cCarl Worth2010-08-111-9/+23
| | | | After a recent change to glcpp-lex.l
* glcpp: Initialize line and column numbers to 1, not 0.Carl Worth2010-08-111-1/+1
| | | | | 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.
* glcpp-test: Capture the stderr output of the preprocessor.Carl Worth2010-08-111-1/+1
| | | | This allows writing tests that verify diagnostics from the preprocessor.
* glsl2: move declarations before codeBrian Paul2010-08-111-2/+4
|
* glcpp: Clean up intermediate file when test suite is interrupted.Carl Worth2010-08-111-0/+2
| | | | | The glcpp-test script was leaving around bogus *.valgrind-errors files if a valgrind test was interrupted.
* glcpp: Regenerate glcpp-parse.cCarl Worth2010-08-111-111/+133
| | | | After a recent change to glcpp-parse.y
* glcpp: Additional fixes for not evaluating skipped #if/#elif expressions.Carl Worth2010-08-115-19/+61
| | | | | | 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).
* glcpp/tests: Commit forgotten file 074-elif-undef.c.expected.Kenneth Graunke2010-08-101-0/+4
|
* glcpp: Discard output of cmp when running the test suite.Carl Worth2010-08-101-1/+1
| | | | | | | 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.
* glcpp: Fix expected result for the 064-version.c test.Carl Worth2010-08-101-0/+1
| | | | | | 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.
* glcpp: Regnerate glcpp-parse.c and glcpp-parse.hCarl Worth2010-08-102-215/+224
| | | | After making a minor change to the .y file.
* glcpp: Initialize location structure at beginning of parse.Carl Worth2010-08-101-0/+8
| | | | | | | | | | 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.
* glcpp: Ignore #if and #elif expressions when skipping.Kenneth Graunke2010-08-042-96/+124
| | | | | Fixes glcpp test cases 073 and 074, as well as piglit test xonotic-vs-generic-diffuse.vert.
* glcpp/tests: Add a corollary to testcase 073 for testing #elif.Kenneth Graunke2010-08-041-0/+3
|
* glcpp/tests: Fix 073-if-in-ifdef.c to use #ifdef, not #if.Kenneth Graunke2010-08-041-1/+1
| | | | The original intention was to use #ifdef.
* glcpp: Refactor HASH_IF and HASH_ELIF expansion to reuse code.Kenneth Graunke2010-08-042-144/+142
|
* glcpp: Refresh autogenerated lexer and parser.Kenneth Graunke2010-08-043-155/+148
|
* glcpp: Remove xtalloc wrappers in favor of plain talloc.Kenneth Graunke2010-08-045-151/+27
| | | | | | 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.
* glsl2: Give the path within src/mesa/ for headers instead of relying on -I.Aras Pranckevicius2010-08-021-1/+1
|
* glcpp: Add a testcase for the failure in compiling xonotic's shader.Eric Anholt2010-08-012-0/+9
| | | | gcc and mesa master agree that this is OK.
* glcpp: Don't look for backslashes before the beginning of the string.Kenneth Graunke2010-07-301-3/+7
| | | | Fixes a valgrind error.
* glsl2: Actually fix glsl-version-define.Eric Anholt2010-07-282-6/+0
|
* glcpp: Add __VERSION__ define to the current language version.Eric Anholt2010-07-285-714/+774
| | | | | | | Fixes: glsl-version-define glsl-version-define-110 glsl-version-define-120
* glcpp: Print integer tokens as decimal, not hex.Eric Anholt2010-07-282-2/+2
|
* glsl2: Add the define for ARB_fragment_coord_conventions when present.Eric Anholt2010-07-282-0/+16
| | | | | Fixes: glsl-arb-fragment-coord-conventions-define
* glcpp: Add generated source files.Carl Worth2010-07-284-3/+6693
| | | | | | | This is now consistent with other usage of flex/bison througout mesa, (which is that these generated files are added to source control so that the build system does not require external tools like flex/bison for non-developers).
* glcpp: Add expected output for a recently-added test.Carl Worth2010-07-281-0/+3
| | | | I simply forgot to add this file when adding the test case originally.
* glcpp: Explicitly expect 0 shift/reduce conflicts.Carl Worth2010-07-281-0/+1
| | | | | | The "%expect 0" construct will make bison emit an error if any future changes to the grammar introduce shift/reduce conflicts, (without also increasing the number after "%expect").
* glcpp: Remove 2 shift/reduce conflicts from the grammar.Carl Worth2010-07-281-1/+0
| | | | | | | Since we have productions to turn "defined FOO" and "defined ( FOO )" into a conditional_token we don't need to list DEFINED as an operator as well. Doing so just introduces the shift/reduce ambiguity with no benefit.
* glcpp: Fix function-like macros with an argument used multiple times.Carl Worth2010-07-222-3/+9
| | | | | | | | | | | It's really hard to believe that this case has been broken, but apparently no test previously exercised it. So this commit adds such a test and fixes it by making a copy of the argument token-list before expanding it. This fix causes the following glean tests to now pass: glsl1-Preprocessor test 6 (#if 0, #define macro) glsl1-Preprocessor test 7 (multi-line #define)