Граф коммитов

2103 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 19a98a8791
Fixed not to make non-literal expression shareable [Feature #17273]
Non-literal expression which is not a part of a literal expression
is not a subject of `shareable_literal_value: literal`.
2020-12-19 00:34:14 +09:00
Nobuyoshi Nakada 8e03e3b0ba
Drop token info also for endless singleton method definition 2020-12-18 15:16:30 +09:00
Nobuyoshi Nakada 9c859f4b3c
Ripper: Pass callback result to alias_error as well as other errors
[Bug #17345]
2020-12-16 22:53:43 +09:00
Nobuyoshi Nakada 47328ad217
Ripper: Fixed erred token on wrong alias [Bug #17345] 2020-12-16 21:08:33 +09:00
Nobuyoshi Nakada e0bdd54348 Ripper: Refined error callbacks [Bug #17345] 2020-12-15 21:36:23 +09:00
Nobuyoshi Nakada 3323174727 Support shareable_constant_value: literal 2020-12-14 19:19:16 +09:00
Nobuyoshi Nakada 89e489d51d Make shareable_constant_value tri-state 2020-12-14 19:19:16 +09:00
Nobuyoshi Nakada 7060aeedbd shareable_constant_value: is effective only in comment-only line 2020-12-14 19:19:16 +09:00
Nobuyoshi Nakada 070a990bcb Save and pass lex_context wholely 2020-12-14 19:19:16 +09:00
Nobuyoshi Nakada dc1cc33d69 Determine shareable-ness after assignment operator 2020-12-14 19:19:16 +09:00
Nobuyoshi Nakada 60f0c376f7 Implemented shareable_constant_value op_asgn 2020-12-14 19:19:16 +09:00
Nobuyoshi Nakada 65450e8f7d Call FrozenCore.make_shareable 2020-12-14 19:19:16 +09:00
Nobuyoshi Nakada f43c71abe0 Implemented shareable_constant_value
It does shallow freeze only for now.
2020-12-14 19:19:16 +09:00
Nobuyoshi Nakada b1bd223085 Support shareable_constant_value pragma 2020-12-14 19:19:16 +09:00
Kazuki Tsujimoto 88f3ce12d3
Reintroduce `expr in pat` [Feature #17371] 2020-12-13 11:51:49 +09:00
Kazuki Tsujimoto a8cf526ae9
Don't emit warning when the pattern of one-line pattern matching is just a variable pattern
https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20201210Japan.md#feature-17371-reintroduce-expr-in-pat-ktsj
2020-12-13 11:51:49 +09:00
Koichi Sasada 5e3259ea74 fix public interface
To make some kind of Ractor related extensions, some functions
should be exposed.

* include/ruby/thread_native.h
  * rb_native_mutex_*
  * rb_native_cond_*
* include/ruby/ractor.h
  * RB_OBJ_SHAREABLE_P(obj)
  * rb_ractor_shareable_p(obj)
  * rb_ractor_std*()
  * rb_cRactor

and rm ractor_pub.h
and rename srcdir/ractor.h to srcdir/ractor_core.h
    (to avoid conflict with include/ruby/ractor.h)
2020-11-18 03:52:41 +09:00
Jeremy Evans f5bb9115a7 Use more specific warning for ambiguous slash
Fixes [Bug #17124]
2020-11-15 15:25:32 -08:00
Nobuyoshi Nakada 79b242260b
ripper: Invalid pragma value warning 2020-11-02 22:49:42 +09:00
Nobuyoshi Nakada 539b89075a
Compare boolean values for parser pragma locale-insensitively 2020-11-02 18:24:45 +09:00
Kazuki Tsujimoto e03e1982bd
Change NODE layout for pattern matching
I prefer pconst to be the first element of NODE.

  Before:

       | ARYPTN | FNDPTN | HSHPTN
    ---+--------+--------+-----------
    u1 | imemo  | imemo  | pkwargs
    u2 | pconst | pconst | pconst
    u3 | apinfo | fpinfo | pkwrestarg

  After:

       | ARYPTN | FNDPTN | HSHPTN
    ---+--------+--------+-----------
    u1 | pconst | pconst | pconst
    u2 | imemo  | imemo  | pkwargs
    u3 | apinfo | fpinfo | pkwrestarg
2020-11-01 16:19:07 +09:00
Kazuki Tsujimoto b601532411
Pattern matching is no longer experimental 2020-11-01 13:33:58 +09:00
Nobuyoshi Nakada bdd1d17ac2
Allow non-argument endless-def with a space instead of parentheses 2020-10-26 21:15:16 +09:00
Nobuyoshi Nakada 52c630da00
Assoc pattern matching (#3703)
[Feature #17260] One-line pattern matching using tASSOC

R-assignment is rejected instead.
2020-10-26 18:00:24 +09:00
Nobuyoshi Nakada 4ed0c33d13
Prohibit setter method names in all kinds of endless methods
Also unwrap NODE_RIPPER to check the method name.
2020-10-12 00:40:55 +09:00
Nobuyoshi Nakada 8d1b188864
Refactored lex_context management
Save and restore `lex_context` as-is wholely, and save in
`k_class` and `k_module` to workaround look-ahead reading.
2020-10-09 13:44:48 +09:00
Nobuyoshi Nakada 7b2bea42a2
Unfreeze string-literal-only interpolated string-literal
[Feature #17104]
2020-09-30 22:15:28 +09:00
Koichi Sasada 79df14c04b Introduce Ractor mechanism for parallel execution
This commit introduces Ractor mechanism to run Ruby program in
parallel. See doc/ractor.md for more details about Ractor.
See ticket [Feature #17100] to see the implementation details
and discussions.

[Feature #17100]

This commit does not complete the implementation. You can find
many bugs on using Ractor. Also the specification will be changed
so that this feature is experimental. You will see a warning when
you make the first Ractor with `Ractor.new`.

I hope this feature can help programmers from thread-safety issues.
2020-09-03 21:11:06 +09:00
Nobuyoshi Nakada 93b78abd77
new_dstr: hoisted out from literal_concat and evstr2dstr 2020-09-02 13:30:16 +09:00
Yusuke Endoh 53ba9fb74e Prohibit setter method names in endless method definition
https://bugs.ruby-lang.org/issues/16746#note-26
2020-08-31 20:30:27 +09:00
Nobuyoshi Nakada 445e5548c9
Fixed error messages at non-ascii %string terminator 2020-08-26 21:36:22 +09:00
Nobuyoshi Nakada cc36b5d4ac
Removed a never-true condition 2020-08-26 21:16:51 +09:00
Kazuki Tsujimoto fcdbdff631
rb_{ary,fnd}_pattern_info: Remove imemo member to reduce memory usage
This is a partial revert commit of 8f096226e1.

NODE layout:

  Before:

       | ARYPTN | FNDPTN | HSHPTN
    ---+--------+--------+-----------
    u1 | pconst | pconst | pconst
    u2 | unused | unused | pkwargs
    u3 | apinfo | fpinfo | pkwrestarg

  After:

       | ARYPTN | FNDPTN | HSHPTN
    ---+--------+--------+-----------
    u1 | imemo  | imemo  | pkwargs
    u2 | pconst | pconst | pconst
    u3 | apinfo | fpinfo | pkwrestarg
2020-08-02 01:04:06 +09:00
Aaron Patterson 35ba2783fe Use a linked list to eliminate imemo tmp bufs for managing local tables
This patch changes local table memory to be managed by a linked list
rather than via the garbage collector.  It reduces allocations from the
GC and also fixes a use-after-free bug in the concurrent-with-sweep
compactor I'm working on.
2020-07-27 12:40:01 -07:00
Jeremy Evans d47e124857 Switch reserved for numbered parameter warning to SyntaxError 2020-07-22 08:34:51 -07:00
Nobuyoshi Nakada 3d8705dcfd
Drop token info for endless method definition
Because it does not have closing `end`.
2020-06-25 01:14:26 +09:00
Nobuyoshi Nakada fe82f72951
AST.of needs SCRIPT_LINES__ filled with a newline 2020-06-25 00:14:31 +09:00
Nobuyoshi Nakada 263b941321
[ripper] fix mismatched indentations warning [Bug #16981]
The scanner location has to be set from `lex.ptok` before it is
flushed by dispatching the scanner event.
2020-06-24 19:53:14 +09:00
Kazuki Tsujimoto 97614c5521
apinfo/fpinfo should always be non-NULL 2020-06-14 13:16:16 +09:00
Kazuki Tsujimoto ddded1157a
Introduce find pattern [Feature #16828] 2020-06-14 09:24:36 +09:00
Kazuki Tsujimoto f7906a7e31
push_pktbl is needed for hash pattern, not for array pattern 2020-06-14 09:23:43 +09:00
Nobuyoshi Nakada 2496bdb28f
Extracted argument forwarding staffs 2020-06-13 23:33:40 +09:00
Nobuyoshi Nakada 8e5352569b
[ripper] use Ripper DSL 2020-06-13 23:33:40 +09:00
Nobuyoshi Nakada c0ba35f334
Differentiate `...` in lambda arguments 2020-06-07 18:44:07 +09:00
Jeremy Evans f8b4340fa2 Add leading arguments support to arguments forwarding
The idFWD_KWREST sections may be wrong. However, the existing
idFWD_KWREST sections for ... without leading arguments are already
broken.

Implements [Feature #16378]
2020-06-06 17:07:11 -07:00
Nobuyoshi Nakada 27bef64862
Include the entire lambda expression in lambda rule 2020-06-02 09:06:49 +09:00
Nobuyoshi Nakada cadd2245f7
Extracted `excessed_comma` to unify ripper and make the order stable 2020-06-01 18:26:34 +09:00
Nobuyoshi Nakada 71c166e11e
Fixed argument forwarding in reserved word method [Bug #16854] 2020-05-15 14:59:11 +09:00
Nobuyoshi Nakada d7d0d01401 Endless method definition including `rescue` modifier 2020-05-14 19:58:44 +09:00
卜部昌平 9e41a75255 sed -i 's|ruby/impl|ruby/internal|'
To fix build failures.
2020-05-11 09:24:08 +09:00