summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Scanner
diff options
context:
space:
mode:
authorRobert Managan <managan1@llnl.gov>2009-12-17 21:13:17 (GMT)
committerRobert Managan <managan1@llnl.gov>2009-12-17 21:13:17 (GMT)
commitc1c4c764c7bafc411829a532c32347b3cfa42c4d (patch)
tree38a8ceba86741cbef5ff8d4f36f861c28302f980 /src/engine/SCons/Scanner
parent5321587717ad0b13387570174a3a9b87d4b28cb2 (diff)
downloadSCons-c1c4c764c7bafc411829a532c32347b3cfa42c4d.zip
SCons-c1c4c764c7bafc411829a532c32347b3cfa42c4d.tar.gz
SCons-c1c4c764c7bafc411829a532c32347b3cfa42c4d.tar.bz2
Add scanning of files included in Latex by means of \lstinputlisting{}
Patch from Stefan Hepp.
Diffstat (limited to 'src/engine/SCons/Scanner')
-rw-r--r--src/engine/SCons/Scanner/LaTeX.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/engine/SCons/Scanner/LaTeX.py b/src/engine/SCons/Scanner/LaTeX.py
index 530c948..913812a 100644
--- a/src/engine/SCons/Scanner/LaTeX.py
+++ b/src/engine/SCons/Scanner/LaTeX.py
@@ -151,6 +151,7 @@ class LaTeX(SCons.Scanner.Base):
of the file being searched:
env['TEXINPUTS'] for "input" and "include" keywords
env['TEXINPUTS'] for "includegraphics" keyword
+ env['TEXINPUTS'] for "lstinputlisting" keyword
env['BIBINPUTS'] for "bibliography" keyword
env['BSTINPUTS'] for "bibliographystyle" keyword
@@ -162,7 +163,8 @@ class LaTeX(SCons.Scanner.Base):
'includegraphics': 'TEXINPUTS',
'bibliography': 'BIBINPUTS',
'bibliographystyle': 'BSTINPUTS',
- 'usepackage': 'TEXINPUTS'}
+ 'usepackage': 'TEXINPUTS',
+ 'lstinputlisting': 'TEXINPUTS'}
env_variables = SCons.Util.unique(keyword_paths.values())
def __init__(self, name, suffixes, graphics_extensions, *args, **kw):
@@ -172,7 +174,7 @@ class LaTeX(SCons.Scanner.Base):
# Without the \n, the ^ could match the beginning of a *previous*
# line followed by one or more newline characters (i.e. blank
# lines), interfering with a match on the next line.
- regex = r'^[^%\n]*\\(include|includegraphics(?:\[[^\]]+\])?|input|bibliography|usepackage){([^}]*)}'
+ regex = r'^[^%\n]*\\(include|includegraphics(?:\[[^\]]+\])?|lstinputlisting(?:\[[^\]]+\])?|input|bibliography|usepackage){([^}]*)}'
self.cre = re.compile(regex, re.M)
self.graphics_extensions = graphics_extensions