diff options
Diffstat (limited to 'doc/user/scanners.xml')
-rw-r--r-- | doc/user/scanners.xml | 17 |
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']) |