20 lines
504 B
C
20 lines
504 B
C
#include "testparser.h"
|
|
#include <assert.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
|
|
int main()
|
|
{
|
|
char const * input = "aaa\n\n\na\n # comment 1\na a aa\n\naa\n# comment 2\na\n";
|
|
p_context_t context;
|
|
p_context_init(&context, (uint8_t const *)input, strlen(input));
|
|
assert(p_parse(&context) == P_SUCCESS);
|
|
|
|
fprintf(stderr, "comments: %s", context.comments);
|
|
fprintf(stderr, "acount: %u\n", context.acount);
|
|
free(context.comments);
|
|
|
|
return 0;
|
|
}
|