From 1e4b9fa23f3818b5d89ad6b4cbb8f24e888a10e7 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Tue, 16 Feb 2016 23:33:34 +1100 Subject: Bug [#1810]. Lex alternate hash key syntax 'key:' as a symbol. --- lexers/LexRuby.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lexers') diff --git a/lexers/LexRuby.cxx b/lexers/LexRuby.cxx index be60f8041..e4fd575fe 100644 --- a/lexers/LexRuby.cxx +++ b/lexers/LexRuby.cxx @@ -466,6 +466,7 @@ static bool sureThisIsNotHeredoc(Sci_Position lt2StartPos, prevStyle = styler.StyleAt(firstWordPosn); // If we have '<<' following a keyword, it's not a heredoc if (prevStyle != SCE_RB_IDENTIFIER + && prevStyle != SCE_RB_SYMBOL && prevStyle != SCE_RB_INSTANCE_VAR && prevStyle != SCE_RB_CLASS_VAR) { return definitely_not_a_here_doc; @@ -1088,6 +1089,10 @@ static void ColouriseRbDoc(Sci_PositionU startPos, Sci_Position length, int init // = is a name only when being def'd -- Get it the next time // This means that = is always lexed as // , (op, =), + } else if (ch == ':' + && isSafeWordcharOrHigh(chPrev) + && strchr(" \t\n\r", chNext) != NULL) { + state = SCE_RB_SYMBOL; } else if ((ch == '?' || ch == '!') && isSafeWordcharOrHigh(chPrev) && !isSafeWordcharOrHigh(chNext)) { -- cgit v1.2.3