sigh i'm gonna have to nuke the ast again in a month

This commit is contained in:
crumbtoo
2024-02-07 18:52:19 -07:00
parent 2a51daf356
commit 80425a274c
5 changed files with 36 additions and 14 deletions

View File

@@ -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

View File

@@ -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