From 8cb3d9c412f1d09f0f4c94df84ff980f3e83c949 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Wed, 17 Feb 2016 15:31:18 +0100 Subject: Ruby: Allow a symbol before a HereDoc for an implicit hash argument Part of bug [#1810]. --- lexers/LexRuby.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- cgit v1.2.3