final class BisonTrivia
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

The text between two lexemes that carries no token of its own.

Whitespace and comments may appear anywhere a lexeme may, so treating them as lexemes would mean every scanner returning "nothing this time" and the lexer looping until one of them returned something. Skipping them first keeps every scanner's contract honest: it is asked to read a lexeme, and it always produces one.

Inside a semantic action the same comment forms appear but a bare slash is division rather than a mistake, so recognising a comment and requiring one are offered separately.

Methods§

public function skipFrom(SourceCursor $cursor): void
public function skipToEndOfLine(SourceCursor $cursor): bool

Consumes a line comment, stopping before the newline that ends it.

The newline is left behind because it is whitespace, and whitespace is skipped by the caller that owns the loop.

Parameters

$cursorSourceCursorCursor positioned on the opening slash

Returns

bool Always true
Test cases 4
Called from 1
Calls 2
public function skipToCommentClose(SourceCursor $cursor): bool

Consumes a block comment together with its terminator.

A comment left open by a truncated grammar ends at the end of the file.

Parameters

$cursorSourceCursorCursor positioned on the opening slash

Returns

bool Always true
Test cases 5
Called from 1
Calls 2

Test cases 28§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 11
Other tests reaching this symbol 17

Relations§

Instantiated in 2
Method calls 2
Type declarations 4