mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
bugfix in the parser
This commit is contained in:
@@ -1025,6 +1025,16 @@ pgf_symbols_cmp(GuString* psent, PgfSymbols* syms, bool case_sensitive)
|
|||||||
for (size_t i = 0; i < n_syms; i++) {
|
for (size_t i = 0; i < n_syms; i++) {
|
||||||
PgfSymbol sym = gu_seq_get(syms, PgfSymbol, i);
|
PgfSymbol sym = gu_seq_get(syms, PgfSymbol, i);
|
||||||
|
|
||||||
|
if (i > 0) {
|
||||||
|
if (!skip_space(psent))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
while (**psent != 0) {
|
||||||
|
if (!skip_space(psent))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GuVariantInfo inf = gu_variant_open(sym);
|
GuVariantInfo inf = gu_variant_open(sym);
|
||||||
switch (inf.tag) {
|
switch (inf.tag) {
|
||||||
case PGF_SYMBOL_CAT:
|
case PGF_SYMBOL_CAT:
|
||||||
@@ -1039,16 +1049,6 @@ pgf_symbols_cmp(GuString* psent, PgfSymbols* syms, bool case_sensitive)
|
|||||||
if (**psent == 0)
|
if (**psent == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (i > 0) {
|
|
||||||
if (!skip_space(psent))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
while (**psent != 0) {
|
|
||||||
if (!skip_space(psent))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int cmp = cmp_string(psent, pks->token, case_sensitive);
|
int cmp = cmp_string(psent, pks->token, case_sensitive);
|
||||||
if (cmp != 0)
|
if (cmp != 0)
|
||||||
return cmp;
|
return cmp;
|
||||||
@@ -2027,7 +2027,7 @@ pgf_parse_result_enum_next(GuEnum* self, void* to, GuPool* pool)
|
|||||||
|
|
||||||
static GuString
|
static GuString
|
||||||
pgf_parsing_last_token(PgfParsing* ps, GuPool* pool)
|
pgf_parsing_last_token(PgfParsing* ps, GuPool* pool)
|
||||||
{
|
{
|
||||||
if (ps->before == NULL)
|
if (ps->before == NULL)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user