scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 9051e2b39dc3488b33c454ec375465471f3c3eb6
parent af498cdd3737f03a77ada5172fff1f727f463b10
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 18 Jul 2015 10:54:18 +0200

Add size in array declarations

At this point this is not a big help, because the type
declared in this way is a not define type, so it cannot
be used to declare variables, and arrays cannot be used
in castig.

Diffstat:
Mcc1/decl.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -39,8 +39,14 @@ queue(struct dcldata *dp, unsigned op, short nelem, void *data) static struct dcldata * arydcl(struct dcldata *dp) { + Node *np = NULL; + expect('['); + np = (yytoken != ']') ? constexpr() : NULL; expect(']'); + /* + * TODO: Evaluate np. + */ return queue(dp, ARY, 0, NULL); }