cmpd

package
v0.0.0-...-91dc524 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2023 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package cmpd contains utilities for working with compound nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lambda

func Lambda(n *parse.Compound) (*parse.Primary, bool)

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

func Primary(n *parse.Compound) (*parse.Primary, bool)

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

func Shape(n *parse.Compound) string

Shape describes the shape of the compound node.

func StringLiteral

func StringLiteral(n *parse.Compound) (string, bool)

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

func StringLiteralOrError(n *parse.Compound, what string) (string, error)

StringLiteralOrError is like StringLiteral, but returns an error suitable as a compiler error when StringLiteral would return false.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL