implemented readExpr & readType

This commit is contained in:
krangelov
2021-08-11 22:07:01 +02:00
parent a5008c2fe1
commit 2c1700776e
9 changed files with 151 additions and 22 deletions

View File

@@ -214,3 +214,27 @@ pgf_function_type(PgfPGF* pgf, PgfText *funname)
return pgf_unmarshall_type(pgf->u, absfun->type);
}
PGF_API uintptr_t
pgf_read_expr(PgfText *input, PgfUnmarshaller *u)
{
PgfExprParser parser(input, u);
uintptr_t res = parser.parse_expr();
if (!parser.eof()) {
u->free_ref(res);
return 0;
}
return res;
}
PGF_API uintptr_t
pgf_read_type(PgfText *input, PgfUnmarshaller *u)
{
PgfExprParser parser(input, u);
uintptr_t res = parser.parse_type();
if (!parser.eof()) {
u->free_ref(res);
return 0;
}
return res;
}