From 15d014abb825837f0fd7c9e17d5907001135faaf Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Wed, 6 Sep 2017 12:38:42 +0200 Subject: 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. --- src/runtime/c/pgf/pgf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/runtime/c/pgf/pgf.h') 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); -- cgit v1.2.3