Skip to content

Commit

Permalink
Move ISASCII defination to parse.y
Browse files Browse the repository at this point in the history
  • Loading branch information
S-H-GAMELINKS authored and yui-knk committed Jul 8, 2023
1 parent 3c4d788 commit 8b2a0ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
11 changes: 11 additions & 0 deletions parse.y
Expand Up @@ -6351,6 +6351,17 @@ ripper_dispatch_delayed_token(struct parser_params *p, enum yytokentype t)
#define dispatch_delayed_token(p, t) ripper_dispatch_delayed_token(p, t)
#endif /* RIPPER */

static inline int
parse_isascii(int c)
{
return '\0' <= c && c <= '\x7f';
}

#ifdef ISASCII
#undef ISASCII
#define ISASCII parse_isascii
#endif

static inline int
is_identchar(struct parser_params *p, const char *ptr, const char *MAYBE_UNUSED(ptr_end), rb_encoding *enc)
{
Expand Down
1 change: 0 additions & 1 deletion ruby_parser.c
Expand Up @@ -791,7 +791,6 @@ rb_parser_config_initialize(rb_parser_config_t *config)
config->strtod = ruby_strtod;

config->isspace = rb_isspace;
config->isascii = rb_isascii;
config->iscntrl = rb_iscntrl;
config->isalpha = rb_isalpha;
config->isdigit = rb_isdigit;
Expand Down
1 change: 0 additions & 1 deletion rubyparser.h
Expand Up @@ -588,7 +588,6 @@ typedef struct rb_parser_config_struct {

/* ctype */
int (*isspace)(int c);
int (*isascii)(int c);
int (*iscntrl)(int c);
int (*isalpha)(int c);
int (*isdigit)(int c);
Expand Down

0 comments on commit 8b2a0ec

Please sign in to comment.