Files
Your NameandClaude Opus 5.5 7cf9727bcd Rename the language from Dino to Rex
Files use .rex, the command is rex, and the crate, runtime prefixes,
docs, editor files and examples all use the new name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:51:23 +01:00

16 lines
527 B
Rexx

// The shape of a parsed calculation.
pub enum Node {
Num(value: float)
Var(name: string)
Neg(inner: []Node)
Bin(op: string, sides: []Node)
Call(name: string, args: []Node)
Assign(name: string, value: []Node)
}
// Enums can't hold themselves directly, so children live in a list of one or two.
pub func neg(n: Node): Node { return Node.Neg([n]) }
pub func bin(op: string, l, r: Node): Node { return Node.Bin(op, [l, r]) }
pub func assign(name: string, v: Node): Node { return Node.Assign(name, [v]) }