Skip to documentation
SLOP

tiny.termtex.ast

Reference tiny.termtex ast

Defined in tiny.termtex.

API (26)

Actions

Public operations.

Types and contracts

Public types and contracts.

No direct callersNo direct callstiny.termtexast
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Called byCallsastrowprivate sourcelib.termtex.src.parse.ParserattachScriptprivate sourcelib.termtex.src.parse.ParsercommandExprprivate sourcelib.termtex.src.parse.ParserignoreArgumentprivate sourcelib.termtex.src.parse.ParserignoreDeclaration+6 moreasttextastempty
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsalphabetapplyprivate sourcelib.termtex.src.alphabetmapTextastoperatorastrowastspace+12 moreastnode
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsprivate sourcelib.termtex.src.parse.ParsercommandExprprivate sourcelib.termtex.src.parse.ParserwithLimitPolicyastnodeastoperator
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersastemptyastnodeastrow
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallstest sourcelib.coz.src.filestest: proc maps parser preserves path...alphabetapplyprivate sourcelib.termtex.src.parse.ParsercommandExprprivate sourcelib.termtex.src.parse.ParsermakeHSpaceprivate sourcelib.termtex.src.parse.ParserparseAtomprivate sourcelib.termtex.src.parse.ParserparseCommandastnodeastspace
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.termtex.src.alphabettest: alphabet maps common mathematic...test sourcelib.termtex.src.alphabettest: alphabet maps script exceptions...test sourcelib.termtex.src.alphabettest: alphabet maps unicode math alia...astemptyprivate sourcelib.termtex.src.parse.ParsercommandExpr+10 moreastnodeasttext
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsprivate sourcelib.termtex.src.imagesingleGlyphIdoperatorlimitsBaseoperatorstretchArrowBaseprivate sourcelib.termtex.src.parse.ParsermakeNotprivate sourcelib.termtex.src.parseemptyExprasttextValue
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/termtex/src/ast.zig

zig
const std = @import("std");pub const Expr = union(enum) {    row: []const *Expr,    text: []const u8,    operator: Operator,    space: Space,    fraction: Fraction,    sqrt: Radical,    scripts: Scripts,    accent: Accent,    grid: Grid,    annotation: Annotation,    delimited: Delimited,};pub const Space = struct {    numerator: i32,    denominator: u32,};pub const LimitPolicy = enum {    auto,    limits,    nolimits,};pub const Operator = struct {    body: *Expr,    limit_policy: LimitPolicy = .auto,};pub const FractionStyle = enum {    text,    display,};pub const Fraction = struct {    numerator: *Expr,    denominator: *Expr,    style: FractionStyle = .text,};pub const Radical = struct {    index: ?*Expr = null,    body: *Expr,};pub const Scripts = struct {    base: *Expr,    sub: ?*Expr = null,    sup: ?*Expr = null,};pub const AccentMark = enum {    bar,    hat,    vec,    dot,    underline,    tilde,    check,    breve,    ddot,    acute,    grave,    ring,    overleft,    overleftright,};pub const Accent = struct {    mark: AccentMark,    body: *Expr,};pub const AnnotationKind = enum {    plain,    overbrace,    underbrace,    boxed,};pub const Annotation = struct {    base: *Expr,    over: ?*Expr = null,    under: ?*Expr = null,    kind: AnnotationKind = .plain,};pub const Delimited = struct {    left: Delimiter,    body: *Expr,    right: Delimiter,};pub const Delimiter = union(enum) {    none,    shape: DelimiterShape,    text: []const u8,};pub const DelimiterShape = enum {    left_paren,    right_paren,    left_bracket,    right_bracket,    left_brace,    right_brace,    bar,    double_bar,    left_angle,    right_angle,    left_double_angle,    right_double_angle,    left_double_bracket,    right_double_bracket,    left_floor,    right_floor,    left_ceil,    right_ceil,};pub const GridFence = enum {    none,    paren,    bracket,    brace,    bar,    double_bar,    left_brace,};pub const GridAlignment = enum {    center,    left,};pub const Grid = struct {    rows: []const GridRow,    fence: GridFence = .none,    alignment: GridAlignment = .center,};pub const GridRow = struct {    cells: []const *Expr,};pub fn empty(arena: std.mem.Allocator) std.mem.Allocator.Error!*Expr {    return text(arena, "");}pub fn text(arena: std.mem.Allocator, value: []const u8) std.mem.Allocator.Error!*Expr {    const owned = try arena.dupe(u8, value);    return node(arena, .{ .text = owned });}pub fn operator(arena: std.mem.Allocator, body: *Expr, limit_policy: LimitPolicy) std.mem.Allocator.Error!*Expr {    return node(arena, .{ .operator = .{        .body = body,        .limit_policy = limit_policy,    } });}pub fn space(arena: std.mem.Allocator, value: Space) std.mem.Allocator.Error!*Expr {    return node(arena, .{ .space = value });}pub fn row(arena: std.mem.Allocator, items: []const *Expr) std.mem.Allocator.Error!*Expr {    if (items.len == 0) return empty(arena);    if (items.len == 1) return items[0];    const owned = try arena.dupe(*Expr, items);    return node(arena, .{ .row = owned });}pub fn node(arena: std.mem.Allocator, expr: Expr) std.mem.Allocator.Error!*Expr {    const out = try arena.create(Expr);    out.* = expr;    return out;}pub fn textValue(expr: *const Expr) ?[]const u8 {    return switch (expr.*) {        .text => |value| value,        .operator => |value| textValue(value.body),        else => null,    };}

Source: lib/termtex/src/root.zig:10

zig
pub const ast = @import("ast.zig");

Complete caller list for ast.empty

11 direct callers.

Complete caller list for ast.node

17 direct callers.

Complete caller list for ast.text

15 direct callers.

Audit

Definitions26
Public names26
Members78
Version26.7.0
Revisiondaab053ee433