diff options
author | Colomban Wendling <devnull@localhost> | 2016-02-16 23:33:34 +1100 |
---|---|---|
committer | Colomban Wendling <devnull@localhost> | 2016-02-16 23:33:34 +1100 |
commit | 1e4b9fa23f3818b5d89ad6b4cbb8f24e888a10e7 (patch) | |
tree | c49a34ba60740a082582d53075ae557946f73d3c | |
parent | 99800d1c26d344983cd27bdf10f71d3572d3d2b8 (diff) | |
download | scintilla-mirror-1e4b9fa23f3818b5d89ad6b4cbb8f24e888a10e7.tar.gz |
Bug [#1810]. Lex alternate hash key syntax 'key:' as a symbol.
-rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
-rw-r--r-- | lexers/LexRuby.cxx | 5 |
2 files changed, 9 insertions, 0 deletions
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. </li> <li> + Ruby lexer treats alternate hash key syntax 'key:' as a symbol. + <a href="http://sourceforge.net/p/scintilla/bugs/1810/">Bug #1810</a>. + </li> + <li> For GTK+ on Windows fix 64-bit build which was broken in 3.6.3. </li> <li> 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 // <name>= is a name only when being def'd -- Get it the next time // This means that <name>=<name> is always lexed as // <name>, (op, =), <name> + } else if (ch == ':' + && isSafeWordcharOrHigh(chPrev) + && strchr(" \t\n\r", chNext) != NULL) { + state = SCE_RB_SYMBOL; } else if ((ch == '?' || ch == '!') && isSafeWordcharOrHigh(chPrev) && !isSafeWordcharOrHigh(chNext)) { |