Documentation ¶
Index ¶
- Constants
- type AddExpression
- type AddOperator
- type Analyzer
- type AnalyzerDummyExecutor
- func (self AnalyzerDummyExecutor) Exec(id string, args map[string]string) (ExecResponse, error)
- func (self AnalyzerDummyExecutor) Get(url string) (HttpResponse, error)
- func (self AnalyzerDummyExecutor) GetStorage(_ string) (*string, error)
- func (self AnalyzerDummyExecutor) GetSwitch(id string) (SwitchResponse, error)
- func (self AnalyzerDummyExecutor) GetUser() string
- func (self AnalyzerDummyExecutor) GetWeather() (Weather, error)
- func (self AnalyzerDummyExecutor) Http(url string, method string, body string, headers map[string]string, ...) (HttpResponse, error)
- func (self AnalyzerDummyExecutor) IsAnalyzer() bool
- func (self AnalyzerDummyExecutor) Log(title string, description string, level LogLevel) error
- func (self AnalyzerDummyExecutor) Notify(title string, description string, level NotificationLevel) error
- func (self AnalyzerDummyExecutor) Ping(ip string, timeout float64) (bool, error)
- func (self AnalyzerDummyExecutor) Print(args ...string) error
- func (self AnalyzerDummyExecutor) Println(args ...string) error
- func (self AnalyzerDummyExecutor) ReadFile(path string) (string, error)
- func (self AnalyzerDummyExecutor) Remind(title string, description string, urgency ReminderUrgency, dueDate time.Time) (uint, error)
- func (self AnalyzerDummyExecutor) ResolveModule(id string) (string, string, bool, bool, error)
- func (self AnalyzerDummyExecutor) SetStorage(key string, value string) error
- func (self AnalyzerDummyExecutor) Sleep(sleepTime float64)
- func (self AnalyzerDummyExecutor) Switch(name string, power bool) error
- type AndExpression
- type AssignExpression
- type AssignOperator
- type Atom
- type AtomBoolean
- type AtomEnum
- type AtomEnumVariant
- type AtomExpression
- type AtomFor
- type AtomFunction
- type AtomIdentifier
- type AtomKind
- type AtomListLiteral
- type AtomLoop
- type AtomNull
- type AtomNumber
- type AtomObject
- type AtomObjectField
- type AtomPair
- type AtomRange
- type AtomString
- type AtomTry
- type AtomWhile
- type Block
- type BreakStmt
- type CallExprPart
- type CallExpression
- type CastExpression
- type ContinueStmt
- type Diagnostic
- type DiagnosticSeverity
- type DummyExecutor
- func (self DummyExecutor) Exec(id string, args map[string]string) (ExecResponse, error)
- func (self DummyExecutor) Get(url string) (HttpResponse, error)
- func (self DummyExecutor) GetStorage(_ string) (*string, error)
- func (self DummyExecutor) GetSwitch(id string) (SwitchResponse, error)
- func (self DummyExecutor) GetUser() string
- func (self DummyExecutor) GetWeather() (Weather, error)
- func (self DummyExecutor) Http(url string, method string, body string, headers map[string]string, ...) (HttpResponse, error)
- func (self DummyExecutor) IsAnalyzer() bool
- func (self DummyExecutor) Log(title string, description string, level LogLevel) error
- func (self DummyExecutor) Notify(title string, description string, level NotificationLevel) error
- func (self DummyExecutor) Ping(ip string, timeout float64) (bool, error)
- func (self DummyExecutor) Print(args ...string) error
- func (self DummyExecutor) Println(args ...string) error
- func (self DummyExecutor) ReadFile(path string) (string, error)
- func (self DummyExecutor) Remind(title string, description string, urgency ReminderUrgency, dueDate time.Time) (uint, error)
- func (self DummyExecutor) ResolveModule(id string) (string, string, bool, bool, error)
- func (self DummyExecutor) SetStorage(key string, value string) error
- func (self DummyExecutor) Sleep(sleepTime float64)
- func (self DummyExecutor) Switch(name string, power bool) error
- type EnumVariant
- type EqExpression
- type ExecResponse
- type Executor
- type ExpExpression
- type Expression
- type ExpressionStmt
- type HttpResponse
- type IfExpr
- type ImportStmt
- type Interpreter
- type LetStmt
- type LogLevel
- type MemberExpression
- type MulExpression
- type MulOperator
- type NotificationLevel
- type OrExpression
- type RelExpression
- type RelOperator
- type ReminderUrgency
- type Result
- type ReturnStmt
- type Statement
- type StatementKind
- type StatementOrExpr
- type SwitchResponse
- type Token
- type TokenKind
- type UnaryExpression
- type UnaryOp
- type Value
- func AnalyzerAssert(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Assert(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func CreateDateObj(tm time.Time) Value
- func Debug(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Exec(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Exit(_ Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Fmt(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Get(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func GetSwitch(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func GetUser(executor Executor, _ errors.Span) (Value, *errors.Error)
- func GetWeather(executor Executor, span errors.Span) (Value, *errors.Error)
- func Http(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Log(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Notify(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Ping(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Print(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Println(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Remind(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Run(executor Executor, sigTerm *chan int, program string, ...) (returnValue Value, exitCode int, rootScope map[string]*Value, ...)
- func Sleep(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Storage(executor Executor, _ errors.Span) (Value, *errors.Error)
- func Switch(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Throw(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
- func Time(executor Executor, _ errors.Span) (Value, *errors.Error)
- type ValueAlg
- type ValueBool
- func (self ValueBool) Add(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBool) Debug(_ Executor, _ errors.Span) (string, *errors.Error)
- func (self ValueBool) Display(_ Executor, _ errors.Span) (string, *errors.Error)
- func (self ValueBool) Div(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBool) Fields() map[string]*Value
- func (self ValueBool) Index(_ Executor, _ Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueBool) IntDiv(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBool) IsEqual(_ Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueBool) IsTrue(_ Executor, _ errors.Span) (bool, *errors.Error)
- func (self ValueBool) Mul(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBool) Pow(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBool) Protected() bool
- func (self ValueBool) Rem(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBool) Span() errors.Span
- func (self ValueBool) Sub(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBool) Type() ValueType
- type ValueBuiltinFunction
- func (self ValueBuiltinFunction) Debug(_ Executor, _ errors.Span) (string, *errors.Error)
- func (self ValueBuiltinFunction) Display(_ Executor, _ errors.Span) (string, *errors.Error)
- func (self ValueBuiltinFunction) Fields() map[string]*Value
- func (self ValueBuiltinFunction) Index(_ Executor, _ Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueBuiltinFunction) IsEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueBuiltinFunction) IsTrue(_ Executor, _ errors.Span) (bool, *errors.Error)
- func (self ValueBuiltinFunction) Protected() bool
- func (self ValueBuiltinFunction) Span() errors.Span
- func (self ValueBuiltinFunction) Type() ValueType
- type ValueBuiltinVariable
- func (self ValueBuiltinVariable) Add(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBuiltinVariable) Debug(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueBuiltinVariable) Display(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueBuiltinVariable) Div(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBuiltinVariable) Fields() map[string]*Value
- func (self ValueBuiltinVariable) Index(_ Executor, _ Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueBuiltinVariable) IntDiv(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBuiltinVariable) IsEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueBuiltinVariable) IsGreaterThan(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueBuiltinVariable) IsGreaterThanOrEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueBuiltinVariable) IsLessThan(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueBuiltinVariable) IsLessThanOrEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueBuiltinVariable) IsTrue(executor Executor, span errors.Span) (bool, *errors.Error)
- func (self ValueBuiltinVariable) Mul(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBuiltinVariable) Pow(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBuiltinVariable) Protected() bool
- func (self ValueBuiltinVariable) Rem(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBuiltinVariable) Span() errors.Span
- func (self ValueBuiltinVariable) Sub(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueBuiltinVariable) Type() ValueType
- type ValueEnum
- func (self ValueEnum) Debug(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueEnum) Display(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueEnum) Fields() map[string]*Value
- func (self ValueEnum) HasVariant(toCheck string) bool
- func (self ValueEnum) Index(_ Executor, indexValue Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueEnum) IsEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueEnum) IsTrue(executor Executor, span errors.Span) (bool, *errors.Error)
- func (self ValueEnum) Protected() bool
- func (self ValueEnum) Span() errors.Span
- func (self ValueEnum) Type() ValueType
- type ValueEnumVariant
- func (self ValueEnumVariant) Debug(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueEnumVariant) Display(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueEnumVariant) Fields() map[string]*Value
- func (self ValueEnumVariant) Index(_ Executor, indexValue Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueEnumVariant) IsEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueEnumVariant) IsTrue(executor Executor, span errors.Span) (bool, *errors.Error)
- func (self ValueEnumVariant) Protected() bool
- func (self ValueEnumVariant) Span() errors.Span
- func (self ValueEnumVariant) Type() ValueType
- type ValueFunction
- func (self ValueFunction) Debug(_ Executor, _ errors.Span) (string, *errors.Error)
- func (self ValueFunction) Display(_ Executor, _ errors.Span) (string, *errors.Error)
- func (self ValueFunction) Fields() map[string]*Value
- func (self ValueFunction) Index(_ Executor, _ Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueFunction) IsEqual(_ Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueFunction) IsTrue(_ Executor, _ errors.Span) (bool, *errors.Error)
- func (self ValueFunction) Protected() bool
- func (self ValueFunction) Span() errors.Span
- func (self ValueFunction) Type() ValueType
- type ValueList
- func (self ValueList) Debug(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueList) Display(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueList) Fields() map[string]*Value
- func (self ValueList) Index(executor Executor, indexValue Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueList) IsEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueList) IsTrue(_ Executor, _ errors.Span) (bool, *errors.Error)
- func (self *ValueList) IterReset()
- func (self *ValueList) Next(val *Value, span errors.Span) bool
- func (self ValueList) Protected() bool
- func (self ValueList) Span() errors.Span
- func (self ValueList) Type() ValueType
- type ValueNull
- func (self ValueNull) Debug(_ Executor, _ errors.Span) (string, *errors.Error)
- func (self ValueNull) Display(_ Executor, _ errors.Span) (string, *errors.Error)
- func (self ValueNull) Fields() map[string]*Value
- func (self ValueNull) Index(_ Executor, _ Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueNull) IsEqual(_ Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueNull) IsTrue(_ Executor, _ errors.Span) (bool, *errors.Error)
- func (self ValueNull) Protected() bool
- func (self ValueNull) Span() errors.Span
- func (self ValueNull) Type() ValueType
- type ValueNumber
- func (self ValueNumber) Add(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueNumber) Debug(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueNumber) Display(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueNumber) Div(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueNumber) Fields() map[string]*Value
- func (self ValueNumber) Index(_ Executor, _ Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueNumber) IntDiv(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueNumber) IsEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueNumber) IsGreaterThan(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueNumber) IsGreaterThanOrEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueNumber) IsLessThan(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueNumber) IsLessThanOrEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueNumber) IsTrue(executor Executor, span errors.Span) (bool, *errors.Error)
- func (self ValueNumber) Mul(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueNumber) Pow(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueNumber) Protected() bool
- func (self ValueNumber) Rem(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueNumber) Span() errors.Span
- func (self ValueNumber) Sub(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueNumber) Type() ValueType
- type ValueObject
- func (self ValueObject) Debug(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueObject) Display(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueObject) Fields() map[string]*Value
- func (self ValueObject) Index(_ Executor, indexValue Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueObject) IsEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueObject) IsTrue(executor Executor, span errors.Span) (bool, *errors.Error)
- func (self *ValueObject) IterReset()
- func (self *ValueObject) Next(val *Value, span errors.Span) bool
- func (self ValueObject) Protected() bool
- func (self ValueObject) Span() errors.Span
- func (self ValueObject) Type() ValueType
- type ValuePair
- func (self ValuePair) Debug(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValuePair) Display(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValuePair) Fields() map[string]*Value
- func (self ValuePair) Index(_ Executor, _ Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValuePair) IsEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValuePair) IsTrue(executor Executor, span errors.Span) (bool, *errors.Error)
- func (self ValuePair) Protected() bool
- func (self ValuePair) Span() errors.Span
- func (self ValuePair) Type() ValueType
- type ValueRange
- func (self ValueRange) Debug(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueRange) Display(executor Executor, span errors.Span) (string, *errors.Error)
- func (self ValueRange) Fields() map[string]*Value
- func (self ValueRange) Index(_ Executor, _ Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueRange) IsEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueRange) IsTrue(_ Executor, _ errors.Span) (bool, *errors.Error)
- func (self *ValueRange) IterReset()
- func (self *ValueRange) Next(val *Value, span errors.Span) bool
- func (self ValueRange) Protected() bool
- func (self ValueRange) Span() errors.Span
- func (self ValueRange) Type() ValueType
- type ValueRelational
- type ValueString
- func (self ValueString) Add(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueString) Debug(_ Executor, _ errors.Span) (string, *errors.Error)
- func (self ValueString) Display(_ Executor, _ errors.Span) (string, *errors.Error)
- func (self ValueString) Div(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueString) Fields() map[string]*Value
- func (self ValueString) Index(_ Executor, indexValue Value, span errors.Span) (*Value, bool, *errors.Error)
- func (self ValueString) IntDiv(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueString) IsEqual(_ Executor, span errors.Span, other Value) (bool, *errors.Error)
- func (self ValueString) IsTrue(_ Executor, span errors.Span) (bool, *errors.Error)
- func (self *ValueString) IterReset()
- func (self ValueString) Mul(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self *ValueString) Next(val *Value, span errors.Span) bool
- func (self ValueString) Pow(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueString) Protected() bool
- func (self ValueString) Rem(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueString) Span() errors.Span
- func (self ValueString) Sub(executor Executor, span errors.Span, other Value) (Value, *errors.Error)
- func (self ValueString) Type() ValueType
- type ValueType
- type Weather
Constants ¶
const ( SymbolTypeUnknown symbolType = "unknown" SymbolTypeNull symbolType = "null" SymbolTypeNumber symbolType = "number" SymbolTypeBoolean symbolType = "boolean" SymbolTypeString symbolType = "string" SymbolTypeList symbolType = "list" SymbolTypePair symbolType = "pair" SymbolTypeObject symbolType = "object" SymbolTypeRange symbolType = "range" SymbolDynamicMember symbolType = "dynamic member" SymbolTypeFunction symbolType = "function" SymbolTypeBuiltinFunction symbolType = "builtin function" SymbolTypeBuiltinVariable symbolType = "builtin variable" SymbolTypeEnum symbolType = "enum" SymbolTypeEnumVariant symbolType = "enum variant" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddExpression ¶
type AddExpression struct { Base MulExpression Following []struct { AddOperator AddOperator Other MulExpression Span errors.Span } Span errors.Span }
Add expression
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
func NewAnalyzer ¶
type AnalyzerDummyExecutor ¶ added in v2.3.0
type AnalyzerDummyExecutor struct{}
func (AnalyzerDummyExecutor) Exec ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) Exec(id string, args map[string]string) (ExecResponse, error)
func (AnalyzerDummyExecutor) Get ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) Get(url string) (HttpResponse, error)
func (AnalyzerDummyExecutor) GetStorage ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) GetStorage(_ string) (*string, error)
func (AnalyzerDummyExecutor) GetSwitch ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) GetSwitch(id string) (SwitchResponse, error)
func (AnalyzerDummyExecutor) GetUser ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) GetUser() string
func (AnalyzerDummyExecutor) GetWeather ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) GetWeather() (Weather, error)
func (AnalyzerDummyExecutor) Http ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) Http(url string, method string, body string, headers map[string]string, cookies map[string]string) (HttpResponse, error)
func (AnalyzerDummyExecutor) IsAnalyzer ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) IsAnalyzer() bool
func (AnalyzerDummyExecutor) Log ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) Log(title string, description string, level LogLevel) error
func (AnalyzerDummyExecutor) Notify ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) Notify(title string, description string, level NotificationLevel) error
func (AnalyzerDummyExecutor) Ping ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) Ping(ip string, timeout float64) (bool, error)
func (AnalyzerDummyExecutor) Print ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) Print(args ...string) error
func (AnalyzerDummyExecutor) Println ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) Println(args ...string) error
func (AnalyzerDummyExecutor) ReadFile ¶ added in v2.4.0
func (self AnalyzerDummyExecutor) ReadFile(path string) (string, error)
func (AnalyzerDummyExecutor) Remind ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) Remind(title string, description string, urgency ReminderUrgency, dueDate time.Time) (uint, error)
func (AnalyzerDummyExecutor) ResolveModule ¶ added in v2.3.0
func (AnalyzerDummyExecutor) SetStorage ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) SetStorage(key string, value string) error
func (AnalyzerDummyExecutor) Sleep ¶ added in v2.3.0
func (self AnalyzerDummyExecutor) Sleep(sleepTime float64)
type AndExpression ¶
type AndExpression struct { Base EqExpression Following []EqExpression Span errors.Span }
And expression
type AssignExpression ¶
type AssignExpression struct { Base CallExpression Other *struct { Operator AssignOperator Expression Expression } Span errors.Span }
Assign expression
type AssignOperator ¶
type AssignOperator uint8
const ( OpAssign AssignOperator = iota OpPlusAssign OpMinusAssign OpMulAssign OpDivAssign OpIntDivAssign OpReminderAssign OpPowerAssign )
type AtomBoolean ¶
Boolean
func (AtomBoolean) Kind ¶
func (self AtomBoolean) Kind() AtomKind
func (AtomBoolean) Span ¶
func (self AtomBoolean) Span() errors.Span
type AtomEnum ¶ added in v2.4.0
type AtomEnum struct { Name string Variants []EnumVariant Range errors.Span }
Enum
type AtomEnumVariant ¶ added in v2.4.0
Enum Variant
func (AtomEnumVariant) Kind ¶ added in v2.4.0
func (self AtomEnumVariant) Kind() AtomKind
func (AtomEnumVariant) Span ¶ added in v2.4.0
func (self AtomEnumVariant) Span() errors.Span
type AtomExpression ¶
type AtomExpression struct { Expression Expression Range errors.Span }
Atom Expression
func (AtomExpression) Kind ¶
func (self AtomExpression) Kind() AtomKind
func (AtomExpression) Span ¶
func (self AtomExpression) Span() errors.Span
type AtomFor ¶
type AtomFor struct { HeadIdentifier struct { Identifier string Span errors.Span } IterExpr Expression IterationCode Block Range errors.Span }
For loop
type AtomFunction ¶
type AtomFunction struct { Ident *string ArgIdentifiers []struct { Identifier string Span errors.Span } Body Block Range errors.Span }
Function declaration
func (AtomFunction) Kind ¶
func (self AtomFunction) Kind() AtomKind
func (AtomFunction) Span ¶
func (self AtomFunction) Span() errors.Span
type AtomIdentifier ¶
Identifier
func (AtomIdentifier) Kind ¶
func (self AtomIdentifier) Kind() AtomKind
func (AtomIdentifier) Span ¶
func (self AtomIdentifier) Span() errors.Span
type AtomKind ¶
type AtomKind uint8
Atom
const ( AtomKindNumber AtomKind = iota AtomKindBoolean AtomKindString AtomKindListLiteral AtomKindObject AtomKindPair AtomKindNull AtomKindIdentifier AtomKindRange AtomKindEnum AtomKindEnumVariant AtomKindIfExpr AtomKindForExpr AtomKindWhileExpr AtomKindLoopExpr AtomKindFnExpr AtomKindTryExpr AtomKindExpression )
type AtomListLiteral ¶
type AtomListLiteral struct { Values []Expression Range errors.Span }
List literals
func (AtomListLiteral) Kind ¶
func (self AtomListLiteral) Kind() AtomKind
func (AtomListLiteral) Span ¶
func (self AtomListLiteral) Span() errors.Span
type AtomNumber ¶
Number
func (AtomNumber) Kind ¶
func (self AtomNumber) Kind() AtomKind
func (AtomNumber) Span ¶
func (self AtomNumber) Span() errors.Span
type AtomObject ¶
type AtomObject struct { Range errors.Span Fields []AtomObjectField }
Object
func (AtomObject) Kind ¶
func (self AtomObject) Kind() AtomKind
func (AtomObject) Span ¶
func (self AtomObject) Span() errors.Span
type AtomObjectField ¶
type AtomString ¶
String
func (AtomString) Kind ¶
func (self AtomString) Kind() AtomKind
func (AtomString) Span ¶
func (self AtomString) Span() errors.Span
type AtomWhile ¶
type AtomWhile struct { HeadCondition Expression IterationCode Block Range errors.Span }
While loop
type Block ¶
type Block struct { Statements []Statement Expr *Expression Span errors.Span }
func (Block) IntoItemsList ¶ added in v2.3.0
func (self Block) IntoItemsList() []StatementOrExpr
type BreakStmt ¶
type BreakStmt struct { Expression *Expression // Can be the return value of the loop Range errors.Span }
func (BreakStmt) Kind ¶
func (self BreakStmt) Kind() StatementKind
type CallExprPart ¶
type CallExprPart struct { MemberExpressionPart *string // Optional: .identifier as a member Args *[]Expression // Optional: (arg1, arg2) to call the function Index *Expression // Optional: [42] to index a value Span errors.Span }
If member expr part is nil, args is used if args is nil, member expr part is used
type CallExpression ¶
type CallExpression struct { Base MemberExpression Parts []CallExprPart // Allows chaining of function calls ( like foo()()() ) Span errors.Span }
Call expression
type CastExpression ¶
type CastExpression struct { Base UnaryExpression Other *ValueType // Casting is optional, otherwise, just the base is used Span errors.Span }
Cast expression
type ContinueStmt ¶
func (ContinueStmt) Kind ¶
func (self ContinueStmt) Kind() StatementKind
func (ContinueStmt) Span ¶
func (self ContinueStmt) Span() errors.Span
type Diagnostic ¶
type Diagnostic struct { Severity DiagnosticSeverity Kind errors.ErrorKind Message string Span errors.Span }
func Analyze ¶
func Analyze( executor Executor, program string, scopeAdditions map[string]Value, moduleStack []string, moduleName string, filename string, ) ( diagnostics []Diagnostic, symbols []symbol, rootScope map[string]*Value, )
Analyzes the given Homescript code
func (Diagnostic) Display ¶
func (self Diagnostic) Display(program string) string
type DiagnosticSeverity ¶
type DiagnosticSeverity uint8
const ( Info DiagnosticSeverity = iota Warning Error )
type DummyExecutor ¶ added in v2.3.0
type DummyExecutor struct{}
func (DummyExecutor) Exec ¶ added in v2.3.0
func (self DummyExecutor) Exec(id string, args map[string]string) (ExecResponse, error)
func (DummyExecutor) Get ¶ added in v2.3.0
func (self DummyExecutor) Get(url string) (HttpResponse, error)
func (DummyExecutor) GetStorage ¶ added in v2.3.0
func (self DummyExecutor) GetStorage(_ string) (*string, error)
func (DummyExecutor) GetSwitch ¶ added in v2.3.0
func (self DummyExecutor) GetSwitch(id string) (SwitchResponse, error)
func (DummyExecutor) GetUser ¶ added in v2.3.0
func (self DummyExecutor) GetUser() string
func (DummyExecutor) GetWeather ¶ added in v2.3.0
func (self DummyExecutor) GetWeather() (Weather, error)
func (DummyExecutor) Http ¶ added in v2.3.0
func (self DummyExecutor) Http(url string, method string, body string, headers map[string]string, cookies map[string]string) (HttpResponse, error)
func (DummyExecutor) IsAnalyzer ¶ added in v2.3.0
func (self DummyExecutor) IsAnalyzer() bool
func (DummyExecutor) Log ¶ added in v2.3.0
func (self DummyExecutor) Log(title string, description string, level LogLevel) error
func (DummyExecutor) Notify ¶ added in v2.3.0
func (self DummyExecutor) Notify(title string, description string, level NotificationLevel) error
func (DummyExecutor) Ping ¶ added in v2.3.0
func (self DummyExecutor) Ping(ip string, timeout float64) (bool, error)
func (DummyExecutor) Print ¶ added in v2.3.0
func (self DummyExecutor) Print(args ...string) error
func (DummyExecutor) Println ¶ added in v2.3.0
func (self DummyExecutor) Println(args ...string) error
func (DummyExecutor) ReadFile ¶ added in v2.4.0
func (self DummyExecutor) ReadFile(path string) (string, error)
func (DummyExecutor) Remind ¶ added in v2.3.0
func (self DummyExecutor) Remind(title string, description string, urgency ReminderUrgency, dueDate time.Time) (uint, error)
func (DummyExecutor) ResolveModule ¶ added in v2.3.0
func (DummyExecutor) SetStorage ¶ added in v2.3.0
func (self DummyExecutor) SetStorage(key string, value string) error
func (DummyExecutor) Sleep ¶ added in v2.3.0
func (self DummyExecutor) Sleep(sleepTime float64)
type EnumVariant ¶ added in v2.4.0
type EqExpression ¶
type EqExpression struct { Base RelExpression Other *struct { // True corresponds to `!=` and false corresponds to `==` Inverted bool Node RelExpression } Span errors.Span }
Equality expression
type ExecResponse ¶
type Executor ¶
type Executor interface { Sleep(float64) Print(args ...string) error Println(args ...string) error GetSwitch(id string) (SwitchResponse, error) Switch(name string, on bool) error Ping(ip string, timeout float64) (bool, error) Notify(title string, description string, level NotificationLevel) error Remind(title string, description string, urgency ReminderUrgency, dueDate time.Time) (uint, error) Log(title string, description string, level LogLevel) error Exec(homescriptId string, args map[string]string) (ExecResponse, error) ResolveModule(homescriptId string) (code string, filename string, found bool, shouldProceed bool, err error) ReadFile(path string) (code string, err error) Get(url string) (HttpResponse, error) Http(url string, method string, body string, headers map[string]string, cookies map[string]string) (HttpResponse, error) GetStorage(key string) (*string, error) SetStorage(key string, value string) error IsAnalyzer() bool // Builtin variables GetUser() string GetWeather() (Weather, error) }
type ExpExpression ¶
type ExpExpression struct { Base AssignExpression Other *UnaryExpression Span errors.Span }
Exp expression
type ExpressionStmt ¶
type ExpressionStmt struct {
Expression Expression
}
func (ExpressionStmt) Kind ¶
func (self ExpressionStmt) Kind() StatementKind
func (ExpressionStmt) Span ¶
func (self ExpressionStmt) Span() errors.Span
type HttpResponse ¶
type IfExpr ¶
type ImportStmt ¶
type ImportStmt struct { Functions []string // import `foo` FromModule string // from `baz` Range errors.Span }
func (ImportStmt) Kind ¶
func (self ImportStmt) Kind() StatementKind
func (ImportStmt) Span ¶
func (self ImportStmt) Span() errors.Span
type Interpreter ¶
type Interpreter struct {
// contains filtered or unexported fields
}
func NewInterpreter ¶
func (Interpreter) ResolveModule ¶
func (self Interpreter) ResolveModule(span errors.Span, module string, functions []string) ([]*Value, map[string]*Value, *errors.Error)
Resolves functions imported by an 'import' statement The builtin just has the task of providing the target module code This function then runs the target module code and returns the values of the target functionsj (analyzes the root scope) If the target module contains top level code, it is also executed
type LetStmt ¶
type LetStmt struct { Left struct { Identifier string Span errors.Span } Right Expression Range errors.Span }
func (LetStmt) Kind ¶
func (self LetStmt) Kind() StatementKind
type MemberExpression ¶
type MemberExpression struct { Base Atom // Each member is either an identifier 'foo.bar.baz' where `foo` is the base and `bar` and `baz` are the members // However, each member can also be an index access: `[1]`, where 1 is an expression Members []struct { // Normal member identifier with a dot Identifier *string // List index access Index *Expression // Span is used in order to deliver better error messages Span errors.Span } Span errors.Span }
Member expression
type MulExpression ¶
type MulExpression struct { Base CastExpression Following []struct { MulOperator MulOperator Other CastExpression Span errors.Span } Span errors.Span }
Mul expression
type MulOperator ¶
type MulOperator uint8
const ( MulOpMul MulOperator = iota MulOpDiv MulOpIntDiv MulOpReminder )
type NotificationLevel ¶
type NotificationLevel uint8
const ( NotiInfo NotificationLevel = iota NotiWarning NotiCritical )
type OrExpression ¶
type OrExpression struct { Base AndExpression Following []AndExpression Span errors.Span }
Or expression
type RelExpression ¶
type RelExpression struct { Base AddExpression Other *struct { RelOperator RelOperator Node AddExpression } Span errors.Span }
Relational expression
type RelOperator ¶
type RelOperator uint8
const ( RelLessThan RelOperator = iota RelLessOrEqual RelGreaterThan RelGreaterOrEqual )
type ReminderUrgency ¶ added in v2.1.0
type ReminderUrgency uint8
const ( UrgencyLow ReminderUrgency = iota UrgencyNormal UrgencyMedium UrgencyHigh UrgencyUrgent )
type ReturnStmt ¶
type ReturnStmt struct { Expression *Expression // Can be the return value of the function Range errors.Span }
func (ReturnStmt) Kind ¶
func (self ReturnStmt) Kind() StatementKind
func (ReturnStmt) Span ¶
func (self ReturnStmt) Span() errors.Span
type Statement ¶
type Statement interface { Kind() StatementKind Span() errors.Span }
type StatementKind ¶
type StatementKind uint8
///// Statements ///////
const ( LetStmtKind StatementKind = iota ImportStmtKind BreakStmtKind ContinueStmtKind ReturnStmtKind ExpressionStmtKind )
func (StatementKind) String ¶
func (self StatementKind) String() string
type StatementOrExpr ¶ added in v2.3.0
type StatementOrExpr struct { Statement Statement Expression *Expression }
func (StatementOrExpr) IsStatement ¶ added in v2.3.0
func (self StatementOrExpr) IsStatement() bool
func (StatementOrExpr) Span ¶ added in v2.3.0
func (self StatementOrExpr) Span() errors.Span
type SwitchResponse ¶
type TokenKind ¶
type TokenKind uint8
const ( Unknown TokenKind = iota EOF Semicolon // ; Comma // , Colon // : Dot // . Range // .. Arrow // => LParen // ( RParen // ) LCurly // { RCurly // } LBracket // [ RBracket // ] Or // || And // && Equal // == NotEqual // != LessThan // < LessThanEqual // <= GreaterThan // > GreaterThanEqual // >= Not // ! Plus // + Minus // - Multiply // * Divide // / IntDivide // / Reminder // % Power // ** Assign // = PlusAssign // += MinusAssign // -= MultiplyAssign // *= DivideAssign // /= IntDivideAssign // \= PowerAssign // **= ReminderAssign // %= Import // import As // as From // from In // in Let // let Fn // fn If // if Else // else Try // try Catch // catch For // for While // while Loop // loop Break // break Continue // continue Return // return Enum // enum StringType // str NumberType // num BooleanType // bool NullType // null True // true False // false String // "foo" (token includes quotes whilst content excludes quotes) Number // 42 Identifier // foobar )
type UnaryExpression ¶
type UnaryExpression struct { UnaryExpression *struct { UnaryOp UnaryOp UnaryExpression UnaryExpression } ExpExpression *ExpExpression Span errors.Span }
Unary expression Is either unary or exp expression if unary = nil, then exp is not nil if exp is nil, then unary is not nil
type Value ¶
type Value interface { Type() ValueType Protected() bool Span() errors.Span Fields() map[string]*Value Index(executor Executor, index Value, span errors.Span) (*Value, bool, *errors.Error) // Is also used for `as str` and printing Display(executor Executor, span errors.Span) (string, *errors.Error) Debug(executor Executor, span errors.Span) (string, *errors.Error) IsTrue(executor Executor, span errors.Span) (bool, *errors.Error) IsEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error) }
Value interfaces
func AnalyzerAssert ¶ added in v2.3.0
func AnalyzerAssert(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
Asserts that a statement is true, otherwise an error is returned
func CreateDateObj ¶ added in v2.3.0
func Exec ¶
Launches a Homescript based on the provided script Id If no valid script could be found or the user lacks permission to execute it, an error is returned
func Exit ¶
Terminates the execution of the current Homescript Exit code `0` indicates success, other values can be used for different purposes
func Http ¶
Makes a network request using an arbitrary URL, method , body (as plaintext), (and optionally headers)
func Notify ¶
If a notification system is provided in the runtime environment, a notification is sent to the current user
func Run ¶
func Run( executor Executor, sigTerm *chan int, program string, scopeAdditions map[string]Value, args map[string]Value, debug bool, stackSize uint, moduleStack []string, moduleName string, filename string, ) ( returnValue Value, exitCode int, rootScope map[string]*Value, hmsErrors []hmsError.Error, )
Executes the given Homescript code The `sigTerm` variable is used to terminate the script at any point in time The value passed into the channel is used as an exit-code to terminate the script
type ValueAlg ¶
type ValueAlg interface { Add(executor Executor, span errors.Span, other Value) (Value, *errors.Error) Sub(executor Executor, span errors.Span, other Value) (Value, *errors.Error) Mul(executor Executor, span errors.Span, other Value) (Value, *errors.Error) Div(executor Executor, span errors.Span, other Value) (Value, *errors.Error) IntDiv(executor Executor, span errors.Span, other Value) (Value, *errors.Error) Rem(executor Executor, span errors.Span, other Value) (Value, *errors.Error) Pow(executor Executor, span errors.Span, other Value) (Value, *errors.Error) }
type ValueBool ¶
Boolean value
type ValueBuiltinFunction ¶
type ValueBuiltinFunction struct {
Callback func(executor Executor, span errors.Span, args ...Value) (Value, *int, *errors.Error)
}
Builtin function value
func (ValueBuiltinFunction) Fields ¶
func (self ValueBuiltinFunction) Fields() map[string]*Value
func (ValueBuiltinFunction) Protected ¶
func (self ValueBuiltinFunction) Protected() bool
func (ValueBuiltinFunction) Span ¶
func (self ValueBuiltinFunction) Span() errors.Span
func (ValueBuiltinFunction) Type ¶
func (self ValueBuiltinFunction) Type() ValueType
type ValueBuiltinVariable ¶
type ValueBuiltinVariable struct {
Callback func(executor Executor, span errors.Span) (Value, *errors.Error)
}
Builtin variable value
func (ValueBuiltinVariable) Fields ¶
func (self ValueBuiltinVariable) Fields() map[string]*Value
func (ValueBuiltinVariable) IsGreaterThan ¶
func (ValueBuiltinVariable) IsGreaterThanOrEqual ¶
func (ValueBuiltinVariable) IsLessThan ¶
func (ValueBuiltinVariable) IsLessThanOrEqual ¶
func (ValueBuiltinVariable) Protected ¶
func (self ValueBuiltinVariable) Protected() bool
func (ValueBuiltinVariable) Span ¶
func (self ValueBuiltinVariable) Span() errors.Span
func (ValueBuiltinVariable) Type ¶
func (self ValueBuiltinVariable) Type() ValueType
type ValueEnum ¶ added in v2.4.0
type ValueEnum struct { Variants []ValueEnumVariant CurrentIterIndex *int Range errors.Span IsProtected bool }
Enum value
func (ValueEnum) HasVariant ¶ added in v2.4.0
type ValueEnumVariant ¶ added in v2.4.0
EnumVariant value
func (ValueEnumVariant) Fields ¶ added in v2.4.0
func (self ValueEnumVariant) Fields() map[string]*Value
func (ValueEnumVariant) Protected ¶ added in v2.4.0
func (self ValueEnumVariant) Protected() bool
func (ValueEnumVariant) Span ¶ added in v2.4.0
func (self ValueEnumVariant) Span() errors.Span
func (ValueEnumVariant) Type ¶ added in v2.4.0
func (self ValueEnumVariant) Type() ValueType
type ValueFunction ¶
type ValueFunction struct { Identifier *string Args []struct { Identifier string Span errors.Span } Body Block Range errors.Span IsProtected bool }
Function value
func (ValueFunction) Fields ¶
func (self ValueFunction) Fields() map[string]*Value
func (ValueFunction) Protected ¶
func (self ValueFunction) Protected() bool
func (ValueFunction) Span ¶
func (self ValueFunction) Span() errors.Span
func (ValueFunction) Type ¶
func (self ValueFunction) Type() ValueType
type ValueList ¶
type ValueList struct { Values *[]*Value // Is set to a value type the first time the list contains at least 1 element ValueType *ValueType Range errors.Span IsProtected bool CurrentIterIndex *int }
List value
type ValueNull ¶
Null value
type ValueNumber ¶
Number value
func (ValueNumber) Fields ¶
func (self ValueNumber) Fields() map[string]*Value
func (ValueNumber) IsGreaterThan ¶
func (ValueNumber) IsGreaterThanOrEqual ¶
func (ValueNumber) IsLessThan ¶
func (ValueNumber) IsLessThanOrEqual ¶
func (ValueNumber) Protected ¶
func (self ValueNumber) Protected() bool
func (ValueNumber) Span ¶
func (self ValueNumber) Span() errors.Span
func (ValueNumber) Type ¶
func (self ValueNumber) Type() ValueType
type ValueObject ¶
type ValueObject struct { // Can be used if a builtin function only accepts objects of a certain type DataType string // Specifies whether this object is dynamic // If it is dynamic, the analyzer will not run its field checks // Such a dynamic object could be the global `ARGS` object IsDynamic bool // The fields of the object ObjFields map[string]*Value CurrentIterIndex *int Range errors.Span IsProtected bool }
Object value
func (ValueObject) Fields ¶
func (self ValueObject) Fields() map[string]*Value
func (*ValueObject) IterReset ¶ added in v2.3.0
func (self *ValueObject) IterReset()
func (*ValueObject) Next ¶ added in v2.3.0
func (self *ValueObject) Next(val *Value, span errors.Span) bool
func (ValueObject) Protected ¶
func (self ValueObject) Protected() bool
func (ValueObject) Span ¶
func (self ValueObject) Span() errors.Span
func (ValueObject) Type ¶
func (self ValueObject) Type() ValueType
type ValuePair ¶
Pair value
type ValueRange ¶ added in v2.3.0
type ValueRange struct { Start *Value End *Value Current *float64 Range errors.Span IsProtected bool }
Range value
func (ValueRange) Fields ¶ added in v2.3.0
func (self ValueRange) Fields() map[string]*Value
func (*ValueRange) IterReset ¶ added in v2.3.0
func (self *ValueRange) IterReset()
func (*ValueRange) Next ¶ added in v2.3.0
func (self *ValueRange) Next(val *Value, span errors.Span) bool
func (ValueRange) Protected ¶ added in v2.3.0
func (self ValueRange) Protected() bool
func (ValueRange) Span ¶ added in v2.3.0
func (self ValueRange) Span() errors.Span
func (ValueRange) Type ¶ added in v2.3.0
func (self ValueRange) Type() ValueType
type ValueRelational ¶
type ValueRelational interface { IsLessThan(executor Executor, span errors.Span, other Value) (bool, *errors.Error) IsLessThanOrEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error) IsGreaterThan(executor Executor, span errors.Span, other Value) (bool, *errors.Error) IsGreaterThanOrEqual(executor Executor, span errors.Span, other Value) (bool, *errors.Error) }
type ValueString ¶
String value
func (ValueString) Fields ¶
func (self ValueString) Fields() map[string]*Value
func (*ValueString) IterReset ¶ added in v2.3.0
func (self *ValueString) IterReset()
func (*ValueString) Next ¶ added in v2.3.0
func (self *ValueString) Next(val *Value, span errors.Span) bool
func (ValueString) Protected ¶
func (self ValueString) Protected() bool
func (ValueString) Span ¶
func (self ValueString) Span() errors.Span
func (ValueString) Type ¶
func (self ValueString) Type() ValueType