From: Bernhard Urban Date: Sat, 20 Mar 2010 18:28:59 +0000 (+0100) Subject: parser: funktionsaufruf mit leerer parameterliste X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=uebersetzerbau-ss10.git;a=commitdiff_plain;h=2f823f8ec67f0a68ca863da9a4fdbd6e6d26cdb6 parser: funktionsaufruf mit leerer parameterliste --- diff --git a/parser/parser.y b/parser/parser.y index c76131f..c6415a7 100644 --- a/parser/parser.y +++ b/parser/parser.y @@ -89,8 +89,11 @@ Methcall: | Term '.' IDENT '(' Exprs ')' ; +/* beachte dass hier auch "nichts" vorkommen kann + * sonst waer ein aufruf der art 'f()' nicht + * moeglich (leere parameterliste) */ Exprs: - Expr + | Expr | Exprs ',' Expr ; diff --git a/test/parser/a.0 b/test/parser/a.0 index c8626b7..2d5724a 100644 --- a/test/parser/a.0 +++ b/test/parser/a.0 @@ -1,25 +1,29 @@ struct mystruct end; method f () var muh := 0x10; - muh := muh * -2; + muh := muh * (9 - 0x4); /* test comment */ /* groeserer comemnt */ - if (muh < -0x5) then + if (muh = -0x5) then muh := muh * -2; else muh := 0x55; + f(); end; while (muh < 10) do - muh := muh * -2; + muh := muh *(-2); end; /* warum geht das nciht? */ while (muh < 10) do - muh := muh - 2; + muh := muh--2; end; + mystruct.hu := muh; + mystruct.check_i_ned := muh; + return muh; end;