UIParser¶
Stateless parser for the UI DSL. Handles comment stripping, line tokenization, and size literal parsing.
Constructors¶
create¶
Returns¶
- UIParser val^
Public Functions¶
strip_comments¶
Remove // line comments and / ... / inline block comments. If a block comment is opened but not closed, strip from /* to end of line.
Parameters¶
- line: String val
Returns¶
- String val
tokenize_line¶
Count leading spaces for indent level (must be multiple of 2), then tokenize the remaining content.
Parameters¶
Returns¶
- (ParsedLine val | BuilderError val)
parse_size¶
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¶
- ((USize val , USize val) | BuilderError val)
eq¶
Parameters¶
- that: UIParser val
Returns¶
- Bool val
ne¶
Parameters¶
- that: UIParser val
Returns¶
- Bool val