Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReferencedVars ¶
Types ¶
type Sexp ¶
type Sexp struct {
I interface{}
}
dynamic types for i are string, qString, int, float64, list, and error.
func Parse ¶
Parse parses a string into a Go representation of an s-expression.
Quoted strings go from one " to the next. There is no escape character, all characters except " are valid.
Otherwise atoms are any string of characters between any of '(', ')', '"', or white space characters. If the atom parses as a Go int type using strconv.Atoi, it is taken as int; if it parses as a Go float64 type using strconv.ParseFloat, it is taken as float64; otherwise it is taken as an unquoted string.
Unmatched (, ), or " are errors. An empty or all whitespace input string is an error. Left over text after the sexp is an error.
An empty list is a valid sexp, but there is no nil, no cons, no dot.