summaryrefslogtreecommitdiff
path: root/vala/valaparser.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2010-07-25 21:05:31 +0200
committerJürg Billeter <j@bitron.ch>2010-07-27 15:47:02 +0200
commit123f70495cedba1bfb3d7e96ee70b9196d95400f (patch)
tree0b19cd8281328edadb1d33774ebde36d248b7c6a /vala/valaparser.vala
parentc866eed90e47fd0fceaae686497f5939ccc32fae (diff)
downloadvala-123f70495cedba1bfb3d7e96ee70b9196d95400f.tar.gz
Add Variable class
Diffstat (limited to 'vala/valaparser.vala')
-rw-r--r--vala/valaparser.vala14
1 files changed, 7 insertions, 7 deletions
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 2acbceef4..9161da2f7 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -2739,11 +2739,11 @@ public class Vala.Parser : CodeVisitor {
expect (TokenType.OPEN_BRACE);
while (current () != TokenType.CLOSE_BRACE) {
if (accept (TokenType.DEFAULT)) {
- if (prop.default_expression != null) {
+ if (prop.initializer != null) {
throw new ParseError.SYNTAX (get_error ("property default value already defined"));
}
expect (TokenType.ASSIGN);
- prop.default_expression = parse_expression ();
+ prop.initializer = parse_expression ();
expect (TokenType.SEMICOLON);
} else {
var accessor_begin = get_location ();
@@ -2812,12 +2812,12 @@ public class Vala.Parser : CodeVisitor {
if (empty_get && empty_set) {
/* automatic property accessor body generation */
- var field_type = prop.property_type.copy ();
- prop.field = new Field ("_%s".printf (prop.name), field_type, prop.default_expression, prop.source_reference);
+ var variable_type = prop.property_type.copy ();
+ prop.field = new Field ("_%s".printf (prop.name), variable_type, prop.initializer, prop.source_reference);
prop.field.access = SymbolAccessibility.PRIVATE;
prop.field.binding = prop.binding;
- } else if (prop.default_expression != null) {
- Report.error (prop.default_expression.source_reference, "only automatic properties can have default values");
+ } else if (prop.initializer != null) {
+ Report.error (prop.initializer.source_reference, "only automatic properties can have default values");
}
}
@@ -3279,7 +3279,7 @@ public class Vala.Parser : CodeVisitor {
param.direction = direction;
param.params_array = params_array;
if (accept (TokenType.ASSIGN)) {
- param.default_expression = parse_expression ();
+ param.initializer = parse_expression ();
}
return param;
}