WhitespacePreprocessor

class WhitespacePreprocessor extends String => String

Processes whitespace, removing or replacing most whitespace characters except for newline and space.

It modifies string input in the following ways:

  • Replaces all occurrences of tabs with the corresponding number of spaces, depending on the column the tab is placed in and the configured tabStops value.

  • Removes any return character.

  • Replaces form feed and vertical tab with spaces.

The processor should run on text input before it is passed to the actual parsers as they would not be able to deal with tabs properly.

Companion:
object
trait String => String
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply(input: String): String

Processes whitespace, removing or replacing most whitespace characters except for newline and space.

Processes whitespace, removing or replacing most whitespace characters except for newline and space.

Inherited methods

@unspecialized
def andThen[A](g: String => A): String => A
Inherited from:
Function1
@unspecialized
def compose[A](g: A => String): A => String
Inherited from:
Function1
override def toString(): String
Definition Classes
Function1 -> Any
Inherited from:
Function1

Concrete fields

val tabStops: Int

The number of columns between tab stops.

The number of columns between tab stops.