Skip to content

UIParser

[Source]

Stateless parser for the UI DSL. Handles comment stripping, line tokenization, and size literal parsing.

primitive val UIParser

Constructors

create

[Source]

new val create()
: UIParser val^

Returns


Public Functions

strip_comments

[Source]

Remove // line comments and / ... / inline block comments. If a block comment is opened but not closed, strip from /* to end of line.

fun box strip_comments(
  line: String val)
: String val

Parameters

Returns


tokenize_line

[Source]

Count leading spaces for indent level (must be multiple of 2), then tokenize the remaining content.

fun box tokenize_line(
  line: String val,
  line_num: USize val)
: (ParsedLine val | BuilderError val)

Parameters

Returns


parse_size

[Source]

Parse a size literal: "*" → (0, 0), "WxH" → (W, H). An asterisk in either position means 0 (unconstrained).

fun box parse_size(
  size_str: String val,
  line_num: USize val)
: ((USize val , USize val) | BuilderError val)

Parameters

Returns


eq

[Source]

fun box eq(
  that: UIParser val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: UIParser val)
: Bool val

Parameters

Returns