From 59fc425d7dc59593cc3f1fb72ea3313e6e152dd3 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Thu, 8 Aug 2013 16:08:29 +0000 Subject: [PATCH] [BUG_FIXED] Fix a crash issue while there's missing tag in function list. [BUG_FIXED] Fix function list parses C++ class (*.h) problem while there is comment on the beginning of document. [ENHANCEMENT] Enhance C/C++ parse result for function list. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1101 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 5 ++++- .../WinControls/FunctionList/functionParser.cpp | 4 ++-- PowerEditor/src/functionList.xml | 16 +++++++--------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 476f0458..393be447 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -5186,7 +5186,7 @@ struct Quote{ const char *_quote; }; -const int nbQuote = 138; +const int nbQuote = 141; Quote quotes[nbQuote] = { {"Notepad++", "Good programmers use Notepad++ to code.\nExtreme programmers use MS Word to code, in Comic Sans, center aligned."}, {"Martin Golding", "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."}, @@ -5317,6 +5317,9 @@ Quote quotes[nbQuote] = { {"Anonymous #97", "Real Programmers don't comment their code.\nIf it was hard to write, it should be hard to read."}, {"Anonymous #98", "My neighbours listen to good music.\nWhether they like it or not."}, {"Anonymous #99", "Mondays are not so bad.\nIt's your job that sucks."}, +{"Anonymous #100", "Dear YouTube,\nI can deal with Ads.\nI can deal with Buffer.\nBut when Ads buffer, I suffer."}, +{"Anonymous #101", "It's always sad when a man and his dick share only one brain...\nand it turns out to be the dick's."}, +{"Anonymous #102", "If IE is brave enough to ask you to set it as your default browser,\ndon't tell me you dare not ask a girl out."}, {"Gandhi", "Earth provides enough to satisfy every man's need, but not every man's greed."}, {"R. D. Laing", "Life is a sexually transmitted disease and the mortality rate is one hundred percent."}, {"Apple fan boy", "I'll buy a second iPhone 5 and buy a lot of iOS applications so that Apple will be able to buy Samsung (this shitty company)\nto shut it down and all the Apple haters will be forced to have an iPhone. Muhahaha..."}, diff --git a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp index fb91be21..d69444b8 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp @@ -135,7 +135,7 @@ bool FunctionParsersManager::getUnitPaserParameters(TiXmlNode *functionParser, g } TiXmlNode *classNameParser = functionParser->FirstChild(TEXT("className")); - if (functionNameParser) + if (classNameParser) { for (TiXmlNode *childNode = classNameParser->FirstChildElement(TEXT("nameExpr")); childNode; @@ -320,7 +320,7 @@ void FunctionParser::funcParse(std::vector & foundInfos, size_t begin if (classStructName != TEXT("")) { fi._data2 = classStructName; - fi._pos2 = 0; // change -1 valeur for validated data2 + fi._pos2 = -1; // change -1 valeur for validated data2 } else if (_classNameExprArray.size()) { diff --git a/PowerEditor/src/functionList.xml b/PowerEditor/src/functionList.xml index b6abc98c..336e95f4 100644 --- a/PowerEditor/src/functionList.xml +++ b/PowerEditor/src/functionList.xml @@ -14,7 +14,7 @@ L_CMAKE: 48 L_YAML: 49 L_COBOL 50 L_GUI4CLI: 51 L_D: 52 L_POWERSHELL: 53 L_R: 54 L_JSP: 55 --> - + + + mainExpr="^[\t ]*((static|const|virtual)[\s]+)?[\w:]+([\s]+[\w]+)?([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+)([\w_]+[\s]*::)?(?!(if|while|for))[\w_]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*\{" + displayMode="$functionName"> - - - @@ -88,7 +86,7 @@ + mainExpr="^[\t ]*((static|const|virtual)[\s]+)?([\w]+([\s]+[\w]+)?([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+))?([\w_]+[\s]*::)?(?!(if|while|for|switch))[\w_~]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*\{"> @@ -96,7 +94,7 @@