From 90f6353f4f082dfe8a2420ddc8d798df8a0054a1 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 20 Aug 2012 15:18:48 +0100 Subject: [PATCH] Minor C++ tokenising changes. --- .../juce_CPlusPlusCodeTokeniserFunctions.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniserFunctions.h b/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniserFunctions.h index 78ab6d6212..b6da6a9018 100644 --- a/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniserFunctions.h +++ b/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniserFunctions.h @@ -146,6 +146,9 @@ struct CppTokeniserFunctions template static bool parseHexLiteral (Iterator& source) noexcept { + if (source.peekNextChar() == '-') + source.skip(); + if (source.nextChar() != '0') return false; @@ -174,6 +177,9 @@ struct CppTokeniserFunctions template static bool parseOctalLiteral (Iterator& source) noexcept { + if (source.peekNextChar() == '-') + source.skip(); + if (source.nextChar() != '0') return false; @@ -194,6 +200,9 @@ struct CppTokeniserFunctions template static bool parseDecimalLiteral (Iterator& source) noexcept { + if (source.peekNextChar() == '-') + source.skip(); + int numChars = 0; while (isDecimalDigit (source.peekNextChar())) { @@ -210,6 +219,9 @@ struct CppTokeniserFunctions template static bool parseFloatLiteral (Iterator& source) noexcept { + if (source.peekNextChar() == '-') + source.skip(); + int numDigits = 0; while (isDecimalDigit (source.peekNextChar()))