Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Apr 28, 2024
1 parent 5c3d5c7 commit 998debc
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 83 deletions.
8 changes: 3 additions & 5 deletions error.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ err_vcatf(VALUE str, const char *pre, const char *file, int line,
return str;
}

static VALUE syntax_error_with_path(VALUE, VALUE, VALUE*, rb_encoding*);

VALUE
rb_syntax_error_append(VALUE exc, VALUE file, int line, int column,
rb_encoding *enc, const char *fmt, va_list args)
Expand All @@ -149,7 +147,7 @@ rb_syntax_error_append(VALUE exc, VALUE file, int line, int column,
}
else {
VALUE mesg;
exc = syntax_error_with_path(exc, file, &mesg, enc);
exc = rb_syntax_error_with_path(exc, file, &mesg, enc);
err_vcatf(mesg, NULL, fn, line, fmt, args);
}

Expand Down Expand Up @@ -2689,8 +2687,8 @@ syntax_error_initialize(int argc, VALUE *argv, VALUE self)
return rb_call_super(argc, argv);
}

static VALUE
syntax_error_with_path(VALUE exc, VALUE path, VALUE *mesg, rb_encoding *enc)
VALUE
rb_syntax_error_with_path(VALUE exc, VALUE path, VALUE *mesg, rb_encoding *enc)
{
if (NIL_P(exc)) {
*mesg = rb_enc_str_new(0, 0, enc);
Expand Down
1 change: 1 addition & 0 deletions internal/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ void rb_deprecated_method_to_be_removed(const char *);
#define RBIMPL_TODO(message) RBIMPL_TODO0("TODO: " message)
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 6, 0)
VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list);
VALUE rb_syntax_error_with_path(VALUE, VALUE, VALUE*, rb_encoding*);
PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3);
PRINTF_ARGS(void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
PRINTF_ARGS(void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...), 3, 4);
Expand Down
Loading

0 comments on commit 998debc

Please sign in to comment.