diff options
author | Jürg Billeter <j@bitron.ch> | 2008-08-04 20:09:19 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-08-04 20:09:19 +0000 |
commit | 62dc265cb2c67c6b891cd0a35d727949da2b451f (patch) | |
tree | 0f8aabc7374b687a7726d0b4e3190efc207c6c89 | |
parent | 26afefa1802cd4440bd816843078b2210ba6d675 (diff) | |
download | vala-62dc265cb2c67c6b891cd0a35d727949da2b451f.tar.gz |
Set source_reference of blocks, patch by Abderrahim Kitouni, fixes bug
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
svn path=/trunk/; revision=1733
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | vala/valablock.vala | 2 | ||||
-rw-r--r-- | vala/valagenieparser.vala | 2 | ||||
-rw-r--r-- | vala/valaparser.vala | 5 | ||||
-rw-r--r-- | vala/valasemanticanalyzer.vala | 4 |
5 files changed, 18 insertions, 5 deletions
@@ -1,5 +1,15 @@ 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: Fix crash on incremental parsing, patch by Abderrahim Kitouni 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) { |