summaryrefslogtreecommitdiffstats
path: root/Source/cmFortranParserImpl.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-5/+4
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-2/+2
|
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* Fortran: Support compilers using no module prefix on submodule filesWillem Deconinck2019-07-081-1/+7
| | | | | | | | | Define `CMAKE_Fortran_SUBMODULE_SEP` with an empty string to mean that the compiler uses no module prefix on its submodule files. Also add a default fallback to use the `.mod` extension when `CMAKE_Fortran_SUBMODULE_EXT` is not set. This is a better guess than no extension at all.
* Fortran: Fix submodule file names across compilersBrad King2019-02-141-1/+1
| | | | | | | | | The naming convention for submodule files varies across compilers. Add a table to the compiler information modules and thread the information through to the Fortran module dependency parser. Fill out the table for compiler ids known to support Fortran submodules. Fixes: #18746
* Fortran: Thread compiler id through to internal Fortran parserBrad King2019-02-141-2/+4
|
* Fortran: Factor out .mod and .smod file name constructionBrad King2019-02-141-6/+17
|
* clang-tidy: Pass by valueRegina Pfeifer2019-01-221-4/+5
|
* Fortran: Add support for submodule dependenciesBrad King2018-04-201-0/+44
| | | | | | | | | | | | | | | | | | | | | Since commit v3.7.0-rc1~73^2~1 (Fortran: Add support for submodule syntax in dependency scanning, 2016-09-05) we support parsing Fortran sources that use submodule syntax, but it left addition of `.smod` dependencies to future work. Add it now. The syntax submodule (module_name) submodule_name means the current source requires `module_name.mod` and provides `module_name@submodule_name.smod`. The syntax submodule (module_name:submodule_name) nested_submodule_name means the current source requires `module_name@submodule_name.smod` provides `module_name@nested_submodule_name.smod`. Fixes: #17017
* Fortran: Refactor to treat .mod extension as part of module nameBrad King2018-04-201-6/+19
| | | | | | When tracking module names internally, include the `.mod` extension. This will later be useful to distinguish them from `.smod` extensions for submodules.
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-3/+3
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-1/+1
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-3/+2
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Merge topic 'cstyle-casts'Daniel Pfeifer2017-08-301-1/+1
|\ | | | | | | | | | | | | 190e3825 Replace C-style casts Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1176
| * Replace C-style castsDaniel Pfeifer2017-08-271-1/+1
| |
* | IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+0
|/ | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-2/+2
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* cmFortranParserImpl: remove unnecessary includeDaniel Pfeifer2017-03-291-1/+0
|
* clang-tidy: apply modernize-use-bool-literals fixesDaniel Pfeifer2016-12-121-5/+5
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* cmFortranParser: Inject a newline at end-of-file when missingBrad King2016-09-061-2/+13
| | | | | | 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.
* Fortran: Warn when dependency scanning fails to parse a source fileBrad King2016-09-061-4/+2
| | | | | | 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.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-1/+8
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-27/+23
|
* Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-1/+1
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-2/+3
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-134/+84
| | | | | | | | | | | | | 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* cmFortranParser: Skip #line directives that do not name filesBrad King2016-04-051-1/+1
| | | | | | | | | 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.
* cmFortranParser: Parse #line directivesBrad King2015-11-021-0/+26
| | | | | | | 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.
* cmFortranParser: Factor out of cmDependsFortranBrad King2015-07-271-0/+408
Move the main parser class and method implementations out of cmDependsFortran.cxx and into separate source files.