fixed recursive case for lexing a list
This commit is contained in:
parent
d38f53208b
commit
cb84db53d8
1 changed files with 12 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ func Lex(input string) Token {
|
|||
delim := ' '
|
||||
var tok strings.Builder
|
||||
iter_alloced := false
|
||||
is_list = false;
|
||||
|
||||
for pos, char := range input {
|
||||
switch char {
|
||||
|
|
@ -23,11 +24,21 @@ func Lex(input string) Token {
|
|||
case '\'', '"', '`':
|
||||
delim = char
|
||||
case '(':
|
||||
is_list = true
|
||||
delim = ')'
|
||||
|
||||
case delim:
|
||||
*iter = new(Token)
|
||||
if is_list {
|
||||
// TODO: Pass a pointer out of Lex and store a pointer
|
||||
*iter._inner = Lex(tok.String())
|
||||
is_list = false
|
||||
|
||||
} else {
|
||||
// TODO: Store a pointer to the contents of the stringbuilder
|
||||
*iter._inner = tok.String()
|
||||
}
|
||||
|
||||
iter_alloced = true
|
||||
delim = ' '
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue