[vala] Drop Dova profile
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Drop Dova profile
- Date: Mon, 6 Aug 2012 11:29:23 +0000 (UTC)
commit 5ea6dc05d62c71ba4e633f70b86e4dd0a5e9c089
Author: JÃrg Billeter <j bitron ch>
Date: Fri Aug 3 09:38:11 2012 +0200
Drop Dova profile
codegen/Makefile.am | 12 -
codegen/valaccodeattribute.vala | 29 +-
codegen/valadovaarraymodule.vala | 90 --
codegen/valadovaassignmentmodule.vala | 155 --
codegen/valadovabasemodule.vala | 2407 -------------------------------
codegen/valadovacontrolflowmodule.vala | 80 -
codegen/valadovadelegatemodule.vala | 221 ---
codegen/valadovaerrormodule.vala | 277 ----
codegen/valadovamemberaccessmodule.vala | 307 ----
codegen/valadovamethodcallmodule.vala | 234 ---
codegen/valadovamethodmodule.vala | 42 -
codegen/valadovaobjectmodule.vala | 1977 -------------------------
codegen/valadovastructmodule.vala | 86 --
codegen/valadovavaluemodule.vala | 726 ----------
compiler/valacompiler.vala | 10 -
vala/Makefile.am | 3 -
vala/valaarraytype.vala | 2 -
vala/valabinaryexpression.vala | 45 +-
vala/valacharacterliteral.vala | 10 +-
vala/valaclass.vala | 30 +-
vala/valacodecontext.vala | 5 -
vala/valacodevisitor.vala | 24 -
vala/valacodewriter.vala | 13 +-
vala/valadatatype.vala | 5 -
vala/valaelementaccess.vala | 36 -
vala/valaenum.vala | 2 +-
vala/valaflowanalyzer.vala | 8 +-
vala/valaforeachstatement.vala | 2 +-
vala/valagenerictype.vala | 7 -
vala/valaintegerliteral.vala | 10 +-
vala/valainterface.vala | 2 +-
vala/valalambdaexpression.vala | 12 +-
vala/valalistliteral.vala | 140 --
vala/valamapliteral.vala | 151 --
vala/valamethod.vala | 2 +-
vala/valamethodcall.vala | 6 +-
vala/valanamespace.vala | 2 +-
vala/valaobjectcreationexpression.vala | 6 +-
vala/valaobjecttype.vala | 5 -
vala/valaparser.vala | 227 +---
vala/valapointertype.vala | 12 +-
vala/valaprofile.vala | 3 +-
vala/valapropertyaccessor.vala | 22 +-
vala/valarealliteral.vala | 2 +-
vala/valareturnstatement.vala | 5 -
vala/valascanner.vala | 9 +-
vala/valasemanticanalyzer.vala | 41 +-
vala/valasetliteral.vala | 124 --
vala/valastruct.vala | 5 +-
vala/valasymbolresolver.vala | 32 -
vala/valatemplate.vala | 15 +-
vala/valatuple.vala | 20 +-
52 files changed, 81 insertions(+), 7617 deletions(-)
---
diff --git a/codegen/Makefile.am b/codegen/Makefile.am
index 2535a88..ac99790 100644
--- a/codegen/Makefile.am
+++ b/codegen/Makefile.am
@@ -28,18 +28,6 @@ libvala_la_VALASOURCES = \
valaccodestructmodule.vala \
valaclassregisterfunction.vala \
valactype.vala \
- valadovaarraymodule.vala \
- valadovaassignmentmodule.vala \
- valadovabasemodule.vala \
- valadovacontrolflowmodule.vala \
- valadovadelegatemodule.vala \
- valadovaerrormodule.vala \
- valadovamemberaccessmodule.vala \
- valadovamethodcallmodule.vala \
- valadovamethodmodule.vala \
- valadovaobjectmodule.vala \
- valadovastructmodule.vala \
- valadovavaluemodule.vala \
valaenumregisterfunction.vala \
valagasyncmodule.vala \
valagdbusclientmodule.vala \
diff --git a/codegen/valaccodeattribute.vala b/codegen/valaccodeattribute.vala
index 2ea1244..523ec78 100644
--- a/codegen/valaccodeattribute.vala
+++ b/codegen/valaccodeattribute.vala
@@ -584,11 +584,6 @@ public class Vala.CCodeAttribute : AttributeCache {
}
} else if (node is ObjectType) {
var type = (ObjectType) node;
- if (CodeContext.get ().profile == Profile.DOVA) {
- if (type.type_symbol.get_full_name () == "string") {
- return "string_t";
- }
- }
string cname;
if (!type.value_owned) {
@@ -603,19 +598,11 @@ public class Vala.CCodeAttribute : AttributeCache {
if (type.inline_allocated) {
return cname;
} else {
- if (CodeContext.get ().profile == Profile.DOVA) {
- return "DovaArray";
- } else {
- return "%s*".printf (cname);
- }
+ return "%s*".printf (cname);
}
} else if (node is DelegateType) {
var type = (DelegateType) node;
- if (CodeContext.get ().profile == Profile.DOVA) {
- return "%s*".printf (CCodeBaseModule.get_ccode_name (type.delegate_symbol));
- } else {
- return CCodeBaseModule.get_ccode_name (type.delegate_symbol);
- }
+ return CCodeBaseModule.get_ccode_name (type.delegate_symbol);
} else if (node is ErrorType) {
return "GError*";
} else if (node is GenericType) {
@@ -1147,14 +1134,6 @@ public class Vala.CCodeAttribute : AttributeCache {
if (base_st != null) {
return CCodeBaseModule.get_ccode_default_value (base_st);
}
-
- if (CodeContext.get ().profile == Profile.DOVA) {
- if (st.is_boolean_type ()) {
- return "false";
- } else if (st.is_integer_type () || st.is_floating_type ()) {
- return "0";
- }
- }
}
return "";
}
@@ -1178,10 +1157,6 @@ public class Vala.CCodeAttribute : AttributeCache {
string infix = "construct";
- if (CodeContext.get ().profile == Profile.DOVA) {
- infix = "init";
- }
-
if (m.name == ".new") {
return "%s%s".printf (CCodeBaseModule.get_ccode_lower_case_prefix (parent), infix);
} else {
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index b0722eb..830c8b9 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -214,9 +214,6 @@ class Vala.Compiler {
// default profile
context.profile = Profile.GOBJECT;
context.add_define ("GOBJECT");
- } else if (profile == "dova") {
- context.profile = Profile.DOVA;
- context.add_define ("DOVA");
} else {
Report.error (null, "Unknown profile %s".printf (profile));
}
@@ -264,11 +261,6 @@ class Vala.Compiler {
context.add_external_package ("glib-2.0");
context.add_external_package ("gobject-2.0");
}
- } else if (context.profile == Profile.DOVA) {
- if (!nostdpkg) {
- /* default package */
- context.add_external_package ("dova-core-0.1");
- }
}
if (packages != null) {
@@ -292,8 +284,6 @@ class Vala.Compiler {
if (context.profile == Profile.GOBJECT) {
context.codegen = new GDBusServerModule ();
- } else if (context.profile == Profile.DOVA) {
- context.codegen = new DovaErrorModule ();
} else {
context.codegen = new CCodeDelegateModule ();
}
diff --git a/vala/Makefile.am b/vala/Makefile.am
index 999a63a..d6df894 100644
--- a/vala/Makefile.am
+++ b/vala/Makefile.am
@@ -85,13 +85,11 @@ libvalacore_la_VALASOURCES = \
valainterfacetype.vala \
valainvalidtype.vala \
valalambdaexpression.vala \
- valalistliteral.vala \
valaliteral.vala \
valalocalvariable.vala \
valalockable.vala \
valalockstatement.vala \
valaloop.vala \
- valamapliteral.vala \
valamarkupreader.vala \
valamemberaccess.vala \
valamemberinitializer.vala \
@@ -123,7 +121,6 @@ libvalacore_la_VALASOURCES = \
valascanner.vala \
valascope.vala \
valasemanticanalyzer.vala \
- valasetliteral.vala \
valasignal.vala \
valasignaltype.vala \
valasizeofexpression.vala \
diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala
index ecd8a0e..c190d1d 100644
--- a/vala/valaarraytype.vala
+++ b/vala/valaarraytype.vala
@@ -245,8 +245,6 @@ public class Vala.ArrayType : ReferenceType {
public override bool is_disposable () {
if (fixed_length) {
return element_type.is_disposable ();
- } else if (CodeContext.get ().profile == Profile.DOVA) {
- return false;
} else {
return base.is_disposable ();
}
diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala
index 1457de3..22c4483 100644
--- a/vala/valabinaryexpression.vala
+++ b/vala/valabinaryexpression.vala
@@ -263,14 +263,6 @@ public class Vala.BinaryExpression : Expression {
&& operator == BinaryOperator.PLUS) {
// string concatenation
- if (context.profile == Profile.DOVA) {
- var concat_call = new MethodCall (new MemberAccess (left, "concat", source_reference), source_reference);
- concat_call.add_argument (right);
- concat_call.target_type = target_type;
- parent_node.replace_expression (this, concat_call);
- return concat_call.check (context);
- }
-
if (right.value_type == null || right.value_type.data_type != context.analyzer.string_type.data_type) {
error = true;
Report.error (source_reference, "Operands must be strings");
@@ -283,16 +275,7 @@ public class Vala.BinaryExpression : Expression {
} else {
value_type.value_owned = true;
}
- } else if (context.profile == Profile.DOVA && left.value_type.data_type == context.analyzer.list_type.data_type
- && operator == BinaryOperator.PLUS) {
- // list concatenation
-
- var concat_call = new MethodCall (new MemberAccess (left, "concat", source_reference), source_reference);
- concat_call.add_argument (right);
- concat_call.target_type = target_type;
- parent_node.replace_expression (this, concat_call);
- return concat_call.check (context);
- } else if (context.profile != Profile.DOVA && left.value_type is ArrayType && operator == BinaryOperator.PLUS) {
+ } else if (left.value_type is ArrayType && operator == BinaryOperator.PLUS) {
// array concatenation
var array_type = (ArrayType) left.value_type;
@@ -329,11 +312,7 @@ public class Vala.BinaryExpression : Expression {
}
} else if (right.value_type is PointerType) {
// pointer arithmetic: pointer - pointer
- if (context.profile == Profile.DOVA) {
- value_type = context.analyzer.long_type;
- } else {
- value_type = context.analyzer.size_t_type;
- }
+ value_type = context.analyzer.size_t_type;
}
} else {
left.target_type.nullable = false;
@@ -427,26 +406,6 @@ public class Vala.BinaryExpression : Expression {
}
}
- if (left.value_type.compatible (context.analyzer.string_type)
- && right.value_type.compatible (context.analyzer.string_type)) {
- // string comparison
- if (context.profile == Profile.DOVA) {
- var string_ma = new MemberAccess.simple ("string", source_reference);
- string_ma.qualified = true;
- var equals_call = new MethodCall (new MemberAccess (string_ma, "equals", source_reference), source_reference);
- equals_call.add_argument (left);
- equals_call.add_argument (right);
- if (operator == BinaryOperator.EQUALITY) {
- parent_node.replace_expression (this, equals_call);
- return equals_call.check (context);
- } else {
- var not = new UnaryExpression (UnaryOperator.LOGICAL_NEGATION, equals_call, source_reference);
- parent_node.replace_expression (this, not);
- return not.check (context);
- }
- }
- }
-
value_type = context.analyzer.bool_type;
} else if (operator == BinaryOperator.BITWISE_AND
|| operator == BinaryOperator.BITWISE_OR) {
diff --git a/vala/valacharacterliteral.vala b/vala/valacharacterliteral.vala
index d38a0e6..71bed95 100644
--- a/vala/valacharacterliteral.vala
+++ b/vala/valacharacterliteral.vala
@@ -90,14 +90,10 @@ public class Vala.CharacterLiteral : Literal {
checked = true;
- if (context.profile == Profile.DOVA) {
- value_type = new IntegerType ((Struct) context.analyzer.root_symbol.scope.lookup ("char"), get_char ().to_string (), "int");
+ if (get_char () < 128) {
+ value_type = new IntegerType ((Struct) context.analyzer.root_symbol.scope.lookup ("char"));
} else {
- if (get_char () < 128) {
- value_type = new IntegerType ((Struct) context.analyzer.root_symbol.scope.lookup ("char"));
- } else {
- value_type = new IntegerType ((Struct) context.analyzer.root_symbol.scope.lookup ("unichar"));
- }
+ value_type = new IntegerType ((Struct) context.analyzer.root_symbol.scope.lookup ("unichar"));
}
return !error;
diff --git a/vala/valaclass.vala b/vala/valaclass.vala
index 87a0441..678c643 100644
--- a/vala/valaclass.vala
+++ b/vala/valaclass.vala
@@ -254,32 +254,6 @@ public class Vala.Class : ObjectTypeSymbol {
* @param f a field
*/
public override void add_field (Field f) {
- if (CodeContext.get ().profile == Profile.DOVA &&
- f.binding == MemberBinding.INSTANCE &&
- (f.access == SymbolAccessibility.PUBLIC || f.access == SymbolAccessibility.PROTECTED) &&
- name != "any" /* temporary workaround */) {
- // public/protected instance fields not supported, convert to automatic property
-
- var prop = new Property (f.name, f.variable_type.copy (), null, null, f.source_reference, comment);
- prop.access = access;
-
- var get_type = prop.property_type.copy ();
- get_type.value_owned = true;
- var set_type = prop.property_type.copy ();
- set_type.value_owned = false;
-
- prop.get_accessor = new PropertyAccessor (true, false, false, get_type, null, f.source_reference);
-
- prop.set_accessor = new PropertyAccessor (false, true, false, set_type, null, f.source_reference);
-
- f.name = "_%s".printf (f.name);
- f.access = SymbolAccessibility.PRIVATE;
- prop.field = f;
-
- add_property (prop);
- return;
- }
-
fields.add (f);
if (f.access == SymbolAccessibility.PRIVATE && f.binding == MemberBinding.INSTANCE) {
has_private_fields = true;
@@ -320,7 +294,7 @@ public class Vala.Class : ObjectTypeSymbol {
m.this_parameter = new Parameter ("this", get_this_type ());
m.scope.add (m.this_parameter.name, m.this_parameter);
}
- if (!(m.return_type is VoidType) && (CodeContext.get ().profile == Profile.DOVA || m.get_postconditions ().size > 0)) {
+ if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
if (m.result_var != null) {
m.scope.remove (m.result_var.name);
}
@@ -560,8 +534,6 @@ public class Vala.Class : ObjectTypeSymbol {
public bool is_fundamental () {
if (!is_compact && base_class == null) {
return true;
- } else if (CodeContext.get ().profile == Profile.DOVA && base_class.base_class == null) {
- return true;
}
return false;
}
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index f2b8b59..6167b55 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -417,11 +417,6 @@ public class Vala.CodeContext {
var ns_ref = new UsingDirective (new UnresolvedSymbol (null, "GLib", null));
source_file.add_using_directive (ns_ref);
root.add_using_directive (ns_ref);
- } else if (profile == Profile.DOVA) {
- // import the Dova namespace by default (namespace of backend-specific standard library)
- var ns_ref = new UsingDirective (new UnresolvedSymbol (null, "Dova", null));
- source_file.add_using_directive (ns_ref);
- root.add_using_directive (ns_ref);
}
add_source_file (source_file);
diff --git a/vala/valacodevisitor.vala b/vala/valacodevisitor.vala
index 395009d..c9b1586 100644
--- a/vala/valacodevisitor.vala
+++ b/vala/valacodevisitor.vala
@@ -486,30 +486,6 @@ public abstract class Vala.CodeVisitor {
}
/**
- * Visit operation called for list literals.
- *
- * @param lit a list literal
- */
- public virtual void visit_list_literal (ListLiteral lit) {
- }
-
- /**
- * Visit operation called for set literals.
- *
- * @param lit a set literal
- */
- public virtual void visit_set_literal (SetLiteral lit) {
- }
-
- /**
- * Visit operation called for map literals.
- *
- * @param lit a map literal
- */
- public virtual void visit_map_literal (MapLiteral lit) {
- }
-
- /**
* Visit operation called for tuples.
*
* @param tuple a tuple
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index 3986e70..7a79614 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -724,9 +724,7 @@ public class Vala.CodeWriter : CodeVisitor {
write_params (m.get_parameters ());
- if (context.profile != Profile.DOVA) {
- write_error_domains (m.get_error_types ());
- }
+ write_error_domains (m.get_error_types ());
write_code_block (m.body);
@@ -767,7 +765,7 @@ public class Vala.CodeWriter : CodeVisitor {
write_property_accessor_accessibility (prop.get_accessor);
- if (context.profile != Profile.DOVA && prop.get_accessor.value_type.is_disposable ()) {
+ if (prop.get_accessor.value_type.is_disposable ()) {
write_string (" owned");
}
@@ -779,7 +777,7 @@ public class Vala.CodeWriter : CodeVisitor {
write_property_accessor_accessibility (prop.set_accessor);
- if (context.profile != Profile.DOVA && prop.set_accessor.value_type.value_owned) {
+ if (prop.set_accessor.value_type.value_owned) {
write_string (" owned");
}
@@ -1429,9 +1427,8 @@ public class Vala.CodeWriter : CodeVisitor {
private void write_identifier (string s) {
char* id = (char*)s;
int id_length = (int)s.length;
- if (context.profile != Profile.DOVA &&
- (Vala.Scanner.get_identifier_or_keyword (id, id_length) != Vala.TokenType.IDENTIFIER ||
- s.get_char ().isdigit ())) {
+ if (Vala.Scanner.get_identifier_or_keyword (id, id_length) != Vala.TokenType.IDENTIFIER ||
+ s.get_char ().isdigit ()) {
stream.putc ('@');
}
write_string (s);
diff --git a/vala/valadatatype.vala b/vala/valadatatype.vala
index c553dcf..e48d12d 100644
--- a/vala/valadatatype.vala
+++ b/vala/valadatatype.vala
@@ -274,11 +274,6 @@ public abstract class Vala.DataType : CodeNode {
}
}
- if (this is ValueType && target_type.data_type != null && target_type.data_type.get_full_name () == "Dova.Value") {
- // allow implicit conversion to Dova.Value
- return true;
- }
-
if (target_type is DelegateType && this is DelegateType) {
return ((DelegateType) target_type).delegate_symbol == ((DelegateType) this).delegate_symbol;
}
diff --git a/vala/valaelementaccess.vala b/vala/valaelementaccess.vala
index 58f0e4d..8210e47 100644
--- a/vala/valaelementaccess.vala
+++ b/vala/valaelementaccess.vala
@@ -115,8 +115,6 @@ public class Vala.ElementAccess : Expression {
return false;
}
- var container_type = container.value_type.data_type;
-
if (container is MemberAccess && container.symbol_reference is Signal) {
// signal detail access
if (get_indices ().size != 1) {
@@ -163,40 +161,6 @@ public class Vala.ElementAccess : Expression {
}
} else if (pointer_type != null && !pointer_type.base_type.is_reference_type_or_type_parameter ()) {
value_type = pointer_type.base_type.copy ();
- } else if (context.profile == Profile.DOVA && container_type == context.analyzer.tuple_type.data_type) {
- if (get_indices ().size != 1) {
- error = true;
- Report.error (source_reference, "Element access with more than one dimension is not supported for tuples");
- return false;
- }
- var index = get_indices ().get (0) as IntegerLiteral;
- if (index == null) {
- error = true;
- Report.error (source_reference, "Element access with non-literal index is not supported for tuples");
- return false;
- }
- int i = int.parse (index.value);
- if (container.value_type.get_type_arguments ().size == 0) {
- error = true;
- Report.error (source_reference, "Element access is not supported for untyped tuples");
- return false;
- }
- if (i < 0 || i >= container.value_type.get_type_arguments ().size) {
- error = true;
- Report.error (source_reference, "Index out of range");
- return false;
- }
-
- value_type = container.value_type.get_type_arguments ().get (i);
-
- // replace element access by call to generic get method
- var ma = new MemberAccess (container, "get", source_reference);
- ma.add_type_argument (value_type);
- var get_call = new MethodCall (ma, source_reference);
- get_call.add_argument (index);
- get_call.target_type = this.target_type;
- parent_node.replace_expression (this, get_call);
- return get_call.check (context);
} else if (container is MemberAccess && container.symbol_reference is Signal) {
index_int_type_check = false;
diff --git a/vala/valaenum.vala b/vala/valaenum.vala
index eeabda9..acb8eb3 100644
--- a/vala/valaenum.vala
+++ b/vala/valaenum.vala
@@ -83,7 +83,7 @@ public class Vala.Enum : TypeSymbol {
m.this_parameter = new Parameter ("this", new EnumValueType (this));
m.scope.add (m.this_parameter.name, m.this_parameter);
}
- if (!(m.return_type is VoidType) && (CodeContext.get ().profile == Profile.DOVA || m.get_postconditions ().size > 0)) {
+ if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
m.result_var = new LocalVariable (m.return_type.copy (), "result", null, source_reference);
m.result_var.is_result = true;
}
diff --git a/vala/valaflowanalyzer.vala b/vala/valaflowanalyzer.vala
index ada3254..57453ee 100644
--- a/vala/valaflowanalyzer.vala
+++ b/vala/valaflowanalyzer.vala
@@ -193,12 +193,6 @@ public class Vala.FlowAnalyzer : CodeVisitor {
m.return_block.connect (m.exit_block);
- if (context.profile == Profile.DOVA && m.result_var != null) {
- // ensure result is defined at end of method
- var result_ma = new MemberAccess.simple ("result", m.source_reference);
- result_ma.symbol_reference = m.result_var;
- m.return_block.add_node (result_ma);
- }
if (m is Method) {
// ensure out parameters are defined at end of method
foreach (var param in ((Method) m).get_parameters ()) {
@@ -224,7 +218,7 @@ public class Vala.FlowAnalyzer : CodeVisitor {
if (current_block != null) {
// end of method body reachable
- if (context.profile != Profile.DOVA && m.has_result) {
+ if (m.has_result) {
Report.error (m.source_reference, "missing return statement at end of subroutine body");
m.error = true;
}
diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala
index 319968a..f27e303 100644
--- a/vala/valaforeachstatement.vala
+++ b/vala/valaforeachstatement.vala
@@ -167,7 +167,7 @@ public class Vala.ForeachStatement : Block {
var collection_type = collection.value_type.copy ();
collection.target_type = collection_type.copy ();
- if (context.profile != Profile.DOVA && collection_type.is_array ()) {
+ if (collection_type.is_array ()) {
var array_type = (ArrayType) collection_type;
// can't use inline-allocated array for temporary variable
diff --git a/vala/valagenerictype.vala b/vala/valagenerictype.vala
index c7d7991..49a4c57 100644
--- a/vala/valagenerictype.vala
+++ b/vala/valagenerictype.vala
@@ -47,13 +47,6 @@ public class Vala.GenericType : DataType {
}
public override Symbol? get_member (string member_name) {
- if (CodeContext.get ().profile == Profile.DOVA) {
- if (member_name == "equals") {
- return CodeContext.get ().root.scope.lookup ("Dova").scope.lookup ("Object").scope.lookup ("equals");
- } else if (member_name == "hash") {
- return CodeContext.get ().root.scope.lookup ("Dova").scope.lookup ("Object").scope.lookup ("hash");
- }
- }
return null;
}
}
diff --git a/vala/valaintegerliteral.vala b/vala/valaintegerliteral.vala
index e16c457..879bd2a 100644
--- a/vala/valaintegerliteral.vala
+++ b/vala/valaintegerliteral.vala
@@ -96,14 +96,6 @@ public class Vala.IntegerLiteral : Literal {
type_suffix = "";
type_name = "int";
}
- } else if (CodeContext.get ().profile == Profile.DOVA) {
- if (u) {
- type_suffix = "UL";
- type_name = "uint64";
- } else {
- type_suffix = "L";
- type_name = "int64";
- }
} else if (l == 1) {
if (u) {
type_suffix = "UL";
@@ -123,7 +115,7 @@ public class Vala.IntegerLiteral : Literal {
}
var st = (Struct) context.analyzer.root_symbol.scope.lookup (type_name);
- // ensure attributes are already processed in case of bootstrapping dova-core
+ // ensure attributes are already processed
st.check (context);
value_type = new IntegerType (st, value, type_name);
diff --git a/vala/valainterface.vala b/vala/valainterface.vala
index 548304f..5780837 100644
--- a/vala/valainterface.vala
+++ b/vala/valainterface.vala
@@ -133,7 +133,7 @@ public class Vala.Interface : ObjectTypeSymbol {
m.this_parameter = new Parameter ("this", get_this_type ());
m.scope.add (m.this_parameter.name, m.this_parameter);
}
- if (!(m.return_type is VoidType) && (CodeContext.get ().profile == Profile.DOVA || m.get_postconditions ().size > 0)) {
+ if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
m.result_var = new LocalVariable (m.return_type.copy (), "result", null, source_reference);
m.result_var.is_result = true;
}
diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala
index 027beaf..61482f4 100644
--- a/vala/valalambdaexpression.vala
+++ b/vala/valalambdaexpression.vala
@@ -164,11 +164,6 @@ public class Vala.LambdaExpression : Expression {
}
method.owner = context.analyzer.current_symbol.scope;
- if (!(method.return_type is VoidType) && CodeContext.get ().profile == Profile.DOVA) {
- method.result_var = new LocalVariable (method.return_type.copy (), "result", null, source_reference);
- method.result_var.is_result = true;
- }
-
var lambda_params = get_parameters ();
Iterator<Parameter> lambda_param_it = lambda_params.iterator ();
@@ -208,12 +203,7 @@ public class Vala.LambdaExpression : Expression {
block.scope.parent_scope = method.scope;
if (method.return_type.data_type != null) {
- if (context.profile == Profile.DOVA) {
- block.add_statement (new ExpressionStatement (new Assignment (new MemberAccess.simple ("result", source_reference), expression_body, AssignmentOperator.SIMPLE, source_reference), source_reference));
- block.add_statement (new ReturnStatement (null, source_reference));
- } else {
- block.add_statement (new ReturnStatement (expression_body, source_reference));
- }
+ block.add_statement (new ReturnStatement (expression_body, source_reference));
} else {
block.add_statement (new ExpressionStatement (expression_body, source_reference));
}
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index 2a1bf81..942f0d2 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -769,7 +769,7 @@ public class Vala.Method : Subroutine {
entry_point = true;
context.entry_point = this;
- if (tree_can_fail && context.profile != Profile.DOVA) {
+ if (tree_can_fail) {
Report.error (source_reference, "\"main\" method cannot throw errors");
}
}
diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala
index 0c6705e..0cb8cac 100644
--- a/vala/valamethodcall.vala
+++ b/vala/valamethodcall.vala
@@ -724,10 +724,8 @@ public class Vala.MethodCall : Expression {
if (parent_node is LocalVariable || parent_node is ExpressionStatement) {
// simple statements, no side effects after method call
} else if (!(context.analyzer.current_symbol is Block)) {
- if (context.profile != Profile.DOVA) {
- // can't handle errors in field initializers
- Report.error (source_reference, "Field initializers must not throw errors");
- }
+ // can't handle errors in field initializers
+ Report.error (source_reference, "Field initializers must not throw errors");
} else {
// store parent_node as we need to replace the expression in the old parent node later on
var old_parent_node = parent_node;
diff --git a/vala/valanamespace.vala b/vala/valanamespace.vala
index b605ac6..47dd4ee 100644
--- a/vala/valanamespace.vala
+++ b/vala/valanamespace.vala
@@ -438,7 +438,7 @@ public class Vala.Namespace : Symbol {
m.error = true;
return;
}
- if (!(m.return_type is VoidType) && (CodeContext.get ().profile == Profile.DOVA || m.get_postconditions ().size > 0)) {
+ if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
m.result_var = new LocalVariable (m.return_type.copy (), "result", null, source_reference);
m.result_var.is_result = true;
}
diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala
index 400bc4c..7384746 100644
--- a/vala/valaobjectcreationexpression.vala
+++ b/vala/valaobjectcreationexpression.vala
@@ -407,10 +407,8 @@ public class Vala.ObjectCreationExpression : Expression {
if (parent_node is LocalVariable || parent_node is ExpressionStatement) {
// simple statements, no side effects after method call
} else if (!(context.analyzer.current_symbol is Block)) {
- if (context.profile != Profile.DOVA) {
- // can't handle errors in field initializers
- Report.error (source_reference, "Field initializers must not throw errors");
- }
+ // can't handle errors in field initializers
+ Report.error (source_reference, "Field initializers must not throw errors");
} else {
// store parent_node as we need to replace the expression in the old parent node later on
var old_parent_node = parent_node;
diff --git a/vala/valaobjecttype.vala b/vala/valaobjecttype.vala
index 6d440b1..7019719 100644
--- a/vala/valaobjecttype.vala
+++ b/vala/valaobjecttype.vala
@@ -100,11 +100,6 @@ public class Vala.ObjectType : ReferenceType {
return false;
}
- if (context.profile == Profile.DOVA && type_symbol.get_full_name () == "Dova.Tuple") {
- // tuples have variadic generics
- return true;
- }
-
int n_type_args = get_type_arguments ().size;
if (n_type_args > 0 && n_type_args < type_symbol.get_type_parameters ().size) {
Report.error (source_reference, "too few type arguments");
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index d01558b..0f7d0e3 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -409,11 +409,7 @@ public class Vala.Parser : CodeVisitor {
bool value_owned = owned_by_default;
if (owned_by_default) {
- if (context.profile == Profile.DOVA) {
- if (can_weak_ref && accept (TokenType.WEAK)) {
- value_owned = false;
- }
- } else if (accept (TokenType.UNOWNED)) {
+ if (accept (TokenType.UNOWNED)) {
value_owned = false;
} else if (accept (TokenType.WEAK)) {
if (!can_weak_ref && !context.deprecated) {
@@ -422,7 +418,7 @@ public class Vala.Parser : CodeVisitor {
value_owned = false;
}
} else {
- value_owned = (context.profile != Profile.DOVA && accept (TokenType.OWNED));
+ value_owned = accept (TokenType.OWNED);
}
DataType type;
@@ -463,7 +459,7 @@ public class Vala.Parser : CodeVisitor {
// only used for parsing, reject use as real type
invalid_array = true;
}
- } while (context.profile != Profile.DOVA && accept (TokenType.COMMA));
+ } while (accept (TokenType.COMMA));
expect (TokenType.CLOSE_BRACKET);
// arrays contain strong references by default
@@ -481,7 +477,7 @@ public class Vala.Parser : CodeVisitor {
}
if (!owned_by_default) {
- if (context.profile != Profile.DOVA && accept (TokenType.HASH)) {
+ if (accept (TokenType.HASH)) {
if (!context.deprecated) {
Report.warning (get_last_src (), "deprecated syntax, use `owned` modifier");
}
@@ -579,18 +575,10 @@ public class Vala.Parser : CodeVisitor {
expr = parse_literal ();
break;
case TokenType.OPEN_BRACE:
- if (context.profile == Profile.DOVA) {
- expr = parse_set_literal ();
- } else {
- expr = parse_initializer ();
- }
+ expr = parse_initializer ();
break;
case TokenType.OPEN_BRACKET:
- if (context.profile == Profile.DOVA) {
- expr = parse_list_literal ();
- } else {
- expr = parse_simple_name ();
- }
+ expr = parse_simple_name ();
break;
case TokenType.OPEN_PARENS:
expr = parse_tuple ();
@@ -632,11 +620,7 @@ public class Vala.Parser : CodeVisitor {
expr = parse_member_access (begin, expr);
break;
case TokenType.OP_PTR:
- if (context.profile == Profile.DOVA) {
- found = false;
- } else {
- expr = parse_pointer_member_access (begin, expr);
- }
+ expr = parse_pointer_member_access (begin, expr);
break;
case TokenType.OPEN_PARENS:
expr = parse_method_call (begin, expr);
@@ -644,14 +628,6 @@ public class Vala.Parser : CodeVisitor {
case TokenType.OPEN_BRACKET:
expr = parse_element_access (begin, expr);
break;
- case TokenType.OPEN_BRACE:
- var ma = expr as MemberAccess;
- if (context.profile == Profile.DOVA && ma != null) {
- expr = parse_object_literal (begin, ma);
- } else {
- found = false;
- }
- break;
case TokenType.OP_INC:
expr = parse_post_increment_expression (begin, expr);
break;
@@ -877,27 +853,6 @@ public class Vala.Parser : CodeVisitor {
return expr;
}
- Expression parse_object_literal (SourceLocation begin, MemberAccess member) throws ParseError {
- member.creation_member = true;
-
- var expr = new ObjectCreationExpression (member, get_src (begin));
-
- expect (TokenType.OPEN_BRACE);
-
- do {
- var member_begin = get_location ();
- string id = parse_identifier ();
- expect (TokenType.COLON);
- var member_expr = parse_expression ();
-
- expr.add_member_initializer (new MemberInitializer (id, member_expr, get_src (member_begin)));
- } while (accept (TokenType.COMMA));
-
- expect (TokenType.CLOSE_BRACE);
-
- return expr;
- }
-
Expression parse_array_creation_expression () throws ParseError {
var begin = get_location ();
expect (TokenType.NEW);
@@ -939,12 +894,12 @@ public class Vala.Parser : CodeVisitor {
size_specified = true;
}
size_specifier_list.add (size);
- } while (context.profile != Profile.DOVA && accept (TokenType.COMMA));
+ } while (accept (TokenType.COMMA));
expect (TokenType.CLOSE_BRACKET);
} while (accept (TokenType.OPEN_BRACKET));
InitializerList initializer = null;
- if (context.profile != Profile.DOVA && current () == TokenType.OPEN_BRACE) {
+ if (current () == TokenType.OPEN_BRACE) {
initializer = parse_initializer ();
}
var expr = new ArrayCreationExpression (element_type, size_specifier_list.size, initializer, get_src (begin));
@@ -958,7 +913,7 @@ public class Vala.Parser : CodeVisitor {
List<MemberInitializer> parse_object_initializer () throws ParseError {
var list = new ArrayList<MemberInitializer> ();
- if (context.profile != Profile.DOVA && accept (TokenType.OPEN_BRACE)) {
+ if (accept (TokenType.OPEN_BRACE)) {
do {
list.add (parse_member_initializer ());
} while (accept (TokenType.COMMA));
@@ -1568,19 +1523,6 @@ public class Vala.Parser : CodeVisitor {
}
if (!is_decl) {
- if (context.profile == Profile.DOVA && stmt is ReturnStatement) {
- // split
- // return foo;
- // into
- // result = foo;
- // return;
- var ret_stmt = (ReturnStatement) stmt;
- if (ret_stmt.return_expression != null) {
- var assignment = new Assignment (new MemberAccess.simple ("result", stmt.source_reference), ret_stmt.return_expression, AssignmentOperator.SIMPLE, stmt.source_reference);
- ret_stmt.return_expression = null;
- block.add_statement (new ExpressionStatement (assignment, stmt.source_reference));
- }
- }
block.add_statement (stmt);
}
} catch (ParseError e) {
@@ -1683,19 +1625,6 @@ public class Vala.Parser : CodeVisitor {
var block = new Block (get_src (get_location ()));
var stmt = parse_embedded_statement_without_block ();
- if (context.profile == Profile.DOVA && stmt is ReturnStatement) {
- // split
- // return foo;
- // into
- // result = foo;
- // return;
- var ret_stmt = (ReturnStatement) stmt;
- if (ret_stmt.return_expression != null) {
- var assignment = new Assignment (new MemberAccess.simple ("result"), ret_stmt.return_expression);
- ret_stmt.return_expression = null;
- block.add_statement (new ExpressionStatement (assignment));
- }
- }
block.add_statement (stmt);
return block;
@@ -2187,7 +2116,7 @@ public class Vala.Parser : CodeVisitor {
method.body.source_reference.end = get_current_src ().end;
- if (!context.experimental && context.profile != Profile.DOVA) {
+ if (!context.experimental) {
Report.warning (method.source_reference, "main blocks are experimental");
}
@@ -2576,9 +2505,6 @@ public class Vala.Parser : CodeVisitor {
var begin = get_location ();
var access = parse_access_modifier ();
var flags = parse_member_declaration_modifiers ();
- if (context.profile == Profile.DOVA) {
- accept (TokenType.VOLATILE);
- }
var type = parse_type (true, true);
string id = parse_identifier ();
@@ -2627,58 +2553,6 @@ public class Vala.Parser : CodeVisitor {
return initializer;
}
- ListLiteral parse_list_literal () throws ParseError {
- var begin = get_location ();
- expect (TokenType.OPEN_BRACKET);
- var initializer = new ListLiteral (get_src (begin));
- if (current () != TokenType.CLOSE_BRACKET) {
- do {
- var init = parse_expression ();
- initializer.add_expression (init);
- } while (accept (TokenType.COMMA));
- }
- expect (TokenType.CLOSE_BRACKET);
- return initializer;
- }
-
- Expression parse_set_literal () throws ParseError {
- var begin = get_location ();
- expect (TokenType.OPEN_BRACE);
- var set = new SetLiteral (get_src (begin));
- bool first = true;
- if (current () != TokenType.CLOSE_BRACE) {
- do {
- var expr = parse_expression ();
- if (first && accept (TokenType.COLON)) {
- // found colon after expression, it's a map
- rollback (begin);
- return parse_map_literal ();
- }
- first = false;
- set.add_expression (expr);
- } while (accept (TokenType.COMMA));
- }
- expect (TokenType.CLOSE_BRACE);
- return set;
- }
-
- Expression parse_map_literal () throws ParseError {
- var begin = get_location ();
- expect (TokenType.OPEN_BRACE);
- var map = new MapLiteral (get_src (begin));
- if (current () != TokenType.CLOSE_BRACE) {
- do {
- var key = parse_expression ();
- map.add_key (key);
- expect (TokenType.COLON);
- var value = parse_expression ();
- map.add_value (value);
- } while (accept (TokenType.COMMA));
- }
- expect (TokenType.CLOSE_BRACE);
- return map;
- }
-
void parse_method_declaration (Symbol parent, List<Attribute>? attrs) throws ParseError {
var begin = get_location ();
var access = parse_access_modifier ();
@@ -2741,21 +2615,10 @@ public class Vala.Parser : CodeVisitor {
} while (accept (TokenType.COMMA));
}
expect (TokenType.CLOSE_PARENS);
- if (context.profile == Profile.DOVA) {
- var error_type = new UnresolvedType.from_symbol (new UnresolvedSymbol (new UnresolvedSymbol (null, "Dova"), "Error"), method.source_reference);
- method.add_error_type (error_type);
- if (accept (TokenType.THROWS)) {
- do {
- parse_type (true, false);
- } while (accept (TokenType.COMMA));
- Report.warning (method.source_reference, "`throws' is ignored in the Dova profile");
- }
- } else {
- if (accept (TokenType.THROWS)) {
- do {
- method.add_error_type (parse_type (true, false));
- } while (accept (TokenType.COMMA));
- }
+ if (accept (TokenType.THROWS)) {
+ do {
+ method.add_error_type (parse_type (true, false));
+ } while (accept (TokenType.COMMA));
}
while (accept (TokenType.REQUIRES)) {
expect (TokenType.OPEN_PARENS);
@@ -2783,9 +2646,7 @@ public class Vala.Parser : CodeVisitor {
var type = parse_type (true, true);
bool getter_owned = false;
- if (context.profile == Profile.DOVA) {
- getter_owned = true;
- } else if (accept (TokenType.HASH)) {
+ if (accept (TokenType.HASH)) {
if (!context.deprecated) {
Report.warning (get_last_src (), "deprecated syntax, use `owned` modifier before `get'");
}
@@ -2819,14 +2680,11 @@ public class Vala.Parser : CodeVisitor {
if (ModifierFlags.EXTERN in flags || scanner.source_file.file_type == SourceFileType.PACKAGE) {
prop.external = true;
}
- if (context.profile == Profile.DOVA) {
- } else {
- if (accept (TokenType.THROWS)) {
- do {
- prop.add_error_type (parse_type (true, false));
- } while (accept (TokenType.COMMA));
- Report.error (prop.source_reference, "properties throwing errors are not supported yet");
- }
+ if (accept (TokenType.THROWS)) {
+ do {
+ prop.add_error_type (parse_type (true, false));
+ } while (accept (TokenType.COMMA));
+ Report.error (prop.source_reference, "properties throwing errors are not supported yet");
}
expect (TokenType.OPEN_BRACE);
while (current () != TokenType.CLOSE_BRACE) {
@@ -2845,7 +2703,7 @@ public class Vala.Parser : CodeVisitor {
var accessor_access = parse_access_modifier (SymbolAccessibility.PUBLIC);
var value_type = type.copy ();
- value_type.value_owned = (context.profile != Profile.DOVA && accept (TokenType.OWNED));
+ value_type.value_owned = accept (TokenType.OWNED);
if (accept (TokenType.GET)) {
if (prop.get_accessor != null) {
@@ -3292,9 +3150,6 @@ public class Vala.Parser : CodeVisitor {
direction = ParameterDirection.REF;
}
- if (context.profile == Profile.DOVA) {
- accept (TokenType.VOLATILE);
- }
DataType type;
if (direction == ParameterDirection.IN) {
// in parameters are unowned by default
@@ -3353,21 +3208,10 @@ public class Vala.Parser : CodeVisitor {
} while (accept (TokenType.COMMA));
}
expect (TokenType.CLOSE_PARENS);
- if (context.profile == Profile.DOVA) {
- var error_type = new UnresolvedType.from_symbol (new UnresolvedSymbol (new UnresolvedSymbol (null, "Dova"), "Error"), method.source_reference);
- method.add_error_type (error_type);
- if (accept (TokenType.THROWS)) {
- do {
- parse_type (true, false);
- } while (accept (TokenType.COMMA));
- Report.warning (method.source_reference, "`throws' is ignored in the Dova profile");
- }
- } else {
- if (accept (TokenType.THROWS)) {
- do {
- method.add_error_type (parse_type (true, false));
- } while (accept (TokenType.COMMA));
- }
+ if (accept (TokenType.THROWS)) {
+ do {
+ method.add_error_type (parse_type (true, false));
+ } while (accept (TokenType.COMMA));
}
while (accept (TokenType.REQUIRES)) {
expect (TokenType.OPEN_PARENS);
@@ -3425,21 +3269,10 @@ public class Vala.Parser : CodeVisitor {
} while (accept (TokenType.COMMA));
}
expect (TokenType.CLOSE_PARENS);
- if (context.profile == Profile.DOVA) {
- var error_type = new UnresolvedType.from_symbol (new UnresolvedSymbol (new UnresolvedSymbol (null, "Dova"), "Error"), d.source_reference);
- d.add_error_type (error_type);
- if (accept (TokenType.THROWS)) {
- do {
- parse_type (true, false);
- } while (accept (TokenType.COMMA));
- Report.warning (d.source_reference, "`throws' is ignored in the Dova profile");
- }
- } else {
- if (accept (TokenType.THROWS)) {
- do {
- d.add_error_type (parse_type (true, false));
- } while (accept (TokenType.COMMA));
- }
+ if (accept (TokenType.THROWS)) {
+ do {
+ d.add_error_type (parse_type (true, false));
+ } while (accept (TokenType.COMMA));
}
expect (TokenType.SEMICOLON);
diff --git a/vala/valapointertype.vala b/vala/valapointertype.vala
index fce8e9b..d0f938d 100644
--- a/vala/valapointertype.vala
+++ b/vala/valapointertype.vala
@@ -92,17 +92,7 @@ public class Vala.PointerType : DataType {
}
public override Symbol? get_member (string member_name) {
- if (CodeContext.get ().profile != Profile.DOVA) {
- return null;
- }
-
- Symbol base_symbol = base_type.data_type;
-
- if (base_symbol == null) {
- return null;
- }
-
- return SemanticAnalyzer.symbol_lookup_inherited (base_symbol, member_name);
+ return null;
}
public override Symbol? get_pointer_member (string member_name) {
diff --git a/vala/valaprofile.vala b/vala/valaprofile.vala
index 5210826..677930f 100644
--- a/vala/valaprofile.vala
+++ b/vala/valaprofile.vala
@@ -22,6 +22,5 @@
public enum Vala.Profile {
POSIX,
- GOBJECT,
- DOVA
+ GOBJECT
}
diff --git a/vala/valapropertyaccessor.vala b/vala/valapropertyaccessor.vala
index 47a1977..466fe6c 100644
--- a/vala/valapropertyaccessor.vala
+++ b/vala/valapropertyaccessor.vala
@@ -143,12 +143,7 @@ public class Vala.PropertyAccessor : Subroutine {
body = new Block (source_reference);
var ma = new MemberAccess.simple ("_%s".printf (prop.name), source_reference);
if (readable) {
- if (context.profile == Profile.DOVA) {
- body.add_statement (new ExpressionStatement (new Assignment (new MemberAccess.simple ("result", source_reference), ma, AssignmentOperator.SIMPLE, source_reference), source_reference));
- body.add_statement (new ReturnStatement (null, source_reference));
- } else {
- body.add_statement (new ReturnStatement (ma, source_reference));
- }
+ body.add_statement (new ReturnStatement (ma, source_reference));
} else {
Expression value = new MemberAccess.simple ("value", source_reference);
if (value_type.value_owned) {
@@ -161,23 +156,16 @@ public class Vala.PropertyAccessor : Subroutine {
}
if (body != null) {
- if (readable && context.profile == Profile.DOVA) {
- result_var = new LocalVariable (value_type.copy (), "result", null, source_reference);
- result_var.is_result = true;
-
- result_var.check (context);
- } else if (writable || construction) {
+ if (writable || construction) {
value_parameter = new Parameter ("value", value_type, source_reference);
body.scope.add (value_parameter.name, value_parameter);
}
body.check (context);
- if (context.profile != Profile.DOVA) {
- foreach (DataType body_error_type in body.get_error_types ()) {
- if (!((ErrorType) body_error_type).dynamic_error) {
- Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
- }
+ foreach (DataType body_error_type in body.get_error_types ()) {
+ if (!((ErrorType) body_error_type).dynamic_error) {
+ Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
}
}
}
diff --git a/vala/valarealliteral.vala b/vala/valarealliteral.vala
index 0acfb88..0dc01ad 100644
--- a/vala/valarealliteral.vala
+++ b/vala/valarealliteral.vala
@@ -78,7 +78,7 @@ public class Vala.RealLiteral : Literal {
checked = true;
var st = (Struct) context.analyzer.root_symbol.scope.lookup (get_type_name ());
- // ensure attributes are already processed in case of bootstrapping dova-core
+ // ensure attributes are already processed
st.check (context);
value_type = new FloatingType (st);
diff --git a/vala/valareturnstatement.vala b/vala/valareturnstatement.vala
index 6a53705..e407aec 100644
--- a/vala/valareturnstatement.vala
+++ b/vala/valareturnstatement.vala
@@ -93,11 +93,6 @@ public class Vala.ReturnStatement : CodeNode, Statement {
return false;
}
- if (context.profile == Profile.DOVA) {
- // no return expressions in Dova profile
- return !error;
- }
-
if (return_expression == null) {
if (!(context.analyzer.current_return_type is VoidType)) {
error = true;
diff --git a/vala/valascanner.vala b/vala/valascanner.vala
index 926a537..ba47369 100644
--- a/vala/valascanner.vala
+++ b/vala/valascanner.vala
@@ -774,7 +774,7 @@ public class Vala.Scanner {
len++;
}
type = get_identifier_or_keyword (begin, len);
- } else if (current[0] == '@' && source_file.context.profile != Profile.DOVA) {
+ } else if (current[0] == '@') {
if (current < end - 1 && current[1] == '"') {
type = TokenType.OPEN_TEMPLATE;
current += 2;
@@ -1129,13 +1129,6 @@ public class Vala.Scanner {
column = 1;
token_length_in_chars = 1;
} else {
- if (type == TokenType.STRING_LITERAL && source_file.context.profile == Profile.DOVA && current[0] == '$') {
- // string template
- type = TokenType.OPEN_TEMPLATE;
- current = begin;
- state_stack += State.TEMPLATE;
- break;
- }
unichar u = ((string) current).get_char_validated ((long) (end - current));
if (u != (unichar) (-1)) {
current += u.to_utf8 (null);
diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala
index 5e8c4f5..3d66b56 100644
--- a/vala/valasemanticanalyzer.vala
+++ b/vala/valasemanticanalyzer.vala
@@ -186,22 +186,15 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
int_type = new IntegerType ((Struct) root_symbol.scope.lookup ("int"));
uint_type = new IntegerType ((Struct) root_symbol.scope.lookup ("uint"));
- if (context.profile != Profile.DOVA) {
- uchar_type = new IntegerType ((Struct) root_symbol.scope.lookup ("uchar"));
- int8_type = new IntegerType ((Struct) root_symbol.scope.lookup ("int8"));
- short_type = new IntegerType ((Struct) root_symbol.scope.lookup ("short"));
- ushort_type = new IntegerType ((Struct) root_symbol.scope.lookup ("ushort"));
- long_type = new IntegerType ((Struct) root_symbol.scope.lookup ("long"));
- ulong_type = new IntegerType ((Struct) root_symbol.scope.lookup ("ulong"));
- size_t_type = new IntegerType ((Struct) root_symbol.scope.lookup ("size_t"));
- ssize_t_type = new IntegerType ((Struct) root_symbol.scope.lookup ("ssize_t"));
- double_type = new FloatingType ((Struct) root_symbol.scope.lookup ("double"));
- } else {
- long_type = int_type;
- ulong_type = uint_type;
- size_t_type = uint_type;
- ssize_t_type = int_type;
- }
+ uchar_type = new IntegerType ((Struct) root_symbol.scope.lookup ("uchar"));
+ int8_type = new IntegerType ((Struct) root_symbol.scope.lookup ("int8"));
+ short_type = new IntegerType ((Struct) root_symbol.scope.lookup ("short"));
+ ushort_type = new IntegerType ((Struct) root_symbol.scope.lookup ("ushort"));
+ long_type = new IntegerType ((Struct) root_symbol.scope.lookup ("long"));
+ ulong_type = new IntegerType ((Struct) root_symbol.scope.lookup ("ulong"));
+ size_t_type = new IntegerType ((Struct) root_symbol.scope.lookup ("size_t"));
+ ssize_t_type = new IntegerType ((Struct) root_symbol.scope.lookup ("ssize_t"));
+ double_type = new FloatingType ((Struct) root_symbol.scope.lookup ("double"));
var unichar_struct = (Struct) root_symbol.scope.lookup ("unichar");
if (unichar_struct != null) {
@@ -223,14 +216,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
gerror_type = (Class) glib_ns.scope.lookup ("Error");
regex_type = new ObjectType ((Class) root_symbol.scope.lookup ("GLib").scope.lookup ("Regex"));
- } else if (context.profile == Profile.DOVA) {
- var dova_ns = root_symbol.scope.lookup ("Dova");
-
- object_type = (Class) dova_ns.scope.lookup ("Object");
- type_type = new ObjectType ((Class) dova_ns.scope.lookup ("Type"));
- list_type = new ObjectType ((Class) dova_ns.scope.lookup ("List"));
- tuple_type = new ObjectType ((Class) dova_ns.scope.lookup ("Tuple"));
- error_type = new ObjectType ((Class) dova_ns.scope.lookup ("Error"));
}
current_symbol = root_symbol;
@@ -631,14 +616,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
instance_type = instance_pointer_type.base_type;
}
- if (CodeContext.get ().profile == Profile.DOVA) {
- while (instance_type is ArrayType) {
- var instance_array_type = (ArrayType) instance_type;
- instance_type = new ObjectType ((Class) CodeContext.get ().root.scope.lookup ("Dova").scope.lookup ("Array"));
- instance_type.add_type_argument (instance_array_type.element_type);
- }
- }
-
if (instance_type is DelegateType && ((DelegateType) instance_type).delegate_symbol == type_symbol) {
return instance_type;
} else if (instance_type.data_type == type_symbol) {
diff --git a/vala/valastruct.vala b/vala/valastruct.vala
index f913a01..b9229e0 100644
--- a/vala/valastruct.vala
+++ b/vala/valastruct.vala
@@ -207,7 +207,7 @@ public class Vala.Struct : TypeSymbol {
m.this_parameter = new Parameter ("this", SemanticAnalyzer.get_data_type_for_symbol (this));
m.scope.add (m.this_parameter.name, m.this_parameter);
}
- if (!(m.return_type is VoidType) && (CodeContext.get ().profile == Profile.DOVA || m.get_postconditions ().size > 0)) {
+ if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
m.result_var = new LocalVariable (m.return_type.copy (), "result", null, source_reference);
m.result_var.is_result = true;
}
@@ -407,9 +407,6 @@ public class Vala.Struct : TypeSymbol {
* instances are passed by value.
*/
public bool is_simple_type () {
- if (CodeContext.get ().profile == Profile.DOVA) {
- return true;
- }
var st = base_struct;
if (st != null && st.is_simple_type ()) {
return true;
diff --git a/vala/valasymbolresolver.vala b/vala/valasymbolresolver.vala
index f11d74e..a269df4 100644
--- a/vala/valasymbolresolver.vala
+++ b/vala/valasymbolresolver.vala
@@ -75,18 +75,6 @@ public class Vala.SymbolResolver : CodeVisitor {
}
}
- if (context.profile == Profile.DOVA) {
- // classes derive from Object by default
- if (cl.base_class == null) {
- var any_class = (Class) root_symbol.scope.lookup ("any");
- if (cl != any_class) {
- var object_class = (Class) root_symbol.scope.lookup ("Dova").scope.lookup ("Object");
- cl.add_base_type (new ObjectType (object_class));
- cl.base_class = object_class;
- }
- }
- }
-
current_scope = current_scope.parent_scope;
}
@@ -122,14 +110,6 @@ public class Vala.SymbolResolver : CodeVisitor {
}
}
- if (context.profile == Profile.DOVA) {
- // all interfaces require Object
- if (iface.get_prerequisites ().size == 0) {
- var object_class = (Class) root_symbol.scope.lookup ("Dova").scope.lookup ("Object");
- iface.add_prerequisite (new ObjectType (object_class));
- }
- }
-
current_scope = current_scope.parent_scope;
}
@@ -483,18 +463,6 @@ public class Vala.SymbolResolver : CodeVisitor {
tmpl.accept_children (this);
}
- public override void visit_list_literal (ListLiteral lit) {
- lit.accept_children (this);
- }
-
- public override void visit_set_literal (SetLiteral lit) {
- lit.accept_children (this);
- }
-
- public override void visit_map_literal (MapLiteral lit) {
- lit.accept_children (this);
- }
-
public override void visit_tuple (Tuple tuple) {
tuple.accept_children (this);
}
diff --git a/vala/valatemplate.vala b/vala/valatemplate.vala
index d11c0c8..5e27a7b 100644
--- a/vala/valatemplate.vala
+++ b/vala/valatemplate.vala
@@ -72,18 +72,11 @@ public class Vala.Template : Expression {
} else {
expr = stringify (expression_list[0]);
if (expression_list.size > 1) {
- if (context.profile == Profile.DOVA) {
- // varargs concat not yet supported
- for (int i = 1; i < expression_list.size; i++) {
- expr = new BinaryExpression (BinaryOperator.PLUS, expr, stringify (expression_list[i]), source_reference);
- }
- } else {
- var concat = new MethodCall (new MemberAccess (expr, "concat", source_reference), source_reference);
- for (int i = 1; i < expression_list.size; i++) {
- concat.add_argument (stringify (expression_list[i]));
- }
- expr = concat;
+ var concat = new MethodCall (new MemberAccess (expr, "concat", source_reference), source_reference);
+ for (int i = 1; i < expression_list.size; i++) {
+ concat.add_argument (stringify (expression_list[i]));
}
+ expr = concat;
}
}
expr.target_type = target_type;
diff --git a/vala/valatuple.vala b/vala/valatuple.vala
index 852215a..d35795a 100644
--- a/vala/valatuple.vala
+++ b/vala/valatuple.vala
@@ -71,23 +71,9 @@ public class Vala.Tuple : Expression {
checked = true;
- if (context.profile != Profile.DOVA) {
- Report.error (source_reference, "tuples are not supported");
- error = true;
- return false;
- }
-
- value_type = new ObjectType ((Class) context.root.scope.lookup ("Dova").scope.lookup ("Tuple"));
- value_type.value_owned = true;
-
- foreach (var expr in expression_list) {
- if (!expr.check (context)) {
- return false;
- }
- value_type.add_type_argument (expr.value_type.copy ());
- }
-
- return !error;
+ Report.error (source_reference, "tuples are not supported");
+ error = true;
+ return false;
}
public override void emit (CodeGenerator codegen) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]