expression

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractExpressions

func ExtractExpressions(value string) ([]Span, []Error)

ExtractExpressions finds all ${{ ... }} expression spans in the given value. It returns the spans and any extraction-level errors (e.g. unterminated expressions).

Types

type Error

type Error struct {
	Offset  int
	Message string
}

Error represents a syntax error at a specific offset within an expression.

func Parse

func Parse(input string) []Error

Parse parses a GitHub Actions expression (the content between ${{ and }}). It returns any syntax errors found. A nil return means the expression is valid.

type Span

type Span struct {
	Start int
	End   int
	Inner string
}

Span represents a single ${{ ... }} expression found in a string value.

type Token

type Token struct {
	Kind   TokenKind
	Value  string
	Offset int
}

type TokenKind

type TokenKind int
const (
	TokenEOF TokenKind = iota
	TokenIdent
	TokenInt
	TokenFloat
	TokenString
	TokenTrue
	TokenFalse
	TokenNull
	TokenLParen
	TokenRParen
	TokenLBracket
	TokenRBracket
	TokenDot
	TokenStar
	TokenNot
	TokenLT
	TokenLE
	TokenGT
	TokenGE
	TokenEQ
	TokenNE
	TokenAnd
	TokenOr
	TokenComma
)

func (TokenKind) String

func (k TokenKind) String() string

Jump to

Keyboard shortcuts

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