summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Scanner
Commit message (Collapse)AuthorAgeFilesLines
* Improve building of docs using Py3 [ci skip]Mats Wichmann2019-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | * context managers on file r/w + use shutil.copy where it makes sense. * lxml wants (demands?) that xml files be processed as bytes * for the phase where we gen the entity files, read as text anyway * Need to solve a problem where the generated xml is putting the \n in literally, not evaluating it. * Fix some examples broken for py3 * Fix more octal constant instances * Cleanups suggested by PyCharm: staticmethods, two blanks before class definition, others. This addresses issues called out in #3300, but is not a complete solution because the actual doc build step still fails with the epydoc failures (which aren't directly because of Py3; epydoc build doesn't work any better on my system with Py3, even with the forked version with patches). Signed-off-by: Mats Wichmann <mats@linux.com>
* LaTeX scanner: Remove obsolete commentLukas Schrangl2019-07-031-7/+0
| | | | | The comment referred to the "old" regular expression that would only find the last include in each line.
* LaTeX scanner: Find > 1 includes per lineLukas Schrangl2019-07-022-1/+16
| | | | | | | | "^[^%\n]*" at the beginning of the reg ex would match all but the last include so that they were lost. There is no point checking for "%" since comments are stripped anyways, so just remove that part. Also add test case for multiple includes per line.
* Use more idiomatic PythonMats Wichmann2019-06-061-3/+3
| | | | | | | | Minor: replace an instance of "for i in range(len(foo))" with the now preferred "for i in foo". This change didn't naturally fit with any of the other instances of this usage, so is submitted by itself. Signed-off-by: Mats Wichmann <mats@linux.com>
* Fix some regexes for Python 3.8 complaintsMats Wichmann2019-05-133-3/+3
| | | | | | | | | | | Regexes that contained unescaped backslashes and were not listed in raw string form caused one more test failure when Python 3.8 was experimentally turned on in the Travis CI build. Also one utility script had the same, not affecting tests - found through inspection. Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge pull request #3345 from mwichmann/py38warns4-testsWilliam Deegan2019-04-281-3/+3
|\ | | | | [wip] Py38warns4 tests
| * [PY 3.8] test fixes for file closings, rawstringsMats Wichmann2019-04-251-3/+3
| | | | | | | | | | | | | | On a linux host (missing some things that may be on the Travis CI setup), Py3.8a3 now shows 19 fails, 1048 pass, with 84 Warning: messages. Signed-off-by: Mats Wichmann <mats@linux.com>
* | Merge pull request #3360 from mwichmann/isnotWilliam Deegan2019-04-281-1/+1
|\ \ | | | | | | Some more lint-derived cleanups
| * | Some more lint-derived cleanupsMats Wichmann2019-04-271-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | Consistently use "not is" and "not in", many instances used the form "not x is y" instead, which pylint objected to. A couple of bare except clauses got a qualifier. Files otherwise touched had trailing whitespace cleaned up as well. These are all things that sider would complain about if a change happened nearby, so this is pre-emptive. Signed-off-by: Mats Wichmann <mats@linux.com>
* | Merge pull request #3359 from bdbaddog/fortran_issue_3135William Deegan2019-04-272-82/+89
|\ \ | |/ |/| Fix Issue #3135 - Type Bound procedures in Fortran submodules
| * Also ignore PURE and ELEMENTAL after MODULE in Scanner and Emitter.Peter Diener2019-04-261-5/+8
| | | | | | | | | | | | | | | | | | | | Add subroutines that are declared pure and elemental to the test of the Emitter. Note that in test_1.f90, the interface is repeated in the submodule, whereas in test_2.f90 the interface is taken from the module. Also note that the regex does not check whether "module pure" or "module elemental" is actually followed by "subroutine" or "function". This would be a syntax error and should trigger a compile time error.
| * Fix Issue #3135 - Also add tests to check that emitter is properly ↵William Deegan2019-04-251-3/+4
| | | | | | | | processing interface module declarations
| * PEP8 plus switch to unittest.main() when running directlyWilliam Deegan2019-04-251-71/+69
| |
| * Use raw strings in regexes.Peter Diener2019-03-061-3/+3
| |
| * Fix issue #3135.Peter Diener2019-03-041-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes issue #3135 regarding the issue with using type bound procedures in Fortran submodules. The fix consists of changing the regex used in the scanner and the emitter to ignore lines starting with: module subroutine and module function as these are used to define type bound procedures instead of modules named 'subroutine' or 'function'. The regex is case insensitive.
* | Clean up some file opens, regex stringsMats Wichmann2019-03-072-6/+6
|/ | | | | | | | | | | | | | | | | | Most recent Python (3.8 alpha) spews warnings aplenty about two subjects: unclosed files and strings which look like they have embedded escapes that Python does not recognize. The latter are usually regexes, and it provides a reminder that regular expressions should normally be specified as raw strings, so Python does not attempt to interpret them. Irritating is that even docstrings are flagged, it's not obvious what the right answer is for a docstring which contains, say, a Windows-style path with backslashes. This converts a bunch of opens that are not closed into context manager usage and regex patterns into raw strings. This eliminate about 4000 warnings spewed by Py3.8 (9200 remain). Signed-off-by: Mats Wichmann <mats@linux.com>
* A few syntax cleanupsMats Wichmann2018-10-032-9/+9
| | | | | | | | | | | | | | | | | | | | | Suggested by PyCharm. Includes three "real" changes: 1. src/engine/SCons/Node/__init__.py has a print statement in a function which references 'self', but there is no 'self' defined (it is not a method in a class). Guessing it should have been 'node'. 2. src/engine/SCons/Environment.py makes a call using 'kwbd' which is not defined, looks like a copy-paste error and should be 'bd'. 3. src/engine/SCons/Tool/JavaCommon.py splits 'file', which is not defined, was evidently supposed to be 'fn'. These should be double-checked. The rest are purely syntax: whitespace, dropping trailing semicolons, using "is" to test for None, simplifying comparisons, normalizing docstring commenting ("always triple double quotes"), unneeded backslashes. Signed-off-by: Mats Wichmann <mats@linux.com>
* Stop using deprecated unittest assertsMats Wichmann2018-09-257-32/+32
| | | | | | | | | failUnless and failIf have been deprecated since 2.7 and 3.1, the docs call them aliases that exist for historical reasons. In Python 3.7, the default DeprecationWarnings make things very noisy, so flip these to assertTrue and assertFalse. Signed-off-by: Mats Wichmann <mats@linux.com>
* Replace usage of unittest.TestSuite with unittest.main()Hao Wu2018-07-125-31/+5
|
* Replace all instances of `int main()` with `int main(void)`Jonathon Reinhart2018-02-112-10/+10
|
* Fix many epydoc warningsWilliam Deegan2017-09-012-10/+18
|
* Remove ancient Aegis revision control system filesJane Doe2017-05-301-5/+0
|
* PY2/3 For msvc resource scanning, ensure we don't try to scan .tlb files ↵William Deegan2017-05-263-18/+64
| | | | which are binary. This worked fine on py2 because all strings are bytes, but failed on py3 because it wasn't valid unicode. Also fixed issue where the Classic scanner was hardcoding recursive to be 1 and not propagating any such parameter passed to its constructor. Added test for changes to Classic Scanner
* py2/3 Remove pdf from list of files to scan. This was causing errors as the ↵William Deegan2017-04-061-1/+4
| | | | binary files can't be regexed with strings on py3. A more complete solution may be called for as it likely doesn't make sense to try to scan: '.png', '.jpg', '.gif', '.tif' files either.
* When iterating over dict.items(), we do not need a new list.Craig Rodrigues2017-03-121-2/+2
|
* Replace list(filter()) with list comprehension.Craig Rodrigues2017-03-111-1/+1
|
* Merged in ricklupton/scons (pull request #374)William Deegan2016-11-252-31/+82
|\ | | | | | | Find dependencies using LaTeX "import" package commands (updated)
| * Find dependencies using LaTeX "import" package commandsRick Lupton2016-11-232-31/+82
| | | | | | | | | | | | The import package adds new commands for including files, similar to \input and \include, but with better handling of subdirectories. These changes extend the LaTeX Scanner to look for these commands.
* | Fixes for str/bytes in Scanners: resolves ~150 tests.William Blevins2016-10-021-2/+2
| |
* | Revert src/engine/SCons/Scanner/Fortran.py changes.William Blevins2016-09-241-6/+6
| |
* | Initial python3 cut of test/Fortran.William Blevins2016-09-231-6/+6
| |
* | Futurize stage 2 2to3 fixes only.William Blevins2016-09-201-2/+2
|/
* Updated selective test to remove impurity from a selection rename.William Blevins2016-08-121-1/+1
|
* Added multiline support test.William Blevins2016-08-121-0/+11
|
* Issue 1924: Updated D Language scanner support.William Blevins2016-08-112-8/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meets DLang specification 2.071.1 accessed 11 August 2016. URL: https://dlang.org/spec/module.html ImportDeclaration: import ImportList ; static import ImportList ; ImportList: Import ImportBindings Import , ImportList Import: ModuleFullyQualifiedName ModuleAliasIdentifier = ModuleFullyQualifiedName ImportBindings: Import : ImportBindList ImportBindList: ImportBind ImportBind , ImportBindList ImportBind: Identifier Identifier = Identifier ModuleAliasIdentifier: Identifier
* wrap several frequently-used open() calls in with statementsDaniel Holth2016-06-151-3/+2
|
* Post merge commit for safety. Building Fortran code works, but tests fail.Russel Winder2015-12-2410-33/+119
|\
| * removed several pre-2.7 methods and imports, including some basic refactoringsDirk Baechle2015-12-103-3/+3
| |
| * Issue 2264: Added cross-language scanner support.William Blevins2015-05-171-0/+45
| |
| * - switching Node class and NodeInfo/Binfo to using slotsDirk Baechle2015-02-264-19/+22
| | | | | | | | - memoizer subsystem now uses decorators instead of the metaclass approach
| * Add comment for a case where LIBS (or part of it) is an objectAlexey Klimkin2015-01-271-0/+1
| |
| * Improve readability of LIB substitution codeAlexey Klimkin2015-01-202-16/+17
| |
| * Fix incomplete LIBS flattening and substitution in Program scannerAlexey Klimkin2015-01-142-3/+39
| |
* | Merged with [default]Stefan Zimmermann2014-03-319-39/+32
|\ \ | |/
| * Switch unit tests to configurable runneranatoly techtonik2014-03-218-37/+30
| |
| * - added doc editor configuration for XXE5Dirk Baechle2014-01-191-2/+2
| | | | | | | | | | - added missing icons for XXE4 - adapted schema location, such that the validation works properly in SernaFree and XXE
* | More __cmp__ to __eq__ (and __lt__). Resolved some UnboundLocalErrors after ↵Stefan Zimmermann2014-03-312-4/+4
| | | | | | | | except.
* | Made former 2to3 changes Python 2.7 compatible (or removed unneeded changes).Stefan Zimmermann2014-03-316-11/+8
| |
* | fix for cpp scanner (maybe)ndbecker22013-09-091-1/+2
| | | | | | | | (transplanted from c68b1a5da5ad47befc3a7e802d8ae23372f0e1a8)
* | Manual python3 post-2to3 fixes from Neal BeckerGary Oberbrunner2013-09-221-1/+1
| |