summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/parser
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-12-21 17:30:23 +0000
committerMartin Odersky <odersky@gmail.com>2009-12-21 17:30:23 +0000
commita326f40dbf25e50976d17a3a90bdd2dc5e37a87e (patch)
treeed48bea23d173cf7d751dd4f6089401e4f7e298d /src/compiler/scala/tools/nsc/ast/parser
parent21e3410dd162f2b78a2507c254c9d516291c3444 (diff)
downloadscala-a326f40dbf25e50976d17a3a90bdd2dc5e37a87e.tar.gz
scala-a326f40dbf25e50976d17a3a90bdd2dc5e37a87e.tar.bz2
scala-a326f40dbf25e50976d17a3a90bdd2dc5e37a87e.zip
(1) Added some classes to allow arbitrary patch...
(1) Added some classes to allow arbitrary patches to source buffers. (These are not yet complete so do not need a review yet I think. (2) Avoided reflexive array operations in ScalaRunTime. review by (community.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/BracePatch.scala1
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Change.scala10
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Patch.scala8
3 files changed, 19 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/BracePatch.scala b/src/compiler/scala/tools/nsc/ast/parser/BracePatch.scala
index 0ef4374a9b..803f35d9cd 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/BracePatch.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/BracePatch.scala
@@ -10,3 +10,4 @@ package ast.parser
* @param inserted If true, brace needs to be inserted, otherwise brace needs to be deleted.
*/
case class BracePatch(off: Int, inserted: Boolean)
+extends Patch(off, if (inserted) Insertion("{") else Deletion(1)) \ No newline at end of file
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Change.scala b/src/compiler/scala/tools/nsc/ast/parser/Change.scala
new file mode 100644
index 0000000000..12f189ac6b
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/ast/parser/Change.scala
@@ -0,0 +1,10 @@
+/* NSC -- new Scala compiler
+ * Copyright 2005-2010 LAMP/EPFL
+ * @author Martin Odersky
+ */
+package scala.tools.nsc.ast.parser
+
+abstract class Change
+case class Insertion(text: String) extends Change
+case class Deletion(nchars: Int) extends Change
+
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Patch.scala b/src/compiler/scala/tools/nsc/ast/parser/Patch.scala
new file mode 100644
index 0000000000..a55f84151c
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/ast/parser/Patch.scala
@@ -0,0 +1,8 @@
+/* NSC -- new Scala compiler
+ * Copyright 2005-2010 LAMP/EPFL
+ * @author Martin Odersky
+ */
+package scala.tools.nsc.ast.parser
+
+class Patch(off: Int, change: Change)
+