Commit graph

2070 commits

Author SHA1 Message Date
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
卜部昌平
d7f4d732c1 sed -i s|ruby/3|ruby/impl|g
This shall fix compile errors.
2020-05-11 09:24:08 +09:00
Nobuyoshi Nakada
5c2508060b
Bison 3.5.91 now defaults parse.error to "simple" 2020-05-04 18:10:02 +09:00
Nobuyoshi Nakada
1997e10f6c
Made parentheses mandatory in endless method defition
Even for empty argument list, not to be confusing with a writer
method name.
2020-04-22 20:44:46 +09:00
Nobuyoshi Nakada
02ad393cd6
Revert "Allow simple R-assign in endless def"
This reverts commit 67bcac879a.
2020-04-22 18:56:06 +09:00
Nobuyoshi Nakada
478135f480
Disallow line-continuation before R-assign 2020-04-15 10:33:11 +09:00
Nobuyoshi Nakada
a520ee4763
Removed duplicate value_expr checks
`arg_rhs` has the same check and is always a non-void value
expression.
2020-04-14 19:47:17 +09:00
Nobuyoshi Nakada
67bcac879a Allow simple R-assign in endless def 2020-04-13 21:51:34 +09:00
Nobuyoshi Nakada
022c7bbea9
Relaxed of R-assign value to arg 2020-04-12 00:07:57 +09:00
Nobuyoshi Nakada
e8f53692ca
Endless method definition [Feature #16746] 2020-04-10 18:02:15 +09:00
Nobuyoshi Nakada
1b2d351b21
Rightward-assign by ASSOC
[Feature #15921]
2020-04-10 15:03:58 +09:00
卜部昌平
9e6e39c351
Merge pull request #2991 from shyouhei/ruby.h
Split ruby.h
2020-04-08 13:28:13 +09:00
Nobuyoshi Nakada
2544bf9452
New macro NEW_RIPPER instead of NEW_CDECL 2020-04-03 01:16:57 +09:00
Nobuyoshi Nakada
f020d340f4
parse.y: hoisted out new_nil_at
new_nil_at: create NEW_NIL node with zero-width location.
2020-03-11 18:13:40 +09:00
Nobuyoshi Nakada
276859e03e
parse.y: unified kwrest and no-kwrest 2020-03-11 18:13:29 +09:00
Nobuyoshi Nakada
7d05f98a84
Renamed lex_flags as lex_context 2020-03-05 17:19:17 +09:00
Nobuyoshi Nakada
c8d0bf0156
Preserve kwarg flag and fix up f5c904c2a9 2020-03-03 16:19:49 +09:00
Nobuyoshi Nakada
85620ffaa6
Reduced parser stack usage by merging non-result actions 2020-03-02 16:45:46 +09:00
Nobuyoshi Nakada
20a2ab0825
Packed stacked bit flags into one struct 2020-03-02 16:34:33 +09:00
Nobuyoshi Nakada
f5c904c2a9
Allow newlines inside braced pattern 2020-03-02 15:49:03 +09:00
Kazuki Tsujimoto
d25a4f413d
Allow trailing comma in hash pattern 2020-03-01 14:35:48 +09:00
Nobuyoshi Nakada
403675e8dc
Named tLABEL token 2020-02-29 21:42:38 +09:00
Nobuyoshi Nakada
07f27383b7
Refined argument name 2020-02-28 20:10:46 +09:00
Nobuyoshi Nakada
6e6844320d Fixed duplicated warning
As `command_rhs` is always a "value expression", `command_asgn`
does not need the same check.
2020-02-10 14:00:40 +09:00
Nobuyoshi Nakada
9cdc964d07
Do not warn CR inside string literal 2020-02-04 14:41:52 +09:00
Kenta Murata
019a0ed0c7
Make RATIONAL_SET_{NUM,DEN} static inline functions 2020-01-17 10:04:19 +09:00
Nobuyoshi Nakada
c171ab23e3
Separate numbered parameter scope in eval
[Feature #16432]
2020-01-16 18:38:48 +09:00
Nobuyoshi Nakada
f38b3e8c70
Fixed the location of args node with numbered parameter 2020-01-16 18:34:31 +09:00
Yusuke Endoh
5b0c3754d8 parse.y: fix a wrong sizeof argument for ruby_sized_xfree 2020-01-05 11:39:35 +09:00
Jeremy Evans
0eeed5bcc5 Make eval(code, binding) use (eval) as __FILE__ and 1 as __LINE__
This removes the warning that was added in
3802fb92ff, and switches the behavior
so that the eval does not use the binding's __FILE__ and __LINE__
implicitly.

Fixes [Bug #4352]
2020-01-03 20:13:09 -08:00
卜部昌平
5e22f873ed decouple internal.h headers
Saves comitters' daily life by avoid #include-ing everything from
internal.h to make each file do so instead.  This would significantly
speed up incremental builds.

We take the following inclusion order in this changeset:

1.  "ruby/config.h", where _GNU_SOURCE is defined (must be the very
    first thing among everything).
2.  RUBY_EXTCONF_H if any.
3.  Standard C headers, sorted alphabetically.
4.  Other system headers, maybe guarded by #ifdef
5.  Everything else, sorted alphabetically.

Exceptions are those win32-related headers, which tend not be self-
containing (headers have inclusion order dependencies).
2019-12-26 20:45:12 +09:00
Nobuyoshi Nakada
56e002981f
Show the error line only when same as the current 2019-12-25 14:49:48 +09:00
Nobuyoshi Nakada
07e595fdbd
Added experimental warning category
[Feature #16420]
2019-12-20 23:48:15 +09:00
Nobuyoshi Nakada
dd7f0c87c9
Hoisted out new_case3 2019-12-20 23:43:38 +09:00