From b7dfdd2b2fd499c63f96937900866a5d123dcf45 Mon Sep 17 00:00:00 2001 From: Jad Altahan Date: Wed, 21 Nov 2018 19:58:45 +1100 Subject: Backport: Changes to IsNumOctal & SCE_NIM_IDENTIFIER - Removed 0c/0C prefix in IsNumOctal(). Not supported. - Added upper-case type suffixes in SCE_NIM_NUMBER. They are case-insensitive. Backport of changeset 7174:caa5c5b342a1. --- lexers/LexNim.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lexers') diff --git a/lexers/LexNim.cxx b/lexers/LexNim.cxx index 2cfc30eeb..94d179e04 100644 --- a/lexers/LexNim.cxx +++ b/lexers/LexNim.cxx @@ -203,9 +203,7 @@ static int IsNumBinary(StyleContext &sc) { } static int IsNumOctal(StyleContext &sc) { - return IsADigit(sc.chNext) - || sc.chNext == 'o' - || sc.chNext == 'c' || sc.chNext == 'C'; + return IsADigit(sc.chNext) || sc.chNext == 'o'; } static bool IsNewline(const int ch) { @@ -273,8 +271,10 @@ void SCI_METHOD LexerNim::Lex(Sci_PositionU startPos, Sci_Position length, case SCE_NIM_NUMBER: // For a type suffix, such as 0x80'u8 if (sc.ch == '\'') { - if (sc.chNext == 'i' || sc.chNext == 'u' || - sc.chNext == 'f' || sc.chNext == 'd') { + if (sc.chNext == 'i' || sc.chNext == 'I' || + sc.chNext == 'u' || sc.chNext == 'U' || + sc.chNext == 'f' || sc.chNext == 'F' || + sc.chNext == 'd' || sc.chNext == 'D') { sc.Forward(2); } } else if (sc.ch == '.') { -- cgit v1.2.3