wip
This commit is contained in:
parent
9760da4df4
commit
06af7fbe3b
@ -4,8 +4,7 @@
|
|||||||
* This file is generated by Propane.
|
* This file is generated by Propane.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PROPANE_PARSER_H
|
#pragma once
|
||||||
#define PROPANE_PARSER_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.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);
|
<%= start_rule_type[1] %> <%= @grammar.prefix %>result(<%= @grammar.prefix %>context_t * context);
|
||||||
|
|
||||||
<%= @grammar.prefix %>position_t <%= @grammar.prefix %>position(<%= @grammar.prefix %>context_t * context);
|
<%= @grammar.prefix %>position_t <%= @grammar.prefix %>position(<%= @grammar.prefix %>context_t * context);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
19
spec/test_multiple_parsers.c
Normal file
19
spec/test_multiple_parsers.c
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user