vala r1632 - in trunk: . vala
- From: jamiemcc svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1632 - in trunk: . vala
- Date: Mon, 23 Jun 2008 02:33:30 +0000 (UTC)
Author: jamiemcc
Date: Mon Jun 23 02:33:30 2008
New Revision: 1632
URL: http://svn.gnome.org/viewvc/vala?rev=1632&view=rev
Log:
2008-06-23 Jamie McCracken <jamiemcc gnome org>
* vala/valagenieparser.vala:
make parens optional when using new operator on objects
Modified:
trunk/ChangeLog
trunk/vala/valagenieparser.vala
Modified: trunk/vala/valagenieparser.vala
==============================================================================
--- trunk/vala/valagenieparser.vala (original)
+++ trunk/vala/valagenieparser.vala Mon Jun 23 02:33:30 2008
@@ -867,18 +867,21 @@
var member = parse_member_name ();
- if (accept (TokenType.OPEN_PARENS)) {
- var expr = parse_object_creation_expression (begin, member);
- return expr;
- } else {
- throw new ParseError.SYNTAX (get_error ("expected ( or ["));
- }
+ var expr = parse_object_creation_expression (begin, member);
+ return expr;
+
}
Expression parse_object_creation_expression (SourceLocation begin, MemberAccess member) throws ParseError {
member.creation_member = true;
- var arg_list = parse_argument_list ();
- expect (TokenType.CLOSE_PARENS);
+ Gee.List<Expression> arg_list;
+ if (accept (TokenType.OPEN_PARENS)) {
+ arg_list = parse_argument_list ();
+ expect (TokenType.CLOSE_PARENS);
+ } else {
+ arg_list = new ArrayList<Expression> ();
+ }
+
var init_list = parse_object_initializer ();
var expr = new ObjectCreationExpression (member, get_src (begin));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]