[project @ 2001-05-07 14:37:00 by simonmar]
authorsimonmar <unknown>
Mon, 7 May 2001 14:37:00 +0000 (14:37 +0000)
committersimonmar <unknown>
Mon, 7 May 2001 14:37:00 +0000 (14:37 +0000)
add
setSrcLocP :: SrcLoc -> P a -> P a

ghc/compiler/parser/Lex.lhs

index faec03f..8172459 100644 (file)
@@ -27,7 +27,7 @@ module Lex (
        StringBuffer,
 
        P, thenP, thenP_, returnP, mapP, failP, failMsgP,
-       getSrcLocP, getSrcFile,
+       getSrcLocP, setSrcLocP, getSrcFile,
        layoutOn, layoutOff, pushContext, popContext
     ) where
 
@@ -1180,6 +1180,9 @@ lexError str buf s@PState{ loc = loc }
 getSrcLocP :: P SrcLoc
 getSrcLocP buf s@(PState{ loc = loc }) = POk s loc
 
+setSrcLocP :: SrcLoc -> P a -> P a
+setSrcLocP new_loc p buf s = p buf s{ loc=new_loc }
+
 getSrcFile :: P FAST_STRING
 getSrcFile buf s@(PState{ loc = loc }) = POk s (srcLocFile loc)