From d66704db5091ec97d57a6939ecef8f33fb1aac76 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 10 Jan 2014 23:05:10 +0100 Subject: The parser --- tests/storycode_test.c | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'tests') diff --git a/tests/storycode_test.c b/tests/storycode_test.c index 524fe19..7d73c41 100644 --- a/tests/storycode_test.c +++ b/tests/storycode_test.c @@ -32,41 +32,19 @@ static int test_sc(const char *tt) { - SCBlockList *bl; - SCBlockListIterator *iter; - struct scblock *b; + SCBlock *bl; printf("'%s' ->\n", tt); - bl = sc_find_blocks(tt, "bg"); + bl = sc_parse(tt); if ( bl == NULL ) { - printf("Failed to find blocks.\n"); + printf("Failed to parse SC\n"); return 1; } - for ( b = sc_block_list_first(bl, &iter); - b != NULL; - b = sc_block_list_next(bl, iter) ) - { - printf(" \\%s [%s] {%s}\n", b->name, b->options, b->contents); - } - sc_block_list_free(bl); - - printf("->\n"); - bl = sc_find_blocks(tt, NULL); + show_sc_blocks(bl); - if ( bl == NULL ) { - printf("Failed to find blocks.\n"); - return 1; - } - - for ( b = sc_block_list_first(bl, &iter); - b != NULL; - b = sc_block_list_next(bl, iter) ) - { - printf(" \\%s [%s] {%s}\n", b->name, b->options, b->contents); - } - sc_block_list_free(bl); + sc_block_free(bl); return 0; } -- cgit v1.2.3