HasLocation
HasLocation
This commit is contained in:
@@ -17,7 +17,7 @@ module Rlp.Parse.Types
|
||||
, RlpToken(..), AlexInput(..), Position(..), spanFromPos, LexerAction
|
||||
, Located(..), PsName
|
||||
-- ** Lenses
|
||||
, aiPrevChar, aiSource, aiBytes, aiPos, posLine, posColumn
|
||||
, _TokenLitInt, aiPrevChar, aiSource, aiBytes, aiPos, posLine, posColumn
|
||||
|
||||
-- * Error handling
|
||||
, MsgEnvelope(..), RlpcError(..), RlpParseError(..)
|
||||
@@ -53,7 +53,7 @@ data RlpcPs
|
||||
|
||||
type instance NameP RlpcPs = PsName
|
||||
|
||||
type PsName = Text
|
||||
type PsName = Located Text
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@@ -125,6 +125,11 @@ data RlpToken
|
||||
| TokenEOF
|
||||
deriving (Show)
|
||||
|
||||
_TokenLitInt :: Prism' RlpToken Int
|
||||
_TokenLitInt = prism TokenLitInt $ \case
|
||||
TokenLitInt n -> Right n
|
||||
x -> Left x
|
||||
|
||||
newtype P a = P {
|
||||
runP :: ParseState
|
||||
-> (ParseState, [MsgEnvelope RlpParseError], Maybe a)
|
||||
|
||||
Reference in New Issue
Block a user