diff options
author | Colomban Wendling <ban@herbesfolles.org> | 2016-02-17 15:31:18 +0100 |
---|---|---|
committer | Colomban Wendling <ban@herbesfolles.org> | 2016-02-17 15:31:18 +0100 |
commit | d5796d0d534bced57f65ed352853d7608f383a7b (patch) | |
tree | a63fb9fe0fcebe3fd839e14986474d7365c0e3a1 | |
parent | 9659d7bd498edf4b08e165f0ff7d6beecf572c70 (diff) | |
download | scintilla-mirror-d5796d0d534bced57f65ed352853d7608f383a7b.tar.gz |
Ruby: Allow a symbol before a HereDoc for an implicit hash argument
Part of bug [#1810].
-rw-r--r-- | lexers/LexRuby.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lexers/LexRuby.cxx b/lexers/LexRuby.cxx index e4fd575fe..092f71dd0 100644 --- a/lexers/LexRuby.cxx +++ b/lexers/LexRuby.cxx @@ -504,6 +504,16 @@ static bool sureThisIsNotHeredoc(Sci_Position lt2StartPos, } // Skip next batch of white-space firstWordPosn = skipWhitespace(firstWordPosn, lt2StartPos, styler); + // possible symbol for an implicit hash argument + if (firstWordPosn < lt2StartPos && styler.StyleAt(firstWordPosn) == SCE_RB_SYMBOL) { + for (; firstWordPosn <= lt2StartPos; firstWordPosn += 1) { + if (styler.StyleAt(firstWordPosn) != SCE_RB_SYMBOL) { + break; + } + } + // Skip next batch of white-space + firstWordPosn = skipWhitespace(firstWordPosn, lt2StartPos, styler); + } if (firstWordPosn != lt2StartPos) { // Have [[^ws[identifier]ws[*something_else*]ws<< return definitely_not_a_here_doc; |