Ticket #1165: quote.jam

File quote.jam, 402 bytes (added by Steven Watanabe, 15 years ago)
Line 
1# quote.jam
2#
3# Copyright (c) 2007
4# Steven Watanabe
5#
6# Distributed under the Boost Software License, Version 1.0. (See
7# accompanying file LICENSE_1_0.txt or copy at
8# http://www.boost.org/LICENSE_1_0.txt
9
10import regex ;
11
12rule quote_string ( string )
13{
14 if ( [ regex.match (\".*\") : $(string) : 1 ] )
15 {
16 return $(string) ;
17 }
18 else
19 {
20 return \"$(string)\" ;
21 }
22}