Src

class Src(val text: String)

Iterator through a string representing test data, primarily used as input to Parsers.

Note that the iterator normally contains all the test data for all the tests, not just the data for a single test. This "global" Src is maintained in hwtest.hw.

The Src iterator is primarly used as input to Parsers.

Note: Although Src is conceptually an iterator implementing the standard hasNext and next() methods, it does NOT inherit from the Iterator trait.

Value parameters:
text

the test data as a String

class Object
trait Matchable
class Any

Value members

Concrete methods

def endOfTest(): Boolean

Is this the end of the current test (as indicated by a $ in the source)?

Is this the end of the current test (as indicated by a $ in the source)?

Consumes the $.

def hasNext: Boolean

Tests whether this source contains another character.

Tests whether this source contains another character.

def hasSignificant: Boolean

Tests whether this source contains another significant character (non-whitespace, non-comment).

Tests whether this source contains another significant character (non-whitespace, non-comment).

def head: Char

Returns the next character, without consuming it. Returns '$' if source is empty.

Returns the next character, without consuming it. Returns '$' if source is empty.

def next(): Char

Returns the next character, consuming it. Returns '$' if source is empty.

Returns the next character, consuming it. Returns '$' if source is empty.

def skipWhite(): Unit

Discards whitespace--including comments--until the next non-whitespace character (or the end of the source).

Discards whitespace--including comments--until the next non-whitespace character (or the end of the source).

Comments count as whitespace, from a # to the nearest \n or \r, after which it skips more whitespace (including the \n in a \r\n).

Concrete fields

val text: String