mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Define an errorSyntax helper constructor.
This commit is contained in:
parent
0d08387684
commit
16dc1b62a7
@ -76,5 +76,8 @@ data Error a = Error { errorCallStack :: [([Char], SrcLoc)], errorExpected :: [S
|
||||
instance Eq1 Error where liftEq = genericLiftEq
|
||||
instance Show1 Error where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
errorSyntax :: Error.Error String -> Error a
|
||||
errorSyntax Error.Error{..} = Error (getCallStack callStack) errorExpected errorActual []
|
||||
|
||||
unError :: HasCallStack => Span -> Error a -> Error.Error String
|
||||
unError span Error{..} = Error.withCallStack (fromCallSiteList errorCallStack) (Error.Error span errorExpected errorActual)
|
||||
|
Loading…
Reference in New Issue
Block a user