Menu

class: AussomPatterns

[91:14] static extends: object

Priority-ordered list of [regexPattern, tokenType] pairs. Derived from Scanner.jflex. Patterns are tried in order; the first match wins. Each pattern is anchored with ^ so it only matches at the start of the remaining source string.

Members

  • list

class: TokenType

[36:14] static extends: object

Token type string constants used by the Tokenizer and Highlighter.

Members

  • DOC
  • COMMENT
  • STRING
  • NUMBER
  • KEYWORD
  • BOOLEAN
  • OPERATOR
  • PUNCTUATION
  • IDENT
  • WS
  • NEWLINE
  • UNKNOWN

class: HighlighterIdGen

[81:14] static extends: object

Simple counter used to generate unique IDs for copy buttons.

Members

  • count

class: AussomKeywords

[56:14] static extends: object

Aussom keyword and boolean literal sets used during tokenization. Keywords are stored as both a list (for reference) and a map (for O(1) lookup during tokenization).

Members

  • keywords
  • booleans
  • keywordMap
  • booleanMap

class: Tokenizer

[118:7] extends: object

The Tokenizer breaks an Aussom source string into a list of token maps. Each token is a map with keys "type" (string) and "text" (string). Uses character-class dispatch to avoid trying all regex patterns for every token position. The first character at the current position determines which small subset of patterns to try.

Members

  • opChars
  • punctChars
  • digitChars
  • identStart
  • identChars

Methods

  • Tokenizer ()

    Constructs a new Tokenizer instance.

  • tokenize (string Code)

    Tokenizes the provided Aussom source code string.

    • @p Code is the Aussom source string to tokenize.
    • @r A list of maps, each with "type" and "text" keys.

class: Highlighter

[393:7] extends: object

The Highlighter tokenizes Aussom source code and produces a styled HNode tree resembling a Shiki code window. Output structure: Div.aus-highlighter Div.aus-header Span.aus-lang-label "aussom" Button.aus-copy-btn "Copy" (optional, ShowCopyButton = true) Pre.aus-pre Code.aus-code Span.aus-line (one per source line) Span.aus-line-num (optional, ShowLineNumbers = true) Span.aus-token.aus-{type} (one per token) Token text is inserted as DOM Text nodes so HTML special characters (<, >, &) are not interpreted as markup.

Members

  • themeColors
  • themeBg
  • themeHeader
  • themeLabel
  • themeBorder
  • showLineNumbers
  • showCopyButton

Methods

  • Highlighter (Theme = null, bool ShowLineNumbers = false, bool ShowCopyButton = false)

    Constructs a new Highlighter.

    • @p Theme is an optional theme name ("dark" or "light") or a custom map of {tokenType: colorString}. Defaults to "dark".
    • @p ShowLineNumbers is an optional bool to show a line-number gutter. Defaults to false.
    • @p ShowCopyButton is an optional bool to show a "Copy" button in the header. Defaults to false.
  • setTheme (Theme)

    Sets the active theme. Can be called after construction to switch themes.

    • @p Theme is a theme name ("dark" or "light") or a custom map.
    • @r this object
  • highlight (string Code)

    Highlights the provided Aussom source code and returns a styled HNode Div.

    • @p Code is the Aussom source string to highlight.
    • @r A Div HNode containing the complete code window.

class: Code

[24:7] extends: HNode

Internal HNode wrapper for the HTML 'code' element. Not included in hnodes.aus, so defined here.

Methods

  • Code ()

    Constructs a 'code' element.

class: AussomThemes

[337:14] static extends: object

Built-in theme definitions for the Highlighter. The "dark" theme mirrors VS Code's dark palette; "light" mirrors VS Code light.

Members

  • dark
  • darkBg
  • darkHeader
  • darkLabel
  • darkBorder
  • light
  • lightBg
  • lightHeader
  • lightLabel
  • lightBorder