| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The previous commit changed glcpp-lex.l so we commit the resulting
generated file here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This reverts commit a77a6bc008b3146c56431fa520a00e1f8dfa3938.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Also remove the --never-interactive command line option for the
preprocessor lexer. This was already done for main compiler lexer.
|
| |
|
| |
|
|
|
|
| |
Makes the build happy on non-GCC platforms.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Due to a recent change to glcpp-parse.y.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
After a recent change to glcpp-lex.l
|
|
|
|
|
| |
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.
|
|
|
|
| |
This allows writing tests that verify diagnostics from the preprocessor.
|
| |
|
|
|
|
|
| |
The glcpp-test script was leaving around bogus *.valgrind-errors files if
a valgrind test was interrupted.
|
|
|
|
| |
After a recent change to glcpp-parse.y
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
After making a minor change to the .y file.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Fixes glcpp test cases 073 and 074, as well as piglit test
xonotic-vs-generic-diffuse.vert.
|
| |
|
|
|
|
| |
The original intention was to use #ifdef.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
gcc and mesa master agree that this is OK.
|
|
|
|
| |
Fixes a valgrind error.
|
| |
|
|
|
|
|
|
|
| |
Fixes:
glsl-version-define
glsl-version-define-110
glsl-version-define-120
|
| |
|
|
|
|
|
| |
Fixes:
glsl-arb-fragment-coord-conventions-define
|
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
I simply forgot to add this file when adding the test case originally.
|
|
|
|
|
|
| |
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").
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|