ast

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package ast provides internal helpers related to AST nodes and ancillary structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Precedence

type Precedence int
const (
	MinPrecedence   Precedence = 1  // Var, Self, Parens, literals
	ApplyPrecedence Precedence = 2  // ast.Function calls and indexing.
	UnaryPrecedence Precedence = 4  // Logical and bitwise negation, unary + -
	MaxPrecedence   Precedence = 16 // ast.Local, If, ast.Import, ast.Function, Error
)

func BinaryOpPrecedence

func BinaryOpPrecedence(bop ast.BinaryOp) Precedence

func ExprPrecedence

func ExprPrecedence(node ast.Node) Precedence

ExprPrecedence gives the precedence level of an operation, so that it can be correctly parsed and unparsed/formatted.

func TighterPrecedence

func TighterPrecedence(p Precedence) Precedence

Jump to

Keyboard shortcuts

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