summaryrefslogtreecommitdiff
path: root/minie
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-12-25 21:12:10 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-12-25 21:12:10 +0100
commit06afd5e79163efd295d18dfbf79d6160c9dc3026 (patch)
tree1ee076e8a47a6be5c1499637e8325e7c96acf830 /minie
parent7081b1ff435807eacedb5276a8d1794cc390b285 (diff)
downloadcompilertests-06afd5e79163efd295d18dfbf79d6160c9dc3026.tar.gz
compilertests-06afd5e79163efd295d18dfbf79d6160c9dc3026.tar.bz2
some more work on internal function length
Diffstat (limited to 'minie')
-rw-r--r--minie/e2c.c5
-rw-r--r--minie/test6.e2
2 files changed, 5 insertions, 2 deletions
diff --git a/minie/e2c.c b/minie/e2c.c
index 38845fd..0001c4f 100644
--- a/minie/e2c.c
+++ b/minie/e2c.c
@@ -778,7 +778,10 @@ static void parameterList( void )
if( sym != S_comma ) {
/* TODO: add internal function maps as symbols and procedures */
if( strcmp( funcName, "length" ) == 0 ) {
- emit( "%d", /* length( funcName ) */ 255 );
+ qualident( );
+ emit( "%d", length( varName ) );
+ Expect( S_rparen );
+ return;
/* handle internal 0-parameter functions and procedures */
} else if( strcmp( funcName, "system.writeline" ) == 0 ) {
emit( "printf( \"%%s\\n\", " );
diff --git a/minie/test6.e b/minie/test6.e
index 1068299..42838ef 100644
--- a/minie/test6.e
+++ b/minie/test6.e
@@ -8,7 +8,7 @@ var
begin
system.readline( s );
- len := length( );
+ len := length( s );
system.writestring( "String: " );
system.writeline( s );
system.writestring( "Length: " );