summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2004-03-11 13:48:54 +0000
committerburaq <buraq@epfl.ch>2004-03-11 13:48:54 +0000
commit6bee9bc8b0b74751e1e8e818293bb6f5015fd4b5 (patch)
tree44d60d87f4c8223648948434d8753abbb9923cc4 /sources
parent95f6a43b4cddf32251bf19aca9ac6ab581a203a7 (diff)
downloadscala-6bee9bc8b0b74751e1e8e818293bb6f5015fd4b5.tar.gz
scala-6bee9bc8b0b74751e1e8e818293bb6f5015fd4b5.tar.bz2
scala-6bee9bc8b0b74751e1e8e818293bb6f5015fd4b5.zip
removed xml stuff
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/Predef.scala2
-rw-r--r--sources/scala/Symbol.scala76
2 files changed, 5 insertions, 73 deletions
diff --git a/sources/scala/Predef.scala b/sources/scala/Predef.scala
index 093330c3c5..6bc8e8c82a 100644
--- a/sources/scala/Predef.scala
+++ b/sources/scala/Predef.scala
@@ -65,8 +65,6 @@ object Predef {
def fst[a](x: a, y: Any): a = x;
def scd[a](x: Any, y: a): a = y;
- val Text = scala.xml.Text;
-
type Function[-a,+b] = Function1[a,b];
}
diff --git a/sources/scala/Symbol.scala b/sources/scala/Symbol.scala
index 2c038761f5..1d6bfe6fbb 100644
--- a/sources/scala/Symbol.scala
+++ b/sources/scala/Symbol.scala
@@ -9,89 +9,23 @@
package scala;
-import org.xml.sax.InputSource;
-
-import scala.xml.{AttributedNode,Node,NodeSeq, Text,Utility};
-import scala.collection.immutable.Map;
-import scala.collection.immutable.ListMap;
-
-
/** Instances of <code>Symbol</code> can be created easily with
* Scala's built-in quote mechanism. For instance, the Scala term
* <code>'mysym</code> will invoke the constructor of the
* <code>Symbol</code> class in the following way:
- * <code>new Symbol("mysym", Nil)</code>. The Scala term <code>'mysym('foo,'bar)</code>
- * will be treated as
- * <code>new Symbol("mysym", List(new Symbol("foo",Nil), new Symbol("bar",Nil)</code>.
+ * <code>new Symbol("mysym")</code>. .
*
- * @author Burak Emir, Martin Odersky
- * @version 1.5, 08/12/2003
+ * @author Martin Odersky
+ * @version 1.7, 08/12/2003
*/
-case class Symbol(name: String, elems: Any*) extends AttributedNode {
-
- /** Returns the symbol name as a string.
- */
- def label: String = name;
-
- /** Returns the list of children of this symbol.
- */
- def children: NodeSeq = new NodeSeq( List.fromIterator(
- elems.elements map ( x => x match {
- case n:Node => n;
- case _ => Text(x.toString());
- })));
-
- //private val attrMap: ListMap[String, String] = ListMap.Empty[String,String];
-
- /** Returns a map representing the attributes of this node.
- */
- def attributes: Map[String, String] = ListMap.Empty;
+case class Symbol( name: String ) {
/** Converts this symbol to a string
*/
override def toString(): String = {
- val s = new StringBuffer("'" + name) ;
- val it = elems.elements;
- if( it.hasNext ) {
- s.append("(");
- val e1 = it.next.toString();
- s.append( e1 );
- for( val e <- it ) {
- s.append(','); s.append( e.toString() );
- }
- s.append(")");
- }
- s.toString();
- }
-
- /** returns a new symbol with updated attributes
- */
- final def %(attrs: List[Pair[String, String]]): Symbol = new Symbol( name, elems:_* ) {
- val themap = Symbol.this.attributes.incl( attrs );
- override def attributes = themap;
- }
-
- /** returns a new symbol with updated attribute
- */
- final def %(attr: Pair[String, String]): Symbol = new Symbol( name, elems:_* ) {
- val themap = Symbol.this.attributes.incl( attr );
- override def attributes = themap;
+ "'" + name
}
final def <=(value: String) = new Pair(name, value);
- final def saveTo(filename:String) = Symbol_IO.save(filename, this);
-}
-
-object Symbol_IO {
- // functions for generic symbol loading, saving
-
- /** loads symbol from a given file
- */
- def load( source:InputSource ):Symbol = scala.xml.nobinding.XML.load( source );
-
- /** saves symbol to filename (with encoding ISO-8859-1)
- */
- def save( filename:String, doc:Symbol ):Unit = scala.xml.nobinding.XML.save( filename, doc );
-
}