Commit Graph

16566 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 351cd5aa46 mruby-string-ext: remove some methods moved to mruby-encoding
- String#valid_encoding?
- String#force_encoding
2025-01-16 09:12:09 +09:00
Yukihiro "Matz" Matsumoto 3b1c5d7397 mruby-string-ext: remove duplicated definition of String#b
When we use `mruby-encoding` gem as well.
2025-01-16 09:08:14 +09:00
Yukihiro "Matz" Matsumoto 0c01bf7ff0 mruby-string-ext: String#codepoints to support binary encoding 2025-01-16 09:06:19 +09:00
Yukihiro "Matz" Matsumoto 8395ffb5f8 mruby-string-ext: String#ord to support binary encoding 2025-01-16 09:00:44 +09:00
Yukihiro "Matz" Matsumoto 74bdae9e4c mruby-encoding: add Poorman's Encoding gem
The difference from CRuby's Encoding:

- Encoding is a module, instead of a class
- each Encoding (e.g. `Encoding::UTF_8) is a string instead of Encoding object
- only supports  `UTF-8` and `ASCII-8BIT` (and its alias `BINARY`)

Using this gem automatically turn on `MRB_UTF8_STRING` support.
2025-01-16 08:52:41 +09:00
Yukihiro "Matz" Matsumoto e45ea53773 print.c: update the header comment 2025-01-15 14:27:22 +09:00
Yukihiro "Matz" Matsumoto f9c1894087 print.c (printstrln): a new function to print string and newline 2025-01-15 09:19:34 +09:00
Yukihiro "Matz" Matsumoto 25bf1faa81 print.c: fixed link error from mrb_print_m with MRB_NO_STDIO; #6466 2025-01-15 09:12:36 +09:00
Yukihiro "Matz" Matsumoto 6c3143aa12 mrbgem/full-core.gembox: stop excluding mruby-print gem; #6466
Since the gem no longer exists.
2025-01-14 13:30:33 +09:00
Yukihiro "Matz" Matsumoto 89d83c27f3 mruby-print: remove the gem; ref #6466 2025-01-14 13:30:32 +09:00
Yukihiro "Matz" Matsumoto b9b505b5f2 kernel.c: define Kernel#print unless mruby-io is loaded; fix #6466
- In addition, merge mruby-print body in to print.c
2025-01-14 13:30:32 +09:00
Yukihiro "Matz" Matsumoto b623f5c149 mruby-io: define HAVE_MRUBY_IO_GEM if present; ref #6466 2025-01-14 13:24:16 +09:00
Yukihiro "Matz" Matsumoto 272f61a051 AUTHORS: update entries [ci skip] 2025-01-13 12:18:59 +09:00
Yukihiro "Matz" Matsumoto e47b4ca704 mruby-string-ext: new method String#force_encoding
It takes a string instead of Encoding object for simplicity
2025-01-12 23:13:28 +09:00
Yukihiro "Matz" Matsumoto 187f27b00b string.c (char_adjust): align arguments with char_backtrack
Also remove the unused argument.
2025-01-12 23:13:28 +09:00
Yukihiro "Matz" Matsumoto a67c8f9335 string.c: use byte index for a string with binary encoding 2025-01-12 23:13:28 +09:00
Yukihiro "Matz" Matsumoto d5fa9504ad mruby-string-ext (str_b): String#b should copy the receiver 2025-01-12 23:13:28 +09:00
Yukihiro "Matz" Matsumoto 6c530b8f48 mruby-string-ext (str_append_as_bytes): reimplement in C
To handle strings as byte sequences.
2025-01-12 23:13:27 +09:00
Yukihiro "Matz" Matsumoto c18cd60c4b string.h: remove unused flag unset macros 2025-01-12 23:13:27 +09:00
Yukihiro "Matz" Matsumoto 0098654e1f string.h: rename MRB_STR_EMBED_LEN_BITS (use plurality for bit width) 2025-01-12 23:13:26 +09:00
Yukihiro "Matz" Matsumoto 8c184d4566 string.h: move flag definitions for readability 2025-01-12 23:13:26 +09:00
Yukihiro "Matz" Matsumoto e75654a991 string.h (RSTR_SET_TYPE): simplify macro definition 2025-01-12 23:13:26 +09:00
Yukihiro "Matz" Matsumoto 0a5acc0303 string.c (str_unshare_buffer): renamed function for more intuitive name
The old name `str_modify_keep_ascii` does not describe the function
behavior. It was named so since it was separated from the function
`mrb_str_modify_keep_ascii`.
2025-01-12 23:13:25 +09:00
Yukihiro "Matz" Matsumoto 797c49bc0b Merge pull request #6465 from diamant3/add-psp-build 2025-01-12 23:10:06 +09:00
Diamond Rivero 7fa467eb40 Add initial playstation portable crossbuild 2025-01-11 08:28:06 +08:00
Yukihiro "Matz" Matsumoto 8276143f03 object.h: remove MRB_SET_FROZEN_FLAG/MRB_UNSET_FROZEN_FLAG macros
Simple `o->frozen = 1/0` now works.
2025-01-07 13:56:30 +09:00
Yukihiro "Matz" Matsumoto c11d18e426 object.h: unify MRB_FROZEN_P() and mrb_frozen_p() 2025-01-07 11:24:58 +09:00
Yukihiro "Matz" Matsumoto 21003746df object.h: separate frozen flag to the independent bit-field
So that other flag operation do not break frozen flag.
2025-01-07 07:44:10 +09:00
Yukihiro "Matz" Matsumoto a234c66c97 class.c: removed a mistakenly copied function 2025-01-06 22:15:58 +09:00
Yukihiro "Matz" Matsumoto 003e0fb330 mruby-print: disable the gem unless explicitly specified
mruby-print is the duplicate of part of mruby-io. You need it only when
limited I/O functionality required.
2025-01-06 13:57:23 +09:00
Yukihiro "Matz" Matsumoto ef88c3b726 kernel.c: move Kernel#p to kernel.c from mruby-print
It's easier to skip `p` in the debugger if it's implemented in C.
2025-01-06 13:57:23 +09:00
Yukihiro "Matz" Matsumoto 6f8bfed18e object.h: change gccolor type to unsigned int
I was uncomfortable with the combination of an integer with a size
specification (uint32_t) and a bit field.
2025-01-06 13:56:58 +09:00
Yukihiro "Matz" Matsumoto 0e79f6b34b include/object.h: rename color to gccolor
To clarify the color is for garbage collection.
2025-01-03 19:12:40 +09:00
Yukihiro "Matz" Matsumoto 4582cc8579 string.c: rename type setting macro 2025-01-03 09:29:43 +09:00
Yukihiro "Matz" Matsumoto 04ab2be2f0 mruby-string-ext (str_ascii_only_p): simplify the flag update 2025-01-03 08:47:38 +09:00
Yukihiro "Matz" Matsumoto 5a7c944a52 mruby-string-ext (str_b): simplify the flag update 2025-01-03 08:46:04 +09:00
Yukihiro "Matz" Matsumoto 8c2c57c59b Merge pull request #6461 from dearblue/auto-release 2025-01-02 21:58:26 +09:00
Yukihiro "Matz" Matsumoto e35c027966 Merge pull request #6463 from dearblue/dirname 2025-01-02 21:58:01 +09:00
Yukihiro "Matz" Matsumoto 1c50d1885d Merge pull request #6462 from dearblue/mruby-io 2025-01-02 21:55:17 +09:00
Yukihiro "Matz" Matsumoto b0127f0cdd mruby-string-ext (str_b): add a new method String#b
The method makes the receiver binary-mode, but in mruby, which is
virtually no meaning.
2025-01-02 18:45:50 +09:00
dearblue 5c91014530 Add level argument to File.dirname
from Ruby-3.1
https://bugs.ruby-lang.org/issues/12194
2025-01-02 18:10:14 +09:00
dearblue ef11cd94e7 Reimplement the File.dirname method
The purpose is as follows:

  - Stop using `mrb_locale_from_utf8()`.
      - Because there is no corresponding `mrb_utf8_from_locale()`.
      - Because on Windows, for example, if the code page is 932 (CP932, likely ShiftJIS), it cannot be distinguished from the second byte 0x5c (\), and returns wrong results.
  - Stop using `dirname(3)`.
      - Because leading consecutive slashes are not truncated.
        For example, if `/////a/b` is given, CRuby returns `/a`, but mruby so far returns `/////a`.
      - Because the `path` argument cannot be passed in an immutable form.
  - Stop using `_splitpath()` in the Windows implementation.
      - Because there is no support for UNC paths with up to 32767 characters.
        ref. https://learn.microsoft.com/ja-jp/dotnet/standard/io/file-path-formats#unc-paths
      - Because modifying the result of paths terminated by a directory separator.
        Previously, for example, `C:/` would return `C:.` instead of `C:/`, and `a/b/` would return `a/b` instead of `a`.
2025-01-02 17:42:40 +09:00
dearblue 3b659f5320 Properly cast the return value of memchr() 2025-01-02 15:34:36 +09:00
dearblue af1e33c442 To create a release package file in draft
This is to allow final confirmation of the created release file.
Release files in draft form cannot be downloaded by the general public.
2025-01-01 20:24:56 +09:00
Yukihiro "Matz" Matsumoto 85df487e63 mruby-string-ext (append_as_bytes): new method introduced by CRuby 3.4
Since mruby does not have Encoding support, append_as_bytes works
exactly same as String#concat.
2025-01-01 16:05:00 +09:00
Yukihiro "Matz" Matsumoto 9f59d26c35 class.c: adjust space around the operator 2024-12-30 22:45:13 +09:00
Yukihiro "Matz" Matsumoto 59d1fcfa02 include/proc/h: add 2 new constants for the future 2024-12-29 18:04:40 +09:00
Yukihiro "Matz" Matsumoto d7559253de mruby-compiler: need to add proper type cast for C++ 2024-12-28 11:39:22 +09:00
Yukihiro "Matz" Matsumoto 86a40189b4 class.c: remove _P suffix from non predicate 2024-12-28 11:18:46 +09:00
Yukihiro "Matz" Matsumoto 0b5ebf1b79 class.c: avoid using separate values in files 2024-12-27 18:49:35 +09:00