8 Interface for Clients of Syntax Color Output

▼ |  | Syntax Color: Utilities

1 | Parenthesis Matching
2 | Lexer Contract and The Don’t-Stop Structure Type
3 | Racket Lexer
4 | Default Lexer
5 | Module Lexer
6 | Scribble Lexer
7 | Splay Tree for Tokenization
8 | Interface for Clients of Syntax Color Output
9 | Racket S-Expression Indentation and Navigation

On this page:

color-textoid<%>
get-text
get-character
last-position
position-paragraph
paragraph-start-position
paragraph-end-position
skip-whitespace
backward-match
backward-containing-sexp
forward-match
classify-position
classify-position*
get-token-range
get-backward-navigation-limit
get-regions

8.15
top contents ← prev up next →

### 8`` Interface for Clients of Syntax Color Output🔗ℹ

(require syntax-color/color-textoid)
| package: syntax-color-lib

Added in version 1.3 of package syntax-color-lib.

interface color-textoid<%> : interface?

The color-textoid<%> interface matches a subset of the color:text<%> interface. It specifies methods that indentation and expression-navigation functions can use so that they work either on actual color:text<%> objects or in other environments that use the start-colorer in color:text<%> protocol without racket/gui.

> > method (send a-color-textoid get-text [start end]) → string?
> > start : exact-nonnegative-integer? = 0
> > end : (or/c exact-nonnegative-integer? 'eof) = 'eof

> Like get-text in text%.

> > method (send a-color-textoid get-character start) → char?
> > start : exact-nonnegative-integer?

> Like get-character in text%.

> > method (send a-color-textoid last-position)
> > → exact-nonnegative-integer?

> Like last-position in text%.

> > > method
> > > (send a-color-textoid position-paragraph |  | start |
> > > | [ | at-eol?]) |
> > → exact-nonnegative-integer?
> > start : exact-nonnegative-integer?
> > at-eol? : any/c = #f

> Like position-paragraph in text%.

> > > method
> > > (send a-color-textoid paragraph-start-position |  | paragraph |
> > > | [ | visible?]) |
> > → exact-nonnegative-integer?
> > paragraph : exact-nonnegative-integer?
> > visible? : any/c = #t

> Like paragraph-start-position in text%.

> > > method
> > > (send a-color-textoid paragraph-end-position |  | paragraph |
> > > | [ | visible?]) |
> > → exact-nonnegative-integer?
> > paragraph : exact-nonnegative-integer?
> > visible? : any/c = #t

> Like paragraph-end-position in text%.

> > > method
> > > (send a-color-textoid skip-whitespace |  | position |
> > > |  | direction |
> > > |  | comments?) |
> > → exact-nonnegative-integer?
> > position : exact-nonnegative-integer?
> > direction : (or/c 'forward 'backward)
> > comments? : boolean?

> Like skip-whitespace in color:text<%>.

> > > method
> > > (send a-color-textoid backward-match |  | position |
> > > |  | cutoff) |
> > → (or/c exact-nonnegative-integer? #f)
> > position : exact-nonnegative-integer?
> > cutoff : exact-nonnegative-integer?

> Like backward-match in color:text<%>.

> > > method
> > > (send a-color-textoid backward-containing-sexp |  | position |
> > > |  | cutoff) |
> > → (or/c exact-nonnegative-integer? #f)
> > position : exact-nonnegative-integer?
> > cutoff : exact-nonnegative-integer?

> Like backward-containing-sexp in color:text<%>.

> > > method
> > > (send a-color-textoid forward-match |  | position |
> > > |  | cutoff) |
> > → (or/c exact-nonnegative-integer? #f)
> > position : exact-nonnegative-integer?
> > cutoff : exact-nonnegative-integer?

> Like forward-match in color:text<%>.

> > method (send a-color-textoid classify-position position)
> > → (or/c symbol? #f)
> > position : exact-nonnegative-integer?

> Like classify-position in color:text<%>.

> > method (send a-color-textoid classify-position* position)
> > → (or/c (and/c (hash/c symbol? any/c) immutable?) #f)
> > position : exact-nonnegative-integer?

> Like classify-position* in color:text<%>.

> > method (send a-color-textoid get-token-range position)
> > | → |  |
> > (or/c #f exact-nonnegative-integer?)
> > (or/c #f exact-nonnegative-integer?)
> > position : exact-nonnegative-integer?

> Like get-token-range in color:text<%>.

> > method (send a-color-textoid get-backward-navigation-limit start)
> > → exact-integer?
> > start : exact-integer?

> Like get-backward-navigation-limit in color:text<%>.

> > method (send a-color-textoid get-regions)
> > → (listof (list/c exact-nonnegative-integer? (or/c exact-nonnegative-integer? 'end)))

> Like get-regions in color:text<%>.

top contents ← prev up next →