summaryrefslogtreecommitdiff
path: root/doc/user/scanners.in
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/scanners.in')
-rw-r--r--doc/user/scanners.in17
1 files changed, 14 insertions, 3 deletions
diff --git a/doc/user/scanners.in b/doc/user/scanners.in
index db3170a..e8bdff7 100644
--- a/doc/user/scanners.in
+++ b/doc/user/scanners.in
@@ -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
@@ -283,7 +294,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'])