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. --- doc/ScintillaHistory.html | 4 ++++ lexers/LexRuby.cxx | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 5071541a1..06ac8f9fc 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -519,6 +519,10 @@ extends nested comments to unlimited levels.
  • + Ruby lexer treats alternate hash key syntax 'key:' as a symbol. + Bug #1810. +
  • +
  • For GTK+ on Windows fix 64-bit build which was broken in 3.6.3.
  • 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