LeonardoHighlighter

it.grypho.scala.leonardo.cli.LeonardoHighlighter
class LeonardoHighlighter(schemeName: () => String) extends Highlighter

JLine Highlighter that token-colours the Leonardo prompt as the user types.

A single left-to-right scan classifies each character run as one of: := / :load / :save (operators / pseudo-commands), numeric literals, word tokens (command keyword, function, constant, or variable), and single-character operators and brackets. The active scheme is fetched via schemeName on every keystroke, so colors dark / colors light / colors none takes effect immediately.

reader is never used; call highlightBuffer directly in tests and tooling.

Attributes

Graph
Supertypes
trait Highlighter
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def highlight(reader: LineReader, buffer: String): AttributedString

Attributes

Definition Classes
Highlighter
def highlightBuffer(buffer: String): AttributedString

Colours buffer and returns an AttributedString for display.

Colours buffer and returns an AttributedString for display.

May be called directly in tests and tooling without a LineReader.

Value parameters

buffer

the raw input string to highlight

Attributes

Returns

the attributed (coloured) string ready for JLine output

override def setErrorIndex(errorIndex: Int): Unit

Attributes

Definition Classes
Highlighter
override def setErrorPattern(errorPattern: Pattern): Unit

Attributes

Definition Classes
Highlighter

Inherited methods

def refresh(x$0: LineReader): Unit

Attributes

Inherited from:
Highlighter