mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-20 10:19:32 -06:00
the linearizer API now allows to detect metavariables. This is used for instancein the lookup where the tokens produced from the metavariables are interpreted as distinct from all other tokens.
This commit is contained in:
@@ -59,7 +59,7 @@ pgf_metrics_lzn_end_phrase1(PgfLinFuncs** funcs, PgfCId cat, int fid, int lin_id
|
||||
|
||||
int start = gu_buf_pop(state->marks, int);
|
||||
int end = state->pos;
|
||||
|
||||
|
||||
if (start != end) {
|
||||
PgfPhrase* phrase = gu_new(PgfPhrase, state->pool);
|
||||
phrase->start = start;
|
||||
@@ -110,13 +110,26 @@ pgf_metrics_lzn_end_phrase2(PgfLinFuncs** funcs, PgfCId cat, int fid, int lin_id
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
pgf_metrics_lzn_symbol_meta(PgfLinFuncs** funcs, PgfMetaId meta_id)
|
||||
{
|
||||
PgfMetricsLznState* state = gu_container(funcs, PgfMetricsLznState, funcs);
|
||||
|
||||
pgf_metrics_put_space(state);
|
||||
if (state->out != NULL)
|
||||
gu_putc('?', state->out, state->err);
|
||||
|
||||
state->pos += 1;
|
||||
}
|
||||
|
||||
static PgfLinFuncs pgf_metrics_lin_funcs1 = {
|
||||
.symbol_token = pgf_metrics_lzn_symbol_token,
|
||||
.begin_phrase = pgf_metrics_lzn_begin_phrase,
|
||||
.end_phrase = pgf_metrics_lzn_end_phrase1,
|
||||
.symbol_ne = pgf_metrics_symbol_ne,
|
||||
.symbol_bind = pgf_metrics_symbol_bind,
|
||||
.symbol_capit = NULL
|
||||
.symbol_capit = NULL,
|
||||
.symbol_meta = pgf_metrics_lzn_symbol_meta
|
||||
};
|
||||
|
||||
static PgfLinFuncs pgf_metrics_lin_funcs2 = {
|
||||
@@ -125,7 +138,8 @@ static PgfLinFuncs pgf_metrics_lin_funcs2 = {
|
||||
.end_phrase = pgf_metrics_lzn_end_phrase2,
|
||||
.symbol_ne = pgf_metrics_symbol_ne,
|
||||
.symbol_bind = pgf_metrics_symbol_bind,
|
||||
.symbol_capit = NULL
|
||||
.symbol_capit = NULL,
|
||||
.symbol_meta = pgf_metrics_lzn_symbol_meta
|
||||
};
|
||||
|
||||
PGF_API bool
|
||||
|
||||
Reference in New Issue
Block a user