Skip to content

Commit

Permalink
Simplified the regular expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
doxygen committed Aug 10, 2021
1 parent 740451e commit 8ffb1a4
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/code.l
Expand Up @@ -270,7 +270,7 @@ static std::mutex g_usingDirectiveMutex;
B [ \t]
Bopt {B}*
BN [ \t\n\r]
ID "$"?[$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
SEP ("::"|"\\")
SCOPENAME ({SEP}{BN}*)?({ID}{BN}*{SEP}{BN}*)*("~"{BN}*)?{ID}
TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">"
Expand Down
2 changes: 1 addition & 1 deletion src/commentscan.l
Expand Up @@ -480,7 +480,7 @@ NW [^a-z_A-Z0-9]
FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+@&#]
FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+@&#]
FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
ID "$"?[$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
Expand Down
2 changes: 1 addition & 1 deletion src/declinfo.l
Expand Up @@ -85,7 +85,7 @@ static yy_size_t yyread(char *buf,yy_size_t max_size, yyscan_t yyscanner);

B [ \t]
Bopt {B}*
ID "$"?([$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)
ID ([$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)

%x Start
%x Template
Expand Down
2 changes: 1 addition & 1 deletion src/doctokenizer.l
Expand Up @@ -226,7 +226,7 @@ WS [ \t\r\n]
NONWS [^ \t\r\n]
BLANK [ \t\r]
BLANKopt {BLANK}*
ID "$"?[$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
PHPTYPE [\\:a-z_A-Z0-9\x80-\xFF\-]+
CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
Expand Down
2 changes: 1 addition & 1 deletion src/lexcode.l
Expand Up @@ -128,7 +128,7 @@ BN [ \t\n\r]
BL [ \t\r]*"\n"
B [ \t]
Bopt {B}*
ID "$"?[$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
PRE [pP][rR][eE]
CODE [cC][oO][dD][eE]
RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
Expand Down
2 changes: 1 addition & 1 deletion src/lexscanner.l
Expand Up @@ -126,7 +126,7 @@ BN [ \t\n\r]
BL [ \t\r]*"\n"
B [ \t]
Bopt {B}*
ID "$"?[$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
PRE [pP][rR][eE]
CODE [cC][oO][dD][eE]
RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
Expand Down
2 changes: 1 addition & 1 deletion src/scanner.l
Expand Up @@ -239,7 +239,7 @@ BNopt {BN}*
BL [ \t\r]*"\n"
B [ \t]
Bopt {B}*
ID "$"?[$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)(((~|!){BN}*)?{ID})
TSCOPE {ID}("<"[a-z_A-Z0-9 \t\*\&,:]*">")?
CSSCOPENAME (({ID}?{BN}*"."{BN}*)*)((~{BN}*)?{ID})
Expand Down
3 changes: 2 additions & 1 deletion src/util.cpp
Expand Up @@ -729,7 +729,8 @@ QCString removeRedundantWhiteSpace(const QCString &s)
{
*dst++=c;
break;
} // fallthrough
}
// else fallthrough
case '@': // '@name' -> ' @name'
case '\'': // ''name' -> '' name'
if (i>0 && i<l-1 && pc!='=' && pc!=':' && !isspace((uchar)pc) &&
Expand Down

0 comments on commit 8ffb1a4

Please sign in to comment.