diff options
| author | hallgren <hallgren@chalmers.se> | 2012-03-18 20:12:26 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2012-03-18 20:12:26 +0000 |
| commit | 07af8988d3e42bf7e18c06cf8c9dabaa34c60578 (patch) | |
| tree | 165108cebfa23228f3483eb2dc0c9534c5d4c078 /src/runtime/haskell/PGF/VisualizeTree.hs | |
| parent | 771c1a0ad7a58e3d4832a93609958a8b3a44f84c (diff) | |
PGF run-time library: function names in BracketedString (experimental)
+ Make room for function names in the BracketedString data structure.
+ Fill in function names when linearizing an abstract syntax tree to a
BracketedString.
+ Fill in wildCId when it is not obvious what the function is.
+ Function bracketedLinearize: for compatibility with the other linearization
functions, return Leaf "" instead of error "cannot linearize".
+ Export flattenBracketedString from module PGF.
+ PGFServce: make function names available in the JSON representation of
BracketedString.
Diffstat (limited to 'src/runtime/haskell/PGF/VisualizeTree.hs')
| -rw-r--r-- | src/runtime/haskell/PGF/VisualizeTree.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/haskell/PGF/VisualizeTree.hs b/src/runtime/haskell/PGF/VisualizeTree.hs index 20fb6b925..6cc5e64eb 100644 --- a/src/runtime/haskell/PGF/VisualizeTree.hs +++ b/src/runtime/haskell/PGF/VisualizeTree.hs @@ -194,12 +194,12 @@ graphvizBracketedString = render . lin2tree getLeaves level parent bs = case bs of Leaf w -> [(level-1,parent,w)] - Bracket _ fid i _ bss -> concatMap (getLeaves (level+1) fid) bss + Bracket _ fid i _ _ bss -> concatMap (getLeaves (level+1) fid) bss getInterns level [] = [] getInterns level nodes = - nub [(level-1,parent,fid,showCId cat) | (parent,Bracket cat fid _ _ _) <- nodes] : - getInterns (level+1) [(fid,child) | (_,Bracket _ fid _ _ children) <- nodes, child <- children] + nub [(level-1,parent,fid,showCId cat) | (parent,Bracket cat fid _ _ _ _) <- nodes] : + getInterns (level+1) [(fid,child) | (_,Bracket _ fid _ _ _ children) <- nodes, child <- children] mkStruct l cs = struct l <> text "[label = \"" <> fields cs <> text "\"] ;" $$ vcat [link pl pid l id | (pl,pid,id,_) <- cs] @@ -247,7 +247,7 @@ genPreAlignment pgf langs = lin2align . linsBracketed getLeaves parent bs = case bs of Leaf w -> [(parent,w)] - Bracket _ fid _ _ bss -> concatMap (getLeaves fid) bss + Bracket _ fid _ _ _ bss -> concatMap (getLeaves fid) bss mkLayers (cs:css:rest) = let (lrest, rrest) = mkLayers (css:rest) in ((fields cs) : lrest, (map (mkLinks css) cs) : rrest) |
