Provides lang syntax facilities for this project.
Package: lang.syntax
Reachable from entry: yes
std/string.mlass→../MiniLangCompilerML/std/string.ml— external dependency
function _char_code(ch)Return the byte value for a one-character string.
| Parameter | Type | Default | Description |
|---|---|---|---|
ch |
dynamic |
— | ch value consumed by this operation. |
function _is_alpha(ch)Return true when a character is an ASCII letter.
| Parameter | Type | Default | Description |
|---|---|---|---|
ch |
dynamic |
— | ch value consumed by this operation. |
function _is_digit(ch)Return true when a character is an ASCII digit.
| Parameter | Type | Default | Description |
|---|---|---|---|
ch |
dynamic |
— | ch value consumed by this operation. |
function _is_ident_part(ch)Return true when a character can continue a MiniLang identifier.
| Parameter | Type | Default | Description |
|---|---|---|---|
ch |
dynamic |
— | ch value consumed by this operation. |
function _is_ident_start(ch)Return true when a character can start a MiniLang identifier.
| Parameter | Type | Default | Description |
|---|---|---|---|
ch |
dynamic |
— | ch value consumed by this operation. |
function _is_keyword(word)Return true when a word is a MiniLang keyword.
| Parameter | Type | Default | Description |
|---|---|---|---|
word |
dynamic |
— | word value consumed by this operation. |
_keywordsStores module-wide keywords state for the lang syntax module.
function _push_seg(segments, text, kind)Append a non-empty syntax segment to the segment list.
| Parameter | Type | Default | Description |
|---|---|---|---|
segments |
dynamic |
— | segments value consumed by this operation. |
text |
dynamic |
— | Text consumed by the operation. |
kind |
dynamic |
— | kind value consumed by this operation. |
function keywords()Return the MiniLang keywords known by the syntax highlighter.
function line_segments(line)Tokenize one MiniLang source line into syntax-highlight segments.
| Parameter | Type | Default | Description |
|---|---|---|---|
line |
dynamic |
— | line value consumed by this operation. |
- lang.syntax.Segment — struct