mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
make strings object
This commit is contained in:
25
src/map.go
25
src/map.go
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user