File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -5793,7 +5793,16 @@ pm_parser_scope_pop(pm_parser_t *parser) {
5793
5793
static inline size_t
5794
5794
char_is_identifier_start(pm_parser_t *parser, const uint8_t *b) {
5795
5795
if (parser->encoding_changed) {
5796
- return parser->encoding.alpha_char(b, parser->end - b) || (*b == '_') || (*b >= 0x80);
5796
+ size_t width;
5797
+ if ((width = parser->encoding.alpha_char(b, parser->end - b)) != 0) {
5798
+ return width;
5799
+ } else if (*b == '_') {
5800
+ return 1;
5801
+ } else if (*b >= 0x80) {
5802
+ return parser->encoding.char_width(b, parser->end - b);
5803
+ } else {
5804
+ return 0;
5805
+ }
5797
5806
} else if (*b < 0x80) {
5798
5807
return (pm_encoding_unicode_table[*b] & PRISM_ENCODING_ALPHABETIC_BIT ? 1 : 0) || (*b == '_');
5799
5808
} else {
@@ -5809,7 +5818,16 @@ char_is_identifier_start(pm_parser_t *parser, const uint8_t *b) {
5809
5818
static inline size_t
5810
5819
char_is_identifier(pm_parser_t *parser, const uint8_t *b) {
5811
5820
if (parser->encoding_changed) {
5812
- return parser->encoding.alnum_char(b, parser->end - b) || (*b == '_') || (*b >= 0x80);
5821
+ size_t width;
5822
+ if ((width = parser->encoding.alnum_char(b, parser->end - b)) != 0) {
5823
+ return width;
5824
+ } else if (*b == '_') {
5825
+ return 1;
5826
+ } else if (*b >= 0x80) {
5827
+ return parser->encoding.char_width(b, parser->end - b);
5828
+ } else {
5829
+ return 0;
5830
+ }
5813
5831
} else if (*b < 0x80) {
5814
5832
return (pm_encoding_unicode_table[*b] & PRISM_ENCODING_ALPHANUMERIC_BIT ? 1 : 0) || (*b == '_');
5815
5833
} else {
You can’t perform that action at this time.
0 commit comments