aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/sexp.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/test/sexp.c b/test/sexp.c
index f6f0b5e..c15b53e 100644
--- a/test/sexp.c
+++ b/test/sexp.c
@@ -7,27 +7,27 @@
int main()
{
- const char *s = "(a b c (sub list) ())\n"
- "(another lispy thingy)\n"
- "() id ciao 20 a1020|x|3a\n"
- ";comm\n3433 ;s\n"
- "'symbol 'another 'a\n"
- "'(a b c) '('a) ''x \"escape \\\"inside the string\"\n"
- "\"string very long sus\" (\"a\" \"b\")\n";
+ const char *s = "(a b c (sub list) ())\n"
+ "(another lispy thingy)\n"
+ "() id ciao 20 a1020|x|3a\n"
+ ";comm\n3433 ;s\n"
+ "'symbol 'another 'a\n"
+ "'(a b c) '('a) ''x \"escape \\\"inside the string\"\n"
+ "\"string very long sus\" (\"a\" \"b\")\n";
- any_sexp_string_stream_t stream;
- any_sexp_parser_t parser;
- any_sexp_parser_init_string(&parser, &stream, s, strlen(s));
+ any_sexp_reader_t reader;
+ any_sexp_reader_string_t string;
+ any_sexp_reader_string_init(&reader, &string, s, strlen(s));
- any_sexp_t sexp = any_sexp_parser_next(&parser);
- while (!ANY_SEXP_IS_ERROR(sexp)) {
- any_sexp_print(sexp);
- putchar('\n');
- any_sexp_free(sexp);
- sexp = any_sexp_parser_next(&parser);
- }
+ any_sexp_t sexp = any_sexp_read(&reader);
+ while (!ANY_SEXP_IS_ERROR(sexp)) {
+ any_sexp_print(sexp);
+ putchar('\n');
+ any_sexp_free(sexp);
+ sexp = any_sexp_read(&reader);
+ }
- //printf("%zu\n", sizeof(any_sexp_t));
+ //printf("%zu\n", sizeof(any_sexp_t));
- return 0;
+ return 0;
}