Issue #21945 has been reported by Earlopain (Earlopain _). ---------------------------------------- Bug #21945: Ripper lexes newline between identifier and `and?` as ignored newline https://bugs.ruby-lang.org/issues/21945 * Author: Earlopain (Earlopain _) * Status: Open * ruby -v: ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [x86_64-linux] * Backport: 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONTNEED, 4.0: UNKNOWN ---------------------------------------- ```rb Ripper.lex("foo\nand?") => [[[1, 0], :on_ident, "foo", CMDARG], [[1, 3], :on_ignored_nl, "\n", CMDARG], [[2, 0], :on_ident, "and?", ARG]] ``` Presumably this is because until the `?` is encountered, it is considered syntax as introduced in https://bugs.ruby-lang.org/issues/20925. The same is true for `and!` and `or`. If any other character is encountered, it lexes correctly like in `foo\nandbar`. -- https://bugs.ruby-lang.org/