summaryrefslogtreecommitdiff
path: root/src/glsl/glcpp/glcpp-parse.y
AgeCommit message (Collapse)Author
2010-07-28glsl2: Add the define for ARB_fragment_coord_conventions when present.Eric Anholt
Fixes: glsl-arb-fragment-coord-conventions-define
2010-07-28glcpp: Explicitly expect 0 shift/reduce conflicts.Carl Worth
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").
2010-07-28glcpp: Remove 2 shift/reduce conflicts from the grammar.Carl Worth
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.
2010-07-22glcpp: Fix function-like macros with an argument used multiple times.Carl Worth
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)
2010-07-20glcpp: Avoid accidental token pasting in preprocessed result.Carl Worth
Consider this test case: #define EMPTY int foo = 1+EMPTY+4; The expression should compile as the sequence of tokens 1, PLUS, UNARY_POSITIVE, 4. But glcpp has been failing for this case since it results in the string "1++4" which a compiler correctly sees as a syntax error, (1, POST_INCREMENT, 4). We fix this by changing any macro with an empty definition to result in a single SPACE token rather than nothing. This then gives "1+ +4" which compiles correctly. This commit does touch up the two existing test cases which already have empty macros, (to add the space to the expected result). It also adds a new test case to exercise the above scenario.
2010-07-20glcpp: Add static keyword to several functions in the parser.Carl Worth
This quiets warnings about missing declarations otherwise.
2010-07-20glcpp: Fix use-after-free error from #undef directive.Carl Worth
By taking advantage of the recently-added hash_table_remove function. With this change, all existing tests are now valgrind-clean.
2010-07-01glsl2: Conditionally define preprocessor tokens for optional extensionsIan Romanick
The only optional extension currently supported by the compiler is GL_EXT_texture_array.
2010-07-01glsl2: Define preprocessor tokens for extensionsIan Romanick
Currently only GL_ARB_draw_buffers and GL_ARB_texture_rectangle are defined because those extensions are always enabled. This make tex_rect-03.frag pass.
2010-06-24glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt