This commit is contained in:
Josh Holtrop 2023-08-20 21:22:34 -04:00
parent 9760da4df4
commit 06af7fbe3b
2 changed files with 20 additions and 4 deletions

View File

@ -4,8 +4,7 @@
* This file is generated by Propane.
*/
#ifndef PROPANE_PARSER_H
#define PROPANE_PARSER_H
#pragma once
#include <stdint.h>
#include <stddef.h>
@ -121,5 +120,3 @@ size_t <%= @grammar.prefix %>parse(<%= @grammar.prefix %>context_t * context);
<%= start_rule_type[1] %> <%= @grammar.prefix %>result(<%= @grammar.prefix %>context_t * context);
<%= @grammar.prefix %>position_t <%= @grammar.prefix %>position(<%= @grammar.prefix %>context_t * context);
#endif

View File

@ -0,0 +1,19 @@
#include "testparsermyp1.h"
#include "testparsermyp2.h"
#include <assert.h>
#include <string.h>
int main()
{
char const * input1 = "a\n1";
myp1_context_t context1;
myp1_context_init(&context1, (uint8_t const *)input1, strlen(input1));
assert(myp1_parse(&context1) == MYP1_SUCCESS);
char const * input2 = "bcb";
myp2_context_t context2;
myp2_context_init(&context2, (uint8_t const *)input2, strlen(input2));
assert(myp2_parse(&context2) == MYP2_SUCCESS);
return 0;
}