make strings object

This commit is contained in:
2023-03-19 01:10:23 +00:00
parent c725d26c01
commit 2e04bb0152
26 changed files with 528 additions and 124 deletions

View File

@@ -1,8 +1,33 @@
package main
import (
"fmt"
"strings"
)
var mapCompiled = makeRegex(`( *)\{(((( *).+( *):( *).+( *))|(` + spacelessVariable + `))(( *)\,(( *).+( *):( *).+( *))|(` + spacelessVariable + `)))*\}( *)`)
func isMap(code UNPARSEcode) bool {
return mapCompiled.MatchString(code.code)
}
func parseMap(code UNPARSEcode) (any, UNPARSEcode) {
trimmed := strings.Trim(code.code, " ")
trimmed = trimmed[1 : len(trimmed)-1]
fmt.Println(trimmed)
return nil, UNPARSEcode{}
}
func Map(val anymap) ArObject {
return ArObject{
TYPE: "map",
obj: val,
}
}
func Class(val anymap) ArObject {
return ArObject{
TYPE: "class",
obj: val,
}
}