vala r2411 - in trunk: . vala
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2411 - in trunk: . vala
- Date: Fri, 30 Jan 2009 17:17:45 +0000 (UTC)
Author: juergbi
Date: Fri Jan 30 17:17:45 2009
New Revision: 2411
URL: http://svn.gnome.org/viewvc/vala?rev=2411&view=rev
Log:
2009-01-30 JÃrg Billeter <j bitron ch>
* vala/valanamespace.vala:
* vala/valaparser.vala:
Ensure that classes in implicit namespaces are not private as
namespaces cannot have private members
Modified:
trunk/ChangeLog
trunk/vala/valanamespace.vala
trunk/vala/valaparser.vala
Modified: trunk/vala/valanamespace.vala
==============================================================================
--- trunk/vala/valanamespace.vala (original)
+++ trunk/vala/valanamespace.vala Fri Jan 30 17:17:45 2009
@@ -1,6 +1,6 @@
/* valanamespace.vala
*
- * Copyright (C) 2006-2008 JÃrg Billeter
+ * Copyright (C) 2006-2009 JÃrg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -119,6 +119,11 @@
* @param cl a class
*/
public void add_class (Class cl) {
+ // namespaces do not support private memebers
+ if (cl.access == SymbolAccessibility.PRIVATE) {
+ cl.access = SymbolAccessibility.INTERNAL;
+ }
+
if (scope.lookup (cl.name) is Class) {
// merge
var old_class = (Class) scope.lookup (cl.name);
@@ -151,6 +156,11 @@
* @param iface an interface
*/
public void add_interface (Interface iface) {
+ // namespaces do not support private memebers
+ if (iface.access == SymbolAccessibility.PRIVATE) {
+ iface.access = SymbolAccessibility.INTERNAL;
+ }
+
interfaces.add (iface);
scope.add (iface.name, iface);
}
@@ -161,6 +171,11 @@
* @param st a struct
*/
public void add_struct (Struct st) {
+ // namespaces do not support private memebers
+ if (st.access == SymbolAccessibility.PRIVATE) {
+ st.access = SymbolAccessibility.INTERNAL;
+ }
+
structs.add (st);
scope.add (st.name, st);
}
@@ -181,6 +196,11 @@
* @param en an enum
*/
public void add_enum (Enum en) {
+ // namespaces do not support private memebers
+ if (en.access == SymbolAccessibility.PRIVATE) {
+ en.access = SymbolAccessibility.INTERNAL;
+ }
+
enums.add (en);
scope.add (en.name, en);
}
@@ -191,6 +211,11 @@
* @param edomain an error domain
*/
public void add_error_domain (ErrorDomain edomain) {
+ // namespaces do not support private memebers
+ if (edomain.access == SymbolAccessibility.PRIVATE) {
+ edomain.access = SymbolAccessibility.INTERNAL;
+ }
+
error_domains.add (edomain);
scope.add (edomain.name, edomain);
}
@@ -201,6 +226,11 @@
* @param d a delegate
*/
public void add_delegate (Delegate d) {
+ // namespaces do not support private memebers
+ if (d.access == SymbolAccessibility.PRIVATE) {
+ d.access = SymbolAccessibility.INTERNAL;
+ }
+
delegates.add (d);
scope.add (d.name, d);
}
@@ -292,6 +322,11 @@
* @param constant a constant
*/
public void add_constant (Constant constant) {
+ // namespaces do not support private memebers
+ if (constant.access == SymbolAccessibility.PRIVATE) {
+ constant.access = SymbolAccessibility.INTERNAL;
+ }
+
constants.add (constant);
scope.add (constant.name, constant);
}
@@ -302,6 +337,11 @@
* @param f a field
*/
public void add_field (Field f) {
+ // namespaces do not support private memebers
+ if (f.access == SymbolAccessibility.PRIVATE) {
+ f.access = SymbolAccessibility.INTERNAL;
+ }
+
if (f.binding == MemberBinding.INSTANCE) {
Report.error (f.source_reference, "instance members are not allowed outside of data types");
f.error = true;
@@ -322,6 +362,11 @@
* @param m a method
*/
public void add_method (Method m) {
+ // namespaces do not support private memebers
+ if (m.access == SymbolAccessibility.PRIVATE) {
+ m.access = SymbolAccessibility.INTERNAL;
+ }
+
if (m is CreationMethod) {
Report.error (m.source_reference, "construction methods may only be declared within classes and structs");
m.error = true;
Modified: trunk/vala/valaparser.vala
==============================================================================
--- trunk/vala/valaparser.vala (original)
+++ trunk/vala/valaparser.vala Fri Jan 30 17:17:45 2009
@@ -1913,11 +1913,6 @@
void parse_namespace_member (Namespace ns) throws ParseError {
var sym = parse_declaration ();
- // namespaces do not support private memebers
- if (sym.access == SymbolAccessibility.PRIVATE) {
- sym.access = SymbolAccessibility.INTERNAL;
- }
-
if (sym is Namespace) {
ns.add_namespace ((Namespace) sym);
} else if (sym is Class) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]