literal

package
v0.24.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Code generated by Tapestry; edit at your own risk.

Index

Constants

This section is empty.

Variables

View Source
var Z_Types = typeinfo.TypeSet{
	Name:       "literal",
	Slot:       z_slot_list,
	Flow:       z_flow_list,
	Signatures: z_signatures,
}

package listing of type data

View Source
var Zt_BoolValue typeinfo.Flow

bool_value, a type of flow.

View Source
var Zt_FieldList typeinfo.Flow

field_list, a type of flow.

View Source
var Zt_FieldValue typeinfo.Flow

field_value, a type of flow.

View Source
var Zt_LiteralValue = typeinfo.Slot{
	Name: "literal_value",
	Markup: map[string]any{
		"blockly-color": "MATH_HUE",
		"comment":       "Slot for constant values.",
	},
}

literal_value, a type of slot.

View Source
var Zt_NumValue typeinfo.Flow

num_value, a type of flow.

View Source
var Zt_NumValues typeinfo.Flow

num_values, a type of flow.

View Source
var Zt_RecordList typeinfo.Flow

record_list, a type of flow.

View Source
var Zt_RecordValue typeinfo.Flow

record_value, a type of flow.

View Source
var Zt_TextValue typeinfo.Flow

text_value, a type of flow.

View Source
var Zt_TextValues typeinfo.Flow

text_values, a type of flow.

Functions

func CustomDecoder

func CustomDecoder(_ *decode.Decoder, slot *typeinfo.Slot, body any) (typeinfo.Instance, error)

func CustomEncoder

func CustomEncoder(enc *encode.Encoder, op typeinfo.Instance) (ret any, err error)

Write literal commands as plain values. ex. BoolValue becomes a bool (true or false) in the output data.

note: TextValues and NumValues of containing a single value and serialized as that single value ( [6]-> 6 ) because, in theory, that can help simply the specification for authors.

func DecodeLiteral

func DecodeLiteral(slot *typeinfo.Slot, body any) (ret typeinfo.Instance, err error)

func GetAffinity

func GetAffinity(a LiteralValue) (ret affine.Affinity)

Types

type BoolValue

type BoolValue struct {
	Value  bool
	Kind   string
	Markup map[string]any
}

Specify an explicit true or false.

func B

func B(b bool) *BoolValue

func (*BoolValue) GetBool

func (op *BoolValue) GetBool(run rt.Runtime) (rt.Value, error)

GetBool implements rt.BoolEval; providing the dl with a boolean literal.

func (*BoolValue) GetLiteralValue

func (op *BoolValue) GetLiteralValue(rt.Kinds) (ret rt.Value, _ error)

func (*BoolValue) GetMarkup

func (op *BoolValue) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*BoolValue) String

func (op *BoolValue) String() string

String uses strconv.FormatBool.

func (*BoolValue) TypeInfo

func (*BoolValue) TypeInfo() typeinfo.T

implements typeinfo.Instance

type BoolValue_Slice

type BoolValue_Slice []BoolValue

holds a slice of type bool_value

func (*BoolValue_Slice) Repeats

func (op *BoolValue_Slice) Repeats() bool

implements typeinfo.Repeats

func (*BoolValue_Slice) TypeInfo

func (*BoolValue_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type FieldList

type FieldList struct {
	Fields []FieldValue
	Markup map[string]any
}

A series of values all for the same record. While it can be specified wherever a literal value can, it only has meaning when the record type is known.

func (*FieldList) GetLiteralValue

func (op *FieldList) GetLiteralValue(rt.Kinds) (rt.Value, error)

unimplemented: panics.

func (*FieldList) GetMarkup

func (op *FieldList) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*FieldList) String

func (op *FieldList) String() (ret string)

unimplemented: panics.

func (*FieldList) TypeInfo

func (*FieldList) TypeInfo() typeinfo.T

implements typeinfo.Instance

type FieldList_Slice

type FieldList_Slice []FieldList

holds a slice of type field_list

func (*FieldList_Slice) Repeats

func (op *FieldList_Slice) Repeats() bool

implements typeinfo.Repeats

func (*FieldList_Slice) TypeInfo

func (*FieldList_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type FieldValue

type FieldValue struct {
	Field  string
	Value  LiteralValue
	Markup map[string]any
}

A fixed value of a record.

func (*FieldValue) GetMarkup

func (op *FieldValue) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*FieldValue) TypeInfo

func (*FieldValue) TypeInfo() typeinfo.T

implements typeinfo.Instance

type FieldValue_Slice

type FieldValue_Slice []FieldValue

holds a slice of type field_value

func (*FieldValue_Slice) Repeats

func (op *FieldValue_Slice) Repeats() bool

implements typeinfo.Repeats

func (*FieldValue_Slice) TypeInfo

func (*FieldValue_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type LiteralValue

type LiteralValue interface {
	GetLiteralValue(rt.Kinds) (rt.Value, error)
}

LiteralValue marks script constants.

func ReadLiteral

func ReadLiteral(aff affine.Affinity, kind string, val any) (ret LiteralValue, err error)

type LiteralValue_Slot

type LiteralValue_Slot struct{ Value LiteralValue }

holds a single slot.

func (*LiteralValue_Slot) TypeInfo

func (*LiteralValue_Slot) TypeInfo() typeinfo.T

implements typeinfo.Instance for a single slot.

type LiteralValue_Slots

type LiteralValue_Slots []LiteralValue

holds a slice of slots.

func (*LiteralValue_Slots) Repeats

func (op *LiteralValue_Slots) Repeats() bool

implements typeinfo.Repeats

func (*LiteralValue_Slots) TypeInfo

func (*LiteralValue_Slots) TypeInfo() typeinfo.T

implements typeinfo.Instance for a series of slots.

type NumValue

type NumValue struct {
	Value  float64
	Kind   string
	Markup map[string]any
}

Specify a particular number.

func F

func F(n float64) *NumValue

func I

func I(n int) *NumValue

func (*NumValue) Float

func (op *NumValue) Float() float64

Float converts to native float.

func (*NumValue) GetLiteralValue

func (op *NumValue) GetLiteralValue(rt.Kinds) (ret rt.Value, _ error)

func (*NumValue) GetMarkup

func (op *NumValue) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*NumValue) GetNumber

func (op *NumValue) GetNumber(run rt.Runtime) (rt.Value, error)

GetNumber implements rt.NumberEval providing the dl with a number literal.

func (*NumValue) Int

func (op *NumValue) Int() int

Int converts to native int.

func (*NumValue) String

func (op *NumValue) String() string

String returns a nicely formatted float, with no decimal point when possible.

func (*NumValue) TypeInfo

func (*NumValue) TypeInfo() typeinfo.T

implements typeinfo.Instance

type NumValue_Slice

type NumValue_Slice []NumValue

holds a slice of type num_value

func (*NumValue_Slice) Repeats

func (op *NumValue_Slice) Repeats() bool

implements typeinfo.Repeats

func (*NumValue_Slice) TypeInfo

func (*NumValue_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type NumValues

type NumValues struct {
	Values []float64
	Kind   string
	Markup map[string]any
}

Number List: Specify a list of numbers.

func (*NumValues) GetLiteralValue

func (op *NumValues) GetLiteralValue(rt.Kinds) (ret rt.Value, _ error)

func (*NumValues) GetMarkup

func (op *NumValues) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*NumValues) GetNumList

func (op *NumValues) GetNumList(run rt.Runtime) (rt.Value, error)

GetNumList implements rt.NumListEval providing the dl with a literal list of numbers.

func (*NumValues) TypeInfo

func (*NumValues) TypeInfo() typeinfo.T

implements typeinfo.Instance

type NumValues_Slice

type NumValues_Slice []NumValues

holds a slice of type num_values

func (*NumValues_Slice) Repeats

func (op *NumValues_Slice) Repeats() bool

implements typeinfo.Repeats

func (*NumValues_Slice) TypeInfo

func (*NumValues_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RecordCache

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

func (*RecordCache) GetRecord

func (rc *RecordCache) GetRecord(kinds rt.Kinds, kind string, fields []FieldValue) (ret rt.Value, err error)

type RecordList

type RecordList struct {
	Kind    string
	Records []FieldList
	Cache   RecordsCache
	Markup  map[string]any
}

Specify a series of records, all of the same kind.

func (*RecordList) GetLiteralValue

func (op *RecordList) GetLiteralValue(kinds rt.Kinds) (rt.Value, error)

func (*RecordList) GetMarkup

func (op *RecordList) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*RecordList) GetRecordList

func (op *RecordList) GetRecordList(run rt.Runtime) (ret rt.Value, _ error)

GetNumList implements rt.RecordListEval providing the dl with a literal list of records.

func (*RecordList) TypeInfo

func (*RecordList) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RecordList_Slice

type RecordList_Slice []RecordList

holds a slice of type record_list

func (*RecordList_Slice) Repeats

func (op *RecordList_Slice) Repeats() bool

implements typeinfo.Repeats

func (*RecordList_Slice) TypeInfo

func (*RecordList_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RecordValue

type RecordValue struct {
	Kind   string
	Fields []FieldValue
	Cache  RecordCache
	Markup map[string]any
}

Specify a record composed of literal values.

func (*RecordValue) GetLiteralValue

func (op *RecordValue) GetLiteralValue(kinds rt.Kinds) (ret rt.Value, err error)

func (*RecordValue) GetMarkup

func (op *RecordValue) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*RecordValue) GetRecord

func (op *RecordValue) GetRecord(run rt.Runtime) (rt.Value, error)

GetRecord implements interface rt.RecordEval providing the dl with a structured literal.

func (*RecordValue) TypeInfo

func (*RecordValue) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RecordValue_Slice

type RecordValue_Slice []RecordValue

holds a slice of type record_value

func (*RecordValue_Slice) Repeats

func (op *RecordValue_Slice) Repeats() bool

implements typeinfo.Repeats

func (*RecordValue_Slice) TypeInfo

func (*RecordValue_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type RecordsCache

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

func (*RecordsCache) GetRecords

func (rc *RecordsCache) GetRecords(kinds rt.Kinds, kind string, els []FieldList) (ret rt.Value, err error)

type TextValue

type TextValue struct {
	Value  string
	Kind   string
	Markup map[string]any
}

Specify a small bit of text.

func T

func T(s string) *TextValue

func (*TextValue) GetLiteralValue

func (op *TextValue) GetLiteralValue(rt.Kinds) (ret rt.Value, _ error)

func (*TextValue) GetMarkup

func (op *TextValue) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*TextValue) GetText

func (op *TextValue) GetText(run rt.Runtime) (rt.Value, error)

GetText implements interface rt.TextEval providing the dl with a text literal.

func (*TextValue) String

func (op *TextValue) String() string

String returns the text.

func (*TextValue) TypeInfo

func (*TextValue) TypeInfo() typeinfo.T

implements typeinfo.Instance

type TextValue_Slice

type TextValue_Slice []TextValue

holds a slice of type text_value

func (*TextValue_Slice) Repeats

func (op *TextValue_Slice) Repeats() bool

implements typeinfo.Repeats

func (*TextValue_Slice) TypeInfo

func (*TextValue_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

type TextValues

type TextValues struct {
	Values []string
	Kind   string
	Markup map[string]any
}

Text List: Specifies a set of text values.

func Ts

func Ts(s ...string) *TextValues

func (*TextValues) GetLiteralValue

func (op *TextValues) GetLiteralValue(rt.Kinds) (ret rt.Value, _ error)

func (*TextValues) GetMarkup

func (op *TextValues) GetMarkup(ensure bool) map[string]any

implements typeinfo.Markup

func (*TextValues) GetTextList

func (op *TextValues) GetTextList(run rt.Runtime) (ret rt.Value, _ error)

GetTextList implements rt.TextListEval providing the dl with a literal list of text.

func (*TextValues) TypeInfo

func (*TextValues) TypeInfo() typeinfo.T

implements typeinfo.Instance

type TextValues_Slice

type TextValues_Slice []TextValues

holds a slice of type text_values

func (*TextValues_Slice) Repeats

func (op *TextValues_Slice) Repeats() bool

implements typeinfo.Repeats

func (*TextValues_Slice) TypeInfo

func (*TextValues_Slice) TypeInfo() typeinfo.T

implements typeinfo.Instance

Jump to

Keyboard shortcuts

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