an attempt to improve error correction on unknown type identifiers.

Also, a minor fix to ival.g
This commit is contained in:
ceriel
1987-08-18 10:05:18 +00:00
parent b5a0bf7fe3
commit 97441a2446
5 changed files with 28 additions and 6 deletions

View File

@@ -68,7 +68,8 @@ decl_specifiers /* non-empty */ (register struct decspecs *ds;)
:
[
other_specifier(ds)+
[%prefer /* the thin ice in R.M. 11.1 */
[%if (DOT != IDENTIFIER || AHEAD == IDENTIFIER)
/* the thin ice in R.M. 11.1 */
single_type_specifier(ds) other_specifier(ds)*
|
empty
@@ -121,6 +122,11 @@ type_specifier(struct type **tpp;)
single_type_specifier(register struct decspecs *ds;):
TYPE_IDENTIFIER /* this includes INT, CHAR, etc. */
{idf2type(dot.tk_idf, &ds->ds_type);}
|
IDENTIFIER
{error("%s is not a type identifier", dot.tk_idf->id_text);
ds->ds_type = error_type;
}
|
struct_or_union_specifier(&ds->ds_type)
|