diff options
author | Martin Odersky <odersky@gmail.com> | 2009-12-21 17:30:23 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-12-21 17:30:23 +0000 |
commit | a326f40dbf25e50976d17a3a90bdd2dc5e37a87e (patch) | |
tree | ed48bea23d173cf7d751dd4f6089401e4f7e298d /src/compiler | |
parent | 21e3410dd162f2b78a2507c254c9d516291c3444 (diff) | |
download | scala-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')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/BracePatch.scala | 1 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Change.scala | 10 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Patch.scala | 8 |
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) + |