diff options
author | Adrian Thurston <thurston@complang.org> | 2012-09-09 18:05:03 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2012-09-09 18:05:03 +0000 |
commit | 0ffd931959c0372dcc08b039a27f85d4181cd39f (patch) | |
tree | 119b018ef63f465d96adb81dbd4e9d59bbaab8fb | |
parent | 055d2bf57788fd88b4fdd5ab541201c0c19759d0 (diff) | |
download | colm-0ffd931959c0372dcc08b039a27f85d4181cd39f.tar.gz |
couple fixes, need vm_root and fixed globals
-rw-r--r-- | colm/lmparse.kl | 2 | ||||
-rw-r--r-- | colm/program.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/colm/lmparse.kl b/colm/lmparse.kl index 3c59eb7c..13284a4a 100644 --- a/colm/lmparse.kl +++ b/colm/lmparse.kl @@ -72,7 +72,7 @@ root_item: context_def commit final { $$->stmt = 0; }; root_item: namespace_def commit final { $$->stmt = 0; }; root_item: function_def commit final { $$->stmt = 0; }; root_item: iter_def commit final { $$->stmt = 0; }; -root_item: global_def commit final { $$->stmt = 0; }; +root_item: global_def commit final { $$->stmt = $1->stmt; }; root_item: export_def commit final { $$->stmt = 0; }; root_item: statement commit final { $$->stmt = $1->stmt; }; root_item: pre_eof commit final { $$->stmt = 0; }; diff --git a/colm/program.c b/colm/program.c index d1f8893c..412473e5 100644 --- a/colm/program.c +++ b/colm/program.c @@ -91,6 +91,11 @@ void vm_init( Program *prg ) prg->stackRoot = prg->sb_end; } +struct ColmTree **vm_root( struct ColmProgram *prg ) +{ + return prg->stackRoot; +} + Tree **vm_bs_add( Program *prg, Tree **sp, int n ) { /* Close off the current block. */ |