Allow '@' signs inside DocuComment @params
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/2330790d Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/2330790d Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/2330790d Branch: refs/heads/master Commit: 2330790ddb3a25f6ffbcc36c0abbb7d9e97af281 Parents: 8210ce8 Author: Nick Wellnhofer <wellnho...@aevum.de> Authored: Fri Aug 21 00:50:44 2015 +0200 Committer: Nick Wellnhofer <wellnho...@aevum.de> Committed: Fri Aug 21 00:50:44 2015 +0200 ---------------------------------------------------------------------- compiler/src/CFCDocuComment.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2330790d/compiler/src/CFCDocuComment.c ---------------------------------------------------------------------- diff --git a/compiler/src/CFCDocuComment.c b/compiler/src/CFCDocuComment.c index ce59275..f5c45cc 100644 --- a/compiler/src/CFCDocuComment.c +++ b/compiler/src/CFCDocuComment.c @@ -144,18 +144,12 @@ CFCDocuComment_parse(const char *raw_text) { // Extract param description. while (isspace(*ptr) && ptr < text_limit) { ptr++; } char *param_doc = ptr; - while (ptr < text_limit) { - if (*ptr == '@') { break; } - else if (*ptr == '\n' && ptr < text_limit) { - ptr++; - while (ptr < text_limit && *ptr != '\n' && isspace(*ptr)) { - ptr++; - } - if (*ptr == '\n' || *ptr == '@') { break; } - } - else { - ptr++; - } + while (ptr < text_limit + && (*ptr != '@' + || (strncmp(ptr, "@param", 6) != 0 + && strncmp(ptr, "@return", 7) != 0)) + ) { + ptr++; } size_t param_doc_len = ptr - param_doc; @@ -202,7 +196,7 @@ CFCDocuComment_parse(const char *raw_text) { char *maybe_retval = strstr(text, "@return "); if (maybe_retval) { self->retval = CFCUtil_strdup(maybe_retval + sizeof("@return ") - 1); - char *terminus = strchr(self->retval, '@'); + char *terminus = strstr(self->retval, "@param"); if (terminus) { *terminus = '\0'; }