Documentation
¶
Index ¶
- Constants
- Variables
- func LocationQualifier(typ sema.Type) string
- func QualifiedName(typeName, functionName string) string
- func TypeQualifiedName(typ sema.Type, functionName string) string
- func TypeQualifier(typ sema.Type) string
- type ImportHandler
- type LocationHandler
- type ResolvedLocation
- type TypeCacheKey
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 BuiltinTypes = common.Concat[sema.Type]( sema.AllBuiltinTypes, []sema.Type{ &sema.ConstantSizedType{}, &sema.VariableSizedType{}, &sema.DictionaryType{}, &sema.FunctionType{}, &sema.OptionalType{}, }, )
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 QualifiedName ¶
func TypeQualifier ¶
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
Click to show internal directories.
Click to hide internal directories.