OSDN Git Service

Remove some redundancy in the top-level production.
authorCarl Worth <cworth@cworth.org>
Wed, 12 May 2010 20:21:20 +0000 (13:21 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 12 May 2010 20:21:20 +0000 (13:21 -0700)
Previously we had two copies of all top-level actions, (once in a list
context and once in a non-list context). Much simpler to instead have
a single list-context production with no action and then only have the
actions in their own non-list contexts.

glcpp-parse.y

index 9883a6f..91fc5b9 100644 (file)
@@ -65,7 +65,7 @@ _list_append (list_t *list, const char *str);
 
 input:
        /* empty */
-|      content
+|      input content
 ;
 
 content:
@@ -77,14 +77,6 @@ content:
 |      NEWLINE {
                printf ("\n");
        }
-|      content token {
-               _print_resolved_token (parser, $2);
-               talloc_free ($2);
-       }
-|      content directive_with_newline
-|      content NEWLINE {
-               printf ("\n");
-       }
 ;
 
 directive_with_newline: