summaryrefslogtreecommitdiff
path: root/src/pre.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/pre.l')
-rw-r--r--src/pre.l34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/pre.l b/src/pre.l
index 18f3b1d..e89a61c 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -454,7 +454,7 @@ static FileState *checkAndOpenFile(const QCString &fileName,bool &alreadyInclude
QFileInfo fi(fileName);
if (fi.exists() && fi.isFile())
{
- static QStrList &exclPatterns = Config_getList("EXCLUDE_PATTERNS");
+ static QStrList &exclPatterns = Config_getList(EXCLUDE_PATTERNS);
if (patternMatch(fi,&exclPatterns)) return 0;
QCString absName = fi.absFilePath().utf8();
@@ -1461,7 +1461,7 @@ static inline void outputArray(const char *a,int len)
static void readIncludeFile(const QCString &inc)
{
- static bool searchIncludes = Config_getBool("SEARCH_INCLUDES");
+ static bool searchIncludes = Config_getBool(SEARCH_INCLUDES);
uint i=0;
// find the start of the include file name
@@ -1507,7 +1507,7 @@ static void readIncludeFile(const QCString &inc)
}
else if (searchIncludes) // search in INCLUDE_PATH as well
{
- QStrList &includePath = Config_getList("INCLUDE_PATH");
+ QStrList &includePath = Config_getList(INCLUDE_PATH);
char *s=includePath.first();
while (s)
{
@@ -1737,6 +1737,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
%x SkipString
%x CopyLine
%x CopyString
+%x CopyStringFtn
%x Include
%x IncludeID
%x EndImport
@@ -1789,7 +1790,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
<Start>^{B}*[_A-Z][_A-Z0-9]+{B}*"("[^\(\)\n]*"("[^\)\n]*")"[^\)\n]*")"{B}*\n | // function list macro with one (...) argument, e.g. for K_GLOBAL_STATIC_WITH_ARGS
<Start>^{B}*[_A-Z][_A-Z0-9]+{B}*"("[^\)\n]*")"{B}*\n { // function like macro
- static bool skipFuncMacros = Config_getBool("SKIP_FUNCTION_MACROS");
+ static bool skipFuncMacros = Config_getBool(SKIP_FUNCTION_MACROS);
QCString name(yytext);
name=name.left(name.find('(')).stripWhiteSpace();
@@ -1850,6 +1851,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
outputChar(*yytext);
BEGIN( CopyString );
}
+<CopyLine>\' {
+ if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran) REJECT;
+ outputChar(*yytext);
+ BEGIN( CopyStringFtn );
+ }
<CopyString>[^\"\\\r\n]+ {
outputArray(yytext,(int)yyleng);
}
@@ -1860,6 +1866,16 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
outputChar(*yytext);
BEGIN( CopyLine );
}
+<CopyStringFtn>[^\'\\\r\n]+ {
+ outputArray(yytext,(int)yyleng);
+ }
+<CopyStringFtn>\\. {
+ outputArray(yytext,(int)yyleng);
+ }
+<CopyStringFtn>\' {
+ outputChar(*yytext);
+ BEGIN( CopyLine );
+ }
<CopyLine>{ID}/{BN}{0,80}"(" {
g_expectGuard = FALSE;
Define *def=0;
@@ -2454,7 +2470,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
outputArray(yytext,(int)yyleng);
}
<SkipCComment>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
- static bool markdownSupport = Config_getBool("MARKDOWN_SUPPORT");
+ static bool markdownSupport = Config_getBool(MARKDOWN_SUPPORT);
if (!markdownSupport)
{
REJECT;
@@ -2467,7 +2483,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
}
<SkipCComment>^({B}*"*"+)?{B}{0,3}"```"[`]* {
- static bool markdownSupport = Config_getBool("MARKDOWN_SUPPORT");
+ static bool markdownSupport = Config_getBool(MARKDOWN_SUPPORT);
if (!markdownSupport)
{
REJECT;
@@ -2999,8 +3015,8 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
//printf("##########################\n%s\n####################\n",
// input.data());
- g_macroExpansion = Config_getBool("MACRO_EXPANSION");
- g_expandOnlyPredef = Config_getBool("EXPAND_ONLY_PREDEF");
+ g_macroExpansion = Config_getBool(MACRO_EXPANSION);
+ g_expandOnlyPredef = Config_getBool(EXPAND_ONLY_PREDEF);
g_skip=FALSE;
g_curlyCount=0;
g_nospaces=FALSE;
@@ -3024,7 +3040,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
{
// add predefined macros
char *defStr;
- QStrList &predefList = Config_getList("PREDEFINED");
+ QStrList &predefList = Config_getList(PREDEFINED);
QStrListIterator sli(predefList);
for (sli.toFirst();(defStr=sli.current());++sli)
{