summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2018-12-21 17:52:34 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2018-12-21 18:02:29 +0100
commit47728f0c89af565e5a0a77aebfb1cc267ec3c979 (patch)
tree22340efb4f444ace022abb027a0eb4df7d931a88 /src/bin
parent8fa3f39e3113f3d50cad96d01fbbe48b491fc07e (diff)
downloadefl-47728f0c89af565e5a0a77aebfb1cc267ec3c979.tar.gz
efl-mono: Remove trailing () from doc references
Summary: Some EO docs include () after a @method reference (some don't). When the method reference is redered by DocFX it already includes the trailing parenthese (and it even includes the parameter types), so it looks very weird: Efl.Gfx.Stack.Raise()() This patch removes the "()" string from any text comment following an @ reference. Test Plan: Check DocFX docs for Efl.Gfx.Stack.Lower before and after this patch. There are references to other methods which include the double parentheses. Reviewers: lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7504
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_mono/eolian/mono/documentation.hh13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh
index 4e9fc5d4b1..3acec94102 100644
--- a/src/bin/eolian_mono/eolian/mono/documentation.hh
+++ b/src/bin/eolian_mono/eolian/mono/documentation.hh
@@ -130,6 +130,7 @@ struct documentation_generator
::Eolian_Doc_Token token;
const char *text_ptr = text.c_str();
::eolian_doc_token_init(&token);
+ ::Eolian_Doc_Token_Type previous_token_type = ::EOLIAN_DOC_TOKEN_UNKNOWN;
while ((text_ptr = ::eolian_documentation_tokenize(text_ptr, &token)) != NULL)
{
std::string token_text, name_tail;
@@ -139,11 +140,18 @@ struct documentation_generator
token_text = token_text_cstr;
free(token_text_cstr);
if (token_text.length() > 4)
- name_tail = token_text.substr(token_text.size() - 4, 4);
+ name_tail = token_text.substr(token_text.length() - 4, 4);
}
- switch(::eolian_doc_token_type_get(&token))
+ ::Eolian_Doc_Token_Type token_type = ::eolian_doc_token_type_get(&token);
+ switch(token_type)
{
case ::EOLIAN_DOC_TOKEN_TEXT:
+ // If previous token was a reference and this text token starts with
+ // parentheses, remove them, since the reference will be rendered
+ // with the parentheses already.
+ if ((previous_token_type == ::EOLIAN_DOC_TOKEN_REF) &&
+ (token_text.substr(0, 2) == "()"))
+ token_text = token_text.substr(2, token_text.length() - 2);
new_text += token_text;
break;
case ::EOLIAN_DOC_TOKEN_REF:
@@ -174,6 +182,7 @@ struct documentation_generator
default:
break;
}
+ previous_token_type = token_type;
}
return new_text;
}