summaryrefslogtreecommitdiff
path: root/src/Language/Fiddle/GenericTree.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-10-03 01:58:23 -0600
committerJosh Rahm <joshuarahm@gmail.com>2024-10-03 01:58:23 -0600
commitfa32199f5ffc6405bd405e055051e11e85c80668 (patch)
tree87effa6909f7cc6f05782f818c01d0a983a620fb /src/Language/Fiddle/GenericTree.hs
parent719c8f8ed3d1e6337f27d3b9d5a033a4b63726b8 (diff)
downloadfiddle-fa32199f5ffc6405bd405e055051e11e85c80668.tar.gz
fiddle-fa32199f5ffc6405bd405e055051e11e85c80668.tar.bz2
fiddle-fa32199f5ffc6405bd405e055051e11e85c80668.zip
Another monolithic change. Not good git ettiquite.
Import statements are fully implemented including compiling to an interface file for faster compilations.
Diffstat (limited to 'src/Language/Fiddle/GenericTree.hs')
-rw-r--r--src/Language/Fiddle/GenericTree.hs25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/Language/Fiddle/GenericTree.hs b/src/Language/Fiddle/GenericTree.hs
index ef53e31..01549b7 100644
--- a/src/Language/Fiddle/GenericTree.hs
+++ b/src/Language/Fiddle/GenericTree.hs
@@ -33,7 +33,8 @@ type Context stage =
( Show (NumberType stage),
Typeable stage,
ToGenericSyntaxTreeValue (NumberType stage),
- Show (ImportInterface stage)
+ Show (ImportInterface stage),
+ Show (FiddleUnitInterface stage)
)
data GenericSyntaxTree f a where
@@ -79,17 +80,17 @@ instance (ToJSON a) => ToJSON (Commented a) where
toJSON (Commented comment a) =
object ["comment" .= comment, "annot" .= a]
-instance ToJSON SourceSpan where
- toJSON (SourceSpan start end) =
- object ["start" .= toJSON start, "end" .= toJSON end]
-
-instance ToJSON SourcePos where
- toJSON sourcePos =
- object
- [ "name" .= sourceName sourcePos,
- "row" .= sourceLine sourcePos,
- "col" .= sourceColumn sourcePos
- ]
+-- instance ToJSON SourceSpan where
+-- toJSON (SourceSpan start end) =
+-- object ["start" .= toJSON start, "end" .= toJSON end]
+--
+-- instance ToJSON SourcePos where
+-- toJSON sourcePos =
+-- object
+-- [ "name" .= sourceName sourcePos,
+-- "row" .= sourceLine sourcePos,
+-- "col" .= sourceColumn sourcePos
+-- ]
instance (Foldable f) => ToJSON (GenericSyntaxTree f (Maybe Value)) where
toJSON = \case