1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-14 17:32:00 +03:00

[concrete] Add HasLoc for LiteralLoc

This commit is contained in:
Paul Cadman 2022-04-04 14:33:02 +01:00
parent b7ce2939f2
commit edcddcd3ce
2 changed files with 5 additions and 2 deletions

View File

@ -694,6 +694,9 @@ instance Pretty LiteralLoc where
instance Eq LiteralLoc where
l1 == l2 = _literalLocLiteral l1 == _literalLocLiteral l2
instance HasLoc LiteralLoc where
getLoc = _literalLocLoc
-- | Expressions without application
data ExpressionAtom (s :: Stage)
= AtomIdentifier (IdentifierType s)

View File

@ -13,7 +13,7 @@ import MiniJuvix.Syntax.Concrete.Scoped.Name.NameKind
import qualified MiniJuvix.Syntax.Concrete.Language as C
import MiniJuvix.Syntax.Fixity
import Prettyprinter
import MiniJuvix.Syntax.Concrete.Language (literalLocLoc, HasLoc)
import MiniJuvix.Syntax.Concrete.Language (HasLoc)
type FunctionName = Name
@ -203,7 +203,7 @@ instance HasLoc Expression where
ExpressionIden i -> C.getLoc i
ExpressionApplication a -> C.getLoc (a ^. appLeft)
ExpressionTyped t -> C.getLoc (t ^. typedExpression)
ExpressionLiteral l -> (l ^. literalLocLoc)
ExpressionLiteral l -> C.getLoc l
instance HasLoc Iden where
getLoc = \case