]> code.delx.au - gnu-emacs/blobdiff - admin/grammars/c.by
Don't overflow if computing approximate percentage
[gnu-emacs] / admin / grammars / c.by
index f224846d4dbfc0f99464973c0ac91eeb78ac20d3..8a3a194b00eb002c4d6f302df79a006071e599c5 100644 (file)
@@ -64,6 +64,7 @@
 %token <punctuation>   PLUS       "\\`[+]\\'"
 %token <punctuation>   MINUS      "\\`[-]\\'"
 %token <punctuation>   BANG       "\\`[!]\\'"
+%token <punctuation>   QUESTION   "\\`[?]\\'"
 %token <punctuation>   EQUAL      "\\`[=]\\'"
 %token <punctuation>   LESS       "\\`[<]\\'"
 %token <punctuation>   GREATER    "\\`[>]\\'"
@@ -590,10 +591,12 @@ template-type
   | declmods typeformbase cv-declmods opt-stars
     opt-ref variablearg-opt-name
     (TYPE-TAG (car $2) nil nil nil
+             :template-specifier (plist-get (nth 2 $2) :template-specifier)
               :constant-flag (if (member "const" (append $1 $3)) t nil)
               :typemodifiers (delete "const" (append $1 $3))
               :reference (car ,$5)
               :pointer (car $4)
+             :typevar (car $6)
               )
   ;
 
@@ -832,7 +835,7 @@ opt-initializers
 
 opt-post-fcn-modifiers
   : post-fcn-modifiers opt-post-fcn-modifiers
-    ( ,(cons ,$1 $2) )
+    ( ,(cons ,(car $1) $2) )
   | ;;EMPTY
     ( nil )
   ;
@@ -1206,7 +1209,9 @@ expr-binop
 ;; Use expression for parsing only.  Don't actually return anything
 ;; for now.  Hopefully we can fix this later.
 expression
-  : unaryexpression expr-binop unaryexpression
+  : unaryexpression QUESTION unaryexpression COLON unaryexpression
+    ( (identity start) (identity end) )
+  | unaryexpression expr-binop unaryexpression
     ( (identity start) (identity end) )
   | unaryexpression
     ( (identity start) (identity end) )