diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2015-08-13 11:51:57 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2015-08-16 10:07:57 +0200 |
commit | 980ccb41e46df0c4909c3ac8f4c5a9a04661053f (patch) | |
tree | 8fe0639788d101ef479463d2b170fabde59f05da /src/Codec | |
parent | 32638a6ff1292360c1a59cc2f0a864cfea345cc6 (diff) | |
download | pesto-980ccb41e46df0c4909c3ac8f4c5a9a04661053f.tar.gz pesto-980ccb41e46df0c4909c3ac8f4c5a9a04661053f.tar.bz2 pesto-980ccb41e46df0c4909c3ac8f4c5a9a04661053f.zip |
Add linting information to dot output
Diffstat (limited to 'src/Codec')
-rw-r--r-- | src/Codec/Pesto.lhs | 1 | ||||
-rw-r--r-- | src/Codec/Pesto/Dot.lhs | 23 | ||||
-rw-r--r-- | src/Codec/Pesto/Lint.lhs | 3 |
3 files changed, 2 insertions, 25 deletions
diff --git a/src/Codec/Pesto.lhs b/src/Codec/Pesto.lhs index bf8e977..cf20105 100644 --- a/src/Codec/Pesto.lhs +++ b/src/Codec/Pesto.lhs @@ -233,7 +233,6 @@ See https://github.com/PromyLOPh/rezepte for example recipes. .. include:: Pesto/Parse.lhs .. include:: Pesto/Graph.lhs .. include:: Pesto/Lint.lhs -.. include:: Pesto/Dot.lhs .. include:: Pesto/Serialize.lhs Using this project diff --git a/src/Codec/Pesto/Dot.lhs b/src/Codec/Pesto/Dot.lhs deleted file mode 100644 index 89439e0..0000000 --- a/src/Codec/Pesto/Dot.lhs +++ /dev/null @@ -1,23 +0,0 @@ -Presentation ------------- - -.. class:: nodoc - -> module Codec.Pesto.Dot (toDot) where -> import Codec.Pesto.Serialize (serialize) - -Since each recipe is just a directed graph (digraph), we can use the dot -language to represent it as well. This in turnXXX can be transformed into an -image, for example. - -> toDot nodes edges = unlines $ ["digraph a {\nnode [fontname=\"Roboto Semi-Light\"];"] ++ n ++ e ++ ["}"] -> where -> f (a, b) = show a ++ " -> " ++ show b ++ ";" -> e = map f edges -> n = map (\(a, b) -> show a ++ " [label=\"" ++ dotEncodeString (serialize b) ++ "\"];") nodes - -> dotEncodeString = concatMap dotEncodeChar -> dotEncodeChar '\n' = "\\n" -> dotEncodeChar '"' = "\\\"" -> dotEncodeChar x = [x] - diff --git a/src/Codec/Pesto/Lint.lhs b/src/Codec/Pesto/Lint.lhs index ebeee44..ecfac79 100644 --- a/src/Codec/Pesto/Lint.lhs +++ b/src/Codec/Pesto/Lint.lhs @@ -7,7 +7,8 @@ Linting > , test > , parseMetadata > , extractMetadata -> , Metadata(..)) where +> , Metadata(..) +> , LintResult(..)) where > import Test.HUnit hiding (test, Node) > import Data.List (sort, isPrefixOf) > import Control.Applicative ((<*>), (<$>), (*>)) |