commit 7495cbc87c06eccd9895057c82ede40112254b6b from: Sven M. Hallberg date: Tue May 12 12:23:10 2020 UTC cosmetics commit - e3cbf911592479fbaa8b6f9edaf54328d9cee629 commit + 7495cbc87c06eccd9895057c82ede40112254b6b blob - 7fb3f05287cc2fe0e730c1507bd28fd0e841c444 blob + 433aee2f5990c42fe42175390d372d66bfda1a84 --- minip_a.h +++ minip_a.h @@ -7,10 +7,7 @@ #define MINIP_A_H_ #include /* NULL */ -#include -#include - typedef const char *stream; /* parser type -- corresponds to grammar nonterminals */ @@ -56,6 +53,9 @@ typedef stream parser(stream, const stream, void *); #define MANY1(...) (p_ = many1_(inp_, endp_, env_, PARGS(__VA_ARGS__))) #define OPT(...) (SEQ(__VA_ARGS__) || EPSILON) + +#include + /* * semantic actions: * @@ -68,6 +68,7 @@ typedef stream parser(stream, const stream, void *); typedef bool action(void *, void *, const char *, size_t); #define ACTION(F, C) (F)((C), env_, inp_, p_ - inp_) + /* * to avoid premature execution of actions, TRY(...) can be used in place of * SEQ on any sequence where actions could execute before a later nonterminal @@ -84,6 +85,8 @@ typedef bool action(void *, void *, const char *, size #define TRY(...) (env_ == NULL || MATCH(__VA_ARGS__)) && SEQ(__VA_ARGS__) +#include + static inline stream anychar_(stream p, const stream endp) {