Merge pull request #3218 from nobu/trailing-space

Removed trailing spaces
This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-09-28 15:51:02 +09:00
committed by GitHub
20 changed files with 82 additions and 82 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ class Liste < Array
def initialize(str = nil)
@feld = str
end
end
end
p Liste.new "foobar"
```
+4 -4
View File
@@ -5,12 +5,12 @@
MRuby::Build.new do |conf|
toolchain :gcc
conf.gembox 'default'
conf.cc.defines = %w(ENABLE_READLINE)
conf.cc.defines = %w(ENABLE_READLINE)
conf.gembox 'default'
#lightweight regular expression
conf.gem :github => "pbosetti/mruby-hs-regexp", :branch => "master"
end
# Define cross build settings
@@ -18,7 +18,7 @@ MRuby::CrossBuild.new('core2-32-poky-linux') do |conf|
toolchain :gcc
# Mac OS X
#
#
POKY_EDISON_PATH = '/opt/poky-edison/1.7.2'
POKY_EDISON_SYSROOT = "#{POKY_EDISON_PATH}/sysroots/core2-32-poky-linux"
@@ -42,7 +42,7 @@ MRuby::CrossBuild.new('core2-32-poky-linux') do |conf|
cxx.include_paths << ["#{POKY_EDISON_SYSROOT}/usr/include/c++/4.9.1"]
cxx.flags = conf.cc.flags.dup
cxx.defines = conf.cc.defines.dup
cxx.compile_options = conf.cc.compile_options.dup
cxx.compile_options = conf.cc.compile_options.dup
end
conf.archiver do |archiver|
+39 -39
View File
@@ -222,7 +222,7 @@ MRB_API struct RClass *mrb_define_class(mrb_state *mrb, const char *name, struct
/**
* Defines a new module.
*
*
* @param [mrb_state *] mrb_state* The current mruby state.
* @param [const char *] char* The name of the module.
* @return [struct RClass *] Reference to the newly defined module.
@@ -232,11 +232,11 @@ MRB_API mrb_value mrb_singleton_class(mrb_state*, mrb_value);
/**
* Include a module in another class or module.
* Equivalent to:
* Equivalent to:
*
* module B
* include A
* end
* module B
* include A
* end
* @param [mrb_state *] mrb_state* The current mruby state.
* @param [struct RClass *] RClass* A reference to module or a class.
* @param [struct RClass *] RClass* A reference to the module to be included.
@@ -253,7 +253,7 @@ MRB_API void mrb_include_module(mrb_state*, struct RClass*, struct RClass*);
* @param [mrb_state *] mrb_state* The current mruby state.
* @param [struct RClass *] RClass* A reference to module or a class.
* @param [struct RClass *] RClass* A reference to the module to be prepended.
*/
*/
MRB_API void mrb_prepend_module(mrb_state*, struct RClass*, struct RClass*);
/**
@@ -302,7 +302,7 @@ MRB_API void mrb_define_method(mrb_state *mrb, struct RClass *cla, const char *n
* foo = mrb_define_class(mrb, "Foo", mrb->object_class);
* mrb_define_class_method(mrb, foo, "bar", bar_method, MRB_ARGS_NONE());
* }
* @param [mrb_state *] mrb_state* The MRuby state reference.
* @param [mrb_state *] mrb_state* The MRuby state reference.
* @param [struct RClass *] RClass* The class where the class method will be defined.
* @param [const char *] char* The name of the class method being defined.
* @param [mrb_func_t] mrb_func_t The function pointer to the class method definition.
@@ -317,23 +317,23 @@ MRB_API void mrb_define_singleton_method(mrb_state*, struct RObject*, const char
* Example:
*
* # Ruby style
* module Foo
* module Foo
* def Foo.bar
* end
* end
* // C style
* end
* end
* // C style
* mrb_value bar_method(mrb_state* mrb, mrb_value self){
* return mrb_nil_value();
* }
* void mrb_example_gem_init(mrb_state* mrb){
* return mrb_nil_value();
* }
* void mrb_example_gem_init(mrb_state* mrb){
* struct RClass *foo;
* foo = mrb_define_module(mrb, "Foo");
* foo = mrb_define_module(mrb, "Foo");
* mrb_define_module_function(mrb, foo, "bar", bar_method, MRB_ARGS_NONE());
* }
* }
* @param [mrb_state *] mrb_state* The MRuby state reference.
* @param [struct RClass *] RClass* The module where the module function will be defined.
* @param [const char *] char* The name of the module function being defined.
* @param [mrb_func_t] mrb_func_t The function pointer to the module function definition.
* @param [mrb_func_t] mrb_func_t The function pointer to the module function definition.
* @param [mrb_aspec] mrb_aspec The method parameters declaration.
*/
MRB_API void mrb_define_module_function(mrb_state*, struct RClass*, const char*, mrb_func_t, mrb_aspec);
@@ -348,9 +348,9 @@ MRB_API void mrb_define_module_function(mrb_state*, struct RClass*, const char*,
* AGE = 22
* end
* // C style
* #include <stdio.h>
* #include <stdio.h>
* #include <mruby.h>
*
*
* void
* mrb_example_gem_init(mrb_state* mrb){
* mrb_define_const(mrb, mrb->kernel_module, "AGE", mrb_fixnum_value(22));
@@ -389,7 +389,7 @@ MRB_API void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_
* // C style
* #include <stdio.h>
* #include <mruby.h>
*
*
* mrb_value
* mrb_example_method(mrb_state *mrb){
* return mrb_str_new_cstr(mrb, "example");
@@ -400,14 +400,14 @@ MRB_API void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_
* struct RClass *example_class_a;
* struct RClass *example_class_b;
* struct RClass *example_class_c;
*
*
* example_class_a = mrb_define_class(mrb, "ExampleClassA", mrb->object_class);
* mrb_define_method(mrb, example_class_a, "example_method", mrb_example_method, MRB_ARGS_NONE());
* example_class_b = mrb_define_class(mrb, "ExampleClassB", example_class_a);
* example_class_c = mrb_define_class(mrb, "ExampleClassC", example_class_b);
* mrb_undef_method(mrb, example_class_c, "example_method");
* }
*
*
* mrb_example_gem_final(mrb_state* mrb){
* }
* @param [mrb_state*] mrb_state* The mruby state reference.
@@ -428,16 +428,16 @@ MRB_API void mrb_undef_method(mrb_state*, struct RClass*, const char*);
* end
*
* ExampleClass.example_method
*
*
* // C style
* #include <stdio.h>
* #include <mruby.h>
* #include <mruby.h>
*
* mrb_value
* mrb_example_method(mrb_state *mrb){
* return mrb_str_new_cstr(mrb, "example");
* return mrb_str_new_cstr(mrb, "example");
* }
*
*
* void
* mrb_example_gem_init(mrb_state* mrb){
* struct RClass *example_class;
@@ -445,7 +445,7 @@ MRB_API void mrb_undef_method(mrb_state*, struct RClass*, const char*);
* mrb_define_class_method(mrb, example_class, "example_method", mrb_example_method, MRB_ARGS_NONE());
* mrb_undef_class_method(mrb, example_class, "example_method");
* }
*
*
* void
* mrb_example_gem_final(mrb_state* mrb){
* }
@@ -476,7 +476,7 @@ MRB_API void mrb_undef_class_method(mrb_state*, struct RClass*, const char*);
* example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class); # => class ExampleClass; end
* obj = mrb_obj_new(mrb, example_class, 0, NULL); # => ExampleClass.new
* mrb_p(mrb, obj); // => Kernel#p
* }
* }
* @param [mrb_state*] mrb The current mruby state.
* @param [RClass*] c Reference to the class of the new object.
* @param [mrb_int] argc Number of arguments in argv
@@ -501,7 +501,7 @@ MRB_API mrb_value mrb_instance_new(mrb_state *mrb, mrb_value cv);
* void
* mrb_example_gem_init(mrb_state* mrb) {
* struct RClass *example_class;
*
*
* mrb_value obj;
* example_class = mrb_class_new(mrb, mrb->object_class);
* obj = mrb_obj_new(mrb, example_class, 0, NULL); // => #<#<Class:0x9a945b8>:0x9a94588>
@@ -521,7 +521,7 @@ MRB_API struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super);
* void
* mrb_example_gem_init(mrb_state* mrb) {
* struct RClass *example_module;
*
*
* example_module = mrb_module_new(mrb);
* }
*
@@ -541,7 +541,7 @@ MRB_API struct RClass * mrb_module_new(mrb_state *mrb);
*
* example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class);
* cd = mrb_class_defined(mrb, "ExampleClass");
*
*
* // If mrb_class_defined returns 1 then puts "True"
* // If mrb_class_defined returns 0 then puts "False"
* if (cd == 1){
@@ -597,7 +597,7 @@ MRB_API mrb_value mrb_notimplement_m(mrb_state*, mrb_value);
* Duplicate an object.
*
* Equivalent to:
* Object#dup
* Object#dup
* @param [mrb_state*] mrb The current mruby state.
* @param [mrb_value] obj Object to be duplicate.
* @return [mrb_value] The newly duplicated object.
@@ -629,7 +629,7 @@ MRB_API mrb_value mrb_check_to_integer(mrb_state *mrb, mrb_value val, const char
* mrb_define_method(mrb, example_class, "example_method", exampleMethod, MRB_ARGS_NONE());
* mid = mrb_intern_str(mrb, mrb_str_new_cstr(mrb, "example_method" ));
* obj_resp = mrb_obj_respond_to(mrb, example_class, mid); // => 1(true in Ruby world)
*
*
* // If mrb_obj_respond_to returns 1 then puts "True"
* // If mrb_obj_respond_to returns 0 then puts "False"
* if (obj_resp == 1) {
@@ -780,13 +780,13 @@ mrb_get_argc(mrb_state *mrb) /* get argc */
* #include <stdio.h>
* #include <mruby.h>
* #include "mruby/compile.h"
*
*
* int
* main()
* {
* mrb_int i = 99;
* mrb_state *mrb = mrb_open();
*
*
* if (!mrb) { }
* FILE *fp = fopen("test.rb","r");
* mrb_value obj = mrb_load_file(mrb,fp);
@@ -804,7 +804,7 @@ mrb_get_argc(mrb_state *mrb) /* get argc */
MRB_API mrb_value mrb_funcall(mrb_state*, mrb_value, const char*, mrb_int,...);
/**
* Call existing ruby functions. This is basically the type safe version of mrb_funcall.
*
*
* #include <stdio.h>
* #include <mruby.h>
* #include "mruby/compile.h"
@@ -813,10 +813,10 @@ MRB_API mrb_value mrb_funcall(mrb_state*, mrb_value, const char*, mrb_int,...);
* {
* mrb_int i = 99;
* mrb_state *mrb = mrb_open();
*
*
* if (!mrb) { }
* mrb_sym m_sym = mrb_intern_cstr(mrb, "method_name"); // Symbol for method.
*
*
* FILE *fp = fopen("test.rb","r");
* mrb_value obj = mrb_load_file(mrb,fp);
* mrb_funcall_argv(mrb, obj, m_sym, 1, &obj); // Calling ruby function from test.rb.
@@ -841,7 +841,7 @@ MRB_API mrb_value mrb_funcall_with_block(mrb_state*, mrb_value, mrb_sym, mrb_int
*
* # Ruby style:
* :pizza # => :pizza
*
*
* // C style:
* mrb_sym m_sym = mrb_intern_cstr(mrb, "pizza"); // => :pizza
* @param [mrb_state*] mrb_state* The current mruby state.
+8 -8
View File
@@ -91,12 +91,12 @@ MRB_API void mrb_str_modify(mrb_state*, struct RString*);
/*
* Appends self to other. Returns self as a concatnated string.
*
*
*
* Example:
*
* !!!c
* int
* main(int argc,
* main(int argc,
* char **argv)
* {
* // Variable declarations.
@@ -138,12 +138,12 @@ MRB_API void mrb_str_concat(mrb_state*, mrb_value, mrb_value);
/*
* Adds two strings together.
*
*
*
* Example:
*
* !!!c
* int
* main(int argc,
* main(int argc,
* char **argv)
* {
* // Variable declarations.
@@ -215,7 +215,7 @@ MRB_API mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj);
*
* !!!c
* int
* main(int argc,
* main(int argc,
* char **argv)
* {
* // Variable declaration.
@@ -224,11 +224,11 @@ MRB_API mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj);
* mrb_state *mrb = mrb_open();
* if (!mrb)
* {
* // handle error
* // handle error
* }
* // Creates a new string.
* str = mrb_str_new_cstr(mrb, "Hello, world!");
* // Returns 5 characters of
* // Returns 5 characters of
* mrb_str_resize(mrb, str, 5);
* mrb_p(mrb, str);
*
@@ -254,7 +254,7 @@ MRB_API mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len);
*
* !!!c
* int
* main(int argc,
* main(int argc,
* char const **argv)
* {
* // Variable declarations.
+1 -1
View File
@@ -14,7 +14,7 @@ class BinTest_MrubyBinDebugger
# compile
`./bin/mrbc -g -o "#{bin.path}" "#{script.path}"`
# add mrdb quit
testcase << {:cmd=>"quit"}
+1 -1
View File
@@ -13,7 +13,7 @@ class BinTest_MrubyBinDebugger
# compile
`./bin/mrbc -g -o "#{bin.path}" "#{script.path}"`
# add mrdb quit
testcase << {:cmd=>"quit"}
@@ -97,7 +97,7 @@ check_file_lineno( struct mrb_irep *irep, const char *file, uint16_t lineno )
result = MRB_DEBUG_BP_FILE_OK;
fix_lineno = check_lineno( info_file, lineno );
if(fix_lineno != 0) {
if(fix_lineno != 0) {
return result | MRB_DEBUG_BP_LINENO_OK;
}
}
@@ -200,7 +200,7 @@ mrb_debug_set_break_line( mrb_state *mrb, mrb_debug_context *dbg, const char *fi
return MRB_DEBUG_BREAK_INVALID_FILE;
}else if(result == MRB_DEBUG_BP_FILE_OK) {
return MRB_DEBUG_BREAK_INVALID_LINENO;
}
}
set_file = mrb_malloc(mrb, strlen(file) + 1);
@@ -272,7 +272,7 @@ mrb_debug_get_breaknum( mrb_state *mrb, mrb_debug_context *dbg )
return dbg->bpnum;
}
int32_t
int32_t
mrb_debug_get_break_all( mrb_state *mrb, mrb_debug_context *dbg, uint32_t size, mrb_debug_breakpoint *bp )
{
uint32_t get_size = 0;
@@ -315,7 +315,7 @@ mrb_debug_get_break( mrb_state *mrb, mrb_debug_context *dbg, uint32_t bpno, mrb_
return 0;
}
int32_t
int32_t
mrb_debug_delete_break( mrb_state *mrb, mrb_debug_context *dbg, uint32_t bpno )
{
uint32_t i;
@@ -346,7 +346,7 @@ mrb_debug_delete_break( mrb_state *mrb, mrb_debug_context *dbg, uint32_t bpno )
return MRB_DEBUG_OK;
}
int32_t
int32_t
mrb_debug_delete_break_all( mrb_state *mrb, mrb_debug_context *dbg )
{
uint32_t i;
@@ -364,7 +364,7 @@ mrb_debug_delete_break_all( mrb_state *mrb, mrb_debug_context *dbg )
return MRB_DEBUG_OK;
}
int32_t
int32_t
mrb_debug_enable_break( mrb_state *mrb, mrb_debug_context *dbg, uint32_t bpno )
{
int32_t index = 0;
@@ -399,7 +399,7 @@ mrb_debug_enable_break_all( mrb_state *mrb, mrb_debug_context *dbg )
return MRB_DEBUG_OK;
}
int32_t
int32_t
mrb_debug_disable_break( mrb_state *mrb, mrb_debug_context *dbg, uint32_t bpno )
{
int32_t index = 0;
@@ -418,7 +418,7 @@ mrb_debug_disable_break( mrb_state *mrb, mrb_debug_context *dbg, uint32_t bpno )
return MRB_DEBUG_OK;
}
int32_t
int32_t
mrb_debug_disable_break_all( mrb_state *mrb, mrb_debug_context *dbg )
{
uint32_t i;
@@ -483,7 +483,7 @@ mrb_debug_check_breakpoint_line( mrb_state *mrb, mrb_debug_context *dbg, const c
}
int32_t
int32_t
mrb_debug_check_breakpoint_method( mrb_state *mrb, mrb_debug_context *dbg, struct RClass *class_obj, mrb_sym method_sym, mrb_bool* isCfunc )
{
mrb_debug_breakpoint *bp;
@@ -22,7 +22,7 @@ dbgcmd_run(mrb_state *mrb, mrdb_state *mrdb)
mrb_raise(mrb, exc, "Restart mrdb.");
}
}
return DBGST_RESTART;
}
+6 -6
View File
@@ -691,7 +691,7 @@ main(int argc, char **argv)
}
mrdb->dbg->xm = DBG_INIT;
mrdb->dbg->ccnt = 1;
/* setup hook functions */
mrb->code_fetch_hook = mrb_code_fetch_hook;
mrdb->dbg->break_hook = mrb_debug_break_hook;
@@ -738,21 +738,21 @@ main(int argc, char **argv)
mrb_p(mrb, v);
}
}
mrdb->dbg->prvfile = "-";
mrdb->dbg->prvline = 0;
while (1) {
cmd = get_and_parse_command(mrb, mrdb);
mrb_assert(cmd);
if (cmd->id == DBGCMD_QUIT) {
break;
}
if( cmd->func(mrb, mrdb) == DBGST_RESTART ) goto l_restart;
}
cleanup(mrb, &args);
return 0;
+1 -1
View File
@@ -2972,7 +2972,7 @@ superclass : /* term */
expr_value term
{
$$ = $3;
} /*
} /*
| error term
{
yyerrok;
+1 -1
View File
@@ -5,7 +5,7 @@ assert 'mrb_protect' do
end
# failure in protect returns [exception, true]
result = ExceptionTest.mrb_protect { raise 'test' }
assert_kind_of RuntimeError, result[0]
assert_kind_of RuntimeError, result[0]
assert_true result[1]
end
+1 -1
View File
@@ -61,7 +61,7 @@ mrb_f_integer(mrb_state *mrb, mrb_value self)
* Float(arg) -> float
*
* Returns <i>arg</i> converted to a float. Numeric types are converted
* directly, the rest are converted using <i>arg</i>.to_f.
* directly, the rest are converted using <i>arg</i>.to_f.
*
* Float(1) #=> 1.0
* Float(123.456) #=> 123.456
+1 -1
View File
@@ -28,7 +28,7 @@
** Any feedback is very welcome.
** http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
** email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
**
**
** This version is modified by mruby developers. If you see any problem,
** contact us first at https://github.com/mruby/mruby/issues
*/
+1 -1
View File
@@ -207,7 +207,7 @@ class String
else
idx = arg1
idx += self.size if arg1 < 0
validated = true if idx >=0 && arg1 < self.size
validated = true if idx >=0 && arg1 < self.size
end
if validated
str = self[arg1]
+1 -1
View File
@@ -201,7 +201,7 @@ class Hash
}.join(", ")+"}"
end
##
# Return the contents of this hash as a string.
# Return the contents of this hash as a string.
#
# ISO 15.2.13.4.30 (x)
def inspect
+2 -2
View File
@@ -253,7 +253,7 @@ fmt_fp(struct fmt_args *f, long double y, int w, int p, int fl, int t)
if (z>d+1) z=d+1;
}
for (; z>a && !z[-1]; z--);
if ((t|32)=='g') {
if (!p) p++;
if (p>e && e>=-4) {
@@ -354,7 +354,7 @@ fmt_core(struct fmt_args *f, const char *fmt, mrb_float flo)
return fmt_fp(f, flo, 0, p, 0, *fmt);
default:
return -1;
}
}
}
mrb_value
+1 -1
View File
@@ -65,7 +65,7 @@
mruby implementer and C extension library writer must insert a write
barrier when updating a reference from a field of an object.
When updating a reference from a field of object A to object B,
When updating a reference from a field of object A to object B,
two different types of write barrier are available:
* mrb_field_write_barrier - target B object for a mark.
+1 -1
View File
@@ -523,7 +523,7 @@ read_binary_header(const uint8_t *bin, size_t *bin_size, uint16_t *crc, uint8_t
if (memcmp(header->binary_ident, RITE_BINARY_IDENT, sizeof(header->binary_ident)) == 0) {
if (bigendian_p())
*flags |= FLAG_BYTEORDER_NATIVE;
else
else
*flags |= FLAG_BYTEORDER_BIG;
}
else if (memcmp(header->binary_ident, RITE_BINARY_IDENT_LIL, sizeof(header->binary_ident)) == 0) {
+1 -1
View File
@@ -55,7 +55,7 @@ num_pow(mrb_state *mrb, mrb_value x)
mrb_get_args(mrb, "o", &y);
yv = mrb_to_flo(mrb, y);
d = pow(mrb_to_flo(mrb, x), yv);
if (mrb_fixnum_p(x) && mrb_fixnum_p(y) && FIXABLE(d) && yv > 0 &&
if (mrb_fixnum_p(x) && mrb_fixnum_p(y) && FIXABLE(d) && yv > 0 &&
(d < 0 || (d > 0 && (mrb_int)d > 0)))
return mrb_fixnum_value((mrb_int)d);
return mrb_float_value(mrb, d);
+1 -1
View File
@@ -18,7 +18,7 @@ module MRuby
alias mruby build
attr_accessor :build_config_initializer
attr_accessor :mrblib_dir, :objs_dir
attr_accessor :version
attr_accessor :description, :summary
attr_accessor :homepage