diff options
author | Brad King <brad.king@kitware.com> | 2015-11-02 20:29:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-11-02 20:29:52 (GMT) |
commit | ba819f49df33b546072a5928de3253770c4716b9 (patch) | |
tree | b281ef543d802a53a9c7a438947003a997401b8d /Source/cmFortranLexer.in.l | |
parent | 7748a02c3f7d028af13d4fc2c83e7181d11397e9 (diff) | |
download | CMake-ba819f49df33b546072a5928de3253770c4716b9.zip CMake-ba819f49df33b546072a5928de3253770c4716b9.tar.gz CMake-ba819f49df33b546072a5928de3253770c4716b9.tar.bz2 |
cmFortranParser: Parse #line directives
Teach the lexer to extract the #line directive prefix and line number as
a new token type. Teach the parser to recognize this token followed by
a string as the file name (plus possibly other content). Report the
named file as included by the source file.
Diffstat (limited to 'Source/cmFortranLexer.in.l')
-rw-r--r-- | Source/cmFortranLexer.in.l | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmFortranLexer.in.l b/Source/cmFortranLexer.in.l index 03fa90c..53984bb 100644 --- a/Source/cmFortranLexer.in.l +++ b/Source/cmFortranLexer.in.l @@ -1,7 +1,7 @@ %{ /*============================================================================ CMake - Cross Platform Makefile Generator - Copyright 2000-2009 Kitware, Inc., Insight Software Consortium + Copyright 2000-2015 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. @@ -116,6 +116,7 @@ Modify cmFortranLexer.h: !.*\n { return EOSTMT; } /* Treat comments like */ <fixed_fmt>^[cC*dD].*\n { return EOSTMT; } /* empty lines */ +^[ \t]*#([ \t]*line)?[ \t]*[0-9]+[ \t]* { return CPP_LINE_DIRECTIVE; } ^[ \t]*#[ \t]*include[ \t]*<[^>]+> { yytext[yyleng-1] = 0; yylvalp->string = strdup(strchr(yytext, '<')+1); |