EscapeParser class

EscapeParser translates control characters and escape sequences into function calls that the terminal can handle.

Design goals:

  • Zero object allocation during processing.
  • Persistent state: an escape sequence split across write calls is parsed incrementally. The partially parsed state is kept between calls, so the completed prefix is never rolled back and re-parsed.

Constructors

EscapeParser(EscapeHandler handler)

Properties

handler EscapeHandler
final
hashCode int
The hash code for this object.
no setterinherited
hasPendingInput bool
Whether the parser is holding back input from previous write calls: an incomplete escape sequence or the high half of a surrogate pair split across chunks. While this is true, new input must go through the parser so the held-back bytes are not reordered behind it.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokenBegin int
Start of sequence or character being processed. Useful for debugging.
getter/setter pair
tokenEnd int
End of sequence or character being processed. Useful for debugging. While a sequence is incomplete this stays at the sequence start, so a held-back sequence does not advance the token position.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
write(String chunk) → void
writeCodepoints(List<int> codepoints) → void
Feeds already-decoded Unicode code points into the parser, taking ownership of codepoints: the caller must not mutate or reuse the list afterwards. This is the entry point of the byte-level input path (Terminal.writeBytes), where UTF-8 decoding happens upstream of the parser and no String materializes at all.

Operators

operator ==(Object other) bool
The equality operator.
inherited