Skip to content

Commit

Permalink
Moving punctuation dependency to translator
Browse files Browse the repository at this point in the history
The translator.py script is very sensitive regarding the layout and content of the translator.h file and the tests performed (regarding tests on functions with prototypes).
  • Loading branch information
albert-github committed Feb 26, 2022
1 parent 29de244 commit 8e0e2cc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion doc/translator.py
Expand Up @@ -880,7 +880,8 @@ def __collectPublicMethodPrototypes(self, tokenIterator):
prototype=="virtual QCString latexDocumentPre()" or
prototype=="virtual QCString latexCommandName()" or
prototype=="virtual QCString latexFont()" or
prototype=="virtual QCString latexFontenc()")):
prototype=="virtual QCString latexFontenc()" or
prototype=="virtual bool needsPunctuation()")):
self.prototypeDic[uniPrototype] = prototype
status = 2 # body consumed
methodId = None # outside of any method
Expand Down
6 changes: 4 additions & 2 deletions src/translator.h
Expand Up @@ -142,8 +142,10 @@ class Translator
*/
virtual QCString getLanguageString() = 0;

/** add punctuation at the end of a brief description when needed and supported by the language */
virtual inline bool needsPunctuation() {return true;}
/**
* add punctuation at the end of a brief description when needed and supported by the language
*/
virtual bool needsPunctuation() { return true; }

// --- Language translation methods -------------------

Expand Down
2 changes: 1 addition & 1 deletion src/translator_cn.h
Expand Up @@ -75,7 +75,7 @@ class TranslatorChinese : public Translator
{
return "\\end{CJK}\n";
}
virtual inline bool needsPunctuation()
virtual bool needsPunctuation()
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/translator_jp.h
Expand Up @@ -99,7 +99,7 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
{
return "\\end{CJK}\n";
}
virtual inline bool needsPunctuation()
virtual bool needsPunctuation()
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/translator_kr.h
Expand Up @@ -102,7 +102,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
{
return "0x412 Korean";
}
virtual inline bool needsPunctuation()
virtual bool needsPunctuation()
{
return false;
}
Expand Down

0 comments on commit 8e0e2cc

Please sign in to comment.