Converts the comments in a file.
2261{
2265 commentcnvYYlex_init_extra(&extra,&yyscanner);
2266#ifdef FLEX_DEBUG
2268#endif
2269 struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2270
2271 yyextra->inBufPos = 0;
2272 yyextra->col = 0;
2274 yyextra->skip = false;
2275 yyextra->fileName = fileName;
2277 yyextra->pythonDocString = false;
2278 yyextra->lineNr = 1;
2279 yyextra->raiseLevel = 0;
2280 yyextra->raiseLabel = "";
2281 yyextra->raiseIncrement = 0;
2282 yyextra->raisePrefix = "";
2283 yyextra->insertCppCommentMarker=false;
2284 yyextra->expandedAliases.clear();
2285 yyextra->replacements.clear();
2286 while (!yyextra->condStack.empty()) yyextra->condStack.pop();
2288 yyextra->vhdl = false;
2289
2291 yyextra->isFixedForm = false;
2292 if (yyextra->lang==SrcLangExt::Fortran)
2293 {
2296 }
2297
2298 if (yyextra->lang==SrcLangExt::Markdown)
2299 {
2300 yyextra->nestingCount=0;
2301 BEGIN(CComment);
2302 yyextra->commentStack.push(yyextra->lineNr);
2303 }
2304 else
2305 {
2306 BEGIN(Scan);
2307 }
2309 while (!yyextra->condStack.empty())
2310 {
2314 warn(yyextra->fileName,ctx.
lineNr,
"Conditional section{}does not have "
2315 "a corresponding \\endcond command within this file.",sectionInfo.data());
2316 yyextra->condStack.pop();
2317 }
2318 if (yyextra->nestingCount>0 && yyextra->lang!=SrcLangExt::Markdown && yyextra->lang!=SrcLangExt::Fortran)
2319 {
2321 bool first = true;
2322 while (!yyextra->commentStack.empty())
2323 {
2324 int lineNr = yyextra->commentStack.top();
2325 if (!first) lines += ", ";
2327 first = false;
2328 yyextra->commentStack.pop();
2329 }
2330 warn(yyextra->fileName,yyextra->lineNr,
"Reached end of file while still inside a (nested) comment. "
2331 "Nesting level {} (possible line reference(s): {})",yyextra->nestingCount,lines);
2332 }
2333 yyextra->nestingCount = 0;
2335 {
2337 "output=[\n{}]\n-----------\n",fileName,yyextra->outBuf
2338 );
2339 }
2340 commentcnvYYlex_destroy(yyscanner);
2341}
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
DString & setNum(short n)
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
static bool isFlagSet(const DebugMask mask)
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
#define Config_getBool(name)
const char * qPrint(const char *s)
bool recognizeFixedForm(const DString &contents, FortranFormat format)
FortranFormat convertFileNameFortranParserCode(const DString &fn)
#define warn(file, line, fmt,...)
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)