]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
re-add support for pre- and postconditions
authorJuerg Billeter <j@bitron.ch>
Wed, 23 Apr 2008 21:12:33 +0000 (21:12 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Wed, 23 Apr 2008 21:12:33 +0000 (21:12 +0000)
2008-04-23  Juerg Billeter  <j@bitron.ch>

* vala/valaparser.vala: re-add support for pre- and postconditions

svn path=/trunk/; revision=1312

ChangeLog
vala/valaparser.vala

index de4beafe02e24f2a5329ac9ca6cf2fe9490b1234..b2a0baf0dff14bb8c0fda73719235e4a29cc21ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-04-23  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valaparser.vala: re-add support for pre- and postconditions
+
 2008-04-23  Jürg Billeter  <j@bitron.ch>
 
        * vapi/glib-2.0.vapi: fix g_signal_* bindings,
index e63d6b84092d70afe9aabe89568bb9c81e0f45d5..1a9e7fe47fc0fbea431016f55b4e12a8749b710e 100644 (file)
@@ -2121,6 +2121,16 @@ public class Vala.Parser : CodeVisitor {
                                method.add_error_domain (parse_type ());
                        } while (accept (TokenType.COMMA));
                }
+               while (accept (TokenType.REQUIRES)) {
+                       expect (TokenType.OPEN_PARENS);
+                       method.add_precondition (parse_expression ());
+                       expect (TokenType.CLOSE_PARENS);
+               }
+               while (accept (TokenType.ENSURES)) {
+                       expect (TokenType.OPEN_PARENS);
+                       method.add_postcondition (parse_expression ());
+                       expect (TokenType.CLOSE_PARENS);
+               }
                if (!accept (TokenType.SEMICOLON)) {
                        method.body = parse_block ();
                }