Skip to content

Commit

Permalink
Fix ripper build error
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Apr 17, 2023
1 parent beb8bd4 commit 808e6bd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -7402,6 +7402,14 @@ escaped_control_code(int c)
#define WARN_SPACE_CHAR(c, prefix) \
rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c2))

#ifdef RIPPER
static int
strterm_is_heredoc(VALUE strterm)
{
return ((rb_strterm_t *)strterm)->flags & STRTERM_HEREDOC;
}
#endif

static int
tokadd_codepoint(struct parser_params *p, rb_encoding **encp,
int regexp_literal, int wide)
Expand Down Expand Up @@ -7959,6 +7967,19 @@ tokadd_string(struct parser_params *p,
return c;
}

#ifdef RIPPER
static VALUE
new_strterm(VALUE v1, VALUE v2, VALUE v3, VALUE v0, int heredoc)
{
rb_strterm_t *imemo = (rb_strterm_t *)rb_imemo_new(imemo_parser_strterm, v1, v2, v3, v0);
if (heredoc) {
imemo->flags |= STRTERM_HEREDOC;
}

return (VALUE)imemo;
}
#endif

/* imemo_parser_strterm for literal */
#define NEW_STRTERM(func, term, paren) \
(rb_strterm_t *)new_strterm((VALUE)(func), (VALUE)(paren), (VALUE)(term), 0, 0)
Expand Down

0 comments on commit 808e6bd

Please sign in to comment.