Fixed a bug in the AST Grower which made the keyword word unusable
This commit is contained in:
parent
dc13ca8bfa
commit
5cecbaf11d
|
@ -68,8 +68,8 @@ i32_t pac_grow_item(pac_tlist_s *tlist, pac_ast_item_s *item)
|
||||||
{
|
{
|
||||||
item->type = PAC_AST_ITEM_SET;
|
item->type = PAC_AST_ITEM_SET;
|
||||||
item->data.set = PAC_AST_SET_WORD;
|
item->data.set = PAC_AST_SET_WORD;
|
||||||
return 1;
|
|
||||||
SKIP_TOKEN;
|
SKIP_TOKEN;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(CURRENT.type == PAC_TOKEN_KEYWORD_INTEGER)
|
if(CURRENT.type == PAC_TOKEN_KEYWORD_INTEGER)
|
||||||
|
@ -101,17 +101,20 @@ i32_t pac_grow_variant(pac_tlist_s *tlist, pac_ast_variant_s *variant)
|
||||||
++variant->num_items;
|
++variant->num_items;
|
||||||
|
|
||||||
if(success < 0)
|
if(success < 0)
|
||||||
|
{
|
||||||
return success - 1;
|
return success - 1;
|
||||||
|
}
|
||||||
if(CURRENT.type == PAC_TOKEN_SIGN_VERTICAL_BAR)
|
if(
|
||||||
return tlist->cursor - start_index;
|
(CURRENT.type == PAC_TOKEN_SIGN_VERTICAL_BAR)
|
||||||
|
|| (CURRENT.type == PAC_TOKEN_SIGN_SEMICOLON)
|
||||||
if(CURRENT.type == PAC_TOKEN_SIGN_SEMICOLON)
|
) {
|
||||||
return tlist->cursor - start_index;
|
return tlist->cursor - start_index;
|
||||||
|
}
|
||||||
|
|
||||||
if(CURRENT.type != PAC_TOKEN_SIGN_COMMA)
|
if(CURRENT.type != PAC_TOKEN_SIGN_COMMA)
|
||||||
|
{
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
SKIP_TOKEN;
|
SKIP_TOKEN;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -183,6 +186,7 @@ i32_t pac_grow_rule(pac_tlist_s *tlist, pac_ast_rule_s *rule)
|
||||||
if(CURRENT.type == PAC_TOKEN_SIGN_SEMICOLON)
|
if(CURRENT.type == PAC_TOKEN_SIGN_SEMICOLON)
|
||||||
{
|
{
|
||||||
printf("Continuing with next rule.\n");
|
printf("Continuing with next rule.\n");
|
||||||
|
SKIP_TOKEN;
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
SKIP_TOKEN;
|
SKIP_TOKEN;
|
||||||
|
|
Loading…
Reference in New Issue