From f12a48f09bc6bc44c8cac0de6f4ebb8ab2a14cb6 Mon Sep 17 00:00:00 2001 From: Gabriel Kerneis Date: Thu, 15 May 2014 12:30:03 +0100 Subject: Check name_sect during parsing --- src/parser.mly | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/parser.mly b/src/parser.mly index 50b2da34..76619f59 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -1011,7 +1011,10 @@ typquant: name_sect: | Lsquare Id Eq String Rsquare - { Name_sect_aux(Name_sect_some($4), loc ()) } + { + if $2 <> "name" then + raise (Parse_error_locn ((loc ()),"Unexpected id \""^$2^"\" in name_sect (should be \"name\")")); + Name_sect_aux(Name_sect_some($4), loc ()) } c_def_body: | typ id -- cgit v1.2.3