pure

package
v1.3.22 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MPL-2.0 Imports: 21 Imported by: 0

README

hybrid TL1 + TL2 pure kernel

This kernel combines relatively simple TL2 kernel with complicated TL1 kernel.

Primitive types are difficult, because they have different names in TL1/TL2.

And TL1 types are themselves complicated, because they have 2 names - TypeDecl.Name and Construct.Name, ab.t1 = cd.T2, but only if they are not unions, which use Construct.Name only for naming data structure for variant.

Also, TL1 type references can be bare or boxed (explicitly with % sign, or by using lower or upper case).

So, we inveneted those rules:

Kernel has types map element for each possible type reference. For primitives int32 and int are added initially, later if boxed wrapper is declared, Int is also added.

During type resolution, we do not in general normalize, only substitute template arguments. So %int could remain %int.

When we want type canonical string, we always look up each name in types, then normalize reference.

TL2 types normalize into themselves, because TL2 has no boxed references.

Primitives, like int32, int, Int with or without percent sign always normalize to +int32 (boxed) or int32.

Unions always normalize to +Union with explicit boxed sign (TODO - try to run kernel without it).

Bare and boxed references to single-constructor type ab.con = ab.Type; normalize to ab.con or +ab.con.

Then, when language generator wants to construct global names, it can select some strategy to use.

We also explicitly add legacy names to some primitives (int, nat and long), so we generate VectorInt not VectorInt32 in go generator. Later, we'll replace those to TL2 names.

TODO

TL1 template argument/field normalized name collision

modifiers in new kernel

Migration

plan

fields masks - local, external
JSON format - simple types, unions

Documentation

Index

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 added in v1.2.35

func (arg *ActualNatArg) IsField() bool

func (*ActualNatArg) IsName added in v1.3.22

func (arg *ActualNatArg) IsName() bool

func (*ActualNatArg) IsNumber added in v1.2.35

func (arg *ActualNatArg) IsNumber() bool

func (*ActualNatArg) Name added in v1.2.35

func (arg *ActualNatArg) Name() string

func (*ActualNatArg) Number

func (arg *ActualNatArg) Number() uint32

type ByteBuilder

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

func (*ByteBuilder) Buf

func (b *ByteBuilder) Buf() []byte

func (*ByteBuilder) FinishSize

func (b *ByteBuilder) FinishSize(firstUsedByte int, lastUsedByte int, optimizeEmpty bool)

func (*ByteBuilder) Len

func (b *ByteBuilder) Len() int

func (*ByteBuilder) Print

func (b *ByteBuilder) Print() string

func (*ByteBuilder) PrintLegend

func (b *ByteBuilder) PrintLegend() string

func (*ByteBuilder) ReserveSpaceForSize

func (b *ByteBuilder) ReserveSpaceForSize() int

func (*ByteBuilder) SetCursorFinish

func (b *ByteBuilder) SetCursorFinish()

func (*ByteBuilder) SetCursorStart

func (b *ByteBuilder) SetCursorStart()

func (*ByteBuilder) WriteElementCount

func (b *ByteBuilder) WriteElementCount(v int)

func (*ByteBuilder) WriteFieldmask

func (b *ByteBuilder) WriteFieldmask()

func (*ByteBuilder) WriteString

func (b *ByteBuilder) WriteString(v string)

func (*ByteBuilder) WriteVariantIndex

func (b *ByteBuilder) WriteVariantIndex(v int)

type ByteColor

type ByteColor byte
const ByteColorElementCount ByteColor = 2
const ByteColorFieldMask ByteColor = 4
const ByteColorNormal ByteColor = 0
const ByteColorObjectSize ByteColor = 1
const ByteColorStringData ByteColor = 7
const ByteColorStringSize ByteColor = 6
const ByteColorVariantIndex ByteColor = 3

type Field

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

func (Field) Bare added in v1.2.35

func (f Field) Bare() bool

func (Field) BitNumber

func (f Field) BitNumber() uint32

func (Field) CommentBefore added in v1.3.0

func (f Field) CommentBefore() string

func (Field) CommentRight added in v1.3.0

func (f Field) CommentRight() string

func (Field) FieldMask added in v1.2.35

func (f Field) FieldMask() *ActualNatArg

func (Field) IsBit added in v1.3.0

func (f Field) IsBit() bool

func (Field) MaskTL2Bit added in v1.2.35

func (f Field) MaskTL2Bit() *int

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) Name added in v1.2.35

func (f Field) Name() string

func (Field) NatArgs added in v1.2.35

func (f Field) NatArgs() []ActualNatArg

func (Field) OwnerTypeInstance added in v1.3.13

func (f Field) OwnerTypeInstance() TypeInstance

func (Field) TypeInstance added in v1.2.35

func (f Field) TypeInstance() TypeInstance

type Kernel

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

func NewKernel

func NewKernel(opts *OptionsKernel) *Kernel

Add builtin types

func (*Kernel) AddFileTL1

func (k *Kernel) AddFileTL1(file string) error

func (*Kernel) AddFileTL2

func (k *Kernel) AddFileTL2(file string) error

func (*Kernel) AllAnnotations added in v1.2.35

func (k *Kernel) AllAnnotations() []string

func (*Kernel) AllTypeInstances

func (k *Kernel) AllTypeInstances() []TypeInstance

func (*Kernel) Compile

func (k *Kernel) Compile() error

func (*Kernel) CompileBoolTL1 added in v1.2.35

func (k *Kernel) CompileBoolTL1(tlType []*tlast.Combinator) error

func (*Kernel) CompileBuiltinTL1 added in v1.2.35

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 added in v1.2.35

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 added in v1.3.19

func (k *Kernel) IsDictWrapper(kt *KernelType, resolvedType tlast.TL2TypeRef) (bool, tlast.TL2TypeArgument, tlast.TL2TypeRef, error)

func (*Kernel) IsTrueType added in v1.2.35

func (k *Kernel) IsTrueType(rt tlast.TypeRef) bool

func (*Kernel) IsTrueType2 added in v1.3.19

func (k *Kernel) IsTrueType2(rt tlast.TL2TypeRef) bool

func (*Kernel) Migration added in v1.2.35

func (k *Kernel) Migration() error

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 added in v1.2.35

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 added in v1.3.15

func (k *Kernel) MigrationCheckTL2FromTL1Argument(refErrList *migrationTL1RefsTL2Errors, tra tlast.ArithmeticOrType, migrateTips map[*KernelType]struct{},
	comb *tlast.Combinator, leftArgs []tlast.TemplateArgument) error

func (*Kernel) MigrationCheckTL2FromTL1Field added in v1.3.15

func (k *Kernel) MigrationCheckTL2FromTL1Field(refErrList *migrationTL1RefsTL2Errors, fieldDef tlast.Field, migrateTips map[*KernelType]struct{},
	comb *tlast.Combinator, leftArgs []tlast.TemplateArgument) error

func (*Kernel) MigrationCheckTL2FromTL1Type added in v1.3.15

func (k *Kernel) MigrationCheckTL2FromTL1Type(refErrList *migrationTL1RefsTL2Errors, tr tlast.TypeRef, migrateTips map[*KernelType]struct{},
	comb *tlast.Combinator, leftArgs []tlast.TemplateArgument) error

func (*Kernel) MigrationFields added in v1.2.35

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 added in v1.2.35

func (k *Kernel) MigrationForTests() (string, error)

migrate and format all files into single deterministic string

func (*Kernel) MigrationTemplateArguments added in v1.2.35

func (k *Kernel) MigrationTemplateArguments(bb *bytes.Buffer, tip *KernelType, comb *tlast.Combinator) error

func (*Kernel) MigrationTypeRef added in v1.2.35

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 added in v1.2.35

func (k *Kernel) MigrationTypeRefImpl(migrateTips map[*KernelType]struct{}, tip *KernelType,
	tr tlast.TL2TypeRef, leftArgs []tlast.TemplateArgument) (tlast.TL2TypeRef, error)

func (*Kernel) PrintUnusedWarnings added in v1.3.22

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 added in v1.3.0

func (k *Kernel) TopLevelTypeInstances() []TypeInstance

func (*Kernel) VariantNames added in v1.2.35

func (k *Kernel) VariantNames(definition []*tlast.Combinator) ([]string, error)

type KernelType

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

func (*KernelType) Annotations added in v1.2.36

func (t *KernelType) Annotations() []string

func (*KernelType) CanBeBare added in v1.2.35

func (t *KernelType) CanBeBare() bool

func (*KernelType) CanBeBoxed added in v1.2.35

func (t *KernelType) CanBeBoxed() bool

func (*KernelType) CanonicalName added in v1.2.35

func (t *KernelType) CanonicalName() tlast.TL2TypeName

func (*KernelType) CombinatorTexts added in v1.3.0

func (t *KernelType) CombinatorTexts() []string

func (*KernelType) HasAnnotation added in v1.2.36

func (t *KernelType) HasAnnotation(a string) bool

func (*KernelType) HistoricalName added in v1.2.36

func (t *KernelType) HistoricalName() tlast.TL2TypeName

func (*KernelType) IsFunction added in v1.2.35

func (t *KernelType) IsFunction() bool

func (*KernelType) OriginTL2 added in v1.2.35

func (t *KernelType) OriginTL2() bool

func (*KernelType) TL1 added in v1.2.35

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 added in v1.2.35

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

type KernelValue

type KernelValue interface {
	Clone() KernelValue

	Reset()
	Random(rg *rand.Rand)
	WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)
	ReadTL2(r []byte, ctx *TL2Context) ([]byte, error)
	WriteJSON(w []byte, ctx *TL2Context) []byte

	UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)
	UIFixPath(side int, level int, model *UIModel) int // always called onPath
	UIStartEdit(level int, model *UIModel, createMode int)
	UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

	CompareForMapKey(other KernelValue) int
}

type KernelValueAlias

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

func (*KernelValueAlias) Clone

func (v *KernelValueAlias) Clone() KernelValue

func (*KernelValueAlias) CompareForMapKey

func (v *KernelValueAlias) CompareForMapKey(other KernelValue) int

func (*KernelValueAlias) Random

func (v *KernelValueAlias) Random(rg *rand.Rand)

func (*KernelValueAlias) ReadTL2

func (v *KernelValueAlias) ReadTL2(r []byte, ctx *TL2Context) ([]byte, error)

func (*KernelValueAlias) Reset

func (v *KernelValueAlias) Reset()

func (*KernelValueAlias) UIFixPath

func (v *KernelValueAlias) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueAlias) UIKey

func (v *KernelValueAlias) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueAlias) UIStartEdit

func (v *KernelValueAlias) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueAlias) UIWrite

func (v *KernelValueAlias) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueAlias) WriteJSON

func (v *KernelValueAlias) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueAlias) WriteTL2

func (v *KernelValueAlias) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueArray

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

func (*KernelValueArray) Clone

func (v *KernelValueArray) Clone() KernelValue

func (*KernelValueArray) CompareForMapKey

func (v *KernelValueArray) CompareForMapKey(other KernelValue) int

func (*KernelValueArray) Random

func (v *KernelValueArray) Random(rg *rand.Rand)

func (*KernelValueArray) ReadTL2

func (v *KernelValueArray) ReadTL2(r []byte, ctx *TL2Context) (_ []byte, err error)

func (*KernelValueArray) Reset

func (v *KernelValueArray) Reset()

func (*KernelValueArray) UIFixPath

func (v *KernelValueArray) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueArray) UIKey

func (v *KernelValueArray) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueArray) UIStartEdit

func (v *KernelValueArray) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueArray) UIWrite

func (v *KernelValueArray) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueArray) WriteJSON

func (v *KernelValueArray) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueArray) WriteTL2

func (v *KernelValueArray) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueArrayBit

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

func (*KernelValueArrayBit) Clone

func (v *KernelValueArrayBit) Clone() KernelValue

func (*KernelValueArrayBit) CompareForMapKey

func (v *KernelValueArrayBit) CompareForMapKey(other KernelValue) int

func (*KernelValueArrayBit) Random

func (v *KernelValueArrayBit) Random(rg *rand.Rand)

func (*KernelValueArrayBit) ReadTL2

func (v *KernelValueArrayBit) ReadTL2(r []byte, ctx *TL2Context) (_ []byte, err error)

func (*KernelValueArrayBit) Reset

func (v *KernelValueArrayBit) Reset()

func (*KernelValueArrayBit) UIFixPath

func (v *KernelValueArrayBit) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueArrayBit) UIKey

func (v *KernelValueArrayBit) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueArrayBit) UIStartEdit

func (v *KernelValueArrayBit) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueArrayBit) UIWrite

func (v *KernelValueArrayBit) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueArrayBit) WriteJSON

func (v *KernelValueArrayBit) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueArrayBit) WriteTL2

func (v *KernelValueArrayBit) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueBit

type KernelValueBit struct {
}

func (*KernelValueBit) Clone

func (v *KernelValueBit) Clone() KernelValue

func (*KernelValueBit) CompareForMapKey

func (v *KernelValueBit) CompareForMapKey(other KernelValue) int

func (*KernelValueBit) Random

func (v *KernelValueBit) Random(rg *rand.Rand)

func (*KernelValueBit) ReadTL2

func (v *KernelValueBit) ReadTL2(r []byte, ctx *TL2Context) ([]byte, error)

func (*KernelValueBit) Reset

func (v *KernelValueBit) Reset()

func (*KernelValueBit) UIFixPath

func (v *KernelValueBit) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueBit) UIKey

func (v *KernelValueBit) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueBit) UIStartEdit

func (v *KernelValueBit) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueBit) UIWrite

func (v *KernelValueBit) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueBit) WriteJSON

func (v *KernelValueBit) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueBit) WriteTL2

func (v *KernelValueBit) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueBool

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

func (*KernelValueBool) Clone

func (v *KernelValueBool) Clone() KernelValue

func (*KernelValueBool) CompareForMapKey

func (v *KernelValueBool) CompareForMapKey(other KernelValue) int

func (*KernelValueBool) Random

func (v *KernelValueBool) Random(rg *rand.Rand)

func (*KernelValueBool) ReadTL2

func (v *KernelValueBool) ReadTL2(r []byte, ctx *TL2Context) ([]byte, error)

func (*KernelValueBool) Reset

func (v *KernelValueBool) Reset()

func (*KernelValueBool) UIFixPath

func (v *KernelValueBool) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueBool) UIKey

func (v *KernelValueBool) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueBool) UIStartEdit

func (v *KernelValueBool) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueBool) UIWrite

func (v *KernelValueBool) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueBool) WriteJSON

func (v *KernelValueBool) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueBool) WriteTL2

func (v *KernelValueBool) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueByte

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

func (*KernelValueByte) Clone

func (v *KernelValueByte) Clone() KernelValue

func (*KernelValueByte) CompareForMapKey

func (v *KernelValueByte) CompareForMapKey(other KernelValue) int

func (*KernelValueByte) Random

func (v *KernelValueByte) Random(rg *rand.Rand)

func (*KernelValueByte) ReadTL2

func (v *KernelValueByte) ReadTL2(r []byte, ctx *TL2Context) ([]byte, error)

func (*KernelValueByte) Reset

func (v *KernelValueByte) Reset()

func (*KernelValueByte) SetFromEditor

func (v *KernelValueByte) SetFromEditor(str string) error

func (*KernelValueByte) UIFixPath

func (v *KernelValueByte) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueByte) UIKey

func (v *KernelValueByte) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueByte) UIStartEdit

func (v *KernelValueByte) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueByte) UIWrite

func (v *KernelValueByte) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueByte) WriteJSON

func (v *KernelValueByte) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueByte) WriteTL2

func (v *KernelValueByte) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueDict

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

func (*KernelValueDict) Clone

func (v *KernelValueDict) Clone() KernelValue

func (*KernelValueDict) CompareForMapKey

func (v *KernelValueDict) CompareForMapKey(other KernelValue) int

func (*KernelValueDict) Random

func (v *KernelValueDict) Random(rg *rand.Rand)

func (*KernelValueDict) ReadTL2

func (v *KernelValueDict) ReadTL2(r []byte, ctx *TL2Context) (_ []byte, err error)

func (*KernelValueDict) Reset

func (v *KernelValueDict) Reset()

func (*KernelValueDict) UIFixPath

func (v *KernelValueDict) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueDict) UIKey

func (v *KernelValueDict) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueDict) UIStartEdit

func (v *KernelValueDict) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueDict) UIWrite

func (v *KernelValueDict) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueDict) WriteJSON

func (v *KernelValueDict) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueDict) WriteTL2

func (v *KernelValueDict) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueInt32

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

func (*KernelValueInt32) Clone

func (v *KernelValueInt32) Clone() KernelValue

func (*KernelValueInt32) CompareForMapKey

func (v *KernelValueInt32) CompareForMapKey(other KernelValue) int

func (*KernelValueInt32) Random

func (v *KernelValueInt32) Random(rg *rand.Rand)

func (*KernelValueInt32) ReadTL2

func (v *KernelValueInt32) ReadTL2(r []byte, ctx *TL2Context) ([]byte, error)

func (*KernelValueInt32) Reset

func (v *KernelValueInt32) Reset()

func (*KernelValueInt32) SetFromEditor

func (v *KernelValueInt32) SetFromEditor(str string) error

func (*KernelValueInt32) UIFixPath

func (v *KernelValueInt32) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueInt32) UIKey

func (v *KernelValueInt32) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueInt32) UIStartEdit

func (v *KernelValueInt32) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueInt32) UIWrite

func (v *KernelValueInt32) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueInt32) WriteJSON

func (v *KernelValueInt32) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueInt32) WriteTL2

func (v *KernelValueInt32) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueInt64

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

func (*KernelValueInt64) Clone

func (v *KernelValueInt64) Clone() KernelValue

func (*KernelValueInt64) CompareForMapKey

func (v *KernelValueInt64) CompareForMapKey(other KernelValue) int

func (*KernelValueInt64) Random

func (v *KernelValueInt64) Random(rg *rand.Rand)

func (*KernelValueInt64) ReadTL2

func (v *KernelValueInt64) ReadTL2(r []byte, ctx *TL2Context) ([]byte, error)

func (*KernelValueInt64) Reset

func (v *KernelValueInt64) Reset()

func (*KernelValueInt64) SetFromEditor

func (v *KernelValueInt64) SetFromEditor(str string) error

func (*KernelValueInt64) UIFixPath

func (v *KernelValueInt64) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueInt64) UIKey

func (v *KernelValueInt64) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueInt64) UIStartEdit

func (v *KernelValueInt64) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueInt64) UIWrite

func (v *KernelValueInt64) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueInt64) WriteJSON

func (v *KernelValueInt64) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueInt64) WriteTL2

func (v *KernelValueInt64) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValuePrimitive

type KernelValuePrimitive interface {
	KernelValue

	SetFromEditor(str string) error
}

type KernelValueString

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

func (*KernelValueString) Clone

func (v *KernelValueString) Clone() KernelValue

func (*KernelValueString) CompareForMapKey

func (v *KernelValueString) CompareForMapKey(other KernelValue) int

func (*KernelValueString) Random

func (v *KernelValueString) Random(rg *rand.Rand)

func (*KernelValueString) ReadTL2

func (v *KernelValueString) ReadTL2(r []byte, ctx *TL2Context) ([]byte, error)

func (*KernelValueString) Reset

func (v *KernelValueString) Reset()

func (*KernelValueString) UIFixPath

func (v *KernelValueString) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueString) UIKey

func (v *KernelValueString) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueString) UIStartEdit

func (v *KernelValueString) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueString) UIWrite

func (v *KernelValueString) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueString) WriteJSON

func (v *KernelValueString) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueString) WriteTL2

func (v *KernelValueString) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueStruct

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

func (*KernelValueStruct) Clone

func (v *KernelValueStruct) Clone() KernelValue

func (*KernelValueStruct) CloneObject

func (v *KernelValueStruct) CloneObject() KernelValueStruct

func (*KernelValueStruct) CompareForMapKey

func (v *KernelValueStruct) CompareForMapKey(other KernelValue) int

func (*KernelValueStruct) Random

func (v *KernelValueStruct) Random(rg *rand.Rand)

func (*KernelValueStruct) ReadFieldsTL2

func (v *KernelValueStruct) ReadFieldsTL2(block byte, currentR []byte, ctx *TL2Context) (err error)

func (*KernelValueStruct) ReadTL2

func (v *KernelValueStruct) ReadTL2(r []byte, ctx *TL2Context) (_ []byte, err error)

func (*KernelValueStruct) Reset

func (v *KernelValueStruct) Reset()

func (*KernelValueStruct) UIFixPath

func (v *KernelValueStruct) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueStruct) UIKey

func (v *KernelValueStruct) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueStruct) UIStartEdit

func (v *KernelValueStruct) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueStruct) UIWrite

func (v *KernelValueStruct) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueStruct) WriteJSON

func (v *KernelValueStruct) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueStruct) WriteTL2

func (v *KernelValueStruct) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueUint32

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

func (*KernelValueUint32) Clone

func (v *KernelValueUint32) Clone() KernelValue

func (*KernelValueUint32) CompareForMapKey

func (v *KernelValueUint32) CompareForMapKey(other KernelValue) int

func (*KernelValueUint32) Random

func (v *KernelValueUint32) Random(rg *rand.Rand)

func (*KernelValueUint32) ReadTL2

func (v *KernelValueUint32) ReadTL2(r []byte, ctx *TL2Context) ([]byte, error)

func (*KernelValueUint32) Reset

func (v *KernelValueUint32) Reset()

func (*KernelValueUint32) SetFromEditor

func (v *KernelValueUint32) SetFromEditor(str string) error

func (*KernelValueUint32) UIFixPath

func (v *KernelValueUint32) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueUint32) UIKey

func (v *KernelValueUint32) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueUint32) UIStartEdit

func (v *KernelValueUint32) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueUint32) UIWrite

func (v *KernelValueUint32) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueUint32) WriteJSON

func (v *KernelValueUint32) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueUint32) WriteTL2

func (v *KernelValueUint32) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueUint64

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

func (*KernelValueUint64) Clone

func (v *KernelValueUint64) Clone() KernelValue

func (*KernelValueUint64) CompareForMapKey

func (v *KernelValueUint64) CompareForMapKey(other KernelValue) int

func (*KernelValueUint64) Random

func (v *KernelValueUint64) Random(rg *rand.Rand)

func (*KernelValueUint64) ReadTL2

func (v *KernelValueUint64) ReadTL2(r []byte, ctx *TL2Context) ([]byte, error)

func (*KernelValueUint64) Reset

func (v *KernelValueUint64) Reset()

func (*KernelValueUint64) SetFromEditor

func (v *KernelValueUint64) SetFromEditor(str string) error

func (*KernelValueUint64) UIFixPath

func (v *KernelValueUint64) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueUint64) UIKey

func (v *KernelValueUint64) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueUint64) UIStartEdit

func (v *KernelValueUint64) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueUint64) UIWrite

func (v *KernelValueUint64) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueUint64) WriteJSON

func (v *KernelValueUint64) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueUint64) WriteTL2

func (v *KernelValueUint64) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type KernelValueUnion

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

func (*KernelValueUnion) Clone

func (v *KernelValueUnion) Clone() KernelValue

func (*KernelValueUnion) CompareForMapKey

func (v *KernelValueUnion) CompareForMapKey(other KernelValue) int

func (*KernelValueUnion) Random

func (v *KernelValueUnion) Random(rg *rand.Rand)

func (*KernelValueUnion) ReadTL2

func (v *KernelValueUnion) ReadTL2(r []byte, ctx *TL2Context) (_ []byte, err error)

func (*KernelValueUnion) Reset

func (v *KernelValueUnion) Reset()

func (*KernelValueUnion) UIFixPath

func (v *KernelValueUnion) UIFixPath(side int, level int, model *UIModel) int

func (*KernelValueUnion) UIKey

func (v *KernelValueUnion) UIKey(level int, model *UIModel, insert bool, delete bool, up bool, down bool)

func (*KernelValueUnion) UIStartEdit

func (v *KernelValueUnion) UIStartEdit(level int, model *UIModel, createMode int)

func (*KernelValueUnion) UIWrite

func (v *KernelValueUnion) UIWrite(sb *strings.Builder, onPath bool, level int, model *UIModel)

func (*KernelValueUnion) WriteJSON

func (v *KernelValueUnion) WriteJSON(w []byte, ctx *TL2Context) []byte

func (*KernelValueUnion) WriteTL2

func (v *KernelValueUnion) WriteTL2(w *ByteBuilder, optimizeEmpty bool, onPath bool, level int, model *UIModel)

type LocalArg

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

type NameCollision added in v1.2.35

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

func (*NameCollision) AddSameCaseName added in v1.2.35

func (c *NameCollision) AddSameCaseName(name string, pr tlast.PositionRange, reason string) error

func (*NameCollision) AddUniqueName added in v1.2.35

func (c *NameCollision) AddUniqueName(name string, pr tlast.PositionRange, reason string) error

func (*NameCollision) NormalizeName added in v1.2.35

func (c *NameCollision) NormalizeName(s string) string

func (*NameCollision) ResetNormalized added in v1.2.35

func (c *NameCollision) ResetNormalized()

allows normalized checks between template arguments and fields, but strict checks between them

type NatFieldUsage added in v1.3.22

type NatFieldUsage struct {
	UsedAsMask bool

	UsedAsSize bool

	AffectedFields [32]map[*TypeInstanceStruct][]int // bit->type->fieldIndexes
	// contains filtered or unexported fields
}

func (*NatFieldUsage) UsedBits added in v1.3.22

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.

	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

	// 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 TL2Context

type TL2Context struct {
}

common for read/write/json/etc... for simplicity

type TypeInstance

type TypeInstance interface {
	CanonicalName() string
	KernelType() *KernelType
	Common() *TypeInstanceCommon

	GoodForMapKey() bool
	IsBit() bool // for vector/tuple special case
	FindCycle(c *cycleFinder)
	GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance
	BoxedOnly() bool

	CreateValue() KernelValue
	SkipTL2(r []byte) ([]byte, error)
}

type TypeInstanceAlias

type TypeInstanceAlias struct {
	TypeInstanceCommon
	// contains filtered or unexported fields
}

func (*TypeInstanceAlias) CreateValue

func (ins *TypeInstanceAlias) CreateValue() KernelValue

func (*TypeInstanceAlias) FindCycle

func (ins *TypeInstanceAlias) FindCycle(c *cycleFinder)

func (*TypeInstanceAlias) GetChildren added in v1.3.13

func (ins *TypeInstanceAlias) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance

func (*TypeInstanceAlias) GoodForMapKey

func (ins *TypeInstanceAlias) GoodForMapKey() bool

func (*TypeInstanceAlias) IsBit

func (ins *TypeInstanceAlias) IsBit() bool

func (*TypeInstanceAlias) SkipTL2

func (ins *TypeInstanceAlias) SkipTL2(r []byte) ([]byte, error)

type TypeInstanceArray

type TypeInstanceArray struct {
	TypeInstanceCommon
	// contains filtered or unexported fields
}

func (*TypeInstanceArray) Count added in v1.2.35

func (ins *TypeInstanceArray) Count() uint32

func (*TypeInstanceArray) CreateValue

func (ins *TypeInstanceArray) CreateValue() KernelValue

func (*TypeInstanceArray) DynamicSize added in v1.2.35

func (ins *TypeInstanceArray) DynamicSize() bool

func (*TypeInstanceArray) Field added in v1.3.13

func (ins *TypeInstanceArray) Field() Field

func (*TypeInstanceArray) FindCycle

func (ins *TypeInstanceArray) FindCycle(c *cycleFinder)

func (*TypeInstanceArray) GetChildren added in v1.3.13

func (ins *TypeInstanceArray) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance

func (*TypeInstanceArray) IsTuple added in v1.2.35

func (ins *TypeInstanceArray) IsTuple() bool

func (*TypeInstanceArray) SkipTL2

func (ins *TypeInstanceArray) SkipTL2(r []byte) ([]byte, error)

type TypeInstanceArrayBit

type TypeInstanceArrayBit struct {
	TypeInstanceCommon
	// contains filtered or unexported fields
}

func (*TypeInstanceArrayBit) CreateValue

func (ins *TypeInstanceArrayBit) CreateValue() KernelValue

func (*TypeInstanceArrayBit) FindCycle

func (ins *TypeInstanceArrayBit) FindCycle(c *cycleFinder)

func (*TypeInstanceArrayBit) GetChildren added in v1.3.13

func (ins *TypeInstanceArrayBit) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance

func (*TypeInstanceArrayBit) SkipTL2

func (ins *TypeInstanceArrayBit) SkipTL2(r []byte) ([]byte, error)

type TypeInstanceCommon

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

func (*TypeInstanceCommon) ArgNamespace added in v1.2.35

func (ins *TypeInstanceCommon) ArgNamespace() string

func (*TypeInstanceCommon) BoxedOnly added in v1.2.35

func (ins *TypeInstanceCommon) BoxedOnly() bool

func (*TypeInstanceCommon) CanonicalName

func (ins *TypeInstanceCommon) CanonicalName() string

func (*TypeInstanceCommon) CommentBefore added in v1.3.21

func (ins *TypeInstanceCommon) CommentBefore() string

union has also comment per variant

func (*TypeInstanceCommon) CommentRight added in v1.3.21

func (ins *TypeInstanceCommon) CommentRight() string

func (*TypeInstanceCommon) Common added in v1.2.35

func (ins *TypeInstanceCommon) Common() *TypeInstanceCommon

func (*TypeInstanceCommon) GoodForMapKey

func (ins *TypeInstanceCommon) GoodForMapKey() bool

func (*TypeInstanceCommon) HasTL2 added in v1.3.13

func (ins *TypeInstanceCommon) HasTL2() bool

func (*TypeInstanceCommon) IsBit

func (ins *TypeInstanceCommon) IsBit() bool

func (*TypeInstanceCommon) IsTopLevel added in v1.2.36

func (ins *TypeInstanceCommon) IsTopLevel() bool

func (*TypeInstanceCommon) KernelType added in v1.2.35

func (ins *TypeInstanceCommon) KernelType() *KernelType

func (*TypeInstanceCommon) NatParams

func (ins *TypeInstanceCommon) NatParams() []string

func (*TypeInstanceCommon) OriginTL2 added in v1.3.22

func (ins *TypeInstanceCommon) OriginTL2() bool

func (*TypeInstanceCommon) ResolvedType added in v1.2.35

func (ins *TypeInstanceCommon) ResolvedType() tlast.TL2TypeRef

func (*TypeInstanceCommon) TLName added in v1.2.36

func (ins *TypeInstanceCommon) TLName() tlast.TL2TypeName

func (*TypeInstanceCommon) TLName2 added in v1.3.15

func (ins *TypeInstanceCommon) TLName2() tlast.TL2TypeName

func (*TypeInstanceCommon) TLTag added in v1.2.36

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 added in v1.3.0

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) CreateValue

func (ins *TypeInstanceDict) CreateValue() KernelValue

func (*TypeInstanceDict) Field added in v1.3.13

func (ins *TypeInstanceDict) Field() Field

func (*TypeInstanceDict) FieldType added in v1.2.35

func (ins *TypeInstanceDict) FieldType() *TypeInstanceStruct

func (*TypeInstanceDict) FindCycle

func (ins *TypeInstanceDict) FindCycle(c *cycleFinder)

func (*TypeInstanceDict) GetChildren added in v1.3.13

func (ins *TypeInstanceDict) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance

func (*TypeInstanceDict) SkipTL2

func (ins *TypeInstanceDict) SkipTL2(r []byte) ([]byte, error)

type TypeInstancePrimitive

type TypeInstancePrimitive struct {
	TypeInstanceCommon
	// contains filtered or unexported fields
}

func (*TypeInstancePrimitive) CreateValue

func (ins *TypeInstancePrimitive) CreateValue() KernelValue

func (*TypeInstancePrimitive) FindCycle

func (ins *TypeInstancePrimitive) FindCycle(c *cycleFinder)

func (*TypeInstancePrimitive) GetChildren added in v1.3.13

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

func (*TypeInstancePrimitive) IsTL1Bool added in v1.3.0

func (ins *TypeInstancePrimitive) IsTL1Bool() (ok bool, falseTag uint32, trueTag uint32)

func (*TypeInstancePrimitive) SkipTL2

func (ins *TypeInstancePrimitive) SkipTL2(r []byte) ([]byte, error)

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) CreateValue

func (ins *TypeInstanceStruct) CreateValue() KernelValue

func (*TypeInstanceStruct) CreateValueObject

func (ins *TypeInstanceStruct) CreateValueObject() KernelValueStruct

func (*TypeInstanceStruct) Fields added in v1.2.35

func (ins *TypeInstanceStruct) Fields() []Field

func (*TypeInstanceStruct) FindCycle

func (ins *TypeInstanceStruct) FindCycle(c *cycleFinder)

func (*TypeInstanceStruct) GetChildren added in v1.3.13

func (ins *TypeInstanceStruct) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance

func (*TypeInstanceStruct) GetNatFieldUsage added in v1.3.22

func (ins *TypeInstanceStruct) GetNatFieldUsage(fieldIndex int, inStructFields bool, inReturnType bool) NatFieldUsage

func (*TypeInstanceStruct) IsAlias added in v1.3.22

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 added in v1.3.14

func (ins *TypeInstanceStruct) IsResultAlias() bool

func (*TypeInstanceStruct) IsTypeDef added in v1.3.0

func (trw *TypeInstanceStruct) IsTypeDef() bool

most generators will need to add !recursive

func (*TypeInstanceStruct) IsUnwrap added in v1.2.36

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 added in v1.3.11

func (ins *TypeInstanceStruct) RPCPreferTL2() bool

func (*TypeInstanceStruct) ReplaceUnwrapArgs added in v1.3.0

func (ins *TypeInstanceStruct) ReplaceUnwrapArgs(natArgs []string) []string

same code as in func (w *TypeInstanceCommon) TransformNatArgsToChild

func (*TypeInstanceStruct) ResultNatArgs added in v1.2.35

func (ins *TypeInstanceStruct) ResultNatArgs() []ActualNatArg

func (*TypeInstanceStruct) ResultType added in v1.2.35

func (ins *TypeInstanceStruct) ResultType() TypeInstance

func (*TypeInstanceStruct) SkipTL2

func (ins *TypeInstanceStruct) SkipTL2(r []byte) ([]byte, error)

type TypeInstanceUnion

type TypeInstanceUnion struct {
	TypeInstanceCommon
	// contains filtered or unexported fields
}

func (*TypeInstanceUnion) BoxedOnly added in v1.2.35

func (ins *TypeInstanceUnion) BoxedOnly() bool

func (*TypeInstanceUnion) CreateValue

func (ins *TypeInstanceUnion) CreateValue() KernelValue

func (*TypeInstanceUnion) ElementNatArgs added in v1.2.35

func (ins *TypeInstanceUnion) ElementNatArgs() []ActualNatArg

func (*TypeInstanceUnion) FindCycle

func (ins *TypeInstanceUnion) FindCycle(c *cycleFinder)

func (*TypeInstanceUnion) GetChildren added in v1.3.13

func (ins *TypeInstanceUnion) GetChildren(children []TypeInstance, withReturnType bool) []TypeInstance

func (*TypeInstanceUnion) IsEnum added in v1.2.35

func (ins *TypeInstanceUnion) IsEnum() bool

func (*TypeInstanceUnion) IsUnionMaybe added in v1.2.36

func (ins *TypeInstanceUnion) IsUnionMaybe() (isMaybe bool, elementField Field)

This is hint to generators

func (*TypeInstanceUnion) SkipTL2

func (ins *TypeInstanceUnion) SkipTL2(r []byte) ([]byte, error)

func (*TypeInstanceUnion) VariantNames added in v1.2.35

func (ins *TypeInstanceUnion) VariantNames() []string

func (*TypeInstanceUnion) VariantTypes added in v1.2.35

func (ins *TypeInstanceUnion) VariantTypes() []*TypeInstanceStruct

type UIBlinkMsg

type UIBlinkMsg struct {
	On bool
}

type UIEditor

type UIEditor interface {
	Value() KernelValue

	UIWrite(sb *strings.Builder, model *UIModel)

	OnRune(msg string, model *UIModel)
	OnBackspace(model *UIModel)
	OnEnter(model *UIModel)
	OnTab(model *UIModel, side int) // -1 Shift-Tab
	OnEscape(model *UIModel)
}

type UIEditorPrimitive

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

func (*UIEditorPrimitive) OnBackspace

func (e *UIEditorPrimitive) OnBackspace(model *UIModel)

func (*UIEditorPrimitive) OnEnter

func (e *UIEditorPrimitive) OnEnter(model *UIModel)

func (*UIEditorPrimitive) OnEscape

func (e *UIEditorPrimitive) OnEscape(model *UIModel)

func (*UIEditorPrimitive) OnRune

func (e *UIEditorPrimitive) OnRune(msg string, model *UIModel)

func (*UIEditorPrimitive) OnTab

func (e *UIEditorPrimitive) OnTab(model *UIModel, side int)

func (*UIEditorPrimitive) SetValue

func (e *UIEditorPrimitive) SetValue(v KernelValuePrimitive)

func (*UIEditorPrimitive) UIWrite

func (e *UIEditorPrimitive) UIWrite(sb *strings.Builder, model *UIModel)

func (*UIEditorPrimitive) Value

func (e *UIEditorPrimitive) Value() KernelValue

type UIEditorString

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

func (*UIEditorString) FinishOK

func (e *UIEditorString) FinishOK()

func (*UIEditorString) OnBackspace

func (e *UIEditorString) OnBackspace(model *UIModel)

func (*UIEditorString) OnEnter

func (e *UIEditorString) OnEnter(model *UIModel)

func (*UIEditorString) OnEscape

func (e *UIEditorString) OnEscape(model *UIModel)

func (*UIEditorString) OnRune

func (e *UIEditorString) OnRune(msg string, model *UIModel)

func (*UIEditorString) OnTab

func (e *UIEditorString) OnTab(model *UIModel, side int)

func (*UIEditorString) SetValue

func (e *UIEditorString) SetValue(v *KernelValueString)

func (*UIEditorString) UIWrite

func (e *UIEditorString) UIWrite(sb *strings.Builder, model *UIModel)

func (*UIEditorString) Value

func (e *UIEditorString) Value() KernelValue

type UIEditorUnion

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

func (*UIEditorUnion) FinishOK

func (e *UIEditorUnion) FinishOK()

func (*UIEditorUnion) OnBackspace

func (e *UIEditorUnion) OnBackspace(model *UIModel)

func (*UIEditorUnion) OnEnter

func (e *UIEditorUnion) OnEnter(model *UIModel)

func (*UIEditorUnion) OnEscape

func (e *UIEditorUnion) OnEscape(model *UIModel)

func (*UIEditorUnion) OnRune

func (e *UIEditorUnion) OnRune(msg string, model *UIModel)

func (*UIEditorUnion) OnTab

func (e *UIEditorUnion) OnTab(model *UIModel, side int)

func (*UIEditorUnion) SetValue

func (e *UIEditorUnion) SetValue(v *KernelValueUnion)

func (*UIEditorUnion) UIWrite

func (e *UIEditorUnion) UIWrite(sb *strings.Builder, model *UIModel)

func (*UIEditorUnion) Value

func (e *UIEditorUnion) Value() KernelValue

type UIModel

type UIModel struct {
	Fun KernelValueStruct

	Path []int // selected field on every hierarchy level, 0 means union constructor

	Blink UIBlinkMsg

	CurrentEditor UIEditor

	LastError error

	ShowLegend bool

	EditorUnion     UIEditorUnion
	EditorString    UIEditorString
	EditorPrimitive UIEditorPrimitive

	Width  int
	Height int
}

func (*UIModel) Move

func (m *UIModel) Move(side int)

func (*UIModel) Right

func (m *UIModel) Right()

func (*UIModel) SetCurrentEditor

func (m *UIModel) SetCurrentEditor(e UIEditor)

func (*UIModel) StartEdit

func (m *UIModel) StartEdit(createMode int)

func (*UIModel) View

func (m *UIModel) View() string

func (*UIModel) WriteCursor

func (m *UIModel) WriteCursor(sb *strings.Builder, text string)

type Whitelist

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

func NewWhiteList

func NewWhiteList(whiltelistName string, filter string) Whitelist

func (*Whitelist) Empty added in v1.2.35

func (w *Whitelist) Empty() bool

func (*Whitelist) HasName added in v1.2.35

func (w *Whitelist) HasName(name tlast.Name) bool

func (*Whitelist) HasName2 added in v1.3.19

func (w *Whitelist) HasName2(name tlast.TL2TypeName) bool

func (*Whitelist) UnusedWarning added in v1.3.22

func (w *Whitelist) UnusedWarning() error

Jump to

Keyboard shortcuts

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