diff options
-rwxr-xr-x | CHANGES.txt | 1 | ||||
-rwxr-xr-x | RELEASE.txt | 1 | ||||
-rw-r--r-- | SCons/Tool/lex.py | 2 | ||||
-rw-r--r-- | test/LEX/lex_headerfile.py | 44 | ||||
-rw-r--r-- | test/LEX/lex_headerfile/spaced path/SConstruct | 2 | ||||
-rw-r--r-- | test/LEX/lex_headerfile/spaced path/src/SConscript | 10 | ||||
-rw-r--r-- | test/LEX/lex_headerfile/spaced path/src/lexer.l | 1 | ||||
-rw-r--r-- | test/LEX/lex_headerfile/spaced path/src/lexer2.l | 1 |
8 files changed, 61 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 03692d6..efea669 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -116,6 +116,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER Note that these are called for every build command run by SCons. It could have considerable performance impact if not used carefully. to connect to the server during start up. + - Updated lex emitter to respect escaped spaces when climbing out of a the SCosncript dir From Mats Wichmann: - Tweak the way default site_scons paths on Windows are expressed to diff --git a/RELEASE.txt b/RELEASE.txt index cfa8afc..a393a36 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -134,6 +134,7 @@ FIXES - The system environment variable names imported for MSVC 7.0 and 6.0 were updated to be consistent with the variables names defined by their respective installers. This fixes an error caused when bypassing MSVC detection by specifying the MSVC 7.0 batch file directly. +- Updated lex emitter to respect escaped spaces when climbing out of a the SCosncript dir IMPROVEMENTS ------------ diff --git a/SCons/Tool/lex.py b/SCons/Tool/lex.py index d8d8de4..c33d0fa 100644 --- a/SCons/Tool/lex.py +++ b/SCons/Tool/lex.py @@ -58,7 +58,7 @@ def lexEmitter(target, source, env): # Different options that are used to trigger the creation of extra files. fileGenOptions = ["--header-file=", "--tables-file="] - lexflags = env.subst("$LEXFLAGS", target=target, source=source) + lexflags = env.subst_list("$LEXFLAGS", target=target, source=source) for option in SCons.Util.CLVar(lexflags): for fileGenOption in fileGenOptions: l = len(fileGenOption) diff --git a/test/LEX/lex_headerfile.py b/test/LEX/lex_headerfile.py new file mode 100644 index 0000000..c2e2e8b --- /dev/null +++ b/test/LEX/lex_headerfile.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python +# +# MIT License +# +# Copyright The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" +Test the headerfile option for lex tool. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.dir_fixture('lex_headerfile') + +test.run(chdir='spaced path', arguments='.') + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/LEX/lex_headerfile/spaced path/SConstruct b/test/LEX/lex_headerfile/spaced path/SConstruct new file mode 100644 index 0000000..aa4aca0 --- /dev/null +++ b/test/LEX/lex_headerfile/spaced path/SConstruct @@ -0,0 +1,2 @@ +DefaultEnvironment(tools=[]) +SConscript("src/SConscript")
\ No newline at end of file diff --git a/test/LEX/lex_headerfile/spaced path/src/SConscript b/test/LEX/lex_headerfile/spaced path/src/SConscript new file mode 100644 index 0000000..a3f4bfd --- /dev/null +++ b/test/LEX/lex_headerfile/spaced path/src/SConscript @@ -0,0 +1,10 @@ +env = Environment(tools=['lex']) + +def make_header_path(env, target, source, for_signature): + return target[1] + +env.Replace(LEX_HEADER_FILE_GEN=make_header_path) +env.Append(LEXFLAGS=['--header-file=$LEX_HEADER_FILE_GEN']) + +env.CFile(target=['#gen_src/lexer.c', '#gen_src/lexer.l.h'], source='lexer.l') +env.CFile(target=['#gen_src/lexer2.c', '#gen_src/lexer2.l.h'], source='lexer2.l')
\ No newline at end of file diff --git a/test/LEX/lex_headerfile/spaced path/src/lexer.l b/test/LEX/lex_headerfile/spaced path/src/lexer.l new file mode 100644 index 0000000..66b82a4 --- /dev/null +++ b/test/LEX/lex_headerfile/spaced path/src/lexer.l @@ -0,0 +1 @@ +%%
\ No newline at end of file diff --git a/test/LEX/lex_headerfile/spaced path/src/lexer2.l b/test/LEX/lex_headerfile/spaced path/src/lexer2.l new file mode 100644 index 0000000..66b82a4 --- /dev/null +++ b/test/LEX/lex_headerfile/spaced path/src/lexer2.l @@ -0,0 +1 @@ +%%
\ No newline at end of file |