diff options
| author | Krasimir Angelov <kr.angelov@gmail.com> | 2017-09-06 12:38:42 +0200 |
|---|---|---|
| committer | Krasimir Angelov <kr.angelov@gmail.com> | 2017-09-06 12:38:42 +0200 |
| commit | 15d014abb825837f0fd7c9e17d5907001135faaf (patch) | |
| tree | bc569f465432042702dfaa240746b8c6db609588 /src/runtime/c/pgf/pgf.h | |
| parent | 18f2135785a71a1e93519a060d40b7ba523cf03b (diff) | |
the parser in the C runtime can now detect incomplete sentences just like the parser in the Haskell runtime. This is also reflected in all bindings.
Diffstat (limited to 'src/runtime/c/pgf/pgf.h')
| -rw-r--r-- | src/runtime/c/pgf/pgf.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/c/pgf/pgf.h b/src/runtime/c/pgf/pgf.h index 632a1d332..e6c1c70b8 100644 --- a/src/runtime/c/pgf/pgf.h +++ b/src/runtime/c/pgf/pgf.h @@ -122,6 +122,13 @@ PGF_API_DECL PgfExprEnum* pgf_generate_all(PgfPGF* pgf, PgfType* ty, GuExn* err, GuPool* pool, GuPool* out_pool); +typedef struct { + int incomplete; // equal to !=0 if the sentence is incomplete, 0 otherwise + size_t offset; + const char* token_ptr; + size_t token_len; +} PgfParseError; + PGF_API_DECL PgfExprEnum* pgf_parse(PgfConcr* concr, PgfType* typ, GuString sentence, GuExn* err, GuPool* pool, GuPool* out_pool); |
