diff options
| author | krasimir <krasimir@chalmers.se> | 2016-05-11 11:10:22 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2016-05-11 11:10:22 +0000 |
| commit | 86c54232752d14069cbb9b3089474d0299f9a20c (patch) | |
| tree | b502ee4110c41f7ae93c3976e607a3bdf61b49c0 /src/runtime/haskell-bind/utils.c | |
| parent | 9abc6aaddeb892015015f9f02d5a790701f1c8a2 (diff) | |
the Literals API in Haskell no longer offers the sentence as an argument to the callbacks. It is just as easy to save the sentence in a closure and by doing that we save the repeated round about from C to Haskell strings
Diffstat (limited to 'src/runtime/haskell-bind/utils.c')
| -rw-r--r-- | src/runtime/haskell-bind/utils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/runtime/haskell-bind/utils.c b/src/runtime/haskell-bind/utils.c index ee1c32ea1..5afb33b5c 100644 --- a/src/runtime/haskell-bind/utils.c +++ b/src/runtime/haskell-bind/utils.c @@ -4,9 +4,7 @@ typedef struct { PgfLiteralCallback callback; - PgfExprProb* (*match)(PgfLiteralCallback* self, - size_t lin_idx, - GuString sentence, size_t* poffset, + PgfExprProb* (*match)(size_t lin_idx, size_t* poffset, GuPool *out_pool); GuFinalizer fin; } HSPgfLiteralCallback; @@ -48,7 +46,7 @@ hspgf_match_callback(PgfLiteralCallback* self, PgfConcr* concr, size_t hs_offset = hspgf_offset2hs(sentence, *poffset); PgfExprProb* ep = - callback->match(self, lin_idx, sentence, &hs_offset, out_pool); + callback->match(lin_idx, &hs_offset, out_pool); *poffset = hspgf_hs2offset(sentence, hs_offset); return ep; |
