Skip to content

Commit

Permalink
fix #60 : invalid state(CCS_VALUE) in parse_char_class()
Browse files Browse the repository at this point in the history
  • Loading branch information
K.Kosako committed May 24, 2017
1 parent b690371 commit 3b63d12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/regparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -4081,7 +4081,9 @@ next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type,
}
}

*state = CCS_VALUE;
if (*state != CCS_START)
*state = CCS_VALUE;

*type = CCV_CLASS;
return 0;
}
Expand Down

2 comments on commit 3b63d12

@kitkat1375
Copy link

@kitkat1375 kitkat1375 commented on 3b63d12 Jun 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we solve it?

@kkos
Copy link
Owner

@kkos kkos commented on 3b63d12 Jun 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely, it looks strange.
But it avoids a problem such as #60, a character-type is at the top of char-class. ([\d-a....])
Now I'm thinking that to divide CCS_START into CCS_START_EMPTY and CCS_EMPTY.

Please sign in to comment.