4 Default Lexer

▼ |  | 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:

default-lexer

top contents ← prev up next →

## 4 Default Lexer🔗ℹ

(require syntax-color/default-lexer)
| package: syntax-color-lib

> > procedure
> > (default-lexer in) |  | → |  |
> > (or/c string? eof-object?)
> > symbol?
> > (or/c symbol? #f)
> > (or/c number? #f)
> > (or/c number? #f)
> in : input-port?

A lexer that only identifies (, ), [, ], {, and } built specifically for color:text<%>.

default-lexer returns 5 values:

- Either a string containing the matching text or the eof object. Block specials currently return an empty string. This may change in the future to other string or non-string data.

- A symbol in '(comment white-space no-color eof).

- A symbol in '(|(| |)| |[| |]| |{| |}|) or #f.

- A number representing the starting position of the match (or #f if eof).

- A number representing the ending position of the match (or #f if eof).

top contents ← prev up next →