mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 11:19:32 -06:00
bugfixes for showContext & showType
This commit is contained in:
@@ -476,7 +476,7 @@ PgfText *pgf_print_context(size_t n_hypos, PgfTypeHypo *hypos,
|
||||
for (size_t i = 0; i < n_hypos; i++) {
|
||||
if (i > 0)
|
||||
printer.puts(" ");
|
||||
printer.hypo(&hypos[i]);
|
||||
printer.hypo(&hypos[i],4);
|
||||
}
|
||||
return printer.get_text();
|
||||
}
|
||||
|
||||
@@ -380,23 +380,24 @@ PgfLiteral PgfPrinter::lstr(PgfText *v)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PgfPrinter::hypo(PgfTypeHypo *hypo)
|
||||
void PgfPrinter::hypo(PgfTypeHypo *hypo, int prio)
|
||||
{
|
||||
if (textcmp(hypo->cid, &wildcard) == 0) {
|
||||
prio = 1;
|
||||
this->prio = prio;
|
||||
m->match_type(this, hypo->type);
|
||||
} else {
|
||||
push_variable(hypo->cid);
|
||||
|
||||
puts("(");
|
||||
if (hypo->bind_type == PGF_BIND_TYPE_IMPLICIT)
|
||||
puts("{");
|
||||
puts(&ctxt->name);
|
||||
puts(hypo->cid);
|
||||
if (hypo->bind_type == PGF_BIND_TYPE_IMPLICIT)
|
||||
puts("}");
|
||||
puts(" : ");
|
||||
this->prio = 0;
|
||||
m->match_type(this, hypo->type);
|
||||
puts(")");
|
||||
|
||||
push_variable(hypo->cid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,7 +412,7 @@ PgfType PgfPrinter::dtyp(size_t n_hypos, PgfTypeHypo *hypos,
|
||||
PgfPrintContext *save_ctxt = ctxt;
|
||||
|
||||
for (int i = 0; i < n_hypos; i++) {
|
||||
hypo(&hypos[i]);
|
||||
hypo(&hypos[i],1);
|
||||
puts(" -> ");
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
|
||||
PgfText *get_text();
|
||||
|
||||
void hypo(PgfTypeHypo *hypo);
|
||||
void hypo(PgfTypeHypo *hypo, int prio);
|
||||
|
||||
virtual PgfExpr eabs(PgfBindType btype, PgfText *name, PgfExpr body);
|
||||
virtual PgfExpr eapp(PgfExpr fun, PgfExpr arg);
|
||||
|
||||
Reference in New Issue
Block a user