diff options
author | Nick Schrader <nick.schrader@mailbox.org> | 2020-03-27 13:12:09 -0300 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-06-02 13:02:42 +0200 |
commit | 35f72f3ecdf0d61d0e67cd4f72c29fee2c3c9a55 (patch) | |
tree | 07beb54a046a765a3e19ed2ad138dc166e74a5e9 /vala/valatokentype.vala | |
parent | ed320c6260bfa369f64f41450bc48fd5b664809a (diff) | |
download | vala-35f72f3ecdf0d61d0e67cd4f72c29fee2c3c9a55.tar.gz |
Add support for "with" statement
Creates data type scoped blocks which allow implicit member access to
the given expression or declaration statement.
with (expr) {
...;
}
Within the with-block the expression's members can be directly accessed
without the member access operator.
Members may hide local, class and instance varibales with the same name.
Instance variables are still accessible through this.
A local variable can be directly declared in the with statement header.
Hidden local and class variables are currently not directly accessible
(using this for class members generates the expected warning).
Fixes https://gitlab.gnome.org/GNOME/vala/issues/327
Diffstat (limited to 'vala/valatokentype.vala')
-rw-r--r-- | vala/valatokentype.vala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vala/valatokentype.vala b/vala/valatokentype.vala index 75cf92e6c..9cc6d1c74 100644 --- a/vala/valatokentype.vala +++ b/vala/valatokentype.vala @@ -153,6 +153,7 @@ public enum Vala.TokenType { VOLATILE, WEAK, WHILE, + WITH, YIELD; public unowned string to_string () { @@ -286,6 +287,7 @@ public enum Vala.TokenType { case VOLATILE: return "`volatile'"; case WEAK: return "`weak'"; case WHILE: return "`while'"; + case WITH: return "`with'"; case YIELD: return "`yield'"; default: return "unknown token"; } |