Documentation
¶
Index ¶
- type ActualNatArg
- type Field
- func (f Field) Bare() bool
- func (f Field) BitNumber() uint32
- func (f Field) CommentBefore() string
- func (f Field) CommentRight() string
- func (f Field) FieldMask() *ActualNatArg
- func (f Field) IsBit() bool
- func (f Field) MaskTL2Bit() *int
- func (f Field) Name() string
- func (f Field) NatArgs() []ActualNatArg
- func (f Field) OwnerTypeInstance() TypeInstance
- func (f Field) TypeInstance() TypeInstance
- type Kernel
- func (k *Kernel) AddFileTL1(file string) error
- func (k *Kernel) AddFileTL2(file string) error
- func (k *Kernel) AllAnnotations() []string
- func (k *Kernel) AllTypeInstances() []TypeInstance
- func (k *Kernel) CheckExclamationWrapper(typ *tlast.Combinator) (exclArg *tlast.TemplateArgument, _ []tlast.TemplateArgument, _ error)
- func (k *Kernel) Compile() error
- func (k *Kernel) CompileBoolTL1(tlType []*tlast.Combinator) error
- func (k *Kernel) CompileBuiltinTL1(typ *tlast.Combinator) error
- func (k *Kernel) CompileTL1(namespaceTL1SeeHere map[string]*tlast.ParseError) error
- func (k *Kernel) GetFunctionInstance(name tlast.TL2TypeName) *TypeInstanceStruct
- func (k *Kernel) GetInstance(tr tlast.TL2TypeRef) (TypeInstance, bool, error)
- func (k *Kernel) IsDictWrapper(kt *KernelType) (fieldT *KernelType, targs []tlast.TemplateArgument, _ bool)
- func (k *Kernel) IsDictWrapperResolved(kt *KernelType, resolvedType tlast.TL2TypeRef) (bool, tlast.TL2TypeArgument, tlast.TL2TypeRef, error)
- func (k *Kernel) IsTrueType(ktTrue *KernelType) bool
- func (k *Kernel) IsTrueTypeRef(rt tlast.TypeRef) bool
- func (k *Kernel) IsTrueTypeRef2(rt tlast.TL2TypeRef) bool
- func (k *Kernel) Migration() error
- func (k *Kernel) MigrationArgument(migrateTips map[*KernelType]struct{}, tip *KernelType, ...) (tlast.TL2TypeArgument, bool, error)
- func (k *Kernel) MigrationCheckTL2FromTL1Argument(refErrList *migrationTL1RefsTL2Errors, tra tlast.ArithmeticOrType, ...) error
- func (k *Kernel) MigrationCheckTL2FromTL1Field(refErrList *migrationTL1RefsTL2Errors, fieldDef tlast.Field, ...) error
- func (k *Kernel) MigrationCheckTL2FromTL1Type(refErrList *migrationTL1RefsTL2Errors, tr tlast.TypeRef, ...) error
- func (k *Kernel) MigrationFields(bb *bytes.Buffer, migrateTips map[*KernelType]struct{}, tip *KernelType, ...) ([]tlast.TemplateArgument, error)
- func (k *Kernel) MigrationForTests() (string, error)
- func (k *Kernel) MigrationTemplateArguments(bb *bytes.Buffer, tip *KernelType, comb *tlast.Combinator) error
- func (k *Kernel) MigrationTypeRef(bb *bytes.Buffer, migrateTips map[*KernelType]struct{}, tip *KernelType, ...) error
- func (k *Kernel) MigrationTypeRefImpl(migrateTips map[*KernelType]struct{}, tip *KernelType, tr tlast.TL2TypeRef, ...) (tlast.TL2TypeRef, error)
- func (k *Kernel) PrintUnusedWarnings()
- func (k *Kernel) TL1() []*tlast.Combinator
- func (k *Kernel) TL2() []tlast.TL2Combinator
- func (k *Kernel) TopLevelTypeInstances() []TypeInstance
- func (k *Kernel) VariantNames(definition []*tlast.Combinator) ([]string, error)
- type KernelType
- func (t *KernelType) Annotations() []string
- func (t *KernelType) CanBeBare() bool
- func (t *KernelType) CanBeBoxed() bool
- func (t *KernelType) CanonicalName() tlast.TL2TypeName
- func (t *KernelType) CombinatorTexts() []string
- func (t *KernelType) HasAnnotation(a string) bool
- func (t *KernelType) HistoricalName() tlast.TL2TypeName
- func (t *KernelType) IsExclamationWrapper() bool
- func (t *KernelType) IsFunction() bool
- func (t *KernelType) OriginTL2() bool
- func (t *KernelType) TL1() []*tlast.Combinator
- type KernelTypeTarg
- type LocalArg
- type NameCollision
- type NatFieldUsage
- type OptionsKernel
- type TypeInstance
- type TypeInstanceArray
- func (ins *TypeInstanceArray) Count() uint32
- func (ins *TypeInstanceArray) DynamicSize() bool
- func (ins *TypeInstanceArray) Field() Field
- func (ins *TypeInstanceArray) FindCycle(c *cycleFinder, prName tlast.PositionRange)
- func (ins *TypeInstanceArray) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
- func (ins *TypeInstanceArray) IsTuple() bool
- func (ins *TypeInstanceArray) SkipTL2(r []byte) ([]byte, error)
- type TypeInstanceCommon
- func (ins *TypeInstanceCommon) ArgNamespace() string
- func (ins *TypeInstanceCommon) BoxedOnly() bool
- func (ins *TypeInstanceCommon) CanonicalName() string
- func (ins *TypeInstanceCommon) CommentBefore() string
- func (ins *TypeInstanceCommon) CommentRight() string
- func (ins *TypeInstanceCommon) Common() *TypeInstanceCommon
- func (ins *TypeInstanceCommon) GoodForMapKey() bool
- func (ins *TypeInstanceCommon) HasFetcher() bool
- func (ins *TypeInstanceCommon) HasTL2() bool
- func (ins *TypeInstanceCommon) IsBit() bool
- func (ins *TypeInstanceCommon) IsTopLevel() bool
- func (ins *TypeInstanceCommon) KernelType() *KernelType
- func (ins *TypeInstanceCommon) NatParams() []string
- func (ins *TypeInstanceCommon) OriginTL2() bool
- func (ins *TypeInstanceCommon) ResolvedType() tlast.TL2TypeRef
- func (ins *TypeInstanceCommon) TLName() tlast.TL2TypeName
- func (ins *TypeInstanceCommon) TLTag() uint32
- func (w *TypeInstanceCommon) TransformNatArgsToChild(natArgs []ActualNatArg, childNatArgs []ActualNatArg) []ActualNatArg
- type TypeInstanceDict
- func (ins *TypeInstanceDict) Field() Field
- func (ins *TypeInstanceDict) FieldType() *TypeInstanceStruct
- func (ins *TypeInstanceDict) FindCycle(c *cycleFinder, prName tlast.PositionRange)
- func (ins *TypeInstanceDict) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
- func (ins *TypeInstanceDict) SkipTL2(r []byte) ([]byte, error)
- type TypeInstancePrimitive
- func (ins *TypeInstancePrimitive) FindCycle(c *cycleFinder, prName tlast.PositionRange)
- func (ins *TypeInstancePrimitive) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
- func (ins *TypeInstancePrimitive) GoodForMapKey() bool
- func (ins *TypeInstancePrimitive) IsBit() bool
- func (ins *TypeInstancePrimitive) IsTL1Bool() (ok bool, falseTag uint32, trueTag uint32)
- func (ins *TypeInstancePrimitive) SkipTL2(r []byte) ([]byte, error)
- type TypeInstanceRef
- type TypeInstanceStruct
- func (ins *TypeInstanceStruct) Fields() []Field
- func (ins *TypeInstanceStruct) FindCycle(c *cycleFinder, prName tlast.PositionRange)
- func (ins *TypeInstanceStruct) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
- func (ins *TypeInstanceStruct) GetNatFieldUsage(fieldIndex int, inStructFields bool, inReturnType bool) NatFieldUsage
- func (ins *TypeInstanceStruct) GoodForMapKey() bool
- func (ins *TypeInstanceStruct) IsAlias() bool
- func (ins *TypeInstanceStruct) IsResultAlias() bool
- func (trw *TypeInstanceStruct) IsTypeDef() bool
- func (ins *TypeInstanceStruct) IsTypedef() bool
- func (ins *TypeInstanceStruct) IsUnionElement() bool
- func (ins *TypeInstanceStruct) IsUnwrap() bool
- func (ins *TypeInstanceStruct) RPCPreferTL2() bool
- func (ins *TypeInstanceStruct) ReplaceUnwrapArgs(natArgs []string) []string
- func (ins *TypeInstanceStruct) ResultNatArgs() []ActualNatArg
- func (ins *TypeInstanceStruct) ResultType() TypeInstance
- func (ins *TypeInstanceStruct) ResultTypeBare() bool
- func (ins *TypeInstanceStruct) SkipTL2(r []byte) ([]byte, error)
- func (ins *TypeInstanceStruct) UnionIndex() int
- type TypeInstanceUnion
- func (ins *TypeInstanceUnion) BoxedOnly() bool
- func (ins *TypeInstanceUnion) ElementNatArgs() []ActualNatArg
- func (ins *TypeInstanceUnion) FindCycle(c *cycleFinder, prName tlast.PositionRange)
- func (ins *TypeInstanceUnion) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
- func (ins *TypeInstanceUnion) IsEnum() bool
- func (ins *TypeInstanceUnion) IsUnionMaybe() (isMaybe bool, elementField Field)
- func (ins *TypeInstanceUnion) SkipTL2(r []byte) ([]byte, error)
- func (ins *TypeInstanceUnion) VariantNames() []string
- func (ins *TypeInstanceUnion) VariantTypes() []*TypeInstanceStruct
- type Whitelist
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActualNatArg ¶
type ActualNatArg struct {
// contains filtered or unexported fields
}
func (*ActualNatArg) FieldIndex ¶
func (arg *ActualNatArg) FieldIndex() int
func (*ActualNatArg) IsField ¶
func (arg *ActualNatArg) IsField() bool
func (*ActualNatArg) IsNatParam ¶
func (arg *ActualNatArg) IsNatParam() bool
func (*ActualNatArg) IsNumber ¶
func (arg *ActualNatArg) IsNumber() bool
func (*ActualNatArg) Name ¶
func (arg *ActualNatArg) Name() string
func (*ActualNatArg) Number ¶
func (arg *ActualNatArg) Number() uint32
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
func (Field) CommentBefore ¶
func (Field) CommentRight ¶
func (Field) FieldMask ¶
func (f Field) FieldMask() *ActualNatArg
func (Field) MaskTL2Bit ¶
we do not know if this object is used by some other TL2 object when we generate this, so we return nil if owner does not marked as one needing TL2
func (Field) NatArgs ¶
func (f Field) NatArgs() []ActualNatArg
func (Field) OwnerTypeInstance ¶
func (f Field) OwnerTypeInstance() TypeInstance
func (Field) TypeInstance ¶
func (f Field) TypeInstance() TypeInstance
type Kernel ¶
type Kernel struct {
// contains filtered or unexported fields
}
func (*Kernel) AddFileTL1 ¶
func (*Kernel) AddFileTL2 ¶
func (*Kernel) AllAnnotations ¶
func (*Kernel) AllTypeInstances ¶
func (k *Kernel) AllTypeInstances() []TypeInstance
func (*Kernel) CheckExclamationWrapper ¶
func (k *Kernel) CheckExclamationWrapper(typ *tlast.Combinator) (exclArg *tlast.TemplateArgument, _ []tlast.TemplateArgument, _ error)
exclamation marker is not actually a template at all, "!X" is simply reference to interface RpcFunction, so we remove template argument from the list @any rpcProxy.diagonal {X:Type} query:!X = Vector (Maybe X);
func (*Kernel) CompileBoolTL1 ¶
func (k *Kernel) CompileBoolTL1(tlType []*tlast.Combinator) error
func (*Kernel) CompileBuiltinTL1 ¶
func (k *Kernel) CompileBuiltinTL1(typ *tlast.Combinator) error
func (*Kernel) CompileTL1 ¶
func (k *Kernel) CompileTL1(namespaceTL1SeeHere map[string]*tlast.ParseError) error
func (*Kernel) GetFunctionInstance ¶
func (k *Kernel) GetFunctionInstance(name tlast.TL2TypeName) *TypeInstanceStruct
TODO - remove or fix
func (*Kernel) GetInstance ¶
func (k *Kernel) GetInstance(tr tlast.TL2TypeRef) (TypeInstance, bool, error)
we do not allow creating additional instances externally for now we identify types by TL2TypeRefs/TL2TypeNames, TL1 types are first converted into TL2 style
func (*Kernel) IsDictWrapper ¶
func (k *Kernel) IsDictWrapper(kt *KernelType) (fieldT *KernelType, targs []tlast.TemplateArgument, _ bool)
func (*Kernel) IsDictWrapperResolved ¶
func (k *Kernel) IsDictWrapperResolved(kt *KernelType, resolvedType tlast.TL2TypeRef) (bool, tlast.TL2TypeArgument, tlast.TL2TypeRef, error)
func (*Kernel) IsTrueType ¶
func (k *Kernel) IsTrueType(ktTrue *KernelType) bool
All functions which have empty result => ; will reference true-type instead, if defined
func (*Kernel) IsTrueTypeRef2 ¶
func (k *Kernel) IsTrueTypeRef2(rt tlast.TL2TypeRef) bool
func (*Kernel) Migration ¶
Overwrites all files given to kernel. For each dir/file.tl containing combinator in a whitelist, if dir/file.tl2 does not exist, it is created. Then combinator is moved (with conversion) from dir/file.tl into dir/file.tl2 Original file is left, even if it is empty, because user might wish to move remaining comments to the new file.
func (*Kernel) MigrationArgument ¶
func (k *Kernel) MigrationArgument(migrateTips map[*KernelType]struct{}, tip *KernelType, tra tlast.TL2TypeArgument, leftArgs []tlast.TemplateArgument, allowRemoved bool) (tlast.TL2TypeArgument, bool, error)
func (*Kernel) MigrationCheckTL2FromTL1Argument ¶
func (k *Kernel) MigrationCheckTL2FromTL1Argument(refErrList *migrationTL1RefsTL2Errors, tra tlast.ArithmeticOrType, migrateTips map[*KernelType]struct{}, comb *tlast.Combinator, leftArgs []tlast.TemplateArgument) error
func (*Kernel) MigrationCheckTL2FromTL1Field ¶
func (k *Kernel) MigrationCheckTL2FromTL1Field(refErrList *migrationTL1RefsTL2Errors, fieldDef tlast.Field, migrateTips map[*KernelType]struct{}, comb *tlast.Combinator, leftArgs []tlast.TemplateArgument) error
func (*Kernel) MigrationCheckTL2FromTL1Type ¶
func (k *Kernel) MigrationCheckTL2FromTL1Type(refErrList *migrationTL1RefsTL2Errors, tr tlast.TypeRef, migrateTips map[*KernelType]struct{}, comb *tlast.Combinator, leftArgs []tlast.TemplateArgument) error
func (*Kernel) MigrationFields ¶
func (k *Kernel) MigrationFields(bb *bytes.Buffer, migrateTips map[*KernelType]struct{}, tip *KernelType, comb *tlast.Combinator, fieldsAfterReplace []tlast.Field, typesAfterReplace []tlast.TL2TypeRef, indent bool) ([]tlast.TemplateArgument, error)
func (*Kernel) MigrationForTests ¶
migrate and format all files into single deterministic string
func (*Kernel) MigrationTemplateArguments ¶
func (k *Kernel) MigrationTemplateArguments(bb *bytes.Buffer, tip *KernelType, comb *tlast.Combinator) error
func (*Kernel) MigrationTypeRef ¶
func (k *Kernel) MigrationTypeRef(bb *bytes.Buffer, migrateTips map[*KernelType]struct{}, tip *KernelType, comb *tlast.Combinator, tr tlast.TL2TypeRef, leftArgs []tlast.TemplateArgument) error
func (*Kernel) MigrationTypeRefImpl ¶
func (k *Kernel) MigrationTypeRefImpl(migrateTips map[*KernelType]struct{}, tip *KernelType, tr tlast.TL2TypeRef, leftArgs []tlast.TemplateArgument) (tlast.TL2TypeRef, error)
func (*Kernel) PrintUnusedWarnings ¶
func (k *Kernel) PrintUnusedWarnings()
func (*Kernel) TL1 ¶
func (k *Kernel) TL1() []*tlast.Combinator
func (*Kernel) TL2 ¶
func (k *Kernel) TL2() []tlast.TL2Combinator
func (*Kernel) TopLevelTypeInstances ¶
func (k *Kernel) TopLevelTypeInstances() []TypeInstance
func (*Kernel) VariantNames ¶
func (k *Kernel) VariantNames(definition []*tlast.Combinator) ([]string, error)
type KernelType ¶
type KernelType struct {
// contains filtered or unexported fields
}
func (*KernelType) Annotations ¶
func (t *KernelType) Annotations() []string
func (*KernelType) CanBeBare ¶
func (t *KernelType) CanBeBare() bool
func (*KernelType) CanBeBoxed ¶
func (t *KernelType) CanBeBoxed() bool
func (*KernelType) CanonicalName ¶
func (t *KernelType) CanonicalName() tlast.TL2TypeName
func (*KernelType) CombinatorTexts ¶
func (t *KernelType) CombinatorTexts() []string
func (*KernelType) HasAnnotation ¶
func (t *KernelType) HasAnnotation(a string) bool
func (*KernelType) HistoricalName ¶
func (t *KernelType) HistoricalName() tlast.TL2TypeName
func (*KernelType) IsExclamationWrapper ¶
func (t *KernelType) IsExclamationWrapper() bool
Very few functions wrap another function. This is for TL1 only, TL2 does not have this complexity. Currently only PHP generator needs them, because parsing of invokeReq is split between runtime and user code. All other generators should skip/ignore such functions.
func (*KernelType) IsFunction ¶
func (t *KernelType) IsFunction() bool
func (*KernelType) OriginTL2 ¶
func (t *KernelType) OriginTL2() bool
func (*KernelType) TL1 ¶
func (t *KernelType) TL1() []*tlast.Combinator
We do not want to give generators access to combinators directly. We want every piece of information to come through strict pure public interface.
type KernelTypeTarg ¶
type KernelTypeTarg struct {
// contains filtered or unexported fields
}
type NameCollision ¶
type NameCollision struct {
// contains filtered or unexported fields
}
func (*NameCollision) AddSameCaseName ¶
func (c *NameCollision) AddSameCaseName(name string, pr tlast.PositionRange, reason string) error
func (*NameCollision) AddUniqueName ¶
func (c *NameCollision) AddUniqueName(name string, pr tlast.PositionRange, reason string) error
func (*NameCollision) NormalizeName ¶
func (c *NameCollision) NormalizeName(s string) string
func (*NameCollision) ResetNormalized ¶
func (c *NameCollision) ResetNormalized()
allows normalized checks between template arguments and fields, but strict checks between them
type NatFieldUsage ¶
type NatFieldUsage struct {
UsedAsMask bool
UsedAsSize bool
AffectedFields [32]map[*TypeInstanceStruct][]int // bit->type->fieldIndexes
// contains filtered or unexported fields
}
func (*NatFieldUsage) UsedBits ¶
func (f *NatFieldUsage) UsedBits() []uint32
type OptionsKernel ¶
type OptionsKernel struct {
WarningsAreErrors bool
Verbose bool
TypesWhiteList string
TL2WhiteList string // if !empty, will generate also TL2 factory, meta, etc.
Annotations string
RPCPreferTL2WhiteList string // RPC client code will prefer to send requests in TL2 format
ErrorWriter io.Writer // all Errors and warnings should be redirected to this io.Writer, by default it is os.Stderr
// This option cannot be set via command line, set by generators which want it.
// By default, we do not instantiate constants simply to reduce # of created instances.
InstantiateConstants bool
// This option cannot be set via command line, set by generators which want it.
// Most generators skip !X function wrappers, but monolith PHP code uses them,
InstantiateExclamationWrappers bool
// TODO - remove after migration code stabilized
TL2MigrationDevMode bool
// TODO - quickly adapt new rules, remove these options
NewBrackets bool // TODO - implement new brackets
}
func (*OptionsKernel) Bind ¶
func (opt *OptionsKernel) Bind(f *flag.FlagSet)
type TypeInstance ¶
type TypeInstance interface {
CanonicalName() string
KernelType() *KernelType
Common() *TypeInstanceCommon
GoodForMapKey() bool
IsBit() bool // for vector/tuple special case
FindCycle(c *cycleFinder, prName tlast.PositionRange)
GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
BoxedOnly() bool
SkipTL2(r []byte) ([]byte, error)
}
type TypeInstanceArray ¶
type TypeInstanceArray struct {
TypeInstanceCommon
// contains filtered or unexported fields
}
func (*TypeInstanceArray) Count ¶
func (ins *TypeInstanceArray) Count() uint32
func (*TypeInstanceArray) DynamicSize ¶
func (ins *TypeInstanceArray) DynamicSize() bool
func (*TypeInstanceArray) Field ¶
func (ins *TypeInstanceArray) Field() Field
func (*TypeInstanceArray) FindCycle ¶
func (ins *TypeInstanceArray) FindCycle(c *cycleFinder, prName tlast.PositionRange)
func (*TypeInstanceArray) GetChildren ¶
func (ins *TypeInstanceArray) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
func (*TypeInstanceArray) IsTuple ¶
func (ins *TypeInstanceArray) IsTuple() bool
type TypeInstanceCommon ¶
type TypeInstanceCommon struct {
// contains filtered or unexported fields
}
func (*TypeInstanceCommon) ArgNamespace ¶
func (ins *TypeInstanceCommon) ArgNamespace() string
func (*TypeInstanceCommon) BoxedOnly ¶
func (ins *TypeInstanceCommon) BoxedOnly() bool
func (*TypeInstanceCommon) CanonicalName ¶
func (ins *TypeInstanceCommon) CanonicalName() string
func (*TypeInstanceCommon) CommentBefore ¶
func (ins *TypeInstanceCommon) CommentBefore() string
union has also comment per variant
func (*TypeInstanceCommon) CommentRight ¶
func (ins *TypeInstanceCommon) CommentRight() string
func (*TypeInstanceCommon) Common ¶
func (ins *TypeInstanceCommon) Common() *TypeInstanceCommon
func (*TypeInstanceCommon) GoodForMapKey ¶
func (ins *TypeInstanceCommon) GoodForMapKey() bool
func (*TypeInstanceCommon) HasFetcher ¶
func (ins *TypeInstanceCommon) HasFetcher() bool
func (*TypeInstanceCommon) HasTL2 ¶
func (ins *TypeInstanceCommon) HasTL2() bool
func (*TypeInstanceCommon) IsBit ¶
func (ins *TypeInstanceCommon) IsBit() bool
func (*TypeInstanceCommon) IsTopLevel ¶
func (ins *TypeInstanceCommon) IsTopLevel() bool
func (*TypeInstanceCommon) KernelType ¶
func (ins *TypeInstanceCommon) KernelType() *KernelType
func (*TypeInstanceCommon) NatParams ¶
func (ins *TypeInstanceCommon) NatParams() []string
func (*TypeInstanceCommon) OriginTL2 ¶
func (ins *TypeInstanceCommon) OriginTL2() bool
func (*TypeInstanceCommon) ResolvedType ¶
func (ins *TypeInstanceCommon) ResolvedType() tlast.TL2TypeRef
func (*TypeInstanceCommon) TLName ¶
func (ins *TypeInstanceCommon) TLName() tlast.TL2TypeName
func (*TypeInstanceCommon) TLTag ¶
func (ins *TypeInstanceCommon) TLTag() uint32
for TL1 union zero, for TL2 union as specified by user for TL1 union variant !zero, for TL2 union variant zero
func (*TypeInstanceCommon) TransformNatArgsToChild ¶
func (w *TypeInstanceCommon) TransformNatArgsToChild(natArgs []ActualNatArg, childNatArgs []ActualNatArg) []ActualNatArg
same code as in func (ins *TypeInstanceStruct) ReplaceUnwrapArgs
type TypeInstanceDict ¶
type TypeInstanceDict struct {
TypeInstanceCommon
// contains filtered or unexported fields
}
func (*TypeInstanceDict) Field ¶
func (ins *TypeInstanceDict) Field() Field
func (*TypeInstanceDict) FieldType ¶
func (ins *TypeInstanceDict) FieldType() *TypeInstanceStruct
func (*TypeInstanceDict) FindCycle ¶
func (ins *TypeInstanceDict) FindCycle(c *cycleFinder, prName tlast.PositionRange)
func (*TypeInstanceDict) GetChildren ¶
func (ins *TypeInstanceDict) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
type TypeInstancePrimitive ¶
type TypeInstancePrimitive struct {
TypeInstanceCommon
// contains filtered or unexported fields
}
func (*TypeInstancePrimitive) FindCycle ¶
func (ins *TypeInstancePrimitive) FindCycle(c *cycleFinder, prName tlast.PositionRange)
func (*TypeInstancePrimitive) GetChildren ¶
func (ins *TypeInstancePrimitive) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
func (*TypeInstancePrimitive) GoodForMapKey ¶
func (ins *TypeInstancePrimitive) GoodForMapKey() bool
func (*TypeInstancePrimitive) IsBit ¶
func (ins *TypeInstancePrimitive) IsBit() bool
type TypeInstanceRef ¶
type TypeInstanceRef struct {
// contains filtered or unexported fields
}
during recursive type resolution, we store pointer to this type, later type instance is instantiated and ins is set
type TypeInstanceStruct ¶
type TypeInstanceStruct struct {
TypeInstanceCommon
// contains filtered or unexported fields
}
func (*TypeInstanceStruct) Fields ¶
func (ins *TypeInstanceStruct) Fields() []Field
func (*TypeInstanceStruct) FindCycle ¶
func (ins *TypeInstanceStruct) FindCycle(c *cycleFinder, prName tlast.PositionRange)
func (*TypeInstanceStruct) GetChildren ¶
func (ins *TypeInstanceStruct) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
func (*TypeInstanceStruct) GetNatFieldUsage ¶
func (ins *TypeInstanceStruct) GetNatFieldUsage(fieldIndex int, inStructFields bool, inReturnType bool) NatFieldUsage
func (*TypeInstanceStruct) GoodForMapKey ¶
func (ins *TypeInstanceStruct) GoodForMapKey() bool
TODO - check how this works
func (*TypeInstanceStruct) IsAlias ¶
func (ins *TypeInstanceStruct) IsAlias() bool
Both TL1-style typedef (single anonymous field) And actual TL2-style alias. In both cases, there is no TL2 object wrapping around the aliasing type So TL2 serialization format is the same. TL1 format will differ if the first field is Boxed.
func (*TypeInstanceStruct) IsResultAlias ¶
func (ins *TypeInstanceStruct) IsResultAlias() bool
func (*TypeInstanceStruct) IsTypeDef ¶
func (trw *TypeInstanceStruct) IsTypeDef() bool
most generators will need to add !recursive
func (*TypeInstanceStruct) IsTypedef ¶
func (ins *TypeInstanceStruct) IsTypedef() bool
this struct has empty name of the single field (without fieldsmask)
func (*TypeInstanceStruct) IsUnionElement ¶
func (ins *TypeInstanceStruct) IsUnionElement() bool
func (*TypeInstanceStruct) IsUnwrap ¶
func (ins *TypeInstanceStruct) IsUnwrap() bool
Where this type is used during generation, we must instad use wrapped type. vector<int> is compiled into []int.
func (*TypeInstanceStruct) RPCPreferTL2 ¶
func (ins *TypeInstanceStruct) RPCPreferTL2() bool
func (*TypeInstanceStruct) ReplaceUnwrapArgs ¶
func (ins *TypeInstanceStruct) ReplaceUnwrapArgs(natArgs []string) []string
same code as in func (w *TypeInstanceCommon) TransformNatArgsToChild
func (*TypeInstanceStruct) ResultNatArgs ¶
func (ins *TypeInstanceStruct) ResultNatArgs() []ActualNatArg
func (*TypeInstanceStruct) ResultType ¶
func (ins *TypeInstanceStruct) ResultType() TypeInstance
func (*TypeInstanceStruct) ResultTypeBare ¶
func (ins *TypeInstanceStruct) ResultTypeBare() bool
In TL1, this is always boxed, but in TL2 references to unions are boxed, and other references are bare
func (*TypeInstanceStruct) SkipTL2 ¶
func (ins *TypeInstanceStruct) SkipTL2(r []byte) ([]byte, error)
func (*TypeInstanceStruct) UnionIndex ¶
func (ins *TypeInstanceStruct) UnionIndex() int
zero if not IsUnionElement()
type TypeInstanceUnion ¶
type TypeInstanceUnion struct {
TypeInstanceCommon
// contains filtered or unexported fields
}
func (*TypeInstanceUnion) BoxedOnly ¶
func (ins *TypeInstanceUnion) BoxedOnly() bool
func (*TypeInstanceUnion) ElementNatArgs ¶
func (ins *TypeInstanceUnion) ElementNatArgs() []ActualNatArg
func (*TypeInstanceUnion) FindCycle ¶
func (ins *TypeInstanceUnion) FindCycle(c *cycleFinder, prName tlast.PositionRange)
func (*TypeInstanceUnion) GetChildren ¶
func (ins *TypeInstanceUnion) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
func (*TypeInstanceUnion) IsEnum ¶
func (ins *TypeInstanceUnion) IsEnum() bool
func (*TypeInstanceUnion) IsUnionMaybe ¶
func (ins *TypeInstanceUnion) IsUnionMaybe() (isMaybe bool, elementField Field)
This is hint to generators
func (*TypeInstanceUnion) VariantNames ¶
func (ins *TypeInstanceUnion) VariantNames() []string
func (*TypeInstanceUnion) VariantTypes ¶
func (ins *TypeInstanceUnion) VariantTypes() []*TypeInstanceStruct
type Whitelist ¶
type Whitelist struct {
// contains filtered or unexported fields
}
func NewWhiteList ¶
func (*Whitelist) UnusedWarning ¶
Source Files
¶
- conversion.go
- cycle.go
- field.go
- function.go
- kernel.go
- kernel_instantiate.go
- kernel_instantiate_tl1.go
- kernel_resolve.go
- kernel_tl1.go
- kernel_tl1_heuristics.go
- kernel_type.go
- kernel_type_check_tl1.go
- kernel_type_check_tl2.go
- migration.go
- name_collision.go
- options.go
- t_alias.go
- t_array.go
- t_dict.go
- t_primitive.go
- t_struct.go
- t_struct_affected_fields.go
- t_union.go
- type_instance.go
- whitelist.go