8.18
5.5 Tool Support🔗ℹ
Librraies such as shrubbery/syntax-color and
shrubbery/indentation provide tools for working with
shrubbery-based programs. They generally follow DrRacket’s protocols,
but they are also intended to support other tools where the protocols
can be adapted.
5.5.1 Language Configuration🔗ℹ
The (submod shrubbery reader) module provides
read, read-syntax, and "get-info"
functions as normal for a reader submodule, but
read and read-syntax accept an extra
#:variant argument in the sense of
shrubbery/variant. To better cooperate with new
languages that are defined with syntax/module-reader,
the (submod shrubbery reader) module also provides
get-info-proc and make-get-info-proc.
Returns a procedure like
get-info-proc, but with
variant already supplied as the
#:variant argument.
5.5.2 Syntax Coloring🔗ℹ
Like
shrubbery-lexer, but starting in “text” mode as if
surrounded by an
@ form and inside the form’s
{
and
}.
5.5.3 Indentation🔗ℹ
Returns a suggested indentation for the line containing
pos in
text following a protocol
used by DrRacket, but with several
extra options described below. The result includes an integer and a
string only when tab characters force a description of indentation in
terms of tab and space characters.
If the current indentation matches a valid indentation but others are
possible, the result when multi? is #f corresponds to
the next valid indentation in a sequence of possibilities.
multi?: Returns all possible indentations, instead of
just the first one.
always?: When #f, returns the line’s current
indentation if that indentation is valid, instead of cycling to the next
valid indentation. This argument is provided as #f when
indenting for a newly created line, for example.
reverse?: When true, causes the a sequence of valid
indentations to be used or returned in reverse order. See
shrubbery-range-indentation/reverse-choices for more information
about the default order.
stop-pos: Indicates a position in text where
indentation should stop inspecting, instead of considering the effect of
earlier characters.
variant: See shrubbery/variant.
By default, non-reversed indentation choices cycle left-to-right. If
the 'shrubbery:tab-right-to-left preference (in the sense of
get-preference) is set to a true value, then non-reversed
indentation choices cycle right-to-left.
5.5.4 Term and Group Navigation🔗ℹ
Returns navigation guidance starting at
pos in
text following a protocol
used by DrRacket.
5.5.5 Keystrokes🔗ℹ
Extra keystrokes suitable for shrubbery forms following a protocol
used by DrRacket.
Returns a list like
shrubbery-keystrokes, but suitable for a
form of shrubbery notation selected by
variant.