[project @ 2001-03-01 20:32:51 by qrczak]
authorqrczak <unknown>
Thu, 1 Mar 2001 20:32:51 +0000 (20:32 +0000)
committerqrczak <unknown>
Thu, 1 Mar 2001 20:32:51 +0000 (20:32 +0000)
#{stuff} is equivalent to #stuff except that it's self-delimited and
thus needs not to be placed at the end of line or in some brackets.

ghc/docs/users_guide/utils.sgml
ghc/utils/hsc2hs/Main.hs

index e3d45fe..5cc4033 100644 (file)
@@ -243,6 +243,11 @@ tags:
       <literal>() [] {} '' "" /* */</literal>. Any character may be
       preceded by a backslash and will not be treated specially.</para>
 
+      <para<In addition <literal>#{stuff}</literal> is equivalent
+      to <literal>#stuff</literal> except that it's self-delimited
+      and thus needs not to be placed at the end of line or in some
+      brackets.</para>
+
       <para>Meanings of specific keys:</para>
 
       <variablelist>
index 6a18f83..58d31a0 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.22 2001/02/22 22:39:56 qrczak Exp $
+-- $Id: Main.hs,v 1.23 2001/03/01 20:32:51 qrczak Exp $
 --
 -- (originally "GlueHsc.hs" by Marcin 'Qrczak' Kowalczyk)
 --
@@ -22,7 +22,7 @@ import Char          (ord, intToDigit, isSpace, isAlpha, isAlphaNum, toUpper)
 import List          (intersperse)
 
 version :: String
-version = "hsc2hs-0.64"
+version = "hsc2hs-0.65"
 
 data Flag
     = Help
@@ -145,6 +145,15 @@ special = do
     pos <- getPosition
     char '#'
     skipMany (oneOf " \t")
+    keyArg pos <|> do
+        char '{'
+        skipMany (oneOf " \t")
+        sp <- keyArg pos
+        char '}'
+        return sp
+
+keyArg :: SourcePos -> Parser Token
+keyArg pos = do
     key <- liftM2 (:) (letter <|> char '_') (many (alphaNum <|> char '_'))
         <?> "hsc directive"
     skipMany (oneOf " \t")