exprx

package
v0.38.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToProto

func ToProto(e expr.Expr, options ToProtoOptions) *exprpb.Expr

ToProto converts this AST into a Protobuf representation, which may be serialized.

Note that package ast does not support deserialization from this proto; instead, you will need to re-parse the text file included in the message. This is because the AST is much richer than what is stored in this message; the message only provides enough information for further semantic analysis and diagnostic generation, but not for pretty-printing.

Panics if the AST contains a cycle (e.g. a message that contains itself as a nested message). Parsed ASTs will never contain cycles, but users may modify them into a cyclic state.

Types

type ToProtoOptions

type ToProtoOptions struct {
	// If set, no spans will be serialized.
	//
	// This operation only destroys non-semantic information.
	OmitSpans bool

	// If set, the contents of the file the AST was parsed from will not
	// be serialized.
	OmitFile bool
}

ToProtoOptions contains options for the [File.ToProto] function.

Jump to

Keyboard shortcuts

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