aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* Return new NODE_LITNobuyoshi Nakada2021-01-141-5/+2
| | | | | As NODE_ZLIST/NODE_LIST are not markable, cannot be reused as NODE_LIT.
* Ensure symbol list node is either NODE_STR or NODE_DSTRNobuyoshi Nakada2021-01-141-3/+8
|
* Capture to reserved name variables if already defined [Bug #17533]Nobuyoshi Nakada2021-01-131-2/+3
|
* parse.y: handle "duplicated argument name" appropriately on ripper.yNobuhiro IMAI2021-01-091-2/+4
| | | | refs: 733ed1e184
* Fixed error message when % at EOFNobuyoshi Nakada2021-01-041-1/+3
|
* Make args info for RubyVM::AST to available on endless method without parensMasataka Pocke Kuwabara2021-01-011-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem === Arguments information is missing for endless method without parens. For example: ```ruby # ok pp RubyVM::AbstractSyntaxTree.parse(<<~RUBY).children[2] def x() = 42 RUBY # => (DEFN@1:0-1:12 # mid: :x # body: # (SCOPE@1:0-1:12 # tbl: [] # args: # (ARGS@1:5-1:6 # pre_num: 0 # pre_init: nil # opt: nil # first_post: nil # post_num: 0 # post_init: nil # rest: nil # kw: nil # kwrest: nil # block: nil) # body: (LIT@1:10-1:12 42))) # ok pp RubyVM::AbstractSyntaxTree.parse(<<~RUBY).children[2] def x() 42 end RUBY # => (DEFN@1:0-1:14 # mid: :x # body: # (SCOPE@1:0-1:14 # tbl: [] # args: # (ARGS@1:5-1:6 # pre_num: 0 # pre_init: nil # opt: nil # first_post: nil # post_num: 0 # post_init: nil # rest: nil # kw: nil # kwrest: nil # block: nil) # body: (LIT@1:8-1:10 42))) # It has a problem, the `args` is nil pp RubyVM::AbstractSyntaxTree.parse(<<~RUBY).children[2] def x = 42 RUBY # => (DEFN@1:0-1:10 # mid: :x # body: (SCOPE@1:0-1:10 tbl: [] args: nil body: (LIT@1:8-1:10 42))) ``` It causes an error if a program expects `args` node exists. For example: https://github.com/ruby/rbs/issues/551 Solution ==== Call `new_args` on this case.
* shareable_constant_value: experimental_copyKoichi Sasada2020-12-241-7/+18
| | | | | | | "experimental_everything" makes the assigned value, it means the assignment change the state of assigned value. "experimental_copy" tries to make a deep copy and make copyied object sharable.
* Reset paren_nest at tAREF and tASET [Bug #17431]Nobuyoshi Nakada2020-12-241-0/+1
|
* Ensure non-literal expressions shareable if `leteral`Nobuyoshi Nakada2020-12-231-1/+1
|
* `begin ... end` is not a literalNobuyoshi Nakada2020-12-231-1/+1
|
* Changed shareable literal semantics [Feature #17397]Nobuyoshi Nakada2020-12-231-34/+123
| | | | | | When `literal`, check if the literal about to be assigned to a constant is ractor-shareable, otherwise raise `Ractor::Error` at runtime instead of `SyntaxError`.
* ripper: fix bad label parameter handling [Bug #17425]Nobuyoshi Nakada2020-12-231-5/+12
|
* Reduced ID cachesNobuyoshi Nakada2020-12-201-3/+6
| | | | NEW_GASGN and NEW_GVAR evaluate `id` argument twice.
* Use category: :experimental in warnings that are related to experimental ↵Jeremy Evans2020-12-181-2/+4
| | | | | | | | | features This adds rb_category_compile_warn in order to emit compiler warnings with categories. Note that Ripper currently ignores the category for these warnings, but by default it ignores the warnings completely, so this shouldn't matter.
* Fixed not to make non-literal expression shareable [Feature #17273]Nobuyoshi Nakada2020-12-191-8/+10
| | | | | Non-literal expression which is not a part of a literal expression is not a subject of `shareable_literal_value: literal`.
* Drop token info also for endless singleton method definitionNobuyoshi Nakada2020-12-181-8/+7
|
* Ripper: Pass callback result to alias_error as well as other errorsNobuyoshi Nakada2020-12-161-2/+1
| | | | [Bug #17345]
* Ripper: Fixed erred token on wrong alias [Bug #17345]Nobuyoshi Nakada2020-12-161-1/+2
|
* Ripper: Refined error callbacks [Bug #17345]Nobuyoshi Nakada2020-12-151-35/+52
|
* Support shareable_constant_value: literalNobuyoshi Nakada2020-12-141-6/+124
|
* Make shareable_constant_value tri-stateNobuyoshi Nakada2020-12-141-18/+72
|
* shareable_constant_value: is effective only in comment-only lineNobuyoshi Nakada2020-12-141-0/+7
|
* Save and pass lex_context wholelyNobuyoshi Nakada2020-12-141-37/+40
|
* Determine shareable-ness after assignment operatorNobuyoshi Nakada2020-12-141-93/+103
|
* Implemented shareable_constant_value op_asgnNobuyoshi Nakada2020-12-141-1/+22
|
* Call FrozenCore.make_shareableNobuyoshi Nakada2020-12-141-2/+4
|
* Implemented shareable_constant_valueNobuyoshi Nakada2020-12-141-1/+15
| | | | It does shallow freeze only for now.
* Support shareable_constant_value pragmaNobuyoshi Nakada2020-12-141-0/+13
|
* Reintroduce `expr in pat` [Feature #17371]Kazuki Tsujimoto2020-12-131-5/+24
|
* Don't emit warning when the pattern of one-line pattern matching is just a ↵Kazuki Tsujimoto2020-12-131-4/+13
| | | | | | variable pattern https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20201210Japan.md#feature-17371-reintroduce-expr-in-pat-ktsj
* fix public interfaceKoichi Sasada2020-11-181-1/+1
| | | | | | | | | | | | | | | | | | 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)
* Use more specific warning for ambiguous slashJeremy Evans2020-11-151-1/+6
| | | | Fixes [Bug #17124]
* ripper: Invalid pragma value warningNobuyoshi Nakada2020-11-021-1/+1
|
* Compare boolean values for parser pragma locale-insensitivelyNobuyoshi Nakada2020-11-021-2/+2
|
* Change NODE layout for pattern matchingKazuki Tsujimoto2020-11-011-3/+3
| | | | | | | | | | | | | | | | | | | | 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
* Pattern matching is no longer experimentalKazuki Tsujimoto2020-11-011-13/+9
|
* Allow non-argument endless-def with a space instead of parenthesesNobuyoshi Nakada2020-10-261-5/+8
|
* Assoc pattern matching (#3703)Nobuyoshi Nakada2020-10-261-34/+3
| | | | | [Feature #17260] One-line pattern matching using tASSOC R-assignment is rejected instead.
* Prohibit setter method names in all kinds of endless methodsNobuyoshi Nakada2020-10-121-3/+16
| | | | Also unwrap NODE_RIPPER to check the method name.
* Refactored lex_context managementNobuyoshi Nakada2020-10-091-8/+8
| | | | | Save and restore `lex_context` as-is wholely, and save in `k_class` and `k_module` to workaround look-ahead reading.
* Unfreeze string-literal-only interpolated string-literalNobuyoshi Nakada2020-09-301-12/+29
| | | | [Feature #17104]
* Introduce Ractor mechanism for parallel executionKoichi Sasada2020-09-031-3/+4
| | | | | | | | | | | | | | | | 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.
* new_dstr: hoisted out from literal_concat and evstr2dstrNobuyoshi Nakada2020-09-021-6/+12
|
* Prohibit setter method names in endless method definitionYusuke Endoh2020-08-311-0/+3
| | | | https://bugs.ruby-lang.org/issues/16746#note-26
* Fixed error messages at non-ascii %string terminatorNobuyoshi Nakada2020-08-261-0/+6
|
* Removed a never-true conditionNobuyoshi Nakada2020-08-261-1/+1
|
* rb_{ary,fnd}_pattern_info: Remove imemo member to reduce memory usageKazuki Tsujimoto2020-08-021-35/+13
| | | | | | | | | | | | | | | | | | | | | | This is a partial revert commit of 8f096226e1b76f95f4d853d3dea2bc75eeeb5244. 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
* Use a linked list to eliminate imemo tmp bufs for managing local tablesAaron Patterson2020-07-271-10/+2
| | | | | | | 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.
* Switch reserved for numbered parameter warning to SyntaxErrorJeremy Evans2020-07-221-2/+2
|
* Drop token info for endless method definitionNobuyoshi Nakada2020-06-251-0/+23
| | | | Because it does not have closing `end`.