diff options
author | Jürg Billeter <j@bitron.ch> | 2010-07-25 20:12:03 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2010-07-27 15:43:33 +0200 |
commit | c866eed90e47fd0fceaae686497f5939ccc32fae (patch) | |
tree | 9c0aa3b3ace401aa2a80f5929a677c7a63bc2176 /vala/valaconstant.vala | |
parent | 1f1ecb7a7776f3fd0c5efb7d1635b29f61329b73 (diff) | |
download | vala-c866eed90e47fd0fceaae686497f5939ccc32fae.tar.gz |
Derive EnumValue from Constant
Diffstat (limited to 'vala/valaconstant.vala')
-rw-r--r-- | vala/valaconstant.vala | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vala/valaconstant.vala b/vala/valaconstant.vala index 223ea45dc..02b815f0c 100644 --- a/vala/valaconstant.vala +++ b/vala/valaconstant.vala @@ -67,9 +67,11 @@ public class Vala.Constant : Symbol, Lockable { * @param source_reference reference to source code * @return newly created constant */ - public Constant (string name, DataType type_reference, Expression? value, SourceReference? source_reference, Comment? comment = null) { + public Constant (string name, DataType? type_reference, Expression? value, SourceReference? source_reference, Comment? comment = null) { base (name, source_reference, comment); - this.type_reference = type_reference; + if (type_reference != null) { + this.type_reference = type_reference; + } this.value = value; } @@ -103,7 +105,7 @@ public class Vala.Constant : Symbol, Lockable { * * @return the name to be used in C code by default */ - public string get_default_cname () { + public virtual string get_default_cname () { if (parent_symbol == null) { // global constant return name; @@ -112,6 +114,10 @@ public class Vala.Constant : Symbol, Lockable { } } + public void set_cname (string value) { + this.cname = value; + } + public bool get_lock_used () { return lock_used; } |