Documentation
¶
Index ¶
- Variables
- func IsIdentifier(e Executable) bool
- type Addition
- type Assignment
- type AssignmentExecute
- type Base
- type BinaryOperation
- type BoolValue
- type Command
- type Comment
- type Comparison
- type ComparisonOperation
- type CompileErrors
- type Executable
- type ExecutableBlock
- type ExecutionEnvironment
- func (ee *ExecutionEnvironment) Get(key string) any
- func (ee *ExecutionEnvironment) GlobalExists(key string) bool
- func (ee *ExecutionEnvironment) NewLocalEnvironment() *ExecutionEnvironment
- func (ee *ExecutionEnvironment) Set(key string, value any)
- func (ee *ExecutionEnvironment) SetGlobal(key string, value any)
- type ExecutionResult
- type Expression
- type FloatValue
- type FunctionExecute
- type IdentifierValue
- type InnerFunctionExecute
- func (ife InnerFunctionExecute) Apply(ee *ExecutionEnvironment) ExecutionResult
- func (ife InnerFunctionExecute) Execute(ee *ExecutionEnvironment) ExecutionResult
- func (ife InnerFunctionExecute) ListRep() []any
- func (ife InnerFunctionExecute) ParameterNames() []string
- func (ife InnerFunctionExecute) Type(typeMap TypeMap) Type
- type IntegerValue
- type Invocation
- type InvocationExecute
- type KeyValue
- type KeyValueExecute
- type KeyValueResult
- type List
- type ListExecute
- type ListResult
- type ListValue
- type Logical
- type Multiplication
- type NamedFunction
- type OpAddition
- type OpAssignment
- type OpComparison
- type OpLogical
- type OpMultiplication
- type OpPipe
- type Operator
- type Parameterized
- type Pipe
- type PipeExecute
- type PlusAssignmentExecute
- type Program
- type ProgramExecute
- type RequiredBlock
- type Series
- type SeriesExecute
- type ShortCircuitAnd
- type ShortCircuitOr
- type StatementBlock
- type StringValue
- type TagValue
- type Type
- type TypeMap
- type Unary
- type UnaryExecuteMinusInteger
- type UnaryExecuteNot
- type UnaryExecuteSubtractFloat
- type UnnamedFunction
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TagNull = TagValue{Value: "#null"} TagComplete = TagValue{Value: "#complete"} TagContinue = TagValue{Value: "#continue"} TagBreak = TagValue{Value: "#break"} )
View Source
var ( PlusOpMap = [TypeCount]func(any, any) any{ TypeFloat: func(a, b any) any { return FloatValue(a.(FloatValue) + b.(FloatValue)) }, TypeInteger: func(a, b any) any { return IntegerValue(a.(IntegerValue) + b.(IntegerValue)) }, TypeString: func(a, b any) any { return StringValue(a.(StringValue) + b.(StringValue)) }, } MinusOpMap = [TypeCount]func(any, any) any{ TypeFloat: func(a, b any) any { return FloatValue(a.(FloatValue) - b.(FloatValue)) }, TypeInteger: func(a, b any) any { return IntegerValue(a.(IntegerValue) - b.(IntegerValue)) }, } MultOpMap = [TypeCount]func(any, any) any{ TypeFloat: func(a, b any) any { return FloatValue(a.(FloatValue) * b.(FloatValue)) }, TypeInteger: func(a, b any) any { return IntegerValue(a.(IntegerValue) * b.(IntegerValue)) }, } DivOpMap = [TypeCount]func(any, any) any{ TypeFloat: func(a, b any) any { return FloatValue(a.(FloatValue) / b.(FloatValue)) }, TypeInteger: func(a, b any) any { return IntegerValue(a.(IntegerValue) / b.(IntegerValue)) }, } ModuloOpMap = [TypeCount]func(any, any) any{ TypeInteger: func(a, b any) any { return IntegerValue(a.(IntegerValue) % b.(IntegerValue)) }, } EqualOpMap = [TypeCount]func(any, any) BoolValue{ TypeBool: func(a, b any) BoolValue { return BoolValue(a.(BoolValue) == b.(BoolValue)) }, TypeFloat: func(a, b any) BoolValue { return BoolValue(a.(FloatValue) == b.(FloatValue)) }, TypeInteger: func(a, b any) BoolValue { return BoolValue(a.(IntegerValue) == b.(IntegerValue)) }, TypeString: func(a, b any) BoolValue { return BoolValue(a.(StringValue) == b.(StringValue)) }, TypeTag: func(a, b any) BoolValue { return BoolValue(a.(TagValue).Value == b.(TagValue).Value) }, } NotEqualOpMap = [TypeCount]func(any, any) BoolValue{ TypeBool: func(a, b any) BoolValue { return BoolValue(a.(BoolValue) != b.(BoolValue)) }, TypeFloat: func(a, b any) BoolValue { return BoolValue(a.(FloatValue) != b.(FloatValue)) }, TypeInteger: func(a, b any) BoolValue { return BoolValue(a.(IntegerValue) != b.(IntegerValue)) }, TypeString: func(a, b any) BoolValue { return BoolValue(a.(StringValue) != b.(StringValue)) }, TypeTag: func(a, b any) BoolValue { return BoolValue(a.(TagValue).Value != b.(TagValue).Value) }, } LessThanOpMap = [TypeCount]func(any, any) BoolValue{ TypeFloat: func(a, b any) BoolValue { return BoolValue(a.(FloatValue) < b.(FloatValue)) }, TypeInteger: func(a, b any) BoolValue { return BoolValue(a.(IntegerValue) < b.(IntegerValue)) }, TypeString: func(a, b any) BoolValue { return BoolValue(a.(StringValue) < b.(StringValue)) }, } LessThanOrEqualOpMap = [TypeCount]func(any, any) BoolValue{ TypeFloat: func(a, b any) BoolValue { return BoolValue(a.(FloatValue) <= b.(FloatValue)) }, TypeInteger: func(a, b any) BoolValue { return BoolValue(a.(IntegerValue) <= b.(IntegerValue)) }, TypeString: func(a, b any) BoolValue { return BoolValue(a.(StringValue) <= b.(StringValue)) }, } GreaterThanOpMap = [TypeCount]func(any, any) BoolValue{ TypeFloat: func(a, b any) BoolValue { return BoolValue(a.(FloatValue) > b.(FloatValue)) }, TypeInteger: func(a, b any) BoolValue { return BoolValue(a.(IntegerValue) > b.(IntegerValue)) }, TypeString: func(a, b any) BoolValue { return BoolValue(a.(StringValue) > b.(StringValue)) }, } GreaterThanOrEqualOpMap = [TypeCount]func(any, any) BoolValue{ TypeFloat: func(a, b any) BoolValue { return BoolValue(a.(FloatValue) >= b.(FloatValue)) }, TypeInteger: func(a, b any) BoolValue { return BoolValue(a.(IntegerValue) >= b.(IntegerValue)) }, TypeString: func(a, b any) BoolValue { return BoolValue(a.(StringValue) >= b.(StringValue)) }, } )
View Source
var (
NoErrors = CompileErrors{}
)
View Source
var (
PipelineLexer = lexer.MustSimple([]lexer.SimpleRule{
{
Name: "Scriptor",
Pattern: `^#![^\n]*`,
},
{
Name: "Comment",
Pattern: `//[^\n]*`,
},
{
Name: "DotDot",
Pattern: `\.\.`,
},
{
Name: "AndAnd",
Pattern: `&&`,
},
{
Name: "OrOr",
Pattern: `\|\|`,
},
{
Name: "PlusEqual",
Pattern: `\+=`,
},
{
Name: "Plus",
Pattern: `\+`,
},
{
Name: "Minus",
Pattern: `-`,
},
{
Name: "Star",
Pattern: `\*`,
},
{
Name: "Slash",
Pattern: `/`,
},
{
Name: "Percent",
Pattern: `%`,
},
{
Name: "EqualEqual",
Pattern: `==`,
},
{
Name: "BangEqual",
Pattern: `!=`,
},
{
Name: "Bang",
Pattern: `!`,
},
{
Name: "MoreMoreMore",
Pattern: `>>>`,
},
{
Name: "MoreMore",
Pattern: `>>`,
},
{
Name: "LessEqual",
Pattern: `<=`,
},
{
Name: "MoreEqual",
Pattern: `>=`,
},
{
Name: "Less",
Pattern: `<`,
},
{
Name: "More",
Pattern: `>`,
},
{
Name: "Bang",
Pattern: `!`,
},
{
Name: "ColonEqual",
Pattern: `:=`,
},
{
Name: "Colon",
Pattern: `:`,
},
{
Name: "String",
Pattern: `"(\\"|[^"])*"`,
},
{
Name: "Function",
Pattern: `fn`,
},
{
Name: "FTail",
Pattern: `ƒ`,
},
{
Name: "Tag",
Pattern: `#[a-zA-Z0-9_][a-zA-Z0-9_-]*`,
},
{
Name: "Ident",
Pattern: `[a-zA-Z_\$]\w*`,
},
{
Name: "Punct",
Pattern: `[-[!@#$%^&*()+_={}\|:;"'<,>.?/]|]`,
},
{
Name: "EOL",
Pattern: `[\n\r]+`,
},
{
Name: "whitespace",
Pattern: `[ \t]+`,
},
{
Name: "DateTime",
Pattern: `\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?([+-]\d\d:\d\d)?`,
},
{
Name: "Date",
Pattern: `\d\d\d\d-\d\d-\d\d`,
},
{
Name: "Time",
Pattern: `\d\d:\d\d:\d\d(\.\d+)?`,
},
{
Name: "TimeSpan",
Pattern: `(\d+[ymdhs])+`,
},
{
Name: "Float",
Pattern: `[-+]?\d+\.\d+`,
},
{
Name: "Integer",
Pattern: `[-+]?\d\d*`,
},
})
)
Functions ¶
func IsIdentifier ¶
func IsIdentifier(e Executable) bool
Types ¶
type Addition ¶
type Addition struct { Pos lexer.Position Multiplication *Multiplication `parser:"@@"` Operations []*OpAddition `parser:"@@*"` }
func (*Addition) Compile ¶
func (a *Addition) Compile(typeMap TypeMap) (Executable, CompileErrors)
type Assignment ¶
type Assignment struct { Pos lexer.Position Pipe *Pipe `parser:"@@"` Operation *OpAssignment `parser:"@@?"` }
func (*Assignment) Compile ¶
func (a *Assignment) Compile(typeMap TypeMap) (Executable, CompileErrors)
func (Assignment) String ¶
func (a Assignment) String() string
type AssignmentExecute ¶
type AssignmentExecute struct { Assignment *Assignment Left IdentifierValue Right Executable }
func (AssignmentExecute) Execute ¶
func (ae AssignmentExecute) Execute(ee *ExecutionEnvironment) ExecutionResult
func (AssignmentExecute) ListRep ¶
func (ae AssignmentExecute) ListRep() []any
func (AssignmentExecute) Type ¶
func (ae AssignmentExecute) Type(typeMap TypeMap) Type
type Base ¶
type Base struct { Pos lexer.Position Subexpression *Expression `parser:" '(' @@ ')' "` List *List `parser:"| @@"` UnnamedFunction *UnnamedFunction `parser:"| @@ "` Invocation *Invocation `parser:"| @@ "` StringValue *string `parser:"| @String "` Bool *string `parser:"| @('true' | 'false')"` Tag *string `parser:"| @Tag"` Ident *string `parser:"| @Ident "` // DateTime *string `parser:"| @DateTime"` // Date *string `parser:"| @Date"` // Time *string `parser:"| @Time"` Float *float64 `parser:"| @Float"` Integer *int64 `parser:"| @Integer"` }
func (*Base) Compile ¶
func (b *Base) Compile(typeMap TypeMap) (Executable, CompileErrors)
type BinaryOperation ¶
type BinaryOperation struct { Pos lexer.Position Name string Func func(any, any) any Left, Right Executable TypeVal Type }
func (BinaryOperation) Execute ¶
func (bo BinaryOperation) Execute(ee *ExecutionEnvironment) ExecutionResult
func (BinaryOperation) ListRep ¶
func (bo BinaryOperation) ListRep() []any
func (BinaryOperation) Type ¶
func (bo BinaryOperation) Type(typeMap TypeMap) Type
type BoolValue ¶
type BoolValue bool
func (BoolValue) Execute ¶
func (b BoolValue) Execute(ee *ExecutionEnvironment) ExecutionResult
type Command ¶
type Command struct { Pos lexer.Position Scriptor *string `parser:" @Scriptor "` Comment *Comment `parser:"| @@ "` EOL *string `parser:"| @EOL "` NamedFunction *NamedFunction `parser:"| @@ "` // named functions only allowed at top level Expression *Expression `parser:"| @@ (EOL|EOF|(Comment (EOL|EOF))) "` }
Command is basically a line, or a multi-line.
type Comparison ¶
type Comparison struct { Pos lexer.Position Series *Series `parser:"@@"` Operations []*OpComparison `parser:"@@*"` }
func (*Comparison) Compile ¶
func (c *Comparison) Compile(typeMap TypeMap) (Executable, CompileErrors)
func (Comparison) String ¶
func (c Comparison) String() string
type ComparisonOperation ¶
type ComparisonOperation struct { Pos lexer.Position Name string Func func(any, any) BoolValue Left, Right Executable }
func (ComparisonOperation) Execute ¶
func (co ComparisonOperation) Execute(ee *ExecutionEnvironment) ExecutionResult
func (ComparisonOperation) ListRep ¶
func (co ComparisonOperation) ListRep() []any
func (ComparisonOperation) Type ¶
func (co ComparisonOperation) Type(typeMap TypeMap) Type
type CompileErrors ¶
type CompileErrors struct {
Errs *[]error
}
func NewError ¶
func NewError(err error) CompileErrors
func (*CompileErrors) Append ¶
func (ce *CompileErrors) Append(err ...error) CompileErrors
func (*CompileErrors) Collect ¶
func (ce *CompileErrors) Collect(e Executable, errs CompileErrors) Executable
func (CompileErrors) Len ¶
func (ce CompileErrors) Len() int
type Executable ¶
type Executable interface { Execute(*ExecutionEnvironment) ExecutionResult Type(TypeMap) Type ListRep() []any }
type ExecutableBlock ¶
type ExecutableBlock struct {
Commands []Executable
}
func (ExecutableBlock) Execute ¶
func (b ExecutableBlock) Execute(ee *ExecutionEnvironment) ExecutionResult
func (ExecutableBlock) ListRep ¶
func (b ExecutableBlock) ListRep() []any
func (ExecutableBlock) Type ¶
func (b ExecutableBlock) Type(typeMap TypeMap) Type
type ExecutionEnvironment ¶
type ExecutionEnvironment struct {
// contains filtered or unexported fields
}
func NewExecutionEnvironment ¶
func NewExecutionEnvironment() *ExecutionEnvironment
func (*ExecutionEnvironment) Get ¶
func (ee *ExecutionEnvironment) Get(key string) any
func (*ExecutionEnvironment) GlobalExists ¶
func (ee *ExecutionEnvironment) GlobalExists(key string) bool
func (*ExecutionEnvironment) NewLocalEnvironment ¶
func (ee *ExecutionEnvironment) NewLocalEnvironment() *ExecutionEnvironment
func (*ExecutionEnvironment) Set ¶
func (ee *ExecutionEnvironment) Set(key string, value any)
func (*ExecutionEnvironment) SetGlobal ¶
func (ee *ExecutionEnvironment) SetGlobal(key string, value any)
type ExecutionResult ¶
type ExecutionResult any
type Expression ¶
type Expression struct { Pos lexer.Position Assignment *Assignment `parser:"@@"` }
func (Expression) Compile ¶
func (e Expression) Compile(typeMap TypeMap) (Executable, CompileErrors)
func (Expression) String ¶
func (e Expression) String() string
type FloatValue ¶
type FloatValue float64
func (FloatValue) Execute ¶
func (f FloatValue) Execute(ee *ExecutionEnvironment) ExecutionResult
func (FloatValue) ListRep ¶
func (f FloatValue) ListRep() []any
func (FloatValue) Type ¶
func (f FloatValue) Type(typeMap TypeMap) Type
type FunctionExecute ¶
type FunctionExecute struct { *NamedFunction *UnnamedFunction ExecutableBlock }
func (FunctionExecute) Apply ¶
func (fe FunctionExecute) Apply(ee *ExecutionEnvironment) ExecutionResult
func (FunctionExecute) Execute ¶
func (fe FunctionExecute) Execute(ee *ExecutionEnvironment) ExecutionResult
func (FunctionExecute) ListRep ¶
func (fe FunctionExecute) ListRep() []any
func (FunctionExecute) ParameterNames ¶
func (fe FunctionExecute) ParameterNames() []string
func (FunctionExecute) Type ¶
func (fe FunctionExecute) Type(typeMap TypeMap) Type
type IdentifierValue ¶
func (IdentifierValue) Execute ¶
func (i IdentifierValue) Execute(ee *ExecutionEnvironment) ExecutionResult
func (IdentifierValue) ListRep ¶
func (i IdentifierValue) ListRep() []any
func (IdentifierValue) Type ¶
func (i IdentifierValue) Type(typeMap TypeMap) Type
type InnerFunctionExecute ¶
type InnerFunctionExecute struct { Pos lexer.Position Function func() ExecutionResult }
func (InnerFunctionExecute) Apply ¶
func (ife InnerFunctionExecute) Apply(ee *ExecutionEnvironment) ExecutionResult
func (InnerFunctionExecute) Execute ¶
func (ife InnerFunctionExecute) Execute(ee *ExecutionEnvironment) ExecutionResult
func (InnerFunctionExecute) ListRep ¶
func (ife InnerFunctionExecute) ListRep() []any
func (InnerFunctionExecute) ParameterNames ¶
func (ife InnerFunctionExecute) ParameterNames() []string
func (InnerFunctionExecute) Type ¶
func (ife InnerFunctionExecute) Type(typeMap TypeMap) Type
type IntegerValue ¶
type IntegerValue int64
func (IntegerValue) Execute ¶
func (i IntegerValue) Execute(ee *ExecutionEnvironment) ExecutionResult
func (IntegerValue) ListRep ¶
func (i IntegerValue) ListRep() []any
func (IntegerValue) Type ¶
func (i IntegerValue) Type(typeMap TypeMap) Type
type Invocation ¶
type Invocation struct { Pos lexer.Position Name *string `parser:" @Ident "` Arguments []*Expression `parser:" '(' @@? ( ',' @@ )* ')' "` }
func (*Invocation) Compile ¶
func (i *Invocation) Compile(typeMap TypeMap) (Executable, CompileErrors)
func (Invocation) String ¶
func (i Invocation) String() string
type InvocationExecute ¶
type InvocationExecute struct { *Invocation ProducerExecutable Executable ExecutableArguments []Executable }
func (InvocationExecute) Execute ¶
func (i InvocationExecute) Execute(ee *ExecutionEnvironment) ExecutionResult
func (InvocationExecute) ListRep ¶
func (i InvocationExecute) ListRep() []any
func (InvocationExecute) Type ¶
func (i InvocationExecute) Type(typeMap TypeMap) Type
type KeyValue ¶
type KeyValue struct { Pos lexer.Position Addition *Addition `parser:"@@"` RightValue *Addition `parser:"( Colon (EOL|Comment EOL)* @@ )?"` }
KeyValue parses a key-value pair. If there is no colon, then it's just a value.
func (*KeyValue) Compile ¶
func (kv *KeyValue) Compile(typeMap TypeMap) (Executable, CompileErrors)
type KeyValueExecute ¶
type KeyValueExecute struct { KeyValue *KeyValue Key Executable Value Executable }
func (KeyValueExecute) Execute ¶
func (kve KeyValueExecute) Execute(ee *ExecutionEnvironment) ExecutionResult
func (KeyValueExecute) ListRep ¶
func (kve KeyValueExecute) ListRep() []any
func (KeyValueExecute) Type ¶
func (kve KeyValueExecute) Type(typeMap TypeMap) Type
type KeyValueResult ¶
type List ¶
type List struct { Pos lexer.Position Items []*Expression `parser:"'[' (EOL|Comment EOL)* @@? ( ',' (EOL|Comment EOL)* @@ )* (EOL|Comment EOL)* ']' "` }
func (List) Compile ¶
func (l List) Compile(typeMap TypeMap) (Executable, CompileErrors)
type ListExecute ¶
type ListExecute struct { List *List Items []Executable }
func (ListExecute) Execute ¶
func (le ListExecute) Execute(ee *ExecutionEnvironment) ExecutionResult
func (ListExecute) ListRep ¶
func (le ListExecute) ListRep() []any
func (ListExecute) Type ¶
func (le ListExecute) Type(typeMap TypeMap) Type
type ListResult ¶
type ListResult struct {
Items []any
}
type ListValue ¶
type ListValue []Executable
func (ListValue) Execute ¶
func (l ListValue) Execute(ee *ExecutionEnvironment) ExecutionResult
type Logical ¶
type Logical struct { Pos lexer.Position Comparison *Comparison `parser:"@@"` Operations []*OpLogical `parser:"@@*"` }
func (*Logical) Compile ¶
func (l *Logical) Compile(typeMap TypeMap) (Executable, CompileErrors)
type Multiplication ¶
type Multiplication struct { Pos lexer.Position Unary *Unary `parser:"@@"` Operations []*OpMultiplication `parser:"@@*"` }
func (*Multiplication) Compile ¶
func (m *Multiplication) Compile(typeMap TypeMap) (Executable, CompileErrors)
func (Multiplication) String ¶
func (x Multiplication) String() string
type NamedFunction ¶
type NamedFunction struct { Pos lexer.Position Func *string `parser:" @Function "` Name *string `parser:" @Ident "` Params []string `parser:" '(' @Ident? (',' @Ident)* ')' "` Body *RequiredBlock `parser:"@@"` }
func (*NamedFunction) Compile ¶
func (nf *NamedFunction) Compile(typeMap TypeMap) (Executable, CompileErrors)
func (NamedFunction) String ¶
func (f NamedFunction) String() string
type OpAddition ¶
type OpAddition struct { Pos lexer.Position Op string `parser:"@( Plus | Minus ) (EOL|Comment EOL)*"` Operand *Multiplication `parser:"@@"` }
type OpAssignment ¶
type OpComparison ¶
type OpLogical ¶
type OpLogical struct { Pos lexer.Position Op string `parser:"@( AndAnd | OrOr ) (EOL|Comment EOL)*"` Operand *Comparison `parser:"@@"` }
type OpMultiplication ¶
type Parameterized ¶
type Parameterized interface { Executable ParameterNames() []string Apply(*ExecutionEnvironment) ExecutionResult }
type Pipe ¶
type Pipe struct { Pos lexer.Position Logical *Logical `parser:"@@"` Operations []*OpPipe `parser:"@@*"` }
func (*Pipe) Compile ¶
func (p *Pipe) Compile(typeMap TypeMap) (Executable, CompileErrors)
type PipeExecute ¶
type PipeExecute struct { Pipe *Pipe DoComplete []bool Commands []Executable }
func (PipeExecute) Execute ¶
func (pe PipeExecute) Execute(ee *ExecutionEnvironment) ExecutionResult
func (PipeExecute) ListRep ¶
func (pe PipeExecute) ListRep() []any
func (PipeExecute) Type ¶
func (pe PipeExecute) Type(typeMap TypeMap) Type
type PlusAssignmentExecute ¶
type PlusAssignmentExecute struct { Assignment *Assignment Left IdentifierValue Right Executable }
func (PlusAssignmentExecute) Execute ¶
func (pae PlusAssignmentExecute) Execute(ee *ExecutionEnvironment) ExecutionResult
func (PlusAssignmentExecute) ListRep ¶
func (pae PlusAssignmentExecute) ListRep() []any
func (PlusAssignmentExecute) Type ¶
func (pae PlusAssignmentExecute) Type(typeMap TypeMap) Type
type Program ¶
func (Program) Compile ¶
func (p Program) Compile(typeMap TypeMap) (ProgramExecute, CompileErrors)
type ProgramExecute ¶
type ProgramExecute struct { Program Program NamedFunctions []FunctionExecute ExecutableBlock }
func (ProgramExecute) DumpFunctions ¶
func (pe ProgramExecute) DumpFunctions()
func (ProgramExecute) DumpProgram ¶
func (pe ProgramExecute) DumpProgram()
func (ProgramExecute) ExecuteProgram ¶
func (pe ProgramExecute) ExecuteProgram() ExecutionResult
type RequiredBlock ¶
type RequiredBlock struct { Pos lexer.Position LeftBrace *string `parser:" @'{' "` Statements []*Expression `parser:" (@@ | Comment EOL | EOL)* "` RightBrace *string `parser:" @'}' "` }
func (*RequiredBlock) Compile ¶
func (rb *RequiredBlock) Compile(typeMap TypeMap) (Executable, CompileErrors)
func (RequiredBlock) String ¶
func (rb RequiredBlock) String() string
type Series ¶
type Series struct { Pos lexer.Position FromValue *KeyValue `parser:" @@ "` ToValue *KeyValue `parser:" ( DotDot @@ )? "` }
Series parses a n..m series.
func (*Series) Compile ¶
func (s *Series) Compile(typeMap TypeMap) (Executable, CompileErrors)
type SeriesExecute ¶
type SeriesExecute struct { Series *Series From Executable To Executable }
func (SeriesExecute) Execute ¶
func (se SeriesExecute) Execute(ee *ExecutionEnvironment) ExecutionResult
func (SeriesExecute) ListRep ¶
func (se SeriesExecute) ListRep() []any
func (SeriesExecute) Type ¶
func (se SeriesExecute) Type(typeMap TypeMap) Type
type ShortCircuitAnd ¶
type ShortCircuitAnd struct {
Left, Right Executable
}
func (ShortCircuitAnd) Execute ¶
func (sca ShortCircuitAnd) Execute(ee *ExecutionEnvironment) ExecutionResult
Execute returns the result of the left expression if it is false, otherwise it returns the result of the right expression.
func (ShortCircuitAnd) ListRep ¶
func (sca ShortCircuitAnd) ListRep() []any
func (ShortCircuitAnd) Type ¶
func (sca ShortCircuitAnd) Type(typeMap TypeMap) Type
type ShortCircuitOr ¶
type ShortCircuitOr struct {
Left, Right Executable
}
func (ShortCircuitOr) Execute ¶
func (sco ShortCircuitOr) Execute(ee *ExecutionEnvironment) ExecutionResult
Execute returns the result of the left expression if it is true, otherwise it returns the result of the right expression.
func (ShortCircuitOr) ListRep ¶
func (sco ShortCircuitOr) ListRep() []any
func (ShortCircuitOr) Type ¶
func (sco ShortCircuitOr) Type(typeMap TypeMap) Type
type StatementBlock ¶
type StatementBlock struct { Pos lexer.Position Statements []*Expression `parser:" (@@ | Comment EOL | EOL)* "` }
func (StatementBlock) String ¶
func (s StatementBlock) String() string
type StringValue ¶
type StringValue string
func (StringValue) Execute ¶
func (s StringValue) Execute(ee *ExecutionEnvironment) ExecutionResult
func (StringValue) ListRep ¶
func (s StringValue) ListRep() []any
func (StringValue) Type ¶
func (s StringValue) Type(typeMap TypeMap) Type
type TagValue ¶
func (TagValue) Execute ¶
func (t TagValue) Execute(ee *ExecutionEnvironment) ExecutionResult
type Unary ¶
type Unary struct { Pos lexer.Position Op *string `parser:" ( @( Bang | Minus )"` Unary *Unary `parser:" @@ )"` Base *Base `parser:"| @@"` }
func (*Unary) Compile ¶
func (u *Unary) Compile(typeMap TypeMap) (Executable, CompileErrors)
type UnaryExecuteMinusInteger ¶
type UnaryExecuteMinusInteger struct { Unary *Unary Operand Executable }
func (UnaryExecuteMinusInteger) Execute ¶
func (uemi UnaryExecuteMinusInteger) Execute(ee *ExecutionEnvironment) ExecutionResult
func (UnaryExecuteMinusInteger) ListRep ¶
func (uemi UnaryExecuteMinusInteger) ListRep() []any
func (UnaryExecuteMinusInteger) Type ¶
func (uemi UnaryExecuteMinusInteger) Type(typeMap TypeMap) Type
type UnaryExecuteNot ¶
type UnaryExecuteNot struct { Unary *Unary Operand Executable }
func (UnaryExecuteNot) Execute ¶
func (uen UnaryExecuteNot) Execute(ee *ExecutionEnvironment) ExecutionResult
func (UnaryExecuteNot) ListRep ¶
func (uen UnaryExecuteNot) ListRep() []any
func (UnaryExecuteNot) Type ¶
func (uen UnaryExecuteNot) Type(typeMap TypeMap) Type
type UnaryExecuteSubtractFloat ¶
type UnaryExecuteSubtractFloat struct { Unary *Unary Operand Executable }
func (UnaryExecuteSubtractFloat) Execute ¶
func (uemf UnaryExecuteSubtractFloat) Execute(ee *ExecutionEnvironment) ExecutionResult
func (UnaryExecuteSubtractFloat) ListRep ¶
func (uemf UnaryExecuteSubtractFloat) ListRep() []any
func (UnaryExecuteSubtractFloat) Type ¶
func (uemf UnaryExecuteSubtractFloat) Type(typeMap TypeMap) Type
type UnnamedFunction ¶
type UnnamedFunction struct { Pos lexer.Position Func *string `parser:" Function "` Params []string `parser:" '(' @Ident? (',' @Ident)* ')' "` Body *RequiredBlock `parser:"@@"` }
func (*UnnamedFunction) Compile ¶
func (uf *UnnamedFunction) Compile(typeMap TypeMap) (Executable, CompileErrors)
func (UnnamedFunction) String ¶
func (f UnnamedFunction) String() string
Click to show internal directories.
Click to hide internal directories.