24 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto b4f6450509 mruby-compiler: do not flip + and - opcode for negative literal
The peephole in gen_addsub() rewrote `q + -n` into OP_SUBI n (and
`q - -n` into OP_ADDI n) by negating n. For numeric receivers this is
equivalent, but for receivers overriding + or - the runtime fallback
dispatches the flipped method, losing the original operator. Restrict
the fold to non-negative immediates; negative falls through to the
normal OP_ADD/OP_SUB path with LOADI of the literal value.

close #2557
ref #2579

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-09 19:47:27 +09:00
Yukihiro "Matz" Matsumoto 6037e50298 test/hash: update tests to new hash format 2024-12-21 08:53:57 +09:00
Yukihiro "Matz" Matsumoto 5387b74be7 hash.c (mrb_hash_to_s): put spaces around =>
CRuby 3.4 puts spaces around `=>` since for example `{:a!=>2}` can be
confusing where to separate tokens.  mruby should follow the behavior.

Many tests in `test/t` directory assumed no spaces around `=>`, so we
needed to fix them too.
2024-11-11 11:07:43 +09:00
John Bampton 9d32d440eb feat(CI): add the GitHub Super Linter
The GitHub Super Linter is a more robust and better supported
tool than the current GitHub Actions we are using.

Running these checks:

ERROR_ON_MISSING_EXEC_BIT: true
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_EDITORCONFIG: true
VALIDATE_MARKDOWN: true
VALIDATE_SHELL_SHFMT: true
VALIDATE_YAML: true

https://github.com/marketplace/actions/super-linter
https://github.com/github/super-linter

Added the GitHub Super Linter badge to the README.

Also updated the pre-commit framework and added
more documentation on pre-commit.

Added one more pre-commit check: check-executables-have-shebangs

Added one extra check for merge conflicts to our
GitHub Actions.

EditorConfig and Markdown linting.

Minor grammar and spelling fixes.

Update linter.yml
2021-04-16 16:37:52 +09:00
Seeker 8286e6052a Fix for escaped newlines in squiggly heredocs 2021-01-03 00:48:10 -08:00
Seeker 4683a196d9 Fix regression for squiggly heredocs 2020-12-31 19:08:44 -08:00
Seeker 49b01f23a4 Fix mixed indentation and escaped tabs in squiggly heredocs 2020-12-28 18:22:13 -08:00
Seeker 3a2ff9824e Fix for empty lines in squiggly heredocs 2020-12-27 23:10:08 -08:00
Seeker 54bfcaf1ff Add support for squiggly heredocs 2020-12-26 23:48:20 -08:00
Kazuhiro Sera b03f1f78e3 Fix misspelling words in comments 2018-08-11 00:28:32 +09:00
Yutaka HARA aaa86a1fd5 Fix typo in test 2016-11-22 16:25:18 +09:00
FUKUZAWA-Tadashi 8d34e00102 fix bugs on Heredocument
- heredoc in array literal
- heredoc in args
- heredoc in expression expand
2013-09-22 18:14:40 +09:00
Jun Hiroe b7651d212b I fix order of actual and expect test value in literals.rb. 2013-08-02 21:48:18 +09:00
Daniel Bovensiepen 409541d1fa Improve Literal Tests 2013-06-15 00:33:11 +08:00
FUKUZAWA-Tadashi cdf8114e27 %I %i literal 2013-03-19 00:41:15 +09:00
FUKUZAWA-Tadashi 76c24894a7 bugfix about escaping '\n' 2013-03-17 21:27:38 +09:00
FUKUZAWA-Tadashi aec3e1c4ff refactor heredoc identifier 2013-03-17 21:27:38 +09:00
FUKUZAWA-Tadashi 44fbfc5184 implement literal %W %w %s
refactor string parsing
2013-03-17 21:27:37 +09:00
FUKUZAWA-Tadashi 1af4110f7d implement heredoc 2013-03-03 20:08:13 +09:00
Masamitsu MURASE f04d9b1c50 Add a test for quoted non-expanded string literal. 2013-01-20 05:00:06 +09:00
Daniel Bovensiepen 82d600da24 Add literal tests for currently working String literals and make notice about literals which yet need to be proper implementation 2012-05-29 23:51:51 +08:00
Daniel Bovensiepen b92f302d59 SEGV by adding a new assert 2012-05-29 13:52:59 +08:00
Daniel Bovensiepen 61a47e344d Raise SEGV by using String literal 2012-05-29 07:23:17 +08:00
Daniel Bovensiepen b19575e5ac Forgot Literals file 2012-05-29 01:33:17 +08:00