Adjust styles [ci skip]
This commit is contained in:
parent
40113454b1
commit
2f595c744e
3
iseq.c
3
iseq.c
@ -1501,7 +1501,8 @@ iseqw_s_compile_file_prism(int argc, VALUE *argv, VALUE self)
|
||||
}
|
||||
|
||||
rb_iseq_t *
|
||||
rb_iseq_new_main_prism(pm_string_t *input, pm_options_t *options, VALUE path) {
|
||||
rb_iseq_new_main_prism(pm_string_t *input, pm_options_t *options, VALUE path)
|
||||
{
|
||||
pm_parser_t parser;
|
||||
pm_parser_init(&parser, pm_string_source(input), pm_string_length(input), options);
|
||||
|
||||
|
3
load.c
3
load.c
@ -751,7 +751,8 @@ load_iseq_eval(rb_execution_context_t *ec, VALUE fname)
|
||||
|
||||
pm_string_free(&input);
|
||||
pm_options_free(&options);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rb_execution_context_t *ec = GET_EC();
|
||||
VALUE v = rb_vm_push_frame_fname(ec, fname);
|
||||
rb_ast_t *ast;
|
||||
|
17
ruby.c
17
ruby.c
@ -1411,13 +1411,16 @@ proc_long_options(ruby_cmdline_options_t *opt, const char *s, long argc, char **
|
||||
else if (is_option_with_arg("parser", Qfalse, Qtrue)) {
|
||||
if (strcmp("prism", s) == 0) {
|
||||
(*rb_ruby_prism_ptr()) = true;
|
||||
rb_warn("The compiler based on the Prism parser is currently experimental and compatibility with the compiler based on parse.y is not yet complete. Please report any issues you find on the `ruby/prism` issue tracker.");
|
||||
rb_warn("The compiler based on the Prism parser is currently experimental and "
|
||||
"compatibility with the compiler based on parse.y "
|
||||
"is not yet complete. Please report any issues you "
|
||||
"find on the `ruby/prism` issue tracker.");
|
||||
}
|
||||
else if (strcmp("parse.y", s) == 0) {
|
||||
// default behavior
|
||||
} else {
|
||||
rb_raise(rb_eRuntimeError,
|
||||
"unknown parser %s", s);
|
||||
}
|
||||
else {
|
||||
rb_raise(rb_eRuntimeError, "unknown parser %s", s);
|
||||
}
|
||||
}
|
||||
#if defined ALLOW_DEFAULT_SOURCE_ENCODING && ALLOW_DEFAULT_SOURCE_ENCODING
|
||||
@ -2400,7 +2403,8 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
|
||||
if (opt->e_script) {
|
||||
pm_string_constant_init(&input, RSTRING_PTR(opt->e_script), RSTRING_LEN(opt->e_script));
|
||||
pm_options_filepath_set(&options, "-e");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
pm_string_mapped_init(&input, RSTRING_PTR(opt->script_name));
|
||||
pm_options_filepath_set(&options, RSTRING_PTR(opt->script_name));
|
||||
}
|
||||
@ -2409,7 +2413,8 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
|
||||
|
||||
pm_string_free(&input);
|
||||
pm_options_free(&options);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rb_binding_t *toplevel_binding;
|
||||
GetBindingPtr(rb_const_get(rb_cObject, rb_intern("TOPLEVEL_BINDING")),
|
||||
toplevel_binding);
|
||||
|
Loading…
x
Reference in New Issue
Block a user