/* valaparser.vala
*
- * Copyright (C) 2006-2009 Jürg Billeter
+ * Copyright (C) 2006-2010 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
}
Expression parse_tuple () throws ParseError {
+ var begin = get_location ();
+
expect (TokenType.OPEN_PARENS);
var expr_list = new ArrayList<Expression> ();
if (current () != TokenType.CLOSE_PARENS) {
}
expect (TokenType.CLOSE_PARENS);
if (expr_list.size != 1) {
- var tuple = new Tuple ();
+ var tuple = new Tuple (get_src (begin));
foreach (Expression expr in expr_list) {
tuple.add_expression (expr);
}
/* valatuple.vala
*
- * Copyright (C) 2006-2008 Jürg Billeter
+ * Copyright (C) 2006-2010 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
public class Vala.Tuple : Expression {
private List<Expression> expression_list = new ArrayList<Expression> ();
- public Tuple () {
+ public Tuple (SourceReference? source_reference = null) {
+ this.source_reference = source_reference;
}
public void add_expression (Expression expr) {
public override bool is_pure () {
return false;
}
+
+ public override bool check (SemanticAnalyzer analyzer) {
+ if (checked) {
+ return !error;
+ }
+
+ checked = true;
+
+ Report.error (source_reference, "tuples are not supported");
+ error = true;
+ return false;
+ }
}