[vala] Genie: Support named arguments
- From: Jamie McCracken <jamiemcc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Genie: Support named arguments
- Date: Mon, 24 May 2010 19:26:44 +0000 (UTC)
commit ebb14f4ceb3f80fbc2910dbf746504aeedb6c448
Author: Jamie McCracken <jamie.mccrack gmail com>
Date: Mon May 24 14:06:40 2010 -0400
Genie: Support named arguments
vala/valagenieparser.vala | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index a02521b..6c1e33f 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -610,7 +610,16 @@ public class Vala.Genie.Parser : CodeVisitor {
var inner = parse_expression ();
return new UnaryExpression (UnaryOperator.OUT, inner, get_src (begin));
} else {
- return parse_expression ();
+ var expr = parse_expression ();
+ var ma = expr as MemberAccess;
+ if (ma != null && ma.inner == null && accept (TokenType.COLON)) {
+ // named argument
+ expr = parse_expression ();
+ return new NamedArgument (ma.member_name, expr, get_src (begin));
+ } else {
+ return expr;
+ }
+
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]