Fix: add semantic check in grammar
[babeltrace.git] / formats / ctf / metadata / ctf-parser.y
index 188f8cd44e0c1d9cce191b9a6ccb37450ffb08f7..58ea245b8d30f2b43b17cb26b7a8a72594bd0dc2 100644 (file)
@@ -1225,7 +1225,13 @@ unary_expression:
                postfix_expression
                {       $$ = $1;                                }
        |       PLUS postfix_expression
-               {       $$ = $2;                                }
+               {
+                       $$ = $2;
+                       if ($$->u.unary_expression.type != UNARY_UNSIGNED_CONSTANT
+                               && $$->u.unary_expression.type != UNARY_SIGNED_CONSTANT) {
+                               reparent_error(scanner, "expecting numeric constant");
+                       }
+               }
        |       MINUS postfix_expression
                {
                        $$ = $2;
This page took 0.023197 seconds and 4 git commands to generate.