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

@@ -96,7 +96,7 @@ postfixed(struct expr **expp;)
unary(register struct expr **expp;)
{struct type *tp; int oper;}
:
%if (first_of_type_specifier(AHEAD))
%if (first_of_type_specifier(AHEAD) && AHEAD != IDENTIFIER)
cast(&tp) unary(expp)
{ ch7cast(expp, CAST, tp);
(*expp)->ex_flags |= EX_CAST;
@@ -114,7 +114,7 @@ size_of(register struct expr **expp;)
{struct type *tp;}
:
SIZEOF
[%if (first_of_type_specifier(AHEAD))
[%if (first_of_type_specifier(AHEAD) && AHEAD != IDENTIFIER)
cast(&tp)
{
*expp = intexpr(size_of_type(tp, "type"), INT);