Modify toArgs to parse quotes/escapes like /bin/sh
authorrjmccall@gmail.com <unknown>
Sun, 17 Sep 2006 00:36:41 +0000 (00:36 +0000)
committerrjmccall@gmail.com <unknown>
Sun, 17 Sep 2006 00:36:41 +0000 (00:36 +0000)
commit3d9f1290f071b0d2e48060a160995af7608d1045
treea1ed8f614bd426f97d303eeb2ca5fdea526bc912
parent28a0d04ee6650069e7912ea69d37376323dab17b
Modify toArgs to parse quotes/escapes like /bin/sh
Addresses ticket #197, which asks for escape sequences to be supported directly (i.e.
not only in dquoted strings) on :load commands in GHCI.  Fix modifies the toArgs
function to parse its input like /bin/sh does, i.e. recognizing escapes anywhere
and treating quoted strings as atomic chunks.  Thus:
  :load a\ b c\"d e" "f
would parse with three arguments, namely 'a b', 'c"d', and 'e f'.

toArgs is used to parse arguments for both :load and :main, but doesn't appear to
be used elsewhere.  I see no harm in modifying both to be consistent -- in fact,
the functionality is probably more useful for :main than for :load.
compiler/utils/Util.lhs