Allow multiple lexer modes to be specified for a lexer pattern - close #35

This commit is contained in:
josh committed 2025-03-11 20:40:10 -04:00
1 parent 54bb3307cd
commit eb9d9026fc
11 files changed
+166 -30

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
#include "testparser.h"
#include <assert.h>
#include <string.h>
#include <stdio.h>
int main()
{
char const * input = "abc.def";
p_context_t context;
p_context_init(&context, (uint8_t const *)input, strlen(input));
assert(p_parse(&context) == P_SUCCESS);
printf("pass1\n");
input = "abc . abc";
p_context_init(&context, (uint8_t const *)input, strlen(input));
assert(p_parse(&context) == P_SUCCESS);
printf("pass2\n");
return 0;
}