5 make_non_list_node(u32 rest) {
6 // A this point text[parse_head:rest] is a term: symbol or int.
7 return push_symbol("foo", empty_list);
11 // Extract terms from the text until a closing bracket is found.
13 parse_list(char *text)
16 while (text[parse_head] && text[parse_head] == ' ') ++parse_head;
18 if (!text[parse_head]) {
19 print_str("Missing ']' bracket. A");
21 error = MISSING_CLOSING_BRACKET;
25 // So now we want to collect all chars up until the
26 // next '[', ']', blank, or the end of the string.
27 u32 rest = parse_head;
29 if (text[rest] == '[' || text[rest] == ']' || text[rest] == ' ')
31 //print_str(text + rest);print_endl();
36 print_str("Missing ']' bracket. B");
38 error = MISSING_CLOSING_BRACKET;
42 // A this point text[parse_head:rest] is a term: symbol or int.
44 u32 diff = rest - parse_head;
47 result = make_non_list_node(rest);
49 /*} else if ('[' == text[rest]) {*/
50 /* parse_head = rest + 1;*/
51 /* result = cons(parse_list(text), empty_list);*/
52 } else if (']' == text[rest]) {
53 parse_head = rest + 1;
56 tails[VALUE_OF(result)] = parse_list(text);
66 while (text[parse_head] && text[parse_head] == ' ') ++parse_head;
68 if (!text[parse_head]) return empty_list;
70 if ('[' == text[parse_head]) {
72 u32 list = parse_list(text);
73 if (error != NO_ERROR)
76 /*foo = cons(list, foo);*/
79 /*print_str(text + parse_head);*/
80 /*print_str(text + parse_head);*/