word completion in the C parser now returns information about the function which generates the token

This commit is contained in:
Krasimir Angelov
2017-09-06 14:37:51 +02:00
parent ef071d9157
commit 301b100988
5 changed files with 19 additions and 5 deletions

View File

@@ -1254,9 +1254,12 @@ pgf_parsing_add_transition(PgfParsing* ps, PgfToken tok, PgfItem* item)
if (ps->prefix != NULL && *current == 0) {
if (gu_string_is_prefix(ps->prefix, tok)) {
PgfProductionApply* papp = gu_variant_data(item->prod);
ps->tp = gu_new(PgfTokenProb, ps->out_pool);
ps->tp->tok = tok;
ps->tp->cat = item->conts->ccat->cnccat->abscat->name;
ps->tp->fun = papp->fun->absfun->name;
ps->tp->prob = item->inside_prob + item->conts->outside_prob;
}
} else {

View File

@@ -200,6 +200,7 @@ pgf_parse_with_oracle(PgfConcr* concr, PgfType* typ,
typedef struct {
PgfToken tok;
PgfCId cat;
PgfCId fun;
prob_t prob;
} PgfTokenProb;