62 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 798ec3aff4 UTF-8 string support in core
define MRB_UTF8_STRING (in mrbconf.h) to enable UTF-8 support.
2015-09-24 02:37:33 +09:00
INOUE Yasuyuki 0d055559f1 Use #nil? instead of == nil. 2015-08-22 19:57:11 +09:00
Yukihiro "Matz" Matsumoto 4fdf492219 add String#setbyte and String#byteslice to mruby-string-ext 2015-08-05 11:28:41 +09:00
Jun Hiroe 4e4929bc72 Rename extended xxxx class or module to xxxx class or module extension 2015-06-28 11:18:52 +09:00
Jun Hiroe c69d1201e1 Fix typo; Replace extensional with extended 2015-06-28 00:05:58 +09:00
cremno 2ee84eb3df remove unnecessary including of <ctype.h>
Not needed anymore since 85075bef75
2015-05-28 10:44:20 +02:00
Kouhei Sutou 09419874c8 Suppress warnings generated by -Wwrite-strings
Here are suppressed warnings:

    src/fmt_fp.c: In function 'fmt_fp':
    src/fmt_fp.c:124:16: warning: initialization discards 'const' qualifier from pointer target type
         char *ss = (t&32)?"inf":"INF";
                    ^
    src/fmt_fp.c:125:17: warning: assignment discards 'const' qualifier from pointer target type
         if (y!=y) ss=(t&32)?"nan":"NAN";
                     ^
    mrbgems/mruby-string-ext/src/string.c: In function 'mrb_str_succ_bang':
    mrbgems/mruby-string-ext/src/string.c:302:27: warning: assignment discards 'const' qualifier from pointer target type
           if (e == b) prepend = "1";
                               ^
    mrbgems/mruby-string-ext/src/string.c:305:27: warning: assignment discards 'const' qualifier from pointer target type
           if (e == b) prepend = "a";
                               ^
    mrbgems/mruby-string-ext/src/string.c:308:27: warning: assignment discards 'const' qualifier from pointer target type
           if (e == b) prepend = "A";
                               ^
    mrbgems/mruby-bin-mruby/tools/mruby/mruby.c: In function 'main':
    mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:213:13: warning: assignment discards 'const' qualifier from pointer target type
         cmdline = args.cmdline ? args.cmdline : "-";
                 ^
    mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c: In function 'print_breakpoint':
    mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:159:3: warning: initialization discards 'const' qualifier from pointer target type
       char* enable_letter[] = {BREAK_INFO_MSG_DISABLE, BREAK_INFO_MSG_ENABLE};
       ^
    mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:159:3: warning: initialization discards 'const' qualifier from pointer target type
2015-04-18 21:43:58 +09:00
Jun Hiroe e998094297 Add String#upto 2015-01-13 16:32:30 +09:00
takahashim 1b606025ed add String#ljust into mruby-string-ext 2015-01-12 22:16:29 +09:00
Yukihiro "Matz" Matsumoto a19a6edb7c mrb_str_new(mrb, "", len) creates an unmodifiable string object; ref #2674 2014-12-17 08:06:44 +09:00
Jun Hiroe 7ea38ce473 Add String#prepend 2014-12-17 02:23:36 +09:00
Jun Hiroe 45a442a9d7 Add String#insert 2014-12-13 15:31:22 +09:00
TOMITA Masahiro 0a0afa7c6a Fix String#slice! raise TypeError or return invalid value. 2014-11-23 21:26:50 +09:00
Tatsuhiko Kubo 45103ebc20 use mrb_str_cat_lit() instead of mrb_str_cat_cstr(). 2014-08-21 16:51:08 +09:00
mattn 4ece1e3e29 "-a-a-".succ should be "-a-b-" 2014-08-11 15:00:44 +09:00
mattn 3103d063e2 Fix String#succ. "-a-".succ should be "-b-" 2014-08-11 14:28:05 +09:00
mattn 34f40b0a01 Fix String#succ. "-".succ should be "." 2014-08-11 14:01:10 +09:00
Yukihiro "Matz" Matsumoto 7a5d3c19c6 remove test for succ on Unicode (non-ASCII) char; #2520 2014-08-08 23:16:12 +09:00
mattn dc0c354658 Add String#succ, String#succ!, String#next, String#next! 2014-08-08 17:58:07 +09:00
Akito Mochizuki ec04fa7e8d Modify return value of String#slice! if idx == self.size 2014-06-19 17:34:17 +09:00
Jun Hiroe 00fa8097f9 Implement String#slice_bang 2014-06-15 21:11:54 +09:00
ksss f1e15b0236 String#clear: use String#replace to simple 2014-06-11 14:46:52 +00:00
Jun Hiroe 9c259c501a Add NOFREE macros 2014-06-11 01:00:35 +09:00
Yukihiro "Matz" Matsumoto 6459a98448 move String#clear to mruby-string-ext; ref #2370 2014-06-07 22:28:42 +09:00
Yukihiro "Matz" Matsumoto 76012a885d remove UTF-8 strings from mruby-string-ext test 2014-06-07 22:23:25 +09:00
Yukihiro "Matz" Matsumoto b01bb33b75 fix String#lines comment; ref mattn@2e1855a 2014-06-04 10:51:09 +09:00
mattn c927277486 Add String#lines 2014-06-04 10:41:07 +09:00
Jun Hiroe e67817fcec Implement String#chr 2014-06-03 19:49:38 +09:00
Yukihiro "Matz" Matsumoto 896c131231 Merge pull request #2346 from suzukaze/add-string-comment2
Fix indent in String#casecmp comments
2014-06-03 15:44:13 +09:00
Jun Hiroe 85ed19ca4d Fix indent in String#casecmp comments 2014-06-02 22:03:29 +09:00
Jun Hiroe cbe73e93f7 Add comments in String#lstrip, rstrip, strip, lstring_bang, rstrip_bang and strip_bang 2014-06-02 22:00:05 +09:00
Nobuyoshi Nakada ab67c57f65 remove trailing spaces 2014-04-30 09:50:14 +09:00
take_cheeze b5028421b9 Use mrb_int in mrbgem rest argument getting. 2014-04-25 22:02:10 +09:00
ksss 617fa70211 String#casecmp should be call to_str
when non String object sent
And should be raise TypeError
when can not responsed to `to_str`
2014-04-20 13:25:07 +09:00
cremno 649081661a reduce RSTRING_PTR usage 2014-04-14 00:58:34 +02:00
mattn ea68fe2f15 More tests for String#hex, String#oct as against 9434506035 2014-03-31 09:47:21 +09:00
cubicdaiya 9c06f297ee add String#oct 2014-03-27 14:10:08 +09:00
mattn 0df65751c6 Implement String#hex 2014-03-27 11:28:29 +09:00
take_cheeze c73f8d4def move summary of mrbgems in default gembox to its spec 2014-03-17 00:34:24 +09:00
ksss 54132e4364 make embed string when create literals 2014-03-06 13:47:51 +00:00
ksss 4070b5987a embed small string
use flags 4 for *this object is embed*
use flags 8~64 for *embed string length*
2014-03-06 13:12:08 +00:00
cremno aa655b9ee1 remove superfluous includes
- reduce compile time by a little bit (full-core: ~0.7s for me)
- thanks to 'include-what-you-use' for some help
- include Standard C header files before any other (coding style)
2014-01-07 17:56:30 +01:00
Yukihiro "Matz" Matsumoto dc25f85bab mruby-string-utf8: UTF-8 string may contail NUL; #1646 2014-01-07 15:00:55 +09:00
Tomoyuki Sahara 120a02c15d add String#partition and String#rpartition. 2013-12-27 15:30:20 +09:00
Tomoyuki Sahara f77dc2e6cb Merge branch 'mruby' into pr-typeerror-string-start-end-with
Conflicts:
	mrbgems/mruby-string-ext/src/string.c
	mrbgems/mruby-string-ext/test/string.rb
2013-08-26 23:20:22 +09:00
Yukihiro "Matz" Matsumoto 91b878e5df Merge pull request #1485 from fjmilens3/string_end_with
Bug in String#end_with? resulting from incorrect length determination
2013-08-26 04:17:20 -07:00
Tomoyuki Sahara 0e8efd4a21 Check type of arguments for #start_with and #end_with. 2013-08-23 15:06:26 +09:00
Frederick John Milens III 2548569f60 Refactor of String#start_with? comparison logic. 2013-08-22 19:29:36 -05:00
Frederick John Milens III d682be9d32 Refactor of String#end_with? comparison logic. 2013-08-22 19:23:53 -05:00
Frederick John Milens III a0183b394a Fix for string-length-related issue in String#end_with? logic. 2013-08-22 18:55:07 -05:00