[vala/wip/issue/658: 37/48] Handled owned keyword
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/issue/658: 37/48] Handled owned keyword
- Date: Sat, 31 Oct 2020 15:08:16 +0000 (UTC)
commit 61fe8042abec97d9e920144f7a6ac1cdd57af792
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Oct 8 09:13:30 2020 +0200
Handled owned keyword
vala/valaparser.vala | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 2755ad1a8..7a5ad9bb5 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -477,14 +477,6 @@ public class Vala.Parser : CodeVisitor {
DataType parse_type (bool owned_by_default, bool can_weak_ref, bool require_unowned = false, Symbol?
parent=null, Method? method=null) throws ParseError {
var begin = get_location ();
- // TODO: Can anonymous delegates be unowned or weak?
- if (accept (TokenType.DELEGATE)) {
- rollback (begin);
- return parse_anonymous_delegate (parent, method);
- } else {
- rollback (begin);
- }
-
bool is_dynamic = accept (TokenType.DYNAMIC);
bool value_owned = owned_by_default;
@@ -517,6 +509,16 @@ public class Vala.Parser : CodeVisitor {
DataType type;
+ var begin2 = get_location ();
+ if (accept (TokenType.DELEGATE)) {
+ rollback (begin2);
+ type = parse_anonymous_delegate (parent, method);
+ type.value_owned = value_owned;
+ return type;
+ } else {
+ rollback (begin2);
+ }
+
bool inner_type_owned = true;
if (accept (TokenType.OPEN_PARENS)) {
type = parse_type (false, false, true);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]