Skip to content

Commit

Permalink
Merge pull request #254 from kbinani/language_switch_command
Browse files Browse the repository at this point in the history
Fix bug: language switch command skipped when langauge id contains "-" letter
  • Loading branch information
Dimitri van Heesch committed Dec 4, 2014
2 parents 33cdac2 + a4cf65d commit 540f0b6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commentscan.l
Expand Up @@ -1120,7 +1120,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
<Comment>{B}*("\\\\"|"@@")"f"[$\[{] { // escaped formula command
addOutput(yytext);
}
<Comment>{B}*{CMD}"~"[a-z_A-Z]* { // language switch command
<Comment>{B}*{CMD}"~"[a-z_A-Z-]* { // language switch command
QCString langId = QString(yytext).stripWhiteSpace().data()+2;
if (!langId.isEmpty() &&
qstricmp(Config_getEnum("OUTPUT_LANGUAGE"),langId)!=0)
Expand Down Expand Up @@ -2160,7 +2160,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"

/* ----- handle language specific sections ------- */

<SkipLang>[\\@]"~"[a-zA-Z]* { /* language switch */
<SkipLang>[\\@]"~"[a-zA-Z-]* { /* language switch */
QCString langId = &yytext[2];
if (langId.isEmpty() ||
qstricmp(Config_getEnum("OUTPUT_LANGUAGE"),langId)==0)
Expand Down
10 changes: 10 additions & 0 deletions testing/065/indexpage.xml
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="indexpage" kind="page">
<compoundname>index</compoundname>
<title>My Project</title>
<detaileddescription>
<para>これは日本語(en)です. Output for all languages. </para>
</detaileddescription>
</compounddef>
</doxygen>
12 changes: 12 additions & 0 deletions testing/065_tilde.dox
@@ -0,0 +1,12 @@
// objective: test \~ command with non default OUTPUT_LANGUAGE which contains '-' letter
// check: indexpage.xml
// config: OUTPUT_LANGUAGE = Japanese-en
/**
\mainpage
\~english This is English.
\~dutch Dit is Nederlands.
\~japanese これは日本語です.
\~japanese-en これは日本語(en)です.
\~german Dies ist Deutsch.
\~ Output for all languages.
*/

0 comments on commit 540f0b6

Please sign in to comment.