summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono
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/eolian_mono
parent8fa3f39e3113f3d50cad96d01fbbe48b491fc07e (diff)
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/eolian_mono')
-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 4e9fc5d..3acec94 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
130 ::Eolian_Doc_Token token; 130 ::Eolian_Doc_Token token;
131 const char *text_ptr = text.c_str(); 131 const char *text_ptr = text.c_str();
132 ::eolian_doc_token_init(&token); 132 ::eolian_doc_token_init(&token);
133 ::Eolian_Doc_Token_Type previous_token_type = ::EOLIAN_DOC_TOKEN_UNKNOWN;
133 while ((text_ptr = ::eolian_documentation_tokenize(text_ptr, &token)) != NULL) 134 while ((text_ptr = ::eolian_documentation_tokenize(text_ptr, &token)) != NULL)
134 { 135 {
135 std::string token_text, name_tail; 136 std::string token_text, name_tail;
@@ -139,11 +140,18 @@ struct documentation_generator
139 token_text = token_text_cstr; 140 token_text = token_text_cstr;
140 free(token_text_cstr); 141 free(token_text_cstr);
141 if (token_text.length() > 4) 142 if (token_text.length() > 4)
142 name_tail = token_text.substr(token_text.size() - 4, 4); 143 name_tail = token_text.substr(token_text.length() - 4, 4);
143 } 144 }
144 switch(::eolian_doc_token_type_get(&token)) 145 ::Eolian_Doc_Token_Type token_type = ::eolian_doc_token_type_get(&token);
146 switch(token_type)
145 { 147 {
146 case ::EOLIAN_DOC_TOKEN_TEXT: 148 case ::EOLIAN_DOC_TOKEN_TEXT:
149 // If previous token was a reference and this text token starts with
150 // parentheses, remove them, since the reference will be rendered
151 // with the parentheses already.
152 if ((previous_token_type == ::EOLIAN_DOC_TOKEN_REF) &&
153 (token_text.substr(0, 2) == "()"))
154 token_text = token_text.substr(2, token_text.length() - 2);
147 new_text += token_text; 155 new_text += token_text;
148 break; 156 break;
149 case ::EOLIAN_DOC_TOKEN_REF: 157 case ::EOLIAN_DOC_TOKEN_REF:
@@ -174,6 +182,7 @@ struct documentation_generator
174 default: 182 default:
175 break; 183 break;
176 } 184 }
185 previous_token_type = token_type;
177 } 186 }
178 return new_text; 187 return new_text;
179 } 188 }