Skip to content

Latest commit

 

History

History
171 lines (105 loc) · 4.65 KB

File metadata and controls

171 lines (105 loc) · 4.65 KB

src/lang/syntax.ml

Home · Files

Provides lang syntax facilities for this project.

Package: lang.syntax

Reachable from entry: yes

Imports

  • std/string.ml as s../MiniLangCompilerML/std/string.ml — external dependency

Declarations

_char_code

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.

View source

_is_alpha

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.

View source

_is_digit

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.

View source

_is_ident_part

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.

View source

_is_ident_start

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.

View source

_is_keyword

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.

View source

_keywords

_keywords

Stores module-wide keywords state for the lang syntax module.

View source

_push_seg

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.

View source

keywords

function keywords()

Return the MiniLang keywords known by the syntax highlighter.

View source

line_segments

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.

View source