mirror of
https://github.com/rgleichman/glance.git
synced 2024-08-17 02:40:28 +03:00
Add test for improper pattern nesting.
This commit is contained in:
parent
7f03bf54f5
commit
9fd08c7432
@ -46,7 +46,7 @@ parentTypeForNode n = case n of
|
||||
PatternApplyNode _ _ -> PatternParent
|
||||
-- The NotAParent case should never occur.
|
||||
_ -> NotAParent
|
||||
|
||||
|
||||
findParents :: ING.Graph gr => IngSyntaxGraph gr -> ING.Node -> [ING.Node]
|
||||
findParents graph node = filter parentFilter $ ING.suc graph node where
|
||||
parentFilter parentNode = parentNode /= node
|
||||
|
@ -6,6 +6,7 @@ import Prelude hiding (return)
|
||||
-- - an special case when translating when Glance is run on its own source code.
|
||||
import Diagrams.Prelude hiding ((#), (&))
|
||||
import Diagrams.Backend.SVG.CmdLine
|
||||
--import Diagrams.Backend.Rasterific.CmdLine
|
||||
import qualified Language.Haskell.Exts as Exts
|
||||
|
||||
import Icons(ColorStyle(..), colorScheme, multilineComment)
|
||||
|
@ -499,6 +499,7 @@ drawingFromDecl d = drawing
|
||||
evaluatedDecl = evalDecl mempty d >>= showTopLevelBinds
|
||||
syntaxGraph = evalState evaluatedDecl initialIdState
|
||||
drawing = collapseNodes $ syntaxGraphToFglGraph syntaxGraph
|
||||
--drawing = syntaxGraphToFglGraph syntaxGraph
|
||||
|
||||
-- Profiling: about 1.5% of total time.
|
||||
translateString :: String -> (IngSyntaxGraph FGR.Gr, Decl)
|
||||
|
@ -36,6 +36,7 @@ executable glance-exe
|
||||
, haskell-src-exts
|
||||
, mtl
|
||||
, semigroups
|
||||
, diagrams-rasterific
|
||||
default-language: Haskell2010
|
||||
Other-modules: Icons, Rendering, Types, Util, Translate, TranslateCore, DrawingColors, GraphAlgorithms
|
||||
|
||||
|
@ -236,7 +236,8 @@ nestedTests = [
|
||||
"Foo (Bar x) = 1",
|
||||
"Foo (Bar x) (Baz y) = 1",
|
||||
"Foo (Bar x) = f 2",
|
||||
"Foo (Bar x) = f x"
|
||||
"Foo (Bar x) = f x",
|
||||
"y x = case x of {Just w -> (let (z,_) = w in z)}"
|
||||
]
|
||||
|
||||
dollarTests :: [String]
|
||||
@ -519,7 +520,8 @@ collapseTestStrings = [
|
||||
"Foo x = 1",
|
||||
"Foo (Bar x) = 1",
|
||||
"Foo 1 x = 2",
|
||||
"Foo (Bar x) = f x"
|
||||
"Foo (Bar x) = f x",
|
||||
"y x = case x of {Just w -> (let (z,_) = w in z)}"
|
||||
]
|
||||
|
||||
makeCollapseTest :: String -> IO (Diagram B)
|
||||
|
Loading…
Reference in New Issue
Block a user