+2008-08-04 Jürg Billeter <j@bitron.ch>
+
+ * vala/valablock.vala:
+ * vala/valagenieparser.vala:
+ * vala/valaparser.vala:
+ * vala/valasemanticanalyzer.vala:
+
+ Set source_reference of blocks, patch by Abderrahim Kitouni,
+ fixes bug 546249
+
2008-08-04 Jürg Billeter <j@bitron.ch>
* vala/valatypesymbol.vala:
*
* @param source reference to source code
*/
- public Block (SourceReference? source_reference = null) {
+ public Block (SourceReference source_reference) {
this.source_reference = source_reference;
}
comment = scanner.pop_comment ();
- var block = new Block ();
+ var block = new Block (get_src_com (get_location ()));
var stmt = parse_embedded_statement_without_block ();
if (stmt == null) {
// workaround for current limitation of exception handling
comment = scanner.pop_comment ();
- var block = new Block ();
+ var block = new Block (get_src_com (get_location ()));
var stmt = parse_embedded_statement_without_block ();
if (stmt == null) {
// workaround for current limitation of exception handling
}
}
+ block.source_reference.last_line = get_current_src ().last_line;
+ block.source_reference.last_column = get_current_src ().last_column;
+
return block;
}
return;
}
acc.automatic_body = true;
- acc.body = new Block ();
+ acc.body = new Block (acc.source_reference);
var ma = new MemberAccess.simple ("_%s".printf (acc.prop.name), acc.source_reference);
if (acc.readable) {
acc.body.add_statement (new ReturnStatement (ma, acc.source_reference));
}
if (l.expression_body != null) {
- var block = new Block ();
+ var block = new Block (l.source_reference);
block.scope.parent_scope = l.method.scope;
if (l.method.return_type.data_type != null) {