From 7679e59613dd45c326d7e1cdc35d364c9e90a5c1 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 7 May 2001 14:37:00 +0000 Subject: [PATCH] [project @ 2001-05-07 14:37:00 by simonmar] add setSrcLocP :: SrcLoc -> P a -> P a --- ghc/compiler/parser/Lex.lhs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/parser/Lex.lhs b/ghc/compiler/parser/Lex.lhs index faec03f..8172459 100644 --- a/ghc/compiler/parser/Lex.lhs +++ b/ghc/compiler/parser/Lex.lhs @@ -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) -- 1.7.10.4