summaryrefslogtreecommitdiff
path: root/doc/user/scanners.xml
diff options
context:
space:
mode:
authorLuca Falavigna <dktrkranz@debian.org>2011-09-10 11:25:54 +0200
committerLuca Falavigna <dktrkranz@debian.org>2011-09-10 11:25:54 +0200
commitf920539cfcaf32813d390bfa501a08ea8bf8ec89 (patch)
tree1b8d1d57e9b38d43d01c28521c2e34aff743adb5 /doc/user/scanners.xml
parentf9b265b27769aff6cff204cea5402d69ead3dda0 (diff)
parentba4425ab5227fd9597fccd368bffff6bf1032149 (diff)
Merge commit 'upstream/2.1.0'
Diffstat (limited to 'doc/user/scanners.xml')
-rw-r--r--doc/user/scanners.xml17
1 files changed, 14 insertions, 3 deletions
diff --git a/doc/user/scanners.xml b/doc/user/scanners.xml
index 2aba7d2..7862265 100644
--- a/doc/user/scanners.xml
+++ b/doc/user/scanners.xml
@@ -1,6 +1,6 @@
<!--
- Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
+ Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -171,10 +171,21 @@ over the file scanning rather than being called for each input line:
def kfile_scan(node, env, path, arg):
contents = node.get_text_contents()
- return include_re.findall(contents)
+ return env.File(include_re.findall(contents))
</programlisting>
<para>
+
+ It is important to note that you
+ have to return a list of File nodes from the scanner function, simple
+ strings for the file names won't do. As in the examples we are showing here,
+ you can use the &File;
+ function of your current Environment in order to create nodes on the fly from
+ a sequence of file names with relative paths.
+
+ </para>
+
+ <para>
The scanner function must
accept the four specified arguments
@@ -282,7 +293,7 @@ over the file scanning rather than being called for each input line:
def kfile_scan(node, env, path):
contents = node.get_text_contents()
includes = include_re.findall(contents)
- return includes
+ return env.File(includes)
kscan = Scanner(function = kfile_scan,
skeys = ['.k'])