#
# " " [white space]
# "non-white-space" [without any dollar signs]
-# '"with-space-or-not"' [without any dollar signs]
# "$" [single dollar sign]
#
_dollar_exps_str = r'\$[\$\(\)]|\$[_a-zA-Z][\.\w]*|\${[^}]*}'
_dollar_exps = re.compile(r'(%s)' % _dollar_exps_str)
-_separate_args = re.compile(r'(%s|\s+|[^"\s\$]+|"[^"\$]+"|\$)' % _dollar_exps_str)
+_separate_args = re.compile(r'(%s|\s+|[^\s\$]+|\$)' % _dollar_exps_str)
# This regular expression is used to replace strings of multiple white
# space characters in the string result from the scons_subst() function.
else:
self.next_word()
else:
- if a[0] == '"' and a[-1] == '"':
- a = a[1:-1]
self.expand(a, lvars, within_list)
else:
self.expand(args, lvars, within_list)
MyNode("/bar/ack.cpp"),
MyNode("../foo/ack.c") ]
+ def _defines(defs):
+ l = []
+ for d in defs:
+ if SCons.Util.is_List(d) or type(d) is types.TupleType:
+ l.append(str(d[0]) + '=' + str(d[1]))
+ else:
+ l.append(str(d))
+ return l
+
loc = {
'xxx' : None,
'NEWLINE' : 'before\nafter',
# Test callable objects that don't match our calling arguments.
'CALLABLE' : TestCallable('callable-2'),
+
+ '_defines' : _defines,
+ 'DEFS' : [ ('Q1', '"q1"'), ('Q2', '"$AAA"') ],
}
env = DummyEnv(loc)
# Test callables that don't match our calling arguments.
'$CALLABLE', [['callable-2']],
+ # Test
+
# Test handling of quotes.
- 'aaa "bbb ccc" ddd', [['aaa', 'bbb ccc', 'ddd']],
+ # XXX Find a way to handle this in the future.
+ #'aaa "bbb ccc" ddd', [['aaa', 'bbb ccc', 'ddd']],
+
+ '${_defines(DEFS)}', [['Q1="q1"', 'Q2="a"']],
]
gvars = env.Dictionary()