ast

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const FQNSeparator = "/"

Variables

This section is empty.

Functions

func IsNullableTypeRef added in v0.0.4

func IsNullableTypeRef(typeRef TypeRef) bool

Types

type AttachmentClause

type AttachmentClause struct {
	What string     // Name of the attachment
	As   Expression // Value of the attachment
	// contains filtered or unexported fields
}

func NewAttachmentClause

func NewAttachmentClause(what string, as Expression, ssp tokens.Range) *AttachmentClause

func (AttachmentClause) Kind

func (n AttachmentClause) Kind() string

func (AttachmentClause) Span

func (n AttachmentClause) Span() tokens.Range

func (AttachmentClause) String

func (a AttachmentClause) String() string

type BlockExpression

type BlockExpression struct {
	Statements []Statement
	Yield      Expression
	// contains filtered or unexported fields
}

func NewBlockExpression

func NewBlockExpression(statements []Statement, yield Expression, ssp tokens.Range) *BlockExpression

func (BlockExpression) Kind

func (n BlockExpression) Kind() string

func (BlockExpression) Span

func (n BlockExpression) Span() tokens.Range

func (*BlockExpression) String

func (b *BlockExpression) String() string

type CallExpression

type CallExpression struct {
	Callee     Expression
	Arguments  []Expression
	Memoized   bool
	MemoizeTTL *time.Duration
	// contains filtered or unexported fields
}

func NewCallExpression

func NewCallExpression(callee Expression, arguments []Expression, memoized bool, memoizeTTL *time.Duration, ssp tokens.Range) *CallExpression

func (CallExpression) Kind

func (n CallExpression) Kind() string

func (CallExpression) Span

func (n CallExpression) Span() tokens.Range

func (*CallExpression) String

func (c *CallExpression) String() string

type CastExpression

type CastExpression struct {
	Expr       Expression
	TargetType TypeRef
	// contains filtered or unexported fields
}

func NewCastExpression

func NewCastExpression(expr Expression, targetType TypeRef, ssp tokens.Range) *CastExpression

func (CastExpression) Kind

func (n CastExpression) Kind() string

func (CastExpression) Span

func (n CastExpression) Span() tokens.Range

func (*CastExpression) String

func (c *CastExpression) String() string

type Cmplx

type Cmplx struct {
	Range  tokens.Range
	With   *FQN
	Node   Node
	Fields map[string]*ShapeField
}

type CommentStatement

type CommentStatement struct {
	Content string
	// contains filtered or unexported fields
}

func NewCommentStatement

func NewCommentStatement(content string, ssp tokens.Range) *CommentStatement

func (CommentStatement) Kind

func (n CommentStatement) Kind() string

func (CommentStatement) Span

func (n CommentStatement) Span() tokens.Range

func (CommentStatement) String

func (c CommentStatement) String() string

type DescriptionStatement added in v0.0.3

type DescriptionStatement struct {
	Value string
	// contains filtered or unexported fields
}

DescriptionStatement is a policy metadata line: description "…".

func NewDescriptionStatement added in v0.0.3

func NewDescriptionStatement(value string, ssp tokens.Range) *DescriptionStatement

func (DescriptionStatement) Kind added in v0.0.3

func (n DescriptionStatement) Kind() string

func (DescriptionStatement) Span added in v0.0.3

func (n DescriptionStatement) Span() tokens.Range

func (*DescriptionStatement) String added in v0.0.3

func (s *DescriptionStatement) String() string

type DictTypeRef added in v0.0.3

type DictTypeRef struct {
	ValueType TypeRef
	// contains filtered or unexported fields
}

func NewDictTypeRef added in v0.0.3

func NewDictTypeRef(valueType TypeRef, ssp tokens.Range) *DictTypeRef

func (DictTypeRef) AddConstraint added in v0.0.3

func (b DictTypeRef) AddConstraint(constraint *TypeRefConstraint) error

func (DictTypeRef) GetConstraints added in v0.0.3

func (b DictTypeRef) GetConstraints() []*TypeRefConstraint

func (*DictTypeRef) String added in v0.0.3

func (m *DictTypeRef) String() string

type DocumentTypeRef

type DocumentTypeRef struct {
	// contains filtered or unexported fields
}

func NewDocumentTypeRef

func NewDocumentTypeRef(ssp tokens.Range) *DocumentTypeRef

func (DocumentTypeRef) AddConstraint

func (b DocumentTypeRef) AddConstraint(constraint *TypeRefConstraint) error

func (DocumentTypeRef) GetConstraints

func (b DocumentTypeRef) GetConstraints() []*TypeRefConstraint

func (*DocumentTypeRef) String

func (d *DocumentTypeRef) String() string

type Expression

type Expression interface {
	Node
	// contains filtered or unexported methods
}

func NewStringLiteral

func NewStringLiteral(value string, ssp tokens.Range) Expression

type FQN

type FQN struct {
	Parts []string
	// contains filtered or unexported fields
}

func CreateFQN

func CreateFQN(base FQN, lastSegment string) FQN

func NewFQN

func NewFQN(parts []string, ssp tokens.Range) FQN

func (FQN) IsChildOf

func (f FQN) IsChildOf(another FQN) bool

IsChildOf returns true if the FQN is a child of another FQN

func (FQN) IsEmpty

func (f FQN) IsEmpty() bool

func (FQN) IsParentOf

func (f FQN) IsParentOf(another FQN) bool

func (FQN) Kind

func (n FQN) Kind() string

func (FQN) LastSegment

func (f FQN) LastSegment() string

LastSegment returns the last segment of the FQN

func (FQN) Parent

func (f FQN) Parent() FQN

Parent returns the parent of the FQN

func (FQN) Ptr

func (f FQN) Ptr() *FQN

func (FQN) Span

func (n FQN) Span() tokens.Range

func (FQN) String

func (f FQN) String() string

type FactStatement

type FactStatement struct {
	Name     string     // Name of the fact
	Type     TypeRef    // Type of the fact
	Alias    string     // Exposed name of the fact
	Default  Expression // Default value expression (optional)
	Optional bool       // Whether the fact is optional (default: false, i.e., required)
	// contains filtered or unexported fields
}

func NewFactStatement

func NewFactStatement(name string, typeRef TypeRef, alias string, defaultExpr Expression, optional bool, ssp tokens.Range) *FactStatement

func (FactStatement) Kind

func (n FactStatement) Kind() string

func (FactStatement) Span

func (n FactStatement) Span() tokens.Range

func (FactStatement) String

func (f FactStatement) String() string

type FieldAccessExpression

type FieldAccessExpression struct {
	Left  Expression
	Field string
	// contains filtered or unexported fields
}

func NewFieldAccessExpression

func NewFieldAccessExpression(left Expression, field string, ssp tokens.Range) *FieldAccessExpression

func (FieldAccessExpression) Kind

func (n FieldAccessExpression) Kind() string

func (FieldAccessExpression) Span

func (n FieldAccessExpression) Span() tokens.Range

func (*FieldAccessExpression) String

func (f *FieldAccessExpression) String() string

type FloatLiteral

type FloatLiteral struct {
	Value float64
	// contains filtered or unexported fields
}

FloatLiteral represents a float literal

func NewFloatLiteral

func NewFloatLiteral(value float64, ssp tokens.Range) *FloatLiteral

func (FloatLiteral) Kind

func (n FloatLiteral) Kind() string

func (FloatLiteral) Span

func (n FloatLiteral) Span() tokens.Range

func (*FloatLiteral) String

func (f *FloatLiteral) String() string

type Identifier

type Identifier struct {
	Value string
	// contains filtered or unexported fields
}

Identifier represents an identifier

func NewIdentifier

func NewIdentifier(value string, ssp tokens.Range) *Identifier

func (Identifier) Kind

func (n Identifier) Kind() string

func (Identifier) Span

func (n Identifier) Span() tokens.Range

func (*Identifier) String

func (i *Identifier) String() string

type ImportClause

type ImportClause struct {
	RuleToImport  string        // The name of the rule being imported
	FromPolicyFQN *FQN          // The source identifier - segmented by '/'
	Withs         []*WithClause // Inline with import clause
	// contains filtered or unexported fields
}

'import value|decision @ident from @string { @WithClause }'

func NewImportClause

func NewImportClause(ruleToImport string, fromPolicyFQN *FQN, withs []*WithClause, ssp tokens.Range) *ImportClause

func (ImportClause) Kind

func (n ImportClause) Kind() string

func (ImportClause) Span

func (n ImportClause) Span() tokens.Range

func (ImportClause) String

func (i ImportClause) String() string

type IndexAccessExpression

type IndexAccessExpression struct {
	Left  Expression
	Index Expression
	// contains filtered or unexported fields
}

func NewIndexAccessExpression

func NewIndexAccessExpression(left Expression, index Expression, ssp tokens.Range) *IndexAccessExpression

func (IndexAccessExpression) Kind

func (n IndexAccessExpression) Kind() string

func (IndexAccessExpression) Span

func (n IndexAccessExpression) Span() tokens.Range

func (*IndexAccessExpression) String

func (i *IndexAccessExpression) String() string

type InfixExpression

type InfixExpression struct {
	Left     Expression
	Operator string
	Right    Expression
	// contains filtered or unexported fields
}

func NewInfixExpression

func NewInfixExpression(left Expression, right Expression, operator string, ssp tokens.Range) *InfixExpression

func (InfixExpression) Kind

func (n InfixExpression) Kind() string

func (InfixExpression) Span

func (n InfixExpression) Span() tokens.Range

func (*InfixExpression) String

func (e *InfixExpression) String() string

type IntegerLiteral

type IntegerLiteral struct {

	// under the hood, all values are floats
	Value float64
	// contains filtered or unexported fields
}

IntegerLiteral represents an integer literal

func NewIntegerLiteral

func NewIntegerLiteral(value int64, ssp tokens.Range) *IntegerLiteral

func (IntegerLiteral) Kind

func (n IntegerLiteral) Kind() string

func (IntegerLiteral) Span

func (n IntegerLiteral) Span() tokens.Range

func (*IntegerLiteral) String

func (i *IntegerLiteral) String() string

type IsDefinedExpression

type IsDefinedExpression struct {
	Left Expression
	// contains filtered or unexported fields
}

func NewIsDefinedExpression

func NewIsDefinedExpression(left Expression, ssp tokens.Range) *IsDefinedExpression

func (IsDefinedExpression) Kind

func (n IsDefinedExpression) Kind() string

func (IsDefinedExpression) Span

func (n IsDefinedExpression) Span() tokens.Range

func (*IsDefinedExpression) String

func (e *IsDefinedExpression) String() string

type IsEmptyExpression

type IsEmptyExpression struct {
	Left Expression
	// contains filtered or unexported fields
}

func NewIsEmptyExpression

func NewIsEmptyExpression(left Expression, ssp tokens.Range) *IsEmptyExpression

func (IsEmptyExpression) Kind

func (n IsEmptyExpression) Kind() string

func (IsEmptyExpression) Span

func (n IsEmptyExpression) Span() tokens.Range

func (*IsEmptyExpression) String

func (e *IsEmptyExpression) String() string

type LambdaExpression added in v0.0.3

type LambdaExpression struct {
	Params []string
	Body   *BlockExpression
	// contains filtered or unexported fields
}

LambdaExpression is an inline block-bodied lambda: (a, b) => { yield ... }

func NewLambdaExpression added in v0.0.3

func NewLambdaExpression(params []string, body *BlockExpression, ssp tokens.Range) *LambdaExpression

func (LambdaExpression) Kind added in v0.0.3

func (n LambdaExpression) Kind() string

func (LambdaExpression) Span added in v0.0.3

func (n LambdaExpression) Span() tokens.Range

func (*LambdaExpression) String added in v0.0.3

func (l *LambdaExpression) String() string

type ListLiteral

type ListLiteral struct {
	Values []Expression
	// contains filtered or unexported fields
}

func NewListLiteral

func NewListLiteral(values []Expression, ssp tokens.Range) *ListLiteral

func (ListLiteral) Kind

func (n ListLiteral) Kind() string

func (ListLiteral) Span

func (n ListLiteral) Span() tokens.Range

func (*ListLiteral) String

func (l *ListLiteral) String() string

type ListTypeRef

type ListTypeRef struct {
	ElemType TypeRef
	// contains filtered or unexported fields
}

func NewListTypeRef

func NewListTypeRef(elemType TypeRef, ssp tokens.Range) *ListTypeRef

func (ListTypeRef) AddConstraint

func (b ListTypeRef) AddConstraint(constraint *TypeRefConstraint) error

func (ListTypeRef) GetConstraints

func (b ListTypeRef) GetConstraints() []*TypeRefConstraint

func (*ListTypeRef) String

func (l *ListTypeRef) String() string

type MapEntry

type MapEntry struct {
	Key   Expression
	Value Expression
}

type MapLiteral

type MapLiteral struct {
	Entries []MapEntry
	// contains filtered or unexported fields
}

func NewMapLiteral

func NewMapLiteral(entries []MapEntry, ssp tokens.Range) *MapLiteral

func (MapLiteral) Kind

func (n MapLiteral) Kind() string

func (MapLiteral) Span

func (n MapLiteral) Span() tokens.Range

func (*MapLiteral) String

func (m *MapLiteral) String() string

type NamespaceStatement

type NamespaceStatement struct {
	Name FQN // Fully Qualified Name (FQN) of the namespace
	// contains filtered or unexported fields
}

func NewNamespaceStatement

func NewNamespaceStatement(name FQN, ssp tokens.Range) *NamespaceStatement

func (NamespaceStatement) Kind

func (n NamespaceStatement) Kind() string

func (NamespaceStatement) Span

func (n NamespaceStatement) Span() tokens.Range

func (NamespaceStatement) String

func (n NamespaceStatement) String() string

type Node

type Node interface {
	Positionable
	String() string
	Kind() string
}

type NullLiteral

type NullLiteral struct {
	// contains filtered or unexported fields
}

func NewNullLiteral

func NewNullLiteral(ssp tokens.Range) *NullLiteral

func (NullLiteral) Kind

func (n NullLiteral) Kind() string

func (NullLiteral) Span

func (n NullLiteral) Span() tokens.Range

func (*NullLiteral) String

func (n *NullLiteral) String() string

type NullableTypeRef added in v0.0.4

type NullableTypeRef struct {
	Inner TypeRef
	// contains filtered or unexported fields
}

func NewNullableTypeRef added in v0.0.4

func NewNullableTypeRef(inner TypeRef, ssp tokens.Range) *NullableTypeRef

func (*NullableTypeRef) AddConstraint added in v0.0.4

func (n *NullableTypeRef) AddConstraint(constraint *TypeRefConstraint) error

func (*NullableTypeRef) GetConstraints added in v0.0.4

func (n *NullableTypeRef) GetConstraints() []*TypeRefConstraint

func (*NullableTypeRef) String added in v0.0.4

func (n *NullableTypeRef) String() string

type NumberTypeRef

type NumberTypeRef struct {
	// contains filtered or unexported fields
}

func NewNumberTypeRef

func NewNumberTypeRef(ssp tokens.Range) *NumberTypeRef

func (NumberTypeRef) AddConstraint

func (b NumberTypeRef) AddConstraint(constraint *TypeRefConstraint) error

func (NumberTypeRef) GetConstraints

func (b NumberTypeRef) GetConstraints() []*TypeRefConstraint

func (*NumberTypeRef) String

func (n *NumberTypeRef) String() string

type PipelineHoleExpression added in v0.0.3

type PipelineHoleExpression struct {
	// contains filtered or unexported fields
}

PipelineHoleExpression is a placeholder used by pipeline lowering.

func NewPipelineHoleExpression added in v0.0.3

func NewPipelineHoleExpression(ssp tokens.Range) *PipelineHoleExpression

func (PipelineHoleExpression) Kind added in v0.0.3

func (n PipelineHoleExpression) Kind() string

func (PipelineHoleExpression) Span added in v0.0.3

func (n PipelineHoleExpression) Span() tokens.Range

func (*PipelineHoleExpression) String added in v0.0.3

func (p *PipelineHoleExpression) String() string

type PolicyStatement

type PolicyStatement struct {
	Name       string
	Statements []Statement
	// contains filtered or unexported fields
}

func NewPolicyStatement

func NewPolicyStatement(name string, statements []Statement, ssp tokens.Range) *PolicyStatement

func (PolicyStatement) Kind

func (n PolicyStatement) Kind() string

func (PolicyStatement) Span

func (n PolicyStatement) Span() tokens.Range

func (PolicyStatement) String

func (p PolicyStatement) String() string

type Positionable

type Positionable interface {
	Span() tokens.Range
}

type PrecedingCommentExpression

type PrecedingCommentExpression struct {
	CommentContent string
	Wrap           Expression
	// contains filtered or unexported fields
}

func NewPrecedingCommentExpression

func NewPrecedingCommentExpression(commentContent string, wrap Expression, ssp tokens.Range) *PrecedingCommentExpression

func (PrecedingCommentExpression) Kind

func (n PrecedingCommentExpression) Kind() string

func (PrecedingCommentExpression) Span

func (n PrecedingCommentExpression) Span() tokens.Range

func (PrecedingCommentExpression) String

type Program

type Program struct {
	Statements []Statement
	Reference  string
}

type RecordTypeRef

type RecordTypeRef struct {
	Fields []TypeRef
	// contains filtered or unexported fields
}

func NewRecordTypeRef

func NewRecordTypeRef(fields []TypeRef, ssp tokens.Range) *RecordTypeRef

func (RecordTypeRef) AddConstraint

func (b RecordTypeRef) AddConstraint(constraint *TypeRefConstraint) error

func (RecordTypeRef) GetConstraints

func (b RecordTypeRef) GetConstraints() []*TypeRefConstraint

func (*RecordTypeRef) String

func (r *RecordTypeRef) String() string

type RuleExportStatement

type RuleExportStatement struct {
	Of          string              // Name of the exported variable or decision
	Attachments []*AttachmentClause // Optional attachments for the export
	// contains filtered or unexported fields
}

func NewRuleExportStatement

func NewRuleExportStatement(of string, attachments []*AttachmentClause, ssp tokens.Range) *RuleExportStatement

func (RuleExportStatement) Kind

func (n RuleExportStatement) Kind() string

func (RuleExportStatement) Span

func (n RuleExportStatement) Span() tokens.Range

func (RuleExportStatement) String

func (v RuleExportStatement) String() string

type RuleStatement

type RuleStatement struct {
	RuleName string
	Default  Expression
	When     Expression
	Body     Expression
	// contains filtered or unexported fields
}

func NewRuleStatement

func NewRuleStatement(ruleName string, defaultExpr Expression, whenExpr Expression, bodyExpr Expression, ssp tokens.Range) *RuleStatement

func (RuleStatement) Kind

func (n RuleStatement) Kind() string

func (RuleStatement) Span

func (n RuleStatement) Span() tokens.Range

func (RuleStatement) String

func (r RuleStatement) String() string

type ShapeExportStatement

type ShapeExportStatement struct {
	Name string
	// contains filtered or unexported fields
}

func NewShapeExportStatement

func NewShapeExportStatement(name string, ssp tokens.Range) *ShapeExportStatement

func (ShapeExportStatement) Kind

func (n ShapeExportStatement) Kind() string

func (ShapeExportStatement) Span

func (n ShapeExportStatement) Span() tokens.Range

func (ShapeExportStatement) String

func (s ShapeExportStatement) String() string

type ShapeField

type ShapeField struct {
	Range    tokens.Range
	Name     string
	Optional bool
	Type     TypeRef
	Node     Node
}

type ShapeStatement

type ShapeStatement struct {
	Name    string
	Simple  TypeRef
	Complex *Cmplx
	// contains filtered or unexported fields
}

func NewShapeStatement

func NewShapeStatement(name string, simple TypeRef, complex *Cmplx, ssp tokens.Range) *ShapeStatement

func (ShapeStatement) Kind

func (n ShapeStatement) Kind() string

func (ShapeStatement) Span

func (n ShapeStatement) Span() tokens.Range

func (*ShapeStatement) String

func (s *ShapeStatement) String() string

type ShapeTypeRef

type ShapeTypeRef struct {
	Ref *FQN // Fully Qualified Name (FQN) of the shape
	// contains filtered or unexported fields
}

func NewShapeTypeRef

func NewShapeTypeRef(ref *FQN, ssp tokens.Range) *ShapeTypeRef

func (ShapeTypeRef) AddConstraint

func (b ShapeTypeRef) AddConstraint(constraint *TypeRefConstraint) error

func (ShapeTypeRef) GetConstraints

func (b ShapeTypeRef) GetConstraints() []*TypeRefConstraint

func (*ShapeTypeRef) String

func (s *ShapeTypeRef) String() string

type Statement

type Statement interface {
	Node
	// contains filtered or unexported methods
}

type StringLiteral

type StringLiteral struct {
	Value string
	// contains filtered or unexported fields
}

StringLiteral represents a string literal

func (StringLiteral) Kind

func (n StringLiteral) Kind() string

func (StringLiteral) Span

func (n StringLiteral) Span() tokens.Range

func (*StringLiteral) String

func (s *StringLiteral) String() string

type StringTypeRef

type StringTypeRef struct {
	// contains filtered or unexported fields
}

func NewStringTypeRef

func NewStringTypeRef(ssp tokens.Range) *StringTypeRef

func (StringTypeRef) AddConstraint

func (b StringTypeRef) AddConstraint(constraint *TypeRefConstraint) error

func (StringTypeRef) GetConstraints

func (b StringTypeRef) GetConstraints() []*TypeRefConstraint

func (*StringTypeRef) String

func (s *StringTypeRef) String() string

type TagStatement added in v0.0.3

type TagStatement struct {
	Key   string
	Value string
	// contains filtered or unexported fields
}

TagStatement is a policy metadata line: tag "key" = "value".

func NewTagStatement added in v0.0.3

func NewTagStatement(key, value string, ssp tokens.Range) *TagStatement

func (TagStatement) Kind added in v0.0.3

func (n TagStatement) Kind() string

func (TagStatement) Span added in v0.0.3

func (n TagStatement) Span() tokens.Range

func (*TagStatement) String added in v0.0.3

func (s *TagStatement) String() string

type TernaryExpression

type TernaryExpression struct {
	Condition  Expression
	ThenBranch Expression
	ElseBranch Expression
	// contains filtered or unexported fields
}

func NewTernaryExpression

func NewTernaryExpression(condition Expression, thenBranch Expression, elseBranch Expression, ssp tokens.Range) *TernaryExpression

func (TernaryExpression) Kind

func (n TernaryExpression) Kind() string

func (TernaryExpression) Span

func (n TernaryExpression) Span() tokens.Range

func (*TernaryExpression) String

func (t *TernaryExpression) String() string

type TitleStatement added in v0.0.3

type TitleStatement struct {
	Value string
	// contains filtered or unexported fields
}

TitleStatement is a policy metadata line: title "…".

func NewTitleStatement added in v0.0.3

func NewTitleStatement(value string, ssp tokens.Range) *TitleStatement

func (TitleStatement) Kind added in v0.0.3

func (n TitleStatement) Kind() string

func (TitleStatement) Span added in v0.0.3

func (n TitleStatement) Span() tokens.Range

func (*TitleStatement) String added in v0.0.3

func (s *TitleStatement) String() string

type TrailingCommentExpression

type TrailingCommentExpression struct {
	CommentContent string
	Wrap           Expression
	// contains filtered or unexported fields
}

func NewTrailingCommentExpression

func NewTrailingCommentExpression(commentContent string, wrap Expression, ssp tokens.Range) *TrailingCommentExpression

func (TrailingCommentExpression) Kind

func (n TrailingCommentExpression) Kind() string

func (TrailingCommentExpression) Span

func (n TrailingCommentExpression) Span() tokens.Range

func (TrailingCommentExpression) String

func (t TrailingCommentExpression) String() string

type TransformExpression

type TransformExpression struct {
	Argument    Expression
	Transformer string
	// contains filtered or unexported fields
}

func NewTransformExpression

func NewTransformExpression(argument Expression, transformer string, ssp tokens.Range) *TransformExpression

func (TransformExpression) Kind

func (n TransformExpression) Kind() string

func (TransformExpression) Span

func (n TransformExpression) Span() tokens.Range

func (*TransformExpression) String

func (t *TransformExpression) String() string

type TrinaryLiteral

type TrinaryLiteral struct {
	Value trinary.Value
	// contains filtered or unexported fields
}

TrinaryLiteral represents a trinary literal

func NewTrinaryLiteral

func NewTrinaryLiteral(value trinary.Value, ssp tokens.Range) *TrinaryLiteral

func (TrinaryLiteral) Kind

func (n TrinaryLiteral) Kind() string

func (TrinaryLiteral) Span

func (n TrinaryLiteral) Span() tokens.Range

func (*TrinaryLiteral) String

func (b *TrinaryLiteral) String() string

type TrinaryTypeRef

type TrinaryTypeRef struct {
	// contains filtered or unexported fields
}

func NewTrinaryTypeRef

func NewTrinaryTypeRef(ssp tokens.Range) *TrinaryTypeRef

func (TrinaryTypeRef) AddConstraint

func (b TrinaryTypeRef) AddConstraint(constraint *TypeRefConstraint) error

func (TrinaryTypeRef) GetConstraints

func (b TrinaryTypeRef) GetConstraints() []*TypeRefConstraint

func (*TrinaryTypeRef) String

func (b *TrinaryTypeRef) String() string

type TypeRef

type TypeRef interface {
	Node

	GetConstraints() []*TypeRefConstraint
	AddConstraint(*TypeRefConstraint) error
	// contains filtered or unexported methods
}

func UnwrapNullableTypeRef added in v0.0.4

func UnwrapNullableTypeRef(typeRef TypeRef) TypeRef

type TypeRefConstraint

type TypeRefConstraint struct {
	Name string
	Args []Expression
	// contains filtered or unexported fields
}

func NewTypeRefConstraint

func NewTypeRefConstraint(name string, args []Expression, ssp tokens.Range) *TypeRefConstraint

func (TypeRefConstraint) Kind

func (n TypeRefConstraint) Kind() string

func (TypeRefConstraint) Span

func (n TypeRefConstraint) Span() tokens.Range

type UnaryExpression

type UnaryExpression struct {
	Operator string
	Right    Expression
	// contains filtered or unexported fields
}

func NewUnaryExpression

func NewUnaryExpression(operator string, right Expression, ssp tokens.Range) *UnaryExpression

func (UnaryExpression) Kind

func (n UnaryExpression) Kind() string

func (UnaryExpression) Span

func (n UnaryExpression) Span() tokens.Range

func (*UnaryExpression) String

func (u *UnaryExpression) String() string

type UseStatement

type UseStatement struct {
	Modules      []string // List of modules to use
	RelativeFrom string   //
	LibFrom      []string // Optional library information
	As           string
	// contains filtered or unexported fields
}

func NewUseStatement

func NewUseStatement(modules []string, relativeFrom string, libFrom []string, as string, ssp tokens.Range) *UseStatement

func (UseStatement) Kind

func (n UseStatement) Kind() string

func (UseStatement) Span

func (n UseStatement) Span() tokens.Range

func (*UseStatement) String

func (s *UseStatement) String() string

type VarDeclaration

type VarDeclaration struct {
	Name  string
	Type  TypeRef
	Value Expression
	// contains filtered or unexported fields
}

func NewVarDeclaration

func NewVarDeclaration(name string, typeRef TypeRef, value Expression, ssp tokens.Range) *VarDeclaration

func (VarDeclaration) Kind

func (n VarDeclaration) Kind() string

func (VarDeclaration) Span

func (n VarDeclaration) Span() tokens.Range

func (VarDeclaration) String

func (v VarDeclaration) String() string

type VersionStatement added in v0.0.3

type VersionStatement struct {
	Literal string
	// contains filtered or unexported fields
}

VersionStatement is a policy metadata line: version "…" (SemVer validated at index time).

func NewVersionStatement added in v0.0.3

func NewVersionStatement(literal string, ssp tokens.Range) *VersionStatement

func (VersionStatement) Kind added in v0.0.3

func (n VersionStatement) Kind() string

func (VersionStatement) Span added in v0.0.3

func (n VersionStatement) Span() tokens.Range

func (*VersionStatement) String added in v0.0.3

func (s *VersionStatement) String() string

type WithClause

type WithClause struct {
	Name string     // Name of the with clause - this is also the name that the target policy exposes
	Expr Expression // Value associated with the with clause
	// contains filtered or unexported fields
}

'with @ident as @string' Represents a 'with' clause in an import statement, allowing for additional context or configuration.

func NewWithClause

func NewWithClause(name string, expr Expression, ssp tokens.Range) *WithClause

func (WithClause) Kind

func (n WithClause) Kind() string

func (WithClause) Span

func (n WithClause) Span() tokens.Range

func (WithClause) String

func (w WithClause) String() string

Jump to

Keyboard shortcuts

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