Menu

#1927 Scite: Bug in Lexer for Ruby (ternary operator)

Bug
closed-fixed
nobody
4
2023-05-31
2017-04-04
Ronald
No

In a Ruby expression like

`f ? /.*/ : /abc/`

the lexer produces incorrect syntax highlighting, in that it does not recognize the first slash as the start of a regular expression. A crucial condition seems to be, that the regexp occurs within a ternary operator (?:) and ends with an asterisk.

The attached screenshot shows the bug. It contains two semantically equivalent assignment statements. The first one, using the keyword if, gets correct syntax highlight, while the second one, using the ternary ?: operator, is not.

1 Attachments

Related

Bugs: #1057
Bugs: #2126

Discussion

  • Neil Hodgson

    Neil Hodgson - 2017-04-05
    • labels: --> scintilla, lexer, ruby
    • status: open --> open-accepted
    • Priority: 5 --> 4
     
  • Zufu Liu

    Zufu Liu - 2022-03-25
     
    • Neil Hodgson

      Neil Hodgson - 2022-03-26

      This is unrelated to "Code folding for Ruby 3 endless method definition" so should be in its own issue on GitHub.

       
  • Neil Hodgson

    Neil Hodgson - 2023-05-31
    • status: open-accepted --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB