sigh i'm gonna have to nuke the ast again in a month
This commit is contained in:
@@ -1,18 +1,25 @@
|
||||
module Rlp.Parse.Associate
|
||||
{-# WARNING "unimplemented" #-}
|
||||
( associate
|
||||
)
|
||||
where
|
||||
--------------------------------------------------------------------------------
|
||||
import Data.HashMap.Strict qualified as H
|
||||
import Data.Functor.Foldable
|
||||
import Data.Functor.Foldable.TH
|
||||
import Data.Functor.Const
|
||||
import Data.Functor
|
||||
import Data.Text qualified as T
|
||||
import Text.Printf
|
||||
import Lens.Micro
|
||||
import Rlp.Parse.Types
|
||||
import Rlp.Syntax
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
associate :: OpTable -> RlpExpr' RlpcPs -> RlpExpr' RlpcPs
|
||||
associate pt e = undefined
|
||||
associate :: OpTable -> Decl' RlpcPs -> Decl' RlpcPs
|
||||
associate _ p = p
|
||||
|
||||
{-# WARNING associate "unimplemented" #-}
|
||||
|
||||
examplePrecTable :: OpTable
|
||||
examplePrecTable = H.fromList
|
||||
|
||||
@@ -200,12 +200,11 @@ data Layout = Explicit
|
||||
type OpTable = H.HashMap Name OpInfo
|
||||
type OpInfo = (Assoc, Int)
|
||||
|
||||
-- data WithLocation a = WithLocation [String] a
|
||||
|
||||
data RlpParseError = RlpParErrOutOfBoundsPrecedence Int
|
||||
| RlpParErrDuplicateInfixD Name
|
||||
| RlpParErrLexical
|
||||
| RlpParErrUnexpectedToken RlpToken [String]
|
||||
| RlpParErrOther [Text]
|
||||
deriving (Show)
|
||||
|
||||
instance IsRlpcError RlpParseError where
|
||||
@@ -224,6 +223,8 @@ instance IsRlpcError RlpParseError where
|
||||
Text [ "Unexpected token " <> tshow t
|
||||
, "Expected: " <> tshow exp
|
||||
]
|
||||
RlpParErrOther ts ->
|
||||
Text ts
|
||||
where
|
||||
tshow :: (Show a) => a -> T.Text
|
||||
tshow = T.pack . show
|
||||
|
||||
Reference in New Issue
Block a user