Documentation
¶
Index ¶
- func Run(executor interpreter.Executor, filename string, code string) (int, []customError.Error)
- type AndExpr
- type Atom
- type AtomBoolean
- type AtomCall
- type AtomExpr
- type AtomIdentifier
- type AtomIf
- type AtomKind
- type AtomNumber
- type AtomString
- type CallExpr
- type DummyExecutor
- func (self DummyExecutor) AddPerm(username string, permission string) error
- func (self DummyExecutor) AddUser(username string, password string, forename string, surname string) error
- func (self DummyExecutor) DelPerm(username string, permission string) error
- func (self DummyExecutor) DelUser(username string) error
- func (self DummyExecutor) Exec(homescriptId string) (string, error)
- func (self DummyExecutor) GetDate() (int, int, int, int, int, int)
- func (self DummyExecutor) GetDebugInfo() (string, error)
- func (self DummyExecutor) GetTemperature() (int, error)
- func (self DummyExecutor) GetUser() string
- func (self DummyExecutor) GetWeather() (string, error)
- func (self DummyExecutor) Log(title string, description string, level interpreter.LogLevel) error
- func (self DummyExecutor) Notify(title string, description string, level interpreter.LogLevel) error
- func (self DummyExecutor) Play(server string, mode string) error
- func (self DummyExecutor) Print(args ...string)
- func (self DummyExecutor) Switch(name string, on bool) error
- func (self DummyExecutor) SwitchOn(name string) (bool, error)
- type EqExpr
- type Expression
- type Expressions
- type IfExpr
- type Interpreter
- type Lexer
- type NotExpr
- type Parser
- type RelExpr
- type Token
- type TokenType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(executor interpreter.Executor, filename string, code string) (int, []customError.Error)
Runs a provided homescript file given the source code Returns an error slice
Types ¶
type AtomBoolean ¶
type AtomBoolean struct{ Value bool }
Boolean
func (AtomBoolean) Kind ¶
func (self AtomBoolean) Kind() AtomKind
type AtomIdentifier ¶
Identifier
func (AtomIdentifier) Kind ¶
func (self AtomIdentifier) Kind() AtomKind
type AtomNumber ¶
type AtomNumber struct{ Num float64 }
Number
func (AtomNumber) Kind ¶
func (self AtomNumber) Kind() AtomKind
type AtomString ¶
type AtomString struct{ Content string }
String
func (AtomString) Kind ¶
func (self AtomString) Kind() AtomKind
type DummyExecutor ¶
type DummyExecutor struct{}
func (DummyExecutor) AddPerm ¶
func (self DummyExecutor) AddPerm(username string, permission string) error
func (DummyExecutor) DelPerm ¶
func (self DummyExecutor) DelPerm(username string, permission string) error
func (DummyExecutor) DelUser ¶
func (self DummyExecutor) DelUser(username string) error
func (DummyExecutor) GetDebugInfo ¶
func (self DummyExecutor) GetDebugInfo() (string, error)
func (DummyExecutor) GetTemperature ¶
func (self DummyExecutor) GetTemperature() (int, error)
func (DummyExecutor) GetUser ¶
func (self DummyExecutor) GetUser() string
func (DummyExecutor) GetWeather ¶
func (self DummyExecutor) GetWeather() (string, error)
func (DummyExecutor) Log ¶
func (self DummyExecutor) Log( title string, description string, level interpreter.LogLevel, ) error
func (DummyExecutor) Notify ¶
func (self DummyExecutor) Notify( title string, description string, level interpreter.LogLevel, ) error
func (DummyExecutor) Print ¶
func (self DummyExecutor) Print(args ...string)
type Expression ¶
type Expressions ¶
type Expressions []Expression
type IfExpr ¶
type IfExpr struct {
Condition Expression
Body Expressions
ElseBody Expressions
Location error.Location
}
type Interpreter ¶
type Interpreter struct {
StartNode Expressions
Executor interpreter.Executor
Scope map[string]interpreter.Value
}
func NewInterpreter ¶
func NewInterpreter(startNode Expressions, executor interpreter.Executor) Interpreter
type Token ¶
func UnknownToken ¶
type TokenType ¶
type TokenType uint8
const ( Unknown TokenType = iota EOF EOL // \n Number // int String // " " Identifier // temperature, sleep // Terminal symbols Or // || And // && Equal // == NotEqual // != LessThan // < LessThanOrEqual // <= GreaterThan // > GreaterThanOrEqual // >= Not // ! LeftParenthesis // ( RightParenthesis // ) LeftCurlyBrace // { RightCurlyBrace // } Comma // , If // if Else // else True // true | on False // false | off )
Click to show internal directories.
Click to hide internal directories.