Module: reefmarker.builtins

Source: ./reefmarker/builtins.reef


Overview

reefmarker/builtins — FTL ? / .method() implementations.

apply(name, obj, args) is the MethodCall dispatcher. has_content matches evaluator.is_truthy (table duplicated; importing evaluator would cycle). split: core.str.split is char-only, so a delimiter longer than one character uses its first character.

Usage: import reefmarker.builtins as builtins let r = builtins.apply("upper_case", obj, args)


Functions

fn ok_val(v: value.Value): result.Result[value.Value, error.Error]

fn err_msg(msg: string): result.Result[value.Value, error.Error]

fn err_copy(e: error.Error): result.Result[value.Value, error.Error]

fn kind_name(v: value.Value): string

fn require_str(v: value.Value): result.Result[string, error.Error]

fn is_truthy(v: value.Value): bool

Must match evaluator.is_truthy.

fn as_string(v: value.Value): string

Must match evaluator.value_to_string (join / contains / html stringify).

fn apply_unary_str(obj: value.Value): result.Result[string, error.Error]

fn apply_cap_first(s: string): string

fn apply_split(s: string, delim: string): value.Value

fn apply_reverse(obj: value.Value): result.Result[value.Value, error.Error]

fn apply_size(obj: value.Value): result.Result[value.Value, error.Error]

fn apply_join(obj: value.Value, args: [value.Value]): result.Result[value.Value, error.Error]

fn apply_contains(obj: value.Value, args: [value.Value]): result.Result[value.Value, error.Error]

fn apply_str_pred(obj: value.Value, args: [value.Value], which: string): result.Result[value.Value, error.Error]

fn apply(name: string, obj: value.Value, args: [value.Value]): result.Result[value.Value, error.Error]


Generated by reefc doc