package cmpd
import "src.elv.sh/pkg/parse/cmpd"
Package cmpd contains utilities for working with compound nodes.
Index ¶
- func Lambda(n *parse.Compound) (*parse.Primary, bool)
- func Primary(n *parse.Compound) (*parse.Primary, bool)
- func Shape(n *parse.Compound) string
- func StringLiteral(n *parse.Compound) (string, bool)
- func StringLiteralOrError(n *parse.Compound, what string) (string, error)
Functions ¶
func Lambda ¶
Lambda returns a lambda primary node and true if that's the only child of the compound node. Otherwise it returns nil and false.
func Primary ¶
Primary returns a primary node and true if that's the only child of the compound node. Otherwise it returns nil and false.
func Shape ¶
Shape describes the shape of the compound node.
func StringLiteral ¶
StringLiteral returns the value of a string literal and true if that's the only child of the compound node. Otherwise it returns "" and false.
func StringLiteralOrError ¶
StringLiteralOrError is like StringLiteral, but returns an error suitable as a compiler error when StringLiteral would return false.
Source Files ¶
cmpd.go
- Version
- v0.21.0 (latest)
- Published
- Aug 13, 2024
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 6 hours ago –
Tools for package owners.