[Bug 63973] I create Fortran project, add long source files, close gideon. Open gideon - it crashes on fortran parser.
Jens Dagerbo
jens.dagerbo at swipnet.se
Mon Mar 29 16:05:07 UTC 2004
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=63973
------- Additional Comments From jens.dagerbo swipnet se 2004-03-29 16:09 -------
CVS commit by dagerbo:
Use QRegExp instead of the deprecated KRegExp.
Hopefully fixing a few crashes in the process..
CCMAIL: 63973 bugs kde org
M +12 -10 fixedformparser.cpp 1.11.2.1
M +2 -2 fixedformparser.h 1.3.2.1
--- kdevelop/languages/fortran/fixedformparser.cpp #1.11:1.11.2.1
@ -22,7 +22,10 @ FixedFormParser::FixedFormParser(CodeMod
m_model = model;
- functionre.compile("(integer|real|logical|complex|character|"
+ functionre.setPattern("(integer|real|logical|complex|character|"
"double(precision)?)function([^(]+).*");
- subroutinere.compile("subroutine([^(]+).*");
+ subroutinere.setPattern("subroutine([^(]+).*");
+
+ functionre.setCaseSensitive( false );
+ subroutinere.setCaseSensitive( false );
}
@ -30,7 +33,4 @ FixedFormParser::FixedFormParser(CodeMod
void FixedFormParser::process(const QCString &line, const QString &fileName, int lineNum)
{
- if (line.isEmpty())
- return;
-
QCString simplified;
int l = line.length();
@ -39,9 +39,11 @ void FixedFormParser::process(const QCSt
simplified += line[i];
- QCString name;
- if (functionre.match(simplified))
- name = functionre.group(3);
- else if (subroutinere.match(simplified))
- name = subroutinere.group(1);
+ if ( simplified.isEmpty() ) return;
+
+ QString name;
+ if (functionre.search(simplified) != -1)
+ name = functionre.cap(3);
+ else if (subroutinere.search(simplified) != -1)
+ name = subroutinere.cap(1);
else
return;
--- kdevelop/languages/fortran/fixedformparser.h #1.3:1.3.2.1
@ -15,5 +15,5 @
#include <qstring.h>
#include <qtextstream.h>
-#include <kregexp.h>
+#include <qregexp.h>
#include <codemodel.h>
@ -30,5 +30,5 @ private:
CodeModel* m_model;
FileDom m_file;
- KRegExp functionre, subroutinere;
+ QRegExp functionre, subroutinere;
};
More information about the KDevelop-devel
mailing list