* The public API (at the bottom of the file) allows parsing the same mood
* definition many times in an efficient manner.
*
- * The first function to all is \ref mp_init(), which analyzes the given mood
+ * The first function to call is \ref mp_init(), which analyzes the given mood
* definition syntactically. It returns the abstract syntax tree of the mood
* definition and pre-compiles all regular expression patterns to make later
* pattern matching efficient.
struct mp_context *ctx;
struct yy_buffer_state *buffer_state;
+ *result = NULL;
if (!definition || nbytes == 0) { /* dummy mood */
if (errmsg)
*errmsg = NULL;
- *result = NULL;
return 0;
}
ctx = para_calloc(sizeof(*ctx));
{
if (!ctx) /* dummy mood */
return true;
+ if (!ctx->ast) /* empty mood */
+ return true;
assert(aft_row);
ctx->aft_row = aft_row;
ctx->have_afsi = false;