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/valacodevisitor.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/valacodevisitor.vala')
-rw-r--r-- | vala/valacodevisitor.vala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vala/valacodevisitor.vala b/vala/valacodevisitor.vala index d961f85e9..a18e0e7fd 100644 --- a/vala/valacodevisitor.vala +++ b/vala/valacodevisitor.vala @@ -405,6 +405,14 @@ public abstract class Vala.CodeVisitor { } /** + * Visit operation called for with statements. + * + * @param stmt a with statement + */ + public virtual void visit_with_statement (WithStatement stmt) { + } + + /** * Visit operation called for delete statements. * * @param stmt a delete statement |