Yukihiro "Matz" Matsumoto
a075498613
mrb_get_args: allow A,H,s,z,a,d specifiers to take ! to accept nil.
...
S,A,H gives nil, s,z,a,d gives NULL for nil argument. ref 02474da
2015-07-14 13:22:42 +09:00
Yukihiro "Matz" Matsumoto
02474daa14
allow '!' after 'S' specifier of mrb_get_args() that allow nil.
...
thus "S!" means String|nil type. you have to check nil before
dereferencing the value. this is added to address #2882 while
keeping code simplicity. besides that current #2882 fix lose
polymorphism provided by mrb_get_args().
2015-07-13 11:14:50 +09:00
Yukihiro "Matz" Matsumoto
9c311ddc93
refactor mrb_bob_missing to share raising NoMethodError code; fix #2878
...
Note: arguments of mrb_no_method_error() has changed. You need to replace
3rd and 4th argument (say n, argv) to mrb_ary_new_from_values(mrb, n, argv).
2015-07-13 11:07:59 +09:00
Franck Verrot
2588507285
Remove unnecessary backticks.
...
Dr Markus Kuhn published in 1999 an article [1] explaining in details
why we shouldn't use the ASCII grave accent (0x60) as a left quotation.
Backticks have been used most notably to produce nice-looking LaTeX
documents but it doesn't seem to be an issue on modern platforms and
for the oldest ones, there are workarounds as mentioned by Dr Kuhn.
[1]: https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
2015-06-24 13:07:07 +02:00
Jared Breeden
9781580c71
Fixes #912
2015-06-22 23:19:58 -07:00
cremno
59ea323976
check if outer is a class or module
...
For modules this check didn't exist yet. Also call #inspect.
2015-05-29 14:58:53 +02:00
cremno
2ee84eb3df
remove unnecessary including of <ctype.h>
...
Not needed anymore since 85075bef75
2015-05-28 10:44:20 +02:00
cremno
2106d4d446
remove mrb_define_method_vm() function
...
It isn't needed as it's very similar to mrb_define_method_raw() and also
there's only one place where mrb_proc_ptr() actually has to be called.
Inspired by @furunkel's method cache patch (#2764 ).
2015-05-15 13:04:55 +02:00
sdottaka
fe01ce5b02
Fix crash if #inspect does not return a string value
...
case 1
~~~
class A; def inspect; 1; end; end
A.new.a
~~~
case 2
~~~
class A
def self.inspect
1
end
alias_method :a, :b
end
~~~
2014-12-12 23:05:22 +09:00
Yukihiro "Matz" Matsumoto
5c6d6309b6
separate mrb_notimplement() and mrb_notimplement_m(); ref #2636
2014-11-19 01:03:19 +09:00
Robert Mosolgo
8dc4d9d973
fix mrb_notimplement typo
2014-11-17 12:13:19 -08:00
ksss
9a06cfa9d8
Implement C API mrb_notimplement
2014-11-17 17:42:20 +09:00
take_cheeze
524c9152d3
Fix mrb_get_args arguments types found by mruby-clang-plugin.
2014-09-21 22:43:13 +09:00
Yukihiro "Matz" Matsumoto
5f7b0580b7
code reduce by using mrb_get_args("n")
2014-09-19 03:03:53 +09:00
Yukihiro "Matz" Matsumoto
147fbf1c12
Module#const_defined? to take second optional argument as CRuby; fix #2593
2014-09-19 03:02:07 +09:00
Yukihiro "Matz" Matsumoto
95c7f570e1
change class argument of mrb_const_defined_at from struct RClass* to mrb_value to make it consistent with mrb_const_defined; ref #2593
2014-09-19 02:51:52 +09:00
Yukihiro "Matz" Matsumoto
1fdf47d71a
Merge pull request #2582 from iij/pr-attr-accessor-save-arena
...
save and restore arena index to prevent arena overflow.
2014-09-03 11:02:52 +09:00
Tomoyuki Sahara
2fd49b2b9f
save and restore arena index to prevent arena overflow.
2014-09-03 10:44:38 +09:00
Tatsuhiko Kubo
b9acd20aef
Use mrb_str_cat_lit() instead of mrb_str_cat_cstr() for string-literals.
2014-09-03 01:43:46 +09:00
Yukihiro "Matz" Matsumoto
90ba47ccfe
implement attr_reader and attr_writer in C; use cfunc closure to speed-up
2014-09-02 16:41:38 +09:00
Tatsuhiko Kubo
5fa30aeaea
Fix mismatches for MRB_API declarations.
2014-08-29 01:06:22 +09:00
kkkkkt
d94469ac23
changed to call check_cv_name_str in check_cv_name_sym and adjust indent
2014-08-21 13:56:43 +09:00
Tatsuhiko Kubo
2b283393c6
Remove empty lines.
2014-08-20 12:07:36 +09:00
Tatsuhiko Kubo
ae306793f2
Use specified macro(NULL) instead of magic-number.
2014-08-20 04:34:03 +09:00
go kikuta
14c36f9f21
use mrb_false_value instead of mrb_bool_value
2014-08-16 02:08:51 +09:00
go kikuta
1c3d05b5b6
refactor class.c methods (fix indent, remove unneed temp value. )
2014-08-16 02:06:05 +09:00
Yukihiro "Matz" Matsumoto
206f89e209
add MRB_API modifiers to mruby API functions
2014-08-04 00:47:08 +09:00
dreamedge
0b8a0f4bb4
add Module#module_function
2014-07-18 09:50:54 +09:00
Yukihiro "Matz" Matsumoto
1dc6a8c872
avoid infinite recursion when error was happened in #inspect; fix #2474
2014-07-17 01:42:03 +09:00
David Turnbull
249f05e7d7
Clean up value.h and mrb_value boxing
2014-07-09 06:32:11 +09:00
ksss
1cced27a79
Proc class define before a first method
...
mrb_define_method setting mrb->proc_class for method proc
2014-06-15 22:34:46 +09:00
take_cheeze
acec9d1ff1
Implement NoMethodError#args.
2014-06-02 22:38:02 +09:00
ksss
7fe34d8f49
Should not call inherited method
...
when class nothing
2014-05-23 23:56:01 +09:00
Yukihiro "Matz" Matsumoto
9be81e7429
call Class#initialize from Class.new; ref ISO 15.2.3.3.1
2014-05-22 14:44:59 +09:00
Yukihiro "Matz" Matsumoto
00f2144692
allocate object after mrb_get_args()
2014-05-22 14:18:03 +09:00
Yukihiro "Matz" Matsumoto
fc557085d8
Merge pull request #2304 from ksss/class-new
...
Class.new do not call `class_eval'
2014-05-22 14:12:03 +09:00
ksss
c28b46bcf6
Class.new do not call `class_eval'
...
and set self for block argument
2014-05-22 00:00:46 +09:00
ksss
0bd8e48773
Module#initialize set created object
...
for block argument
2014-05-21 23:09:19 +09:00
Yukihiro "Matz" Matsumoto
74da72409e
direct invocation of module_eval; ref #2298
2014-05-21 14:49:06 +09:00
ksss
c4a225f0be
mrb_include_module support class and module
...
that not have methods each other
2014-05-19 19:29:33 +09:00
ksss
ffbf90bdc8
Implement Module#initialize (15.2.2.4.31)
2014-05-19 19:28:42 +09:00
ksss
ef4f29be70
support class define in singleton class
2014-05-18 12:55:35 +00:00
yui-knk
45305686fe
Add a space aftre bracket.
2014-05-18 19:40:17 +09:00
Jun Hiroe
bcd8980c78
Use boolean macro
2014-05-17 02:08:01 +09:00
ksss
066c2772e8
const_missing error message more detail
2014-05-16 22:26:47 +09:00
Yukihiro "Matz" Matsumoto
a5161e76ed
Class.constants to take optional argument; close #2133
2014-04-26 23:47:55 +09:00
Yukihiro "Matz" Matsumoto
83c1399af0
eliminate plain int except for a few cases like arena_index
2014-04-25 04:01:57 +09:00
cremno
8271b4ba27
various functions should have internal linkage
2014-04-16 21:26:12 +02:00
Yukihiro "Matz" Matsumoto
5138f62d6b
resolve conflict
2014-04-15 10:55:46 +09:00
Takeshi Watanabe
824d3450c5
Qualify argv argument of API const.
2014-04-11 20:38:23 +09:00