diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-09-08 21:44:12 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-25 00:08:16 +0200 |
commit | 38f1b4eeaeb013983126c155a9b25e08074c41f7 (patch) | |
tree | 4024eaa4f63de0a437f87c87afa7cb03f45825d0 /src/tools/moc/utils.h | |
parent | 34a3b63dc7d3b09342647537d378f5a55d0c81f0 (diff) |
Correctly parse function macros
Parse function macros and add it's list of arguments
to the Macro definition.
Change-Id: Id22f5cf4a1c098f7b4f5b72f002900cd40d03e0f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/tools/moc/utils.h')
-rw-r--r-- | src/tools/moc/utils.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tools/moc/utils.h b/src/tools/moc/utils.h index bacc908be2..aaaaaa3267 100644 --- a/src/tools/moc/utils.h +++ b/src/tools/moc/utils.h @@ -73,6 +73,18 @@ inline bool is_ident_char(char s) ); } +inline bool is_identifier(const char *s, int len) +{ + if (len < 1) + return false; + if (!is_ident_start(*s)) + return false; + for (int i = 1; i < len; ++i) + if (!is_ident_char(s[i])) + return false; + return true; +} + inline bool is_digit_char(char s) { return (s >= '0' && s <= '9'); |