[#114703] [Ruby master Bug#19875] Ruby 2.7 -> 3.1 Performance regression in String#count — "iz (Illia Zub) via ruby-core" <ruby-core@...>

Issue #19875 has been reported by iz (Illia Zub).

18 messages 2023/09/12

[#114774] [Ruby master Feature#19884] Make Safe Navigation Operator work on classes — "p8 (Petrik de Heus) via ruby-core" <ruby-core@...>

Issue #19884 has been reported by p8 (Petrik de Heus).

13 messages 2023/09/15

[#114796] [Ruby master Feature#19889] Let `Kernel.#require` search for files relative to the current working directory for non ./, ../ relative paths — "sawa (Tsuyoshi Sawada) via ruby-core" <ruby-core@...>

Issue #19889 has been reported by sawa (Tsuyoshi Sawada).

6 messages 2023/09/18

[#114803] [Ruby master Bug#19890] File#realine(chomp: true) slower/more allocations than readline.chomp! — "segiddins (Samuel Giddins) via ruby-core" <ruby-core@...>

Issue #19890 has been reported by segiddins (Samuel Giddins).

12 messages 2023/09/18

[#114817] [Ruby master Bug#19892] Build failure with 8f1b688177 — "vo.x (Vit Ondruch) via ruby-core" <ruby-core@...>

Issue #19892 has been reported by vo.x (Vit Ondruch).

8 messages 2023/09/19

[#114915] [Ruby master Feature#19905] Introduce `Queue#peek` — "hi@... (Joao Fernandes) via ruby-core" <ruby-core@...>

Issue #19905 has been reported by hi@joaofernandes.me (Joao Fernandes).

8 messages 2023/09/28

[ruby-core:114623] [Ruby master Bug#19281] SyntaxError if first argument of command call has semicolon inside parenthesis

From: "fxn (Xavier Noria) via ruby-core" <ruby-core@...>
Date: 2023-09-04 11:12:53 UTC
List: ruby-core #114623
Issue #19281 has been updated by fxn (Xavier Noria).


>From the point of view of the user, I believe the reasoning would be:

In a method call with parentheses, no spaces are allowed between the method name and the argument list.

Each argument is an expression. In particular, each argument can be written as one or more statements if enclosed in parentheses (generic property of parenthesized expressions). Statements can be separated by newlines or `;` (again, generic).

If there is a space after the mehtod name, what follows is considered to be its argument list without surrounding parentheses. In particular, if there is a parenthesis after the space, that one is considered to start an expression.

Makes sense?

So,

```ruby
puts(1)
puts((1))

puts 1
puts (1)
```

are all the same structurally (mod tokens).


----------------------------------------
Bug #19281: SyntaxError if first argument of command call has semicolon inside parenthesis
https://bugs.ruby-lang.org/issues/19281#change-104450

* Author: tompng (tomoya ishida)
* Status: Closed
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
These are syntax error
~~~ruby
p (1;2),(3),(4)
p (;),(),()
a.b (1;2),(3),(4)
a.b (;),(),()
~~~
I expect it to be syntax ok because the code below is syntax ok.
~~~ruby
p (1),(2;3),(4;5)
p (),(;),(;)
a.b (1),(2;3),(4;5)
a.b (),(;),(;)
~~~

It will be easy to traverse sexp if the sexp of first argument is same as others
~~~ruby
Ripper.sexp "p (),(),()"
# =>
[:program,
 [[:command,
   [:@ident, "p", [1, 0]],
   [:args_add_block,
    [[:paren, false], # [:paren, [[:void_stmt]]]
     [:paren, [[:void_stmt]]],
     [:paren, [[:void_stmt]]]],
    false]]]]
Ripper.sexp "p (1),(2),(3)"
# =>
[:program,
 [[:command,
   [:@ident, "p", [1, 0]],
   [:args_add_block,
    [[:paren, [:@int, "1", [1, 3]]], # [:paren, [[:@int, "1", [1, 3]]]]
     [:paren, [[:@int, "2", [1, 7]]]],
     [:paren, [[:@int, "3", [1, 11]]]]],
    false]]]]
~~~




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

In This Thread

Prev Next