Permalink
Browse files

Bug 786409 - parsing error in Fortran file with preprocessing

Problem with ' (single quote) in Fortran. A string in Fortran can be between single or double quotes.
  • Loading branch information...
albert-github committed Aug 17, 2017
1 parent 0072ba5 commit 2f5e22a4be9d237a150d04659bf6abec1349fbd9
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/pre.l
View
@@ -1984,6 +1984,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
g_defArgsStr+=*yytext;
BEGIN(ReadString);
}
<FindDefineArgs>' {
if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran) REJECT;
g_defArgsStr+=*yytext;
BEGIN(ReadString);
}
<FindDefineArgs>\n {
g_defArgsStr+=' ';
g_yyLineNr++;
@@ -2014,6 +2019,12 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
g_defArgsStr+=*yytext;
BEGIN(FindDefineArgs);
}
<ReadString>"'" {
if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran) REJECT;
g_defArgsStr+=*yytext;
BEGIN(FindDefineArgs);
}
<ReadString>"//"|"/*" {
g_defArgsStr+=yytext;
}

0 comments on commit 2f5e22a

Please sign in to comment.