From 80a9e0ac7e3754e12ea9003080f6e303887f906f Mon Sep 17 00:00:00 2001 From: qrczak Date: Thu, 1 Mar 2001 20:32:51 +0000 Subject: [PATCH] [project @ 2001-03-01 20:32:51 by qrczak] #{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 | 5 +++++ ghc/utils/hsc2hs/Main.hs | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ghc/docs/users_guide/utils.sgml b/ghc/docs/users_guide/utils.sgml index e3d45fe..5cc4033 100644 --- a/ghc/docs/users_guide/utils.sgml +++ b/ghc/docs/users_guide/utils.sgml @@ -243,6 +243,11 @@ tags: () [] {} '' "" /* */. Any character may be preceded by a backslash and will not be treated specially. + #{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. + Meanings of specific keys: diff --git a/ghc/utils/hsc2hs/Main.hs b/ghc/utils/hsc2hs/Main.hs index 6a18f83..58d31a0 100644 --- a/ghc/utils/hsc2hs/Main.hs +++ b/ghc/utils/hsc2hs/Main.hs @@ -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") -- 1.7.10.4