scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 5956b8e016a018b2701f8651e328f7ddae62084f
parent 9b4d794ae6c685b822c9318d2f343ca5e5814ffc
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 10 Jul 2014 19:54:06 +0200

Add typedef handling

This is a first version of types defined by the user. I am pretty sure
this version is not going to work, but it is good enough to can
create a commit.

Diffstat:
cc1/decl.c | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -410,8 +410,9 @@ decl(void) switch (sclass) { case TYPEDEF: - /* TODO: */ - break; + sym->token = TYPE; + sym->u.token = TYPENAME; + continue; case STATIC: sym->s.isstatic = 1; break; @@ -486,7 +487,10 @@ extdecl(void) case EXTERN: sym->s.isdefined = 0; break; - case TYPEDEF: /* TODO: */ break; + case TYPEDEF: + sym->token = TYPE; + sym->u.token = TYPENAME; + continue; } if (BTYPE(tp) != FTN) {