summaryrefslogtreecommitdiff
path: root/minie
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-12-27 21:09:54 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-12-27 21:09:54 +0100
commit214c24ffe26af7c2434a43c4624cc69ef6f5121f (patch)
treefd4b5f704b1ff3d8c969a2876bb9424e977a5a7d /minie
parent97df3ff8620c5939ddf93ddb0eecf18af47db9d1 (diff)
downloadcompilertests-214c24ffe26af7c2434a43c4624cc69ef6f5121f.tar.gz
compilertests-214c24ffe26af7c2434a43c4624cc69ef6f5121f.tar.bz2
attempt to implement an array selector
Diffstat (limited to 'minie')
-rw-r--r--minie/e2c.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/minie/e2c.c b/minie/e2c.c
index e8368de..e4bfa05 100644
--- a/minie/e2c.c
+++ b/minie/e2c.c
@@ -731,6 +731,16 @@ static void factor( void )
} else {
Abort( "Unkown constant '%s'", varName );
}
+ } else if( type.type == TYPE_ARRAY ) {
+ if( sym == S_lbracket ) {
+ sym = getSym( );
+ emit( "%s[", varName );
+ simpleExpression( );
+ Expect( S_rbracket );
+ emit( "]" );
+ } else {
+ emit( "%s", varName );
+ }
} else {
emit( "%s", varName );
}