mirror of
https://github.com/github/semantic.git
synced 2024-12-23 23:11:50 +03:00
Define a Rose tree type.
This commit is contained in:
parent
c0578deeca
commit
2477035b9d
@ -32,6 +32,9 @@ import Text.Parser.TreeSitter.TypeScript
|
|||||||
|
|
||||||
data ParseTreeFile = ParseTreeFile { parseTreeFilePath :: FilePath, node :: ParseNode } deriving (Show)
|
data ParseTreeFile = ParseTreeFile { parseTreeFilePath :: FilePath, node :: ParseNode } deriving (Show)
|
||||||
|
|
||||||
|
data Rose a = Rose a [Rose a]
|
||||||
|
deriving (Eq, Show)
|
||||||
|
|
||||||
instance ToJSON ParseTreeFile where
|
instance ToJSON ParseTreeFile where
|
||||||
toJSON ParseTreeFile{..} = object [ "filePath" .= parseTreeFilePath, "programNode" .= node ]
|
toJSON ParseTreeFile{..} = object [ "filePath" .= parseTreeFilePath, "programNode" .= node ]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user