Trait/Object

scala.tools.refactoring.util.SourceWithMarker

Movement

Related Docs: object Movement | package SourceWithMarker

Permalink

trait Movement extends SimpleMovement

A context dependent, directional movement that can be applied to a SourceWithMarker

Overview

Movements can be combined similar to parser combinators and optionally applied backwards. They are meant to be used to perform minor tweaks in already parsed source code that might be necessary due to compiler bugs or compiler API limitations.

Why not use parser combinators?

Examples

scala> import scala.tools.refactoring.util.SourceWithMarker
scala> import scala.tools.refactoring.util.SourceWithMarker._
scala> import scala.tools.refactoring.util.SourceWithMarker.Movements._

scala> val src = SourceWithMarker("private val /*---*/ x = 4".toCharArray)
src: scala.tools.refactoring.util.SourceWithMarker =

riv...
scala> val movement = ("private" | "protected") ~ commentsAndSpaces ~ "val" ~ commentsAndSpaces
scala> val srcAtx = src.moveMarker(movement)
srcAtx: scala.tools.refactoring.util.SourceWithMarker = ... <x> = ...
scala> val moveBackToVal = ("al" ~ commentsAndSpaces ~ "x").backward
scala> val srcAtVal = srcAtx.moveMarker(moveBackToVal)
srcAtVal:  scala.tools.refactoring.util.SourceWithMarker = ...te <v>al ...
Self Type
Movement
See also

Movements

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Movement
  2. SimpleMovement
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def apply(sourceWithMarker: SourceWithMarker): Option[Int]

    Permalink
    Definition Classes
    SimpleMovement
  2. abstract def backward: Movement

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. final def atLeastOnce: Movement

    Permalink
    Definition Classes
    MovementSimpleMovement
  6. final def atMostNtimes(n: Int): Movement

    Permalink
    Definition Classes
    MovementSimpleMovement
  7. final def butNot(mvnt: Movement): Movement

    Permalink
  8. def butNot(other: SimpleMovement): SimpleMovement

    Permalink
    Definition Classes
    SimpleMovement
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. final def nTimes(n: Int): Movement

    Permalink
    Definition Classes
    MovementSimpleMovement
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def optional: Movement

    Permalink
    Definition Classes
    MovementSimpleMovement
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def zeroOrMore: Movement

    Permalink
    Definition Classes
    MovementSimpleMovement
  27. final def |(other: Movement): Movement

    Permalink
  28. final def |(other: SimpleMovement): SimpleMovement

    Permalink
    Definition Classes
    SimpleMovement
  29. final def ~(other: Movement): Movement

    Permalink
  30. final def ~(other: SimpleMovement): SimpleMovement

    Permalink
    Definition Classes
    SimpleMovement

Inherited from SimpleMovement

Inherited from AnyRef

Inherited from Any

Ungrouped