[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [frameworks-ktexteditor] [Bug 340519] New: Ruby's alternate Hash syntax is not supported
From:       Rubén <ruben.caro.estevez () gmail ! com>
Date:       2014-10-31 7:56:13
Message-ID: bug-340519-17878 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=340519

            Bug ID: 340519
           Summary: Ruby's alternate Hash syntax is not supported
           Product: frameworks-ktexteditor
           Version: unspecified
          Platform: Other
                OS: All
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: general
          Assignee: kwrite-bugs-null@kde.org
          Reporter: ruben.caro.estevez@gmail.com

Alternate Hash syntax is there since Ruby 1.9, and after Ruby 2.0 is even more
used (for keyword arguments, for example). 

I have been hacking your syntax files to support this on my machines waiting
for this to be implemented, but long has passsed and it's not there yet.

My hack is simply to recognise alternate Hash keys as symbols too. Actually
they are always symbols, so it looks right to me. I got this by copying and
altering a bit the symbol detection rules, like this:

<!-- regular symbol detection -->
<RegExpr attribute="Symbol" String=":(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?"
context="check_div_1"/>
<RegExpr attribute="Symbol" String=":\[\]=?" context="check_div_1"/>

<!-- alternate Hash symbol detection -->
<RegExpr attribute="Symbol" String="(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?: "
context="check_div_1"/>
<RegExpr attribute="Symbol" String="\[\]=?: " context="check_div_1"/>

Reproducible: Always

-- 
You are receiving this mail because:
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic