Skip to content

Commit

Permalink
Added comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen van der Heijden committed Feb 19, 2020
1 parent 1a24528 commit ced6716
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/prio.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <stdlib.h>
#include <stdio.h>


static void prio__free(cleri_t * cl_obj);

static cleri_node_t * prio__parse(
Expand Down Expand Up @@ -123,6 +122,12 @@ static cleri_node_t * prio__parse(
{
if (tested->node != NULL)
{
/*
* It is required to decrement an extra reference here, one
* belongs to the parse result, and one for the tested rule.
* The node->ref increment below is required for when a str
* position is visited a second time by another parent.
*/
--tested->node->ref;
cleri__node_free(tested->node);
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_thingsdb_lang/test_thingsdb_lang.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static int test_thingsdb_lang(void)

_assert_is_valid (grammar, "x = 1");
_assert_is_valid (grammar, "||1?2:3");
_assert_is_not_valid (grammar, "||1?2" );
_assert_is_not_valid (grammar, "||1?2");

cleri_grammar_free(grammar);

Expand Down

0 comments on commit ced6716

Please sign in to comment.