Commit Graph

11 Commits

Author SHA1 Message Date
Brad King d28da906fe cmFortranParser: Inject a newline at end-of-file when missing
Our parser grammar expects all statements to end in an `EOSTMT` token
such as a newline.  Ensure that the last statement in a file can be
parsed even if it is missing a newline.
2016-09-06 15:52:40 -04:00
Brad King e11cd31fa0 Fortran: Warn when dependency scanning fails to parse a source file
We expect to handle all relevant statements and ignore those that we do
not understand.  Warn if this process ever fails.  Otherwise dependency
information may be silently left out.
2016-09-06 15:40:04 -04:00
Daniel Pfeifer efed6468ed fix a load of include-what-you-use violations 2016-09-03 08:04:56 -04:00
Daniel Pfeifer 7b6349da4d CMake: don't use else after return 2016-08-18 20:36:29 +02:00
Daniel Pfeifer e7b842e189 Make sure unnused parameters are /*named*/ 2016-08-17 01:49:57 +02:00
Daniel Pfeifer 1d6909a287 use CM_NULLPTR 2016-06-28 09:02:26 -04:00
Kitware Robot d9fd2f5402 Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2016-05-16 16:05:19 -04:00
Brad King 0ac18d40c8 Remove `//------...` horizontal separator comments
Modern editors provide plenty of ways to visually separate functions.
Drop the explicit comments that previously served this purpose.
Use the following command to automate the change:

    $ git ls-files -z -- \
        "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" |
      egrep -z -v "^Source/cmCommandArgumentLexer\." |
      egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmDependsJavaLexer\." |
      egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmExprLexer\." |
      egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmFortranLexer\." |
      egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmListFileLexer\." |
      egrep -z -v "^Source/cm_sha2" |
      egrep -z -v "^Source/(kwsys|CursesDialog/form)/" |
      egrep -z -v "^Utilities/(KW|cm).*/" |
      xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}'

This avoids modifying third-party sources and generated sources.
2016-05-09 09:41:43 -04:00
Brad King f831d752ae cmFortranParser: Skip #line directives that do not name files
Since commit v3.5.0-rc1~241^2~1 (cmFortranParser: Parse #line
directives, 2015-11-02) our Fortran dependency scanner parses `#line`
directives to extract the named files.  However, some compilers produce
`#line` directives that name directories instead of files.  Work around
such cases by verifying that the extracted path names a file and not a
directory.
2016-04-05 12:59:45 -04:00
Brad King ba819f49df 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.
2015-11-02 15:29:52 -05:00
Brad King eebe732bb6 cmFortranParser: Factor out of cmDependsFortran
Move the main parser class and method implementations out of
cmDependsFortran.cxx and into separate source files.
2015-07-27 09:45:36 -04:00