final class Canonical
Restricted visibility: declared "@visibility SqlSemantics\Platform\Sqlite". Code outside that scope must not name this declaration.

Reads the spelling a node has when it is rendered without a layout of its own.

Rule: CORE-SPELLING-001 (SQLite part). A layout is kept only where it differs from this spelling, so that a node rendered without a layout reads back without one, and a layout always records a spelling the rendering would not produce by itself. Layouts nested in the node keep their effect, as they do when the node is rendered. The trivia after a region belongs to its spelling only when it holds a comment: SQLite drops the whitespace at the end of a span (sqlite3DbSpanDup() in malloc.c), so whitespace alone spells nothing. Status: Implemented.

Constants§

public const SPACE = " \t\n\v\f\r"

The characters SQLite treats as whitespace (sqlite3Isspace()).

Methods§

public function trail(string $trivia): string

Answers the part of the trivia after a region that its spelling keeps: all of it when it holds a comment, nothing when it is whitespace alone.

Parameters

$triviastring

Returns

string
Test cases 1
Called from 2
Calls 2
public function span(Layout $layout): string

Answers the text a region of a layout names: its tokens and the trivia after them, without the whitespace at the end.

Parameters

$layoutLayout

Returns

string
Test cases 1
Called from 1
Calls 3
public function same(Layout $left, Layout $right): bool

Test cases 5§

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

Dedicated tests 5

Relations§

Instantiated in 6
Method calls 8