mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Don’t pass the debug flags to the renderers.
This commit is contained in:
parent
5267ff4bb5
commit
59735e5dac
@ -59,8 +59,8 @@ data ParseTreeRenderer fields output where
|
||||
resolveParseTreeRenderer :: (Monoid output, StringConv output ByteString) => ParseTreeRenderer fields output -> SourceBlob -> Term (Syntax Text) (Record fields) -> output
|
||||
resolveParseTreeRenderer renderer = case renderer of
|
||||
SExpressionParseTreeRenderer format -> R.sExpressionParseTree format
|
||||
JSONParseTreeRenderer debug -> R.jsonParseTree debug
|
||||
JSONIndexParseTreeRenderer debug -> R.jsonIndexParseTree debug
|
||||
JSONParseTreeRenderer debug -> R.jsonParseTree
|
||||
JSONIndexParseTreeRenderer debug -> R.jsonIndexParseTree
|
||||
|
||||
runParseTreeRenderer :: (Monoid output, StringConv output ByteString) => ParseTreeRenderer fields output -> [(SourceBlob, Term (Syntax Text) (Record fields))] -> output
|
||||
runParseTreeRenderer = foldMap . uncurry . resolveParseTreeRenderer
|
||||
|
@ -203,11 +203,11 @@ newtype Identifier = Identifier { unIdentifier :: Text }
|
||||
instance ToJSONFields Identifier where
|
||||
toJSONFields (Renderer.JSON.Identifier i) = ["identifier" .= i]
|
||||
|
||||
jsonParseTree :: ToJSONFields (Record fields) => Bool -> SourceBlob -> Term (Syntax Text) (Record fields) -> Value
|
||||
jsonParseTree _ SourceBlob{..} = toJSON . File path . decoratorWithAlgebra (fToR identifierAlg)
|
||||
jsonParseTree :: ToJSONFields (Record fields) => SourceBlob -> Term (Syntax Text) (Record fields) -> Value
|
||||
jsonParseTree SourceBlob{..} = toJSON . File path . decoratorWithAlgebra (fToR identifierAlg)
|
||||
|
||||
jsonIndexParseTree :: ToJSONFields (Record fields) => Bool -> SourceBlob -> Term (Syntax Text) (Record fields) -> Value
|
||||
jsonIndexParseTree _ SourceBlob{..} = toJSON . File path . fmap (object . toJSONFields) . cata combine . decoratorWithAlgebra (fToR identifierAlg)
|
||||
jsonIndexParseTree :: ToJSONFields (Record fields) => SourceBlob -> Term (Syntax Text) (Record fields) -> Value
|
||||
jsonIndexParseTree SourceBlob{..} = toJSON . File path . fmap (object . toJSONFields) . cata combine . decoratorWithAlgebra (fToR identifierAlg)
|
||||
where combine (a :< f) | Nothing <- rhead a = Prologue.concat f
|
||||
| Leaf _ <- f = Prologue.concat f
|
||||
| otherwise = a : Prologue.concat f
|
||||
|
Loading…
Reference in New Issue
Block a user