diff options
Diffstat (limited to 'src/doctokenizer.l')
-rw-r--r-- | src/doctokenizer.l | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 3118cfd..5cd97a8 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -41,6 +41,8 @@ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 + +#define TK_COMMAND_SEL() (yytext[0] == '@' ? TK_COMMAND_AT : TK_COMMAND_BS) //-------------------------------------------------------------------------- @@ -116,12 +118,13 @@ const char *tokToString(int token) case TK_WHITESPACE: return "TK_WHITESPACE"; case TK_LISTITEM: return "TK_LISTITEM"; case TK_ENDLIST: return "TK_ENDLIST"; - case TK_COMMAND: return "TK_COMMAND"; + case TK_COMMAND_AT: return "TK_COMMAND_AT"; case TK_HTMLTAG: return "TK_HTMLTAG"; case TK_SYMBOL: return "TK_SYMBOL"; case TK_NEWPARA: return "TK_NEWPARA"; case TK_RCSTAG: return "TK_RCSTAG"; case TK_URL: return "TK_URL"; + case TK_COMMAND_BS: return "TK_COMMAND_BS"; } return "ERROR"; } @@ -558,11 +561,11 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} } <St_Para>"{"{BLANK}*"@link"/{BLANK}+ { g_token->name = "javalink"; - return TK_COMMAND; + return TK_COMMAND_AT; } <St_Para>"{"{BLANK}*"@inheritDoc"{BLANK}*"}" { g_token->name = "inheritdoc"; - return TK_COMMAND; + return TK_COMMAND_AT; } <St_Para>"@_fakenl" { // artificial new line yylineno++; @@ -572,14 +575,14 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} bool ok; g_token->id = QCString(yytext).right((int)yyleng-6).toInt(&ok); ASSERT(ok); - return TK_COMMAND; + return TK_COMMAND_SEL(); } <St_Para>{CMD}"n"\n { /* \n followed by real newline */ yylineno++; g_token->name = yytext+1; g_token->name = g_token->name.stripWhiteSpace(); g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return TK_COMMAND_SEL(); } <St_Para>{SPCMD1} | <St_Para>{SPCMD2} | @@ -587,7 +590,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->name = yytext+1; g_token->name = g_token->name.stripWhiteSpace(); g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return TK_COMMAND_SEL(); } <St_Para>{PARAMIO} { /* param [in,out] command */ g_token->name = "param"; @@ -613,7 +616,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} { g_token->paramDir=TokenInfo::Unspecified; } - return TK_COMMAND; + return TK_COMMAND_SEL(); } <St_Para>("http:"|"https:"|"ftp:"|"file:"|"news:"){URLMASK}/\. { // URL. g_token->name=yytext; @@ -733,7 +736,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} } <St_Text>[\\@<>&$#%~] { g_token->name = yytext; - return TK_COMMAND; + return TK_COMMAND_SEL(); } <St_Para>({BLANK}*\n)+{BLANK}*\n/{LISTITEM} { /* skip trailing paragraph followed by new list item */ if (g_insidePre || g_autoListLevel==0) @@ -926,7 +929,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} <St_TitleN>{SPCMD2} { /* special command */ g_token->name = yytext+1; g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return TK_COMMAND_SEL(); } <St_TitleN>{ID}"=" { /* attribute */ if (yytext[0]=='%') // strip % if present @@ -960,7 +963,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} <St_TitleQ>{SPCMD2} { /* special command */ g_token->name = yytext+1; g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return TK_COMMAND_SEL(); } <St_TitleQ>{WORD1NQ} | <St_TitleQ>{WORD2NQ} { /* word */ @@ -1091,7 +1094,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} <St_Ref2>{SPCMD2} { /* special command */ g_token->name = yytext+1; g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return TK_COMMAND_SEL(); } <St_Ref2>{WORD1NQ} | <St_Ref2>{WORD2NQ} { @@ -1323,7 +1326,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} <*>[\\@<>&$#%~"=] { /* unescaped special character */ //warn(g_fileName,yylineno,"Unexpected character `%s', assuming command \\%s was meant.",yytext,yytext); g_token->name = yytext; - return TK_COMMAND; + return TK_COMMAND_SEL(); } <*>. { warn(g_fileName,yylineno,"Unexpected character `%s'",yytext); |