]> git.saurik.com Git - bison.git/blobdiff - src/parse-gram.y
package: bump to 2015
[bison.git] / src / parse-gram.y
index 4c87c909ceddc35e5e71e3a39ccc970d2a0f2a72..39431ef7e71f61b305c197be86b9953b19467852 100644 (file)
@@ -1,6 +1,6 @@
 /* Bison Grammar Parser                             -*- C -*-
 
-   Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
   #include "symtab.h"
 }
 
+%code top
+{
+  /* On column 0 to please syntax-check.  */
+#include <config.h>
+}
+
 %code
 {
-  #include <config.h>
   #include "system.h"
 
   #include "c-ctype.h"
@@ -622,7 +627,7 @@ rhs:
 
 named_ref.opt:
   %empty         { $$ = 0; }
-| BRACKETED_ID   { $$ = named_ref_new($1, @1); }
+| BRACKETED_ID   { $$ = named_ref_new ($1, @1); }
 ;
 
 /*---------------------.
@@ -661,8 +666,7 @@ value:
   %empty  { $$.kind = muscle_keyword; $$.chars = ""; }
 | ID      { $$.kind = muscle_keyword; $$.chars = $1; }
 | STRING  { $$.kind = muscle_string;  $$.chars = $1; }
-| "{...}" { $$.kind = muscle_code;
-            $$.chars = translate_code_braceless ($1, @1); }
+| "{...}" { $$.kind = muscle_code;    $$.chars = strip_braces ($1); }
 ;
 
 
@@ -746,7 +750,7 @@ lloc_default (YYLTYPE const *rhs, int n)
 static
 char *strip_braces (char *code)
 {
-  code[strlen(code) - 1] = 0;
+  code[strlen (code) - 1] = 0;
   return code + 1;
 }