commons

package
v1.9.8 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitFunctionName                = "init"
	ExecuteFunctionName             = "execute"
	TransactionWrapperCompositeName = "transaction"
	TransactionExecuteFunctionName  = "transaction.execute"
	TransactionPrepareFunctionName  = "transaction.prepare"

	// FailPreConditionFunctionName is the name of the function which is used for failing pre-conditions
	FailPreConditionFunctionName = "$failPreCondition"
	// FailPostConditionFunctionName is the name  of the function which is used for failing post-conditions
	FailPostConditionFunctionName = "$failPostCondition"

	GeneratedNameQualifier              = "$"
	ResourceDestroyedEventsFunctionName = GeneratedNameQualifier + ast.ResourceDestructionDefaultEventName
	CollectEventsParamName              = "collectEvents"

	ProgramInitFunctionName         = "$_init_"
	TransactionGeneratedParamPrefix = "$_param_"

	TypeQualifierArrayConstantSized = "$ArrayConstantSized"
	TypeQualifierArrayVariableSized = "$ArrayVariableSized"
	TypeQualifierDictionary         = "$Dictionary"
	TypeQualifierFunction           = "$Function"
	TypeQualifierOptional           = "$Optional"
	TypeQualifierInclusiveRange     = "$InclusiveRange"
	TypeQualifierCapability         = "$Capability"
)

Variables

View Source
var CollectEventsFunctionType = &sema.FunctionType{
	Purity:               sema.FunctionPurityImpure,
	ReturnTypeAnnotation: sema.VoidTypeAnnotation,
	Arity:                &sema.Arity{Min: 0, Max: -1},
	Parameters: []sema.Parameter{
		{
			TypeAnnotation: sema.AnyStructTypeAnnotation,
			Label:          sema.ArgumentLabelNotRequired,
			Identifier:     CollectEventsParamName,
		},
	},
}

Functions

func LocationQualifier

func LocationQualifier(typ sema.Type) string

func QualifiedName

func QualifiedName(typeName, functionName string) string

func TypeQualifiedName

func TypeQualifiedName(typ sema.Type, functionName string) string

func TypeQualifier

func TypeQualifier(typ sema.Type) string

TypeQualifier returns the prefix to be appended to an identifier (e.g: to a function name), to make it type-qualified. For primitive types, the type-qualifier is the typeID itself. For derived types (e.g: arrays, dictionaries, capabilities, etc.) the type-qualifier is a predefined identifier. TODO: Add other types TODO: Maybe make this a method on the type

Types

type ImportHandler

type ImportHandler func(location common.Location) *bbq.InstructionProgram

type LocationHandler

type LocationHandler = sema.LocationHandlerFunc

type ResolvedLocation

type ResolvedLocation = sema.ResolvedLocation

func ResolveLocation

func ResolveLocation(
	locationHandler LocationHandler,
	identifiers []ast.Identifier,
	location common.Location,
) ([]ResolvedLocation, error)

type TypeCacheKey added in v1.9.7

type TypeCacheKey interface {
	// contains filtered or unexported methods
}

func NewTypeCacheKeyFromStaticType added in v1.9.7

func NewTypeCacheKeyFromStaticType(typ interpreter.StaticType) TypeCacheKey

func NewTypeCacheKeyFromType added in v1.9.7

func NewTypeCacheKeyFromType(typ sema.Type) TypeCacheKey

Jump to

Keyboard shortcuts

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