Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Concepts = make(map[string]Concept)
View Source
var Expression = compiler.Expression{ Detect: func(c *compiler.Compiler) compiler.Type { var Name = c.Token() if concept, ok := Concepts[Name]; ok { if c.Peek() == "(" { return CreateAndCall(c, Name, concept) } else { return Create(c, Name, concept, nil) } } return nil }, }
View Source
var Functions = make(map[string]Func)
View Source
var Name = compiler.Translatable{ compiler.English: "concept", }
View Source
var Return = compiler.Statement{ Name: compiler.Translatable{ compiler.English: "return", }, OnScan: func(c *compiler.Compiler) { c.Return(c.ScanExpression()) }, }
View Source
var Statement = compiler.Statement{ Name: Name, OnScan: func(c *compiler.Compiler) { var Name = c.Scan() c.Expecting("(") var Arguments []string for c.Peek() != ")" { Arguments = append(Arguments, c.Scan()) if c.Peek() != ")" { c.Expecting(",") } } c.Expecting(")") var cache compiler.Cache if c.ScanIf(":") { cache = c.NewCache("", "\n") } else { cache = c.NewCache("", "}") } Concepts[Name] = Concept{ Arguments: Arguments, Cache: cache, } }, Detect: func(c *compiler.Compiler) bool { var Name = c.Token() if function := c.GetVariable(Name); function.Defined && function.Value().IsFunc() { if len(function.Value().Func().Arguments()) == 0 { c.Expecting("(") c.Expecting(")") function.Value().Func().Run() return true } c.Unimplemented() } if concept, ok := Concepts[Name]; ok { CreateAndCall(c, Name, concept) return true } return false }, }
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.