aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-05-15 13:28:46 +0000
committersimonmar <unknown>2002-05-15 13:28:46 +0000
commit5665f31a78a44626dc0d622eb8ef814da9e44007 (patch)
tree8272f6b28a878f8e857c3a3f32bdf00a328c53e7
parentb0b1f89f48ab02ad2542d2fab476dc8b09bbf2b8 (diff)
[haddock @ 2002-05-15 13:28:46 by simonmar]
Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson.
-rw-r--r--src/HsLexer.lhs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/HsLexer.lhs b/src/HsLexer.lhs
index c6026b67..fb4447d3 100644
--- a/src/HsLexer.lhs
+++ b/src/HsLexer.lhs
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------------
--- $Id: HsLexer.lhs,v 1.9 2002/05/15 13:03:02 simonmar Exp $
+-- $Id: HsLexer.lhs,v 1.10 2002/05/15 13:28:46 simonmar Exp $
--
-- (c) The GHC Team, 1997-2000
--
@@ -482,6 +482,7 @@ lexString cont s loc y x = loop "" s x y
'\\':c:s | isSpace c -> stringGap e s (x+2) y
| otherwise -> (escapeChar (c:s) `thenP` \(e',s,i) _ _ _ _ ->
loop (e':e) s (x+i) y) s loc y x
+ '\"':'#':s -> cont (PrimString (reverse e)) s loc y (x+2)
'\"':s{-"-} -> cont (StringTok (reverse e)) s loc y (x+1)
c:s -> loop (c:e) s (x+1) y
[] -> parseError "Improperly terminated string" s loc y x