aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cparser/handcrafted.messages14
-rw-r--r--cparser/pre_parser.mly9
2 files changed, 4 insertions, 19 deletions
diff --git a/cparser/handcrafted.messages b/cparser/handcrafted.messages
index dc368fbf..9f8f2694 100644
--- a/cparser/handcrafted.messages
+++ b/cparser/handcrafted.messages
@@ -1843,17 +1843,6 @@ is expected.
# ------------------------------------------------------------------------------
-translation_unit_file: SEMICOLON XOR_ASSIGN
-##
-## Ends in an error in state: 399.
-##
-## translation_unit -> translation_unit . external_declaration [ VOLATILE VOID UNSIGNED UNION UNDERSCORE_BOOL TYPEDEF STRUCT STATIC SIGNED SHORT SEMICOLON RESTRICT REGISTER PRE_NAME PRAGMA PACKED LONG INT INLINE FLOAT EXTERN EOF ENUM DOUBLE CONST CHAR AUTO ATTRIBUTE ALIGNAS ]
-## translation_unit -> translation_unit . SEMICOLON [ VOLATILE VOID UNSIGNED UNION UNDERSCORE_BOOL TYPEDEF STRUCT STATIC SIGNED SHORT SEMICOLON RESTRICT REGISTER PRE_NAME PRAGMA PACKED LONG INT INLINE FLOAT EXTERN EOF ENUM DOUBLE CONST CHAR AUTO ATTRIBUTE ALIGNAS ]
-## translation_unit_file -> translation_unit . EOF [ # ]
-##
-## The known suffix of the stack is as follows:
-## translation_unit
-##
translation_unit_file: XOR_ASSIGN
##
## Ends in an error in state: 0.
@@ -1863,9 +1852,8 @@ translation_unit_file: XOR_ASSIGN
## The known suffix of the stack is as follows:
##
##
-# The king of all syntax errors: an error in the initial state.
-# Anyway, we are at the toplevel.
+# We are at the toplevel.
# clang and gcc want an identifier or an opening parenthesis, which is way incomplete.
diff --git a/cparser/pre_parser.mly b/cparser/pre_parser.mly
index d217a7a4..d6a4a21c 100644
--- a/cparser/pre_parser.mly
+++ b/cparser/pre_parser.mly
@@ -873,18 +873,15 @@ asm_flags:
{}
translation_unit_file:
-| translation_unit EOF
-| EOF
+| translation_item* EOF
{}
-translation_unit:
+translation_item:
| external_declaration
-| translation_unit external_declaration
-| translation_unit SEMICOLON
| SEMICOLON
{}
-external_declaration:
+%inline external_declaration:
| function_definition
| declaration(external_declaration)
| PRAGMA