README

Milky2018/diago/ast does not have a README file

#
ArrayNode

pub(all) enum ArrayNode {
Comment(
Range
, String)
BlockComment(
Range
, String)
Substitution(Substitution)
Import(Import)
Value(Value)
} derive(Eq,
Debug
)

Nodes that can appear inside an array

#
ArrayNode::range

#
ArrayValue

An array value

#
ArrayValue::new

#
BlockString

pub struct BlockString {
range :
Range

quote : String
tag : String
value : String
} derive(Eq,
Debug
)

Block string (|md, |sh, etc.)

#
BlockString::new

fn BlockString::new(range :
Range
, quote : String, tag : String, value : String) -> BlockString

#
DoubleQuotedString

pub struct DoubleQuotedString {
range :
Range

value : Array[Interpolation]
} derive(Eq,
Debug
)

Double-quoted string that may contain substitutions

#
DoubleQuotedString::to_string

fn DoubleQuotedString::to_string(self : DoubleQuotedString) -> String

#
Edge

pub struct Edge {
range :
Range

src : KeyPath
src_arrow : String
dst : KeyPath
dst_arrow : String
} derive(Eq,
Debug
)

An edge between two nodes

#
Edge::new

fn Edge::new(range :
Range
, src : KeyPath, dst : KeyPath, src_arrow : String, dst_arrow : String) -> Edge

#
EdgeIndex

pub struct EdgeIndex {
range :
Range

index : Int?
glob : Bool
} derive(Eq,
Debug
)

Index into an edge group

#
EdgeIndex::new

fn EdgeIndex::new(range :
Range
, index : Int?, glob : Bool) -> EdgeIndex

#
Import

pub struct Import {
range :
Range

spread : Bool
pre : String
path : Array[StringValue]
} derive(Eq,
Debug
)

Import declaration (@path/to/file)

#
Import::new

fn Import::new(range :
Range
, spread : Bool, pre : String, path : Array[StringValue]) -> Import

#
Interpolation

pub(all) enum Interpolation {
Text(String)
Sub(Substitution)
} derive(Eq,
Debug
)

Part of an interpolated string

#
Key

pub struct Key {
range :
Range

ampersand : Bool
not_ampersand : Bool
key : KeyPath?
edges : Array[Edge]
edge_index : EdgeIndex?
edge_key : KeyPath?
primary : Scalar?
value : Value?
} derive(Eq,
Debug
)

A key declaration in a map

Examples:
  • x (simple key)
  • x: value (key with value)
  • x -> y (edge)
  • container.child (nested key path)
  • (x -> y).label (edge with property)

#
Key::new

fn Key::new(range :
Range
, ampersand : Bool, not_ampersand : Bool, key : KeyPath?, edges : Array[Edge], edge_index : EdgeIndex?, edge_key : KeyPath?, primary : Scalar?, value : Value?) -> Key

#
KeyPath

A path of identifiers separated by dots Example: container.child.grandchild

#
KeyPath::has_glob

fn KeyPath::has_glob(self : KeyPath) -> Bool

#
KeyPath::last

fn KeyPath::last(self : KeyPath) -> StringValue?

#
KeyPath::new

#
KeyPath::to_strings

fn KeyPath::to_strings(self : KeyPath) -> Array[String]

#
Map

A diago file is represented as a Map at the root level

#
Map::new

fn Map::new(range :
Range
, nodes : Array[MapNode]) -> Map

#
MapNode

pub(all) enum MapNode {
Comment(
Range
, String)
BlockComment(
Range
, String)
Substitution(Substitution)
Import(Import)
Key(Key)
} derive(Eq,
Debug
)

Nodes that can appear inside a Map

#
MapNode::range

#
Node

pub(all) enum Node {
Map(Map)
MapNode(MapNode)
Key(Key)
KeyPath(KeyPath)
Edge(Edge)
EdgeIndex(EdgeIndex)
Value(Value)
ArrayValue(ArrayValue)
ArrayNode(ArrayNode)
Scalar(Scalar)
StringValue(StringValue)
UnquotedString(UnquotedString)
DoubleQuotedString(DoubleQuotedString)
BlockString(BlockString)
Substitution(Substitution)
Import(Import)
} derive(Eq,
Debug
)

Boxed AST node for generic traversal.

This is intentionally a closed set of variants over the public AST structs/enums.

#
Node::children

fn Node::children(self : Node) -> Array[Node]

#
Node::node_type

fn Node::node_type(self : Node) -> String

#
Node::range

#
Scalar

Scalar values

#
Scalar::range

#
StringValue

pub(all) enum StringValue {
Unquoted(UnquotedString)
SingleQuoted(
Range
, String)
DoubleQuoted(DoubleQuotedString)
Block(BlockString)
} derive(Eq,
Debug
)

String values with their quote style

#
StringValue::content

fn StringValue::content(self : StringValue) -> String

#
StringValue::range

#
Substitution

pub struct Substitution {
range :
Range

spread : Bool
path : Array[StringValue]
} derive(Eq,
Debug
)

Variable substitution ($var or ${var})

#
Substitution::new

#
UnquotedString

pub struct UnquotedString {
range :
Range

value : Array[Interpolation]
pattern : Array[String]
} derive(Eq,
Debug
)

Unquoted string that may contain substitutions

#
UnquotedString::new

#
UnquotedString::to_string

fn UnquotedString::to_string(self : UnquotedString) -> String

#
Value

pub(all) enum Value {
Scalar(Scalar)
Array(ArrayValue)
Map(Map)
Import(Import)
BlockScalar(Value, Map)
} derive(Eq,
Debug
)

Values that can appear on the right side of a colon

#
Value::range

#
board_keywords

let board_keywords : Array[String]

Board keywords (create new boards)

#
composite_keywords

let composite_keywords : Array[String]

Keywords that hold composites

#
fill_patterns

let fill_patterns : Array[String]

Valid fill patterns

#
is_board_keyword

fn is_board_keyword(s : String) -> Bool

Check if a string is a board keyword

#
is_reserved_keyword

fn is_reserved_keyword(s : String) -> Bool

Check if a string is a reserved keyword

#
is_style_keyword

fn is_style_keyword(s : String) -> Bool

Check if a string is a style keyword

#
label_positions

let label_positions : Array[String]

Label positions

#
near_constants

let near_constants : Array[String]

Near constant positions

#
simple_reserved_keywords

let simple_reserved_keywords : Array[String]

Simple reserved keywords (non-style, non-composite)

#
style_keywords

let style_keywords : Array[String]

Style keywords (must be inside "style" block)

#
text_transforms

let text_transforms : Array[String]

Valid text transforms

#
tooltip_positions

let tooltip_positions : Array[String]

Tooltip positions

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io