Module: reefmarker.parser

Source: ./reefmarker/parser.reef


Overview

reefmarker/parser — text, interpolations, and FTL directives.

Comments are already stripped by the lexer. Supported <# directives: if / elseif / else, list / sep / else, assign, include, noparse, macro, attempt / recover, switch / case / default, stop, return, plus <@call/>. Other <# names are Err(InvalidInput) "unknown directive". Unclosed #if / #list / #assign / #noparse / #macro / #attempt / #switch is Err.

Usage: import reefmarker.parser as parser let r = parser.parse(src, file)


Types

Parser

Fields:

Name Type
toks [ast.Token]
pos int
src string
failed bool
fail_msg string

Functions

fn is_cmp_kind(k: ast.TokenKind): bool

fn prepend_arg(obj: ast.Expression, rest: [ast.Expression]): [ast.Expression]

fn make_binary(op: string, span: source.SourcePos, left: ast.Expression, right: ast.Expression): ast.Expression

fn make_unary(op: string, span: source.SourcePos, operand: ast.Expression): ast.Expression

fn make_default(span: source.SourcePos, expr: ast.Expression, fallback: ast.Expression): ast.Expression

fn nested_macro_close_end(text: string): int

fn parse(src: string, file: string): result.Result[[ast.Node], error.Error]


Generated by reefc doc