From: Jürg Billeter Date: Mon, 4 Aug 2008 20:09:19 +0000 (+0000) Subject: Set source_reference of blocks, patch by Abderrahim Kitouni, fixes bug X-Git-Tag: VALA_0_3_5~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62dc265cb2c67c6b891cd0a35d727949da2b451f;p=thirdparty%2Fvala.git Set source_reference of blocks, patch by Abderrahim Kitouni, fixes bug 2008-08-04 Jürg Billeter * vala/valablock.vala: * vala/valagenieparser.vala: * vala/valaparser.vala: * vala/valasemanticanalyzer.vala: Set source_reference of blocks, patch by Abderrahim Kitouni, fixes bug 546249 svn path=/trunk/; revision=1733 --- diff --git a/ChangeLog b/ChangeLog index 166e54d8e..d319d2d16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-08-04 Jürg Billeter + + * 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 * vala/valatypesymbol.vala: diff --git a/vala/valablock.vala b/vala/valablock.vala index 839a86d36..4d333b5ca 100644 --- a/vala/valablock.vala +++ b/vala/valablock.vala @@ -41,7 +41,7 @@ public class Vala.Block : Symbol, Statement { * * @param source reference to source code */ - public Block (SourceReference? source_reference = null) { + public Block (SourceReference source_reference) { this.source_reference = source_reference; } diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala index 190b630f5..1c35b4831 100644 --- a/vala/valagenieparser.vala +++ b/vala/valagenieparser.vala @@ -1651,7 +1651,7 @@ public class Vala.Genie.Parser : CodeVisitor { 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 diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 68b785d53..0bdff4967 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -1301,7 +1301,7 @@ public class Vala.Parser : CodeVisitor { 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 @@ -1345,6 +1345,9 @@ public class Vala.Parser : CodeVisitor { } } + block.source_reference.last_line = get_current_src ().last_line; + block.source_reference.last_column = get_current_src ().last_column; + return block; } diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index 16cf2ec47..750133caf 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -710,7 +710,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor { 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)); @@ -3375,7 +3375,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor { } 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) {