[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdesdk/scripts/kde-emacs
From: David Faure <faure () kde ! org>
Date: 2008-11-06 8:50:01
Message-ID: 1225961401.469354.13893.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 880700 by dfaure:
Fix agulbra-make-member not removing the default value correctly when the function decl has nested (...), like this:
int columnCount( const QModelIndex & parent = QModelIndex() ) const;
M +6 -2 kde-emacs-utils.el
--- trunk/KDE/kdesdk/scripts/kde-emacs/kde-emacs-utils.el #880699:880700
@@ -171,9 +171,13 @@
(setq function (replace-match " " t t function)))
(while (string-match "^ " function) ; remove leading whitespace
(setq function (replace-match "" t t function)))
+ ; remove default values. complex case: void foo(p=QString())
(let ((startargs (string-match "(" function)))
- (while (string-match " ?=[^,)]+" function startargs) ; remove default values
- (setq function (replace-match " " t t function))))
+ (while (string-match " ?=[^,()]+" function startargs) ; part 1 (stop at '(')
+ (setq function (replace-match "" t t function)))
+ (while (string-match "([^()]*)" function (+ startargs 1)) ; part 2, remove "(...)"
+ (setq function (replace-match "" t t function))))
+
(while (string-match " +," function) ; remove space before commas
(setq function (replace-match "," t t function)))
function ; the return value
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic