Skip to content

Commit

Permalink
Remove "internal/thread.h"
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Apr 13, 2023
1 parent 979f64d commit 31910e3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions external/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ typedef struct rb_parser_config_struct {
void *(*calloc)(size_t number, size_t size);
void (*free)(void *ptr);

// VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
VALUE (*compile_callback)(VALUE (*func)(VALUE), VALUE arg);

/* Array */
VALUE (*ary_new)(void);
VALUE (*ary_push)(VALUE ary, VALUE elem);
Expand Down
8 changes: 6 additions & 2 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ struct lex_context;
#include "internal/imemo.h"
#include "internal/re.h"
#include "internal/symbol.h"
#include "internal/thread.h"
#include "internal/variable.h"
#include "probes.h"
#include "regenc.h"
Expand All @@ -64,6 +63,8 @@ struct lex_context;
#include "internal/hash.h"
#include "internal/io.h"
#include "internal/rational.h"
#include "internal/thread.h"

#endif

enum shareability {
Expand Down Expand Up @@ -95,6 +96,9 @@ RBIMPL_WARNING_POP()
#include "parse.h"

#ifndef RIPPER

#define compile_callback p->config.compile_callback

#define rb_ary_new p->config.ary_new
#define rb_ary_push p->config.ary_push
#define rb_ary_new_from_args p->config.ary_new_from_args
Expand Down Expand Up @@ -6887,7 +6891,7 @@ yycompile(struct parser_params *p, VALUE fname, int line)
p->lvtbl = NULL;

p->ast = ast = rb_ast_new();
rb_suppress_tracing(yycompile0, (VALUE)p);
compile_callback(yycompile0, (VALUE)p);
p->ast = 0;

while (p->lvtbl) {
Expand Down
3 changes: 3 additions & 0 deletions ruby_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "internal/rational.h"
#include "internal/ruby_parser.h"
#include "internal/string.h"
#include "internal/thread.h"

#include "ruby/ruby.h"
#include "node.h"
Expand Down Expand Up @@ -114,6 +115,8 @@ rb_parser_config_initialize(rb_parser_config_t *config)
config->calloc = ruby_xcalloc;
config->free = ruby_xfree;

config->compile_callback = rb_suppress_tracing;

config->ary_new = rb_ary_new;
config->ary_push = rb_ary_push;
config->ary_new_from_args = rb_ary_new_from_args;
Expand Down

0 comments on commit 31910e3

Please sign in to comment.