added type casts
This commit is contained in:
parent
77ce00970f
commit
8278430882
4 changed files with 72 additions and 1 deletions
|
|
@ -43,6 +43,13 @@ func concat(in *ast.Token, vt ast.VarTable, ft ast.FuncTable) *ast.Token {
|
|||
return t
|
||||
}
|
||||
|
||||
func str_cast(in *ast.Token, vt ast.VarTable, ft ast.FuncTable) *ast.Token {
|
||||
body := in.Eval(ft, vt, false).String()
|
||||
res := &ast.Token{ Tag: ast.STRING }
|
||||
res.Set(body)
|
||||
return res
|
||||
}
|
||||
|
||||
func print_str(in *ast.Token, vt ast.VarTable, ft ast.FuncTable) *ast.Token {
|
||||
body := in.Eval(ft, vt, false).String()
|
||||
if body[0] != body[len(body)-1] && body[0] != '"' {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue