prolog_colour.pl -- Prolog syntax colouring support.
This module defines reusable code to colourise Prolog source.
- prolog_colourise_stream(+Stream, +SourceID, :ColourItem) is det
- prolog_colourise_stream(+Stream, +SourceID, :ColourItem, +Opts) is det
- Determine colour fragments for the data on Stream. SourceID is
the canonical identifier of the input as known to the
cross-referencer, i.e., as created using
xref_source(SourceID)
.ColourItem is a closure that is called for each identified fragment with three additional arguments:
- The syntactical category
- Start position (character offset) of the fragment
- Length of the fragment (in characters).
Options
- operators(+Ops)
- Provide an initial list of additional operators.
- prolog_colourise_query(+Query:string, +SourceId, :ColourItem)
- Colourise a query, to be executed in the context of SourceId.
- prolog_colourise_term(+Stream, +SourceID, :ColourItem, +Options)
- Colourise the next term on Stream. Unlike
prolog_colourise_stream/3, this predicate assumes it is reading
a single term rather than the entire stream. This implies that
it cannot adjust syntax according to directives that precede it.
Options:
- subterm_positions(-TermPos)
- Return complete term-layout. If an error is read, this is a
term
error_position(StartClause, EndClause, ErrorPos)
- vararg_goal_classification(+Name, +Arity, -Class) is semidet[multifile]
- Multifile hookable classification for vararg predicates.
- syntax_colour(?Class, ?Attributes) is nondet
- True when a range classified Class must be coloured using
Attributes. Attributes is a list of:
colour(ColourName)
background(ColourName)
bold(Boolean)
underline(Boolean)
Attributes may be the empty list. This is used for cases where -for example- a menu is associated with the fragment. If syntax_colour/2 fails, no fragment is created for the region.
Undocumented predicates
The following predicates are exported, but not or incorrectly documented.