From: Jürg Billeter Date: Tue, 1 Jul 2008 11:33:22 +0000 (+0000) Subject: Set source_reference for error codes X-Git-Tag: VALA_0_3_5~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=801a392bb1dfc728b7d2373f182db499842edd3a;p=thirdparty%2Fvala.git Set source_reference for error codes 2008-07-01 Jürg Billeter * vala/valaerrorcode.vala: * vala/valaparser.vala: Set source_reference for error codes svn path=/trunk/; revision=1668 --- diff --git a/ChangeLog b/ChangeLog index 2a2497a91..dd1ad809a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-01 Jürg Billeter + + * vala/valaerrorcode.vala: + * vala/valaparser.vala: + + Set source_reference for error codes + 2008-07-01 Jared Moore * vapi/gtk+-2.0.vapi: Regenerated to make consistent with recent diff --git a/vala/valaerrorcode.vala b/vala/valaerrorcode.vala index 18795db3f..c872c83a4 100644 --- a/vala/valaerrorcode.vala +++ b/vala/valaerrorcode.vala @@ -39,8 +39,9 @@ public class Vala.ErrorCode : Symbol { * @param name enum value name * @return newly created enum value */ - public ErrorCode (string name) { + public ErrorCode (string name, SourceReference? source_reference = null) { this.name = name; + this.source_reference = source_reference; } /** @@ -50,9 +51,10 @@ public class Vala.ErrorCode : Symbol { * @param value numerical representation * @return newly created enum value */ - public ErrorCode.with_value (string name, Expression value) { + public ErrorCode.with_value (string name, Expression value, SourceReference? source_reference = null) { this.name = name; this.value = value; + this.source_reference = source_reference; } public override void accept (CodeVisitor visitor) { diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 25c0a5bcb..1e4e5ebc5 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -2489,8 +2489,9 @@ public class Vala.Parser : CodeVisitor { break; } var code_attrs = parse_attributes (); + var code_begin = get_location (); string id = parse_identifier (); - var ec = new ErrorCode (id); + var ec = new ErrorCode (id, get_src (code_begin)); set_attributes (ec, code_attrs); if (accept (TokenType.ASSIGN)) { ec.value = parse_expression ();