[vala/wip/issue/658: 7/9] cleaning 3
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/issue/658: 7/9] cleaning 3
- Date: Wed, 7 Oct 2020 17:15:53 +0000 (UTC)
commit e83c0222f9331132aa9c87940ee676df29d7e011
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Oct 7 18:51:22 2020 +0200
cleaning 3
vala/valaparser.vala | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 447cce690..059d95883 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -3696,6 +3696,8 @@ public class Vala.Parser : CodeVisitor {
}
}
+ static int next_anonymous_id = 0;
+
DelegateType parse_anonymous_delegate (Symbol? parent) throws ParseError { //(Symbol parent,
List<Attribute>? attrs) throws ParseError {
if (parent == null) {
throw new ParseError.SYNTAX ("anonymous delegate: parent==null");
@@ -3725,10 +3727,9 @@ public class Vala.Parser : CodeVisitor {
expect (TokenType.LAMBDA);
var type = parse_type (true, false);
- // TODO: Get rid of hardcoded name, it should be anonymous
- var d = new Delegate ("oma123", type, get_src (begin), comment);
+ var d = new Delegate ("__delegate%i_".printf (next_anonymous_id++), type, get_src (begin),
comment);
d.anonymous = true;
-
+
foreach (var type_param in type_param_list) {
d.add_type_parameter (type_param);
}
@@ -3741,7 +3742,7 @@ public class Vala.Parser : CodeVisitor {
d.add_error_type (error_type);
}
- parent.scope.add(null, d);
+ parent.add_delegate (d);
return new DelegateType (d);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]