func NewNameWord(name string) kit.NameWord { return &nameWord{ word: word{wordType: TNameWord, author: author.NewUserAuthor()}, name: name, } }
func NewStringWord(val string) kit.StringWord { return &stringWord{ str: val, word: word{wordType: TStringWord, author: author.NewUserAuthor()}, } }
func NewArrayWordFromList(l *list.List) kit.ArrayWord { return &arrayWord{ chainWord: chainWord{ word: word{wordType: TArrayWord, author: author.NewUserAuthor()}, List: *l, }, } }
func NewDictWordFromList(l *list.List) kit.DictWord { return &dictWord{ dict: make(map[kit.Word]kit.Word, 0), chainWord: chainWord{ word: word{wordType: TArrayWord, author: author.NewUserAuthor()}, List: *l, }, } }
func parseAnonFuncBody(p *parser) kit.FuncWord { // skip the first square bracket p.next() if w, t := parseChainWordBody(p, word.TFuncWord); t == word.TFuncWord { return word.NewFuncWordFromChainWord("", author.NewUserAuthor(), w) } return nil }
func NewNumberWord(val string) kit.NumberWord { var ( f float64 err error ) if f, err = strconv.ParseFloat(val, 64); err != nil { f = 0.0 } return &numberWord{ word: word{wordType: TNumberWord, author: author.NewUserAuthor()}, number: f, } }
func NewChainWord() kit.ChainWord { return &chainWord{ word: word{wordType: TChainWord, author: author.NewUserAuthor()}, } }