summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/glcpp')
-rw-r--r--src/glsl/glcpp/glcpp-parse.y2
-rw-r--r--src/glsl/glcpp/glcpp.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 840003b226e..4913330b3c0 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -184,6 +184,8 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
%left '*' '/' '%'
%right UNARY
+%debug
+
%%
input:
diff --git a/src/glsl/glcpp/glcpp.c b/src/glsl/glcpp/glcpp.c
index 07b1500b6b8..ca188015c7e 100644
--- a/src/glsl/glcpp/glcpp.c
+++ b/src/glsl/glcpp/glcpp.c
@@ -124,6 +124,7 @@ enum {
const static struct option
long_options[] = {
{"disable-line-continuations", no_argument, 0, DISABLE_LINE_CONTINUATIONS_OPT },
+ {"debug", no_argument, 0, 'd'},
{0, 0, 0, 0 }
};
@@ -140,11 +141,14 @@ main (int argc, char *argv[])
init_fake_gl_context (&gl_ctx);
- while ((c = getopt_long(argc, argv, "", long_options, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "d", long_options, NULL)) != -1) {
switch (c) {
case DISABLE_LINE_CONTINUATIONS_OPT:
gl_ctx.Const.DisableGLSLLineContinuations = true;
break;
+ case 'd':
+ glcpp_parser_debug = 1;
+ break;
default:
usage ();
exit (1);