diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index 52ca72751..4cb861e69 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -37,12 +37,17 @@ type Syntax = '[ , Literal.Tuple , Syntax.AllConstructors , Syntax.AnnotatedTypeVariable + , Syntax.App + , Syntax.ArithmeticSequence + , Syntax.BindPattern , Syntax.Class + , Syntax.ConstructorPattern , Syntax.ConstructorSymbol , Syntax.Context , Syntax.Context' , Syntax.DefaultDeclaration , Syntax.Deriving + , Syntax.Do , Syntax.Empty , Syntax.EntityIdentifier , Syntax.Error @@ -53,27 +58,39 @@ type Syntax = '[ , Syntax.FunctionType , Syntax.GADT , Syntax.GADTConstructor + , Syntax.Generator + , Syntax.HiddenImport , Syntax.Identifier + , Syntax.Import + , Syntax.ImportAlias + , Syntax.ImportDeclaration , Syntax.InfixOperatorPattern , Syntax.Kind , Syntax.KindFunctionType , Syntax.KindListType , Syntax.KindSignature + , Syntax.Lambda + , Syntax.ListComprehension , Syntax.ListConstructor , Syntax.Module , Syntax.ModuleExport , Syntax.NewType , Syntax.Operator + , Syntax.OperatorSection , Syntax.Pragma - , Syntax.QualifiedModuleIdentifier - , Syntax.QualifiedTypeConstructorIdentifier + , Syntax.PrefixNegation + , Syntax.QualifiedEntityIdentifier + , Syntax.QualifiedImportDeclaration , Syntax.QuotedName , Syntax.RecordDataConstructor , Syntax.ScopedTypeVariables + , Syntax.StandaloneDerivingInstance , Syntax.Star , Syntax.StrictType , Syntax.StrictTypeVariable + , Syntax.Tuple , Syntax.TupleConstructor + , Syntax.TuplePattern , Syntax.Type , Syntax.TypeConstructorExport , Syntax.TypePattern @@ -108,11 +125,28 @@ allConstructors = makeTerm <$> token AllConstructors <*> pure Syntax.AllConstruc annotatedTypeVariable :: Assignment annotatedTypeVariable = makeTerm <$> symbol AnnotatedTypeVariable <*> children (Syntax.AnnotatedTypeVariable <$> typeVariableIdentifier <* token Annotation <*> (kind <|> type')) +app :: Assignment +app = makeTerm <$> symbol FunctionApplication <*> children (Syntax.App <$> expression <*> expression) + +arithmeticSequence :: Assignment +arithmeticSequence = symbol ArithmeticSequence *> children ( enumFrom + <|> enumFromThen + <|> enumFromTo + <|> enumFromThenTo) + where + enumFrom = makeTerm <$> symbol EnumFrom <*> children (Syntax.EnumFrom <$> expression) + enumFromThen = makeTerm <$> symbol EnumFromThen <*> children (Syntax.EnumFromThen <$> expression <*> expression) + enumFromTo = makeTerm <$> symbol EnumFromTo <*> children (Syntax.EnumFromTo <$> expression <*> expression) + enumFromThenTo = makeTerm <$> symbol EnumFromThenTo <*> children (Syntax.EnumFromThenTo <$> expression <*> expression <*> expression) + +bindPattern :: Assignment +bindPattern = makeTerm <$> symbol BindPattern <*> children (Syntax.BindPattern <$> expression <*> expression) + character :: Assignment character = makeTerm <$> symbol Char <*> (Literal.Character <$> source) class' :: Assignment -class' = makeTerm <$> symbol Class <*> children (Syntax.Class <$> typeConstructor <*> typeParameters) +class' = makeTerm <$> symbol Class <*> children (Syntax.Class <$> manyTerm expression) comment :: Assignment comment = makeTerm <$> symbol Comment <*> (Comment.Comment <$> source) @@ -127,14 +161,17 @@ constructorIdentifier = makeTerm <$> symbol ConstructorIdentifier <*> (Syntax.Co constructorOperator :: Assignment constructorOperator = makeTerm <$> symbol ConstructorOperator <*> children (Syntax.ConstructorOperator <$> expression) +constructorPattern :: Assignment +constructorPattern = makeTerm <$> symbol ConstructorPattern <*> children (Syntax.ConstructorPattern <$> expressions) + constructorSymbol :: Assignment constructorSymbol = makeTerm <$> symbol ConstructorSymbol <*> (Syntax.ConstructorSymbol . Name.name <$> source) context' :: Assignment -context' = makeTerm <$> symbol Context <*> children (Syntax.Context' <$> manyTerm expression) +context' = makeTerm <$> symbol Context <*> children (Syntax.Context' <$> expressions) contextPattern :: Assignment -contextPattern = makeTerm <$> symbol ContextPattern <*> children (manyTerm expression) +contextPattern = symbol ContextPattern *> children expressions defaultDeclaration :: Assignment defaultDeclaration = makeTerm <$> symbol DefaultDeclaration <*> children (Syntax.DefaultDeclaration <$> manyTerm expression) @@ -142,6 +179,9 @@ defaultDeclaration = makeTerm <$> symbol DefaultDeclaration <*> children (Syntax derivingClause :: Assignment derivingClause = makeTerm <$> symbol Deriving <*> children (Syntax.Deriving <$> manyTerm typeConstructor) +do' :: Assignment +do' = makeTerm <$> symbol Do <*> children (Syntax.Do <$> manyTerm expression) + equalityConstraint :: Assignment equalityConstraint = makeTerm <$> symbol EqualityConstraint <*> children (Syntax.EqualityConstraint <$> equalityLhs <*> equalityRhs) where @@ -151,6 +191,9 @@ equalityConstraint = makeTerm <$> symbol EqualityConstraint <*> children (Syntax export :: Assignment export = makeTerm <$> symbol Export <*> children (Syntax.Export <$> expressions) +expression' :: Assignment +expression' = symbol Expression *> children expression + expressions :: Assignment expressions = makeTerm'' <$> location <*> manyTerm expression @@ -162,46 +205,73 @@ expressionChoices = [ algebraicDatatypeDeclaration , allConstructors , annotatedTypeVariable + , app + , arithmeticSequence + , bindPattern , character , comment , context' , contextPattern , constructorIdentifier , constructorOperator + , constructorPattern , constructorSymbol , defaultDeclaration , derivingClause + , do' , equalityConstraint + , expression' , float , functionConstructor , functionDeclaration , functionType , gadtConstructor , gadtDeclaration + , generator + , importAlias + , importDeclaration + , infixOperatorApp , infixOperatorPattern + , infixVariableIdentifier , integer , kind , kindSignature + , lambda , listConstructor + , listComprehension , listExpression , listType , moduleExport , moduleIdentifier , newType , operator + , operatorSection + , parenthesizedExpression + , parenthesizedPattern , parenthesizedTypePattern + , pattern' , pragma + , prefixNegation , primitiveConstructorIdentifier + , primitiveVariableIdentifier + , qualifiedConstructorIdentifier + , qualifiedImportDeclaration + , qualifiedInfixVariableIdentifier , qualifiedModuleIdentifier , qualifiedTypeConstructorIdentifier + , qualifiedVariableIdentifier , quotedName , scopedTypeVariables + , standaloneDerivingInstance , star , strictType , string + , tuple + , tuplePattern , tupleType , type' , type'' + , typeClassIdentifier , typePattern , typeConstructorExport , typeConstructorIdentifier @@ -270,9 +340,41 @@ gadtDeclaration = makeTerm where typeParameters' = makeTerm <$> location <*> manyTermsTill expression (symbol KindSignature <|> symbol Where') +generator :: Assignment +generator = makeTerm <$> symbol Generator <*> children (Syntax.Generator <$> expression <*> expression) + +hiddenImport :: Assignment +hiddenImport = makeTerm <$> symbol Import <*> children (Syntax.HiddenImport <$> expressions) + +hiddenImportSpec :: Assignment.Assignment [] Grammar [Term] +hiddenImportSpec = symbol HiddenImportSpec *> children (manyTerm hiddenImport) + +import' :: Assignment +import' = makeTerm <$> symbol Import <*> children (Syntax.Import <$> expressions) + +importAlias :: Assignment +importAlias = makeTerm <$> symbol ImportAlias <*> children (Syntax.ImportAlias <$> expression <*> expression) + +importDeclaration :: Assignment +importDeclaration = makeTerm + <$> symbol ImportDeclaration + <*> children (Syntax.ImportDeclaration + <$> (packageQualifiedImport <|> emptyTerm) + <*> expression + <*> (importSpec <|> hiddenImportSpec <|> pure [])) + +importSpec :: Assignment.Assignment [] Grammar [Term] +importSpec = symbol ImportSpec *> children (manyTerm import') + +infixOperatorApp :: Assignment +infixOperatorApp = makeTerm <$> symbol InfixOperatorApplication <*> children (Syntax.InfixOperatorApp <$> expression <*> expression <*> expression) + infixOperatorPattern :: Assignment infixOperatorPattern = makeTerm <$> symbol InfixOperatorPattern <*> children (Syntax.InfixOperatorPattern <$> expression <*> operator <*> expression) +infixVariableIdentifier :: Assignment +infixVariableIdentifier = makeTerm <$> symbol InfixVariableIdentifier <*> children (Syntax.InfixVariableIdentifier . Name.name <$> source) + integer :: Assignment integer = makeTerm <$> symbol Integer <*> (Literal.Integer <$> source) @@ -294,6 +396,15 @@ kindListType = makeTerm <$> symbol KindListType <*> children (Syntax.KindListTyp kindSignature :: Assignment kindSignature = makeTerm <$> symbol KindSignature <*> children (Syntax.KindSignature <$ token Annotation <*> kind) +lambda :: Assignment +lambda = makeTerm <$> symbol Lambda <*> children (Syntax.Lambda <$> lambdaHead <*> lambdaBody) + where + lambdaHead = symbol LambdaHead *> children expressions + lambdaBody = symbol LambdaBody *> children expressions + +listComprehension :: Assignment +listComprehension = makeTerm <$> symbol ListComprehension <*> children (Syntax.ListComprehension <$> expression <*> manyTerm expression) + listConstructor :: Assignment listConstructor = makeTerm <$> token ListConstructor <*> pure Syntax.ListConstructor @@ -307,7 +418,10 @@ listType = makeTerm <$> symbol ListType <*> children (Literal.Array <$> manyTerm module' :: Assignment module' = makeTerm <$> symbol Module - <*> children (Syntax.Module <$> (term moduleIdentifier <|> emptyTerm) <*> moduleExports <*> (where' <|> expressions <|> emptyTerm)) + <*> children (Syntax.Module + <$> (term moduleIdentifier <|> emptyTerm) + <*> moduleExports + <*> (where' <|> expressions <|> emptyTerm)) where moduleExports = symbol ModuleExports *> children (manyTerm export) <|> pure [] @@ -329,27 +443,71 @@ newType = makeTerm <$> symbol NewtypeDeclaration <*> children (Syntax.NewType <$ operator :: Assignment operator = typeOperator <|> constructorOperator <|> variableOperator +operatorSection :: Assignment +operatorSection = (makeTerm <$> symbol RightOperatorSection <*> children (Syntax.RightOperatorSection <$> expression <*> expression)) + <|> (makeTerm <$> symbol LeftOperatorSection <*> children (Syntax.LeftOperatorSection <$> expression <*> expression)) + +packageQualifiedImport :: Assignment +packageQualifiedImport = makeTerm <$> symbol PackageQualifiedImport <*> (Literal.TextElement <$> source) + +parenthesizedExpression :: Assignment +parenthesizedExpression = symbol ParenthesizedExpression *> children expression + +parenthesizedPattern :: Assignment +parenthesizedPattern = symbol ParenthesizedPattern *> children expressions + parenthesizedTypePattern :: Assignment parenthesizedTypePattern = symbol ParenthesizedTypePattern *> children expressions +pattern' :: Assignment +pattern' = symbol Pattern *> children expression + pragma :: Assignment pragma = makeTerm <$> symbol Pragma <*> (Syntax.Pragma <$> source) +prefixNegation :: Assignment +prefixNegation = makeTerm <$> symbol PrefixNegation <*> children (Syntax.PrefixNegation <$> expression) + primitiveConstructorIdentifier :: Assignment primitiveConstructorIdentifier = makeTerm <$> symbol PrimitiveConstructorIdentifier <*> (Syntax.PrimitiveConstructorIdentifier . Name.name <$> source) +primitiveVariableIdentifier :: Assignment +primitiveVariableIdentifier = makeTerm <$> symbol PrimitiveVariableIdentifier <*> (Syntax.PrimitiveVariableIdentifier . Name.name <$> source) + +qualifiedConstructorIdentifier :: Assignment +qualifiedConstructorIdentifier = makeTerm <$> symbol QualifiedConstructorIdentifier <*> children (Syntax.QualifiedConstructorIdentifier <$> someTerm' expression) + +qualifiedImportDeclaration :: Assignment +qualifiedImportDeclaration = makeTerm + <$> symbol QualifiedImportDeclaration + <*> children (Syntax.QualifiedImportDeclaration + <$> (packageQualifiedImport <|> emptyTerm) + <*> expression + <*> (importSpec <|> hiddenImportSpec <|> pure [])) + +qualifiedInfixVariableIdentifier :: Assignment +qualifiedInfixVariableIdentifier = makeTerm <$> symbol QualifiedInfixVariableIdentifier <*> children (Syntax.QualifiedInfixVariableIdentifier <$> someTerm' expression) + qualifiedModuleIdentifier :: Assignment qualifiedModuleIdentifier = makeTerm <$> symbol QualifiedModuleIdentifier <*> children (Syntax.QualifiedModuleIdentifier <$> someTerm' expression) qualifiedTypeConstructorIdentifier :: Assignment qualifiedTypeConstructorIdentifier = makeTerm <$> symbol QualifiedTypeConstructorIdentifier <*> children (Syntax.QualifiedTypeConstructorIdentifier <$> someTerm' expression) +qualifiedVariableIdentifier :: Assignment +qualifiedVariableIdentifier = makeTerm <$> symbol QualifiedVariableIdentifier <*> children (Syntax.QualifiedVariableIdentifier <$> someTerm' expression) + quotedName :: Assignment quotedName = makeTerm <$> symbol QuotedName <*> children (Syntax.QuotedName <$> expression) scopedTypeVariables :: Assignment scopedTypeVariables = makeTerm <$> symbol ScopedTypeVariables <*> children (Syntax.ScopedTypeVariables <$> expressions <* token Dot) +standaloneDerivingInstance :: Assignment +standaloneDerivingInstance = makeTerm <$> symbol StandaloneDerivingDeclaration <*> children (Syntax.StandaloneDerivingInstance <$> manyTerm (context' <|> scopedTypeVariables) <*> expression <*> instance') + where + instance' = symbol Instance *> children expressions + star :: Assignment star = makeTerm <$> token Star <*> pure Syntax.Star @@ -362,6 +520,9 @@ strictType = makeTerm' string :: Assignment string = makeTerm <$> symbol String <*> (Literal.TextElement <$> source) +tuplePattern :: Assignment +tuplePattern = makeTerm <$> symbol TuplePattern <*> children (Syntax.TuplePattern <$> manyTerm expression) + tupleType :: Assignment tupleType = makeTerm <$> symbol TupleType <*> children (Literal.Tuple <$> manyTerm type') @@ -378,11 +539,14 @@ typeOperator :: Assignment typeOperator = makeTerm <$> symbol TypeOperator <*> (Syntax.TypeOperator . Name.name <$> source) typeSignature :: Assignment -typeSignature = makeTerm <$> symbol TypeSignature <*> children (Syntax.TypeSignature <$> variableIdentifier <* token Annotation <*> manyTerm (context' <|> scopedTypeVariables) <*> expression) +typeSignature = makeTerm <$> symbol TypeSignature <*> children (Syntax.TypeSignature <$> variableIdentifier <* token Annotation <*> manyTerm (context' <|> scopedTypeVariables) <*> expressions) typeVariableIdentifier :: Assignment typeVariableIdentifier = makeTerm <$> symbol TypeVariableIdentifier <*> (Syntax.TypeVariableIdentifier . Name.name <$> source) +tuple :: Assignment +tuple = makeTerm <$> symbol TupleExpression <*> children (Syntax.Tuple <$> manyTerm expression) + tuplingConstructor :: Assignment tuplingConstructor = makeTerm <$> symbol TuplingConstructor <*> (tupleWithArity <$> rawSource) -- a tuple (,) has arity two, but only one comma, so apply the successor to the count of commas for the correct arity. diff --git a/src/Language/Haskell/Syntax.hs b/src/Language/Haskell/Syntax.hs index b4d1fa691..af81a458f 100644 --- a/src/Language/Haskell/Syntax.hs +++ b/src/Language/Haskell/Syntax.hs @@ -126,7 +126,7 @@ instance Ord1 Deriving where liftCompare = genericLiftCompare instance Show1 Deriving where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Deriving -newtype Context' a = Context' [a] +newtype Context' a = Context' a deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Context' where liftEq = genericLiftEq @@ -135,7 +135,7 @@ instance Show1 Context' where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Context' -data Class a = Class { classType :: a, classTypeParameters :: a } +newtype Class a = Class { classContent :: [a] } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Class where liftEq = genericLiftEq @@ -225,15 +225,19 @@ instance Show1 Star where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Star -newtype QualifiedTypeConstructorIdentifier a = QualifiedTypeConstructorIdentifier { qualifiedTypeConstructorIdentifierName :: NonEmpty a } +data QualifiedEntityIdentifier a = QualifiedTypeConstructorIdentifier (NonEmpty a) + | QualifiedConstructorIdentifier (NonEmpty a) + | QualifiedInfixVariableIdentifier (NonEmpty a) + | QualifiedModuleIdentifier (NonEmpty a) + | QualifiedVariableIdentifier (NonEmpty a) deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Mergeable, Ord, Show, ToJSONFields1, Traversable) -instance Eq1 QualifiedTypeConstructorIdentifier where liftEq = genericLiftEq -instance Ord1 QualifiedTypeConstructorIdentifier where liftCompare = genericLiftCompare -instance Show1 QualifiedTypeConstructorIdentifier where liftShowsPrec = genericLiftShowsPrec -instance Hashable1 QualifiedTypeConstructorIdentifier where liftHashWithSalt = foldl +instance Eq1 QualifiedEntityIdentifier where liftEq = genericLiftEq +instance Ord1 QualifiedEntityIdentifier where liftCompare = genericLiftCompare +instance Show1 QualifiedEntityIdentifier where liftShowsPrec = genericLiftShowsPrec +instance Hashable1 QualifiedEntityIdentifier where liftHashWithSalt = foldl -instance Evaluatable QualifiedTypeConstructorIdentifier +instance Evaluatable QualifiedEntityIdentifier data AnnotatedTypeVariable a = AnnotatedTypeVariable { annotatedTypeVariableIdentifier :: a, annotatedTypeVariableannotation :: a } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) @@ -244,16 +248,6 @@ instance Show1 AnnotatedTypeVariable where liftShowsPrec = genericLiftShowsPrec instance Evaluatable AnnotatedTypeVariable -newtype QualifiedModuleIdentifier a = QualifiedModuleIdentifier { qualifiedModuleIdentifierName :: NonEmpty a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Mergeable, Ord, Show, ToJSONFields1, Traversable) - -instance Eq1 QualifiedModuleIdentifier where liftEq = genericLiftEq -instance Ord1 QualifiedModuleIdentifier where liftCompare = genericLiftCompare -instance Show1 QualifiedModuleIdentifier where liftShowsPrec = genericLiftShowsPrec -instance Hashable1 QualifiedModuleIdentifier where liftHashWithSalt = foldl - -instance Evaluatable QualifiedModuleIdentifier - newtype Export a = Export { exportContent :: a } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) @@ -357,9 +351,11 @@ data EntityIdentifier a = TypeVariableIdentifier Name | TypeConstructorIdentifier Name | ModuleIdentifier Name | ConstructorIdentifier Name + | InfixVariableIdentifier Name | TypeClassIdentifier Name | VariableIdentifier Name | PrimitiveConstructorIdentifier Name + | PrimitiveVariableIdentifier Name deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) instance Eq1 EntityIdentifier where liftEq = genericLiftEq @@ -396,3 +392,172 @@ instance Ord1 VariableSymbol where liftCompare = genericLiftCompare instance Show1 VariableSymbol where liftShowsPrec = genericLiftShowsPrec instance Evaluatable VariableSymbol + +data StandaloneDerivingInstance a = StandaloneDerivingInstance { standaloneDerivingInstanceContext :: [a], standaloneDerivingInstanceClass :: a, standaloneDerivingInstanceInstance :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 StandaloneDerivingInstance where liftEq = genericLiftEq +instance Ord1 StandaloneDerivingInstance where liftCompare = genericLiftCompare +instance Show1 StandaloneDerivingInstance where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable StandaloneDerivingInstance + +data ImportDeclaration a = ImportDeclaration { importPackageQualifiedContent :: a, importModule :: a, importSpec :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 ImportDeclaration where liftEq = genericLiftEq +instance Ord1 ImportDeclaration where liftCompare = genericLiftCompare +instance Show1 ImportDeclaration where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable ImportDeclaration + +data QualifiedImportDeclaration a = QualifiedImportDeclaration { qualifiedImportPackageQualifiedContent :: a, qualifiedImportModule :: a, qualifiedImportSpec :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 QualifiedImportDeclaration where liftEq = genericLiftEq +instance Ord1 QualifiedImportDeclaration where liftCompare = genericLiftCompare +instance Show1 QualifiedImportDeclaration where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable QualifiedImportDeclaration + +newtype Import a = Import { importContent :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 Import where liftEq = genericLiftEq +instance Ord1 Import where liftCompare = genericLiftCompare +instance Show1 Import where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Import + +newtype HiddenImport a = HiddenImport { hiddenimportContent :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 HiddenImport where liftEq = genericLiftEq +instance Ord1 HiddenImport where liftCompare = genericLiftCompare +instance Show1 HiddenImport where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable HiddenImport + +data ImportAlias a = ImportAlias { importAliasSource :: a, importAliasName :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 ImportAlias where liftEq = genericLiftEq +instance Ord1 ImportAlias where liftCompare = genericLiftCompare +instance Show1 ImportAlias where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable ImportAlias + +data App a = App { appLeft :: a, appRight :: a } + | InfixOperatorApp { appLeft :: a, infixOperator :: a, appRight :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 App where liftEq = genericLiftEq +instance Ord1 App where liftCompare = genericLiftCompare +instance Show1 App where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable App + +data ListComprehension a = ListComprehension { comprehensionValue :: a, comprehensionSource :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 ListComprehension where liftEq = genericLiftEq +instance Ord1 ListComprehension where liftCompare = genericLiftCompare +instance Show1 ListComprehension where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable ListComprehension + +data Generator a = Generator { generatorValue :: a, generatorSource :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 Generator where liftEq = genericLiftEq +instance Ord1 Generator where liftCompare = genericLiftCompare +instance Show1 Generator where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Generator + +newtype Tuple a = Tuple [a] + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 Tuple where liftEq = genericLiftEq +instance Ord1 Tuple where liftCompare = genericLiftCompare +instance Show1 Tuple where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Tuple + +newtype TuplePattern a = TuplePattern [a] + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 TuplePattern where liftEq = genericLiftEq +instance Ord1 TuplePattern where liftCompare = genericLiftCompare +instance Show1 TuplePattern where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable TuplePattern + +data ArithmeticSequence a = EnumFrom a -- e.g. [1..] + | EnumFromThen a a -- e.g. [1,2..] + | EnumFromTo a a -- e.g. [1..2] + | EnumFromThenTo a a a -- e.g. [1,2..10] + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 ArithmeticSequence where liftEq = genericLiftEq +instance Ord1 ArithmeticSequence where liftCompare = genericLiftCompare +instance Show1 ArithmeticSequence where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable ArithmeticSequence + +data OperatorSection a = RightOperatorSection a a + | LeftOperatorSection a a + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 OperatorSection where liftEq = genericLiftEq +instance Ord1 OperatorSection where liftCompare = genericLiftCompare +instance Show1 OperatorSection where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable OperatorSection + +newtype ConstructorPattern a = ConstructorPattern a + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 ConstructorPattern where liftEq = genericLiftEq +instance Ord1 ConstructorPattern where liftCompare = genericLiftCompare +instance Show1 ConstructorPattern where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable ConstructorPattern + +-- e.g. `a <- b` in a Haskell do block. +data BindPattern a = BindPattern { bindPatternLeft :: a, bindPatternRight :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 BindPattern where liftEq = genericLiftEq +instance Ord1 BindPattern where liftCompare = genericLiftCompare +instance Show1 BindPattern where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable BindPattern + +newtype Do a = Do [a] + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 Do where liftEq = genericLiftEq +instance Ord1 Do where liftCompare = genericLiftCompare +instance Show1 Do where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Do + +data Lambda a = Lambda { lambdaHead :: a, lambdaBody :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 Lambda where liftEq = genericLiftEq +instance Ord1 Lambda where liftCompare = genericLiftCompare +instance Show1 Lambda where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Lambda + +-- e.g. -1 or (-a) as an expression and not `-` as a variable operator. +newtype PrefixNegation a = PrefixNegation a + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 PrefixNegation where liftEq = genericLiftEq +instance Ord1 PrefixNegation where liftCompare = genericLiftCompare +instance Show1 PrefixNegation where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable PrefixNegation diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt index 81a5f83cb..2eff06678 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt @@ -62,10 +62,6 @@ ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) - (Constructor - { (ConstructorIdentifier) - ->(ConstructorIdentifier) } - (TypeParameters)) {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} @@ -81,6 +77,12 @@ {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} + {+(Constructor + {+(ConstructorIdentifier)+} + {+(TypeParameters)+})+} + {-(Constructor + {-(ConstructorIdentifier)-} + {-(TypeParameters)-})-} {-(Constructor {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} @@ -306,12 +308,10 @@ (TypeClassIdentifier))) (Datatype (Context' - (Statements - (Class - { (TypeClassIdentifier) - ->(TypeClassIdentifier) } - (TypeParameters - (TypeVariableIdentifier))))) + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeVariableIdentifier))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -328,18 +328,13 @@ (Class { (TypeClassIdentifier) ->(TypeClassIdentifier) } - (TypeParameters - (TypeVariableIdentifier)))) - (Statements + (TypeVariableIdentifier)) (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier)))) - (Statements + (TypeVariableIdentifier)) (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (TypeVariableIdentifier)))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -357,16 +352,13 @@ (Statements (Class (TypeClassIdentifier) - (TypeParameters - (Statements - (TypeVariableIdentifier) - (TypeVariableIdentifier))))) - (Statements + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (Class { (TypeClassIdentifier) ->(TypeClassIdentifier) } - (TypeParameters - (TypeVariableIdentifier))))) + (TypeVariableIdentifier)))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -388,8 +380,7 @@ (Empty)) (Constructor (Context' - (Statements - (TypeConstructorIdentifier))) + (TypeConstructorIdentifier)) { (ConstructorIdentifier) ->(ConstructorIdentifier) } (TypeParameters @@ -405,12 +396,10 @@ (Empty)) (Constructor (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - { (TypeVariableIdentifier) - ->(TypeVariableIdentifier) })))) + (Class + (TypeClassIdentifier) + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })) (ConstructorIdentifier) (TypeParameters { (TypeVariableIdentifier) @@ -441,12 +430,10 @@ { (TypeVariableIdentifier) ->(TypeVariableIdentifier) }) (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - { (TypeVariableIdentifier) - ->(TypeVariableIdentifier) })))) + (Class + (TypeClassIdentifier) + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })) (ConstructorIdentifier) (TypeParameters (Statements diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt index 0e15597cc..4c7b58dc6 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt @@ -62,10 +62,9 @@ ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) - (Constructor - { (ConstructorIdentifier) - ->(ConstructorIdentifier) } - (TypeParameters)) + {+(Constructor + {+(ConstructorIdentifier)+} + {+(TypeParameters)+})+} {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} @@ -79,10 +78,15 @@ {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} - (Constructor - { (ConstructorIdentifier) - ->(ConstructorIdentifier) } - (TypeParameters)) + {+(Constructor + {+(ConstructorIdentifier)+} + {+(TypeParameters)+})+} + {-(Constructor + {-(ConstructorIdentifier)-} + {-(TypeParameters)-})-} + {-(Constructor + {-(ConstructorIdentifier)-} + {-(TypeParameters)-})-} {-(Constructor {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} @@ -302,12 +306,10 @@ (TypeClassIdentifier))) (Datatype (Context' - (Statements - (Class - { (TypeClassIdentifier) - ->(TypeClassIdentifier) } - (TypeParameters - (TypeVariableIdentifier))))) + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeVariableIdentifier))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -324,18 +326,13 @@ (Class { (TypeClassIdentifier) ->(TypeClassIdentifier) } - (TypeParameters - (TypeVariableIdentifier)))) - (Statements + (TypeVariableIdentifier)) (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier)))) - (Statements + (TypeVariableIdentifier)) (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (TypeVariableIdentifier)))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -353,16 +350,13 @@ (Statements (Class (TypeClassIdentifier) - (TypeParameters - (Statements - (TypeVariableIdentifier) - (TypeVariableIdentifier))))) - (Statements + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (Class { (TypeClassIdentifier) ->(TypeClassIdentifier) } - (TypeParameters - (TypeVariableIdentifier))))) + (TypeVariableIdentifier)))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -384,8 +378,7 @@ (Empty)) (Constructor (Context' - (Statements - (TypeConstructorIdentifier))) + (TypeConstructorIdentifier)) { (ConstructorIdentifier) ->(ConstructorIdentifier) } (TypeParameters @@ -401,12 +394,10 @@ (Empty)) (Constructor (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - { (TypeVariableIdentifier) - ->(TypeVariableIdentifier) })))) + (Class + (TypeClassIdentifier) + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })) (ConstructorIdentifier) (TypeParameters { (TypeVariableIdentifier) @@ -437,12 +428,10 @@ { (TypeVariableIdentifier) ->(TypeVariableIdentifier) }) (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - { (TypeVariableIdentifier) - ->(TypeVariableIdentifier) })))) + (Class + (TypeClassIdentifier) + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })) (ConstructorIdentifier) (TypeParameters (Statements diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt index a3022c6c1..c73c9192c 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt @@ -246,11 +246,9 @@ (TypeClassIdentifier))) (Datatype (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -266,18 +264,13 @@ (Statements (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier)))) - (Statements + (TypeVariableIdentifier)) (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier)))) - (Statements + (TypeVariableIdentifier)) (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (TypeVariableIdentifier)))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -295,15 +288,12 @@ (Statements (Class (TypeClassIdentifier) - (TypeParameters - (Statements - (TypeVariableIdentifier) - (TypeVariableIdentifier))))) - (Statements + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (TypeVariableIdentifier)))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -325,8 +315,7 @@ (Empty)) (Constructor (Context' - (Statements - (TypeConstructorIdentifier))) + (TypeConstructorIdentifier)) (ConstructorIdentifier) (TypeParameters (TypeVariableIdentifier))) @@ -340,11 +329,9 @@ (Empty)) (Constructor (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (ConstructorIdentifier) (TypeParameters (TypeVariableIdentifier))) @@ -371,11 +358,9 @@ (ScopedTypeVariables (TypeVariableIdentifier)) (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (ConstructorIdentifier) (TypeParameters (Statements diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt index a3022c6c1..c73c9192c 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt @@ -246,11 +246,9 @@ (TypeClassIdentifier))) (Datatype (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -266,18 +264,13 @@ (Statements (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier)))) - (Statements + (TypeVariableIdentifier)) (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier)))) - (Statements + (TypeVariableIdentifier)) (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (TypeVariableIdentifier)))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -295,15 +288,12 @@ (Statements (Class (TypeClassIdentifier) - (TypeParameters - (Statements - (TypeVariableIdentifier) - (TypeVariableIdentifier))))) - (Statements + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (Class (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (TypeVariableIdentifier)))) (Type (TypeConstructorIdentifier) (TypeParameters @@ -325,8 +315,7 @@ (Empty)) (Constructor (Context' - (Statements - (TypeConstructorIdentifier))) + (TypeConstructorIdentifier)) (ConstructorIdentifier) (TypeParameters (TypeVariableIdentifier))) @@ -340,11 +329,9 @@ (Empty)) (Constructor (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (ConstructorIdentifier) (TypeParameters (TypeVariableIdentifier))) @@ -371,11 +358,9 @@ (ScopedTypeVariables (TypeVariableIdentifier)) (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (ConstructorIdentifier) (TypeParameters (Statements diff --git a/test/fixtures/haskell/corpus/expressions.A.hs b/test/fixtures/haskell/corpus/expressions.A.hs new file mode 100644 index 000000000..f80538083 --- /dev/null +++ b/test/fixtures/haskell/corpus/expressions.A.hs @@ -0,0 +1,58 @@ +f = a b +f = a b c +f = a b c d + +f = Just b +f = Right b +f = Example a c d +f = () + +a = [1..] +a = [1,2..] +a = [1..2] +a = [1,2..10] + +a = [x | x <- xs] +a = [(x, y) | x <- xs, y <- ys] +a = [ x | xs <- [ [(1,2),(3,4)], [(5,4),(3,2)] ], (3,x) <- xs ] +a = [(i,j) | i <- [1,2], + j <- [1..4] ] +a = [ [ (i,j) | i <- [1,2] ] | j <- [1..] ] + +f = take 5 [ [ (i,j) | i <- [1,2] ] | j <- [1..] ] + +a = (: a) +a = (:< a) + +a = (a :) +a = (a :|) + +g = h `i` j + +a = Data.Just + +parseJSON (JSON.Object r) = IncPK <$> + r .: "id" <*> + r .: "nullable_string" <*> + r .: "non_nullable_string" <*> + r .: "inserted_at" + +f = do + a <- b =<< c + b <- e >>= g + +f = \ x -> x + +f = \ (Just a) -> a + +f = \ x -> x : a : xs + +f = \ g a b -> g <$> a <*> b + +f = (-) +f = 1 - 1 +f = (-1) +f = (-a) +f = -(1) + +foo = catMaybes $ fmap (\p -> (p,) . Just <$> bar p) waz diff --git a/test/fixtures/haskell/corpus/expressions.B.hs b/test/fixtures/haskell/corpus/expressions.B.hs new file mode 100644 index 000000000..8be8ad7f2 --- /dev/null +++ b/test/fixtures/haskell/corpus/expressions.B.hs @@ -0,0 +1,58 @@ +g = a b +g = a b c +g = a b c d + +g = Just b +g = Right b +g = Example a c d +g = () + +a = [2..] +a = [2,3..] +a = [2..9] +a = [2,3..18] + +b = [x | x <- xs] +b = [(x, y) | x <- xs, y <- ys] +b = [ x | xs <- [ [(10,20),(30,40)], [(50,40),(30,20)] ], (30,x) <- xs ] +b = [(i,j) | i <- [1,2,3,4], + j <- [1..10] ] +b = [ [ (i,j) | i <- [2,4] ] | j <- [5..] ] + +b = take 7 [ [ (i,j) | i <- [1,2] ] | j <- [1..] ] + +b = (: a) +b = (:< a) + +b = (b :) +b = (b :|) + +b = h `i` j + +b = Data.Just + +parseJSON (JSON.Object s) = IncPK <$> + s .: "id" <*> + s .: "nullable_string" <*> + s .: "non_nullable_string" <*> + s .: "inserted_at" + +g = do + b <- d =<< e + c <- f >>= h + +g = \ x -> x + +g = \ (Just a) -> a + +g = \ x -> x : a : xs + +g = \ g a b -> g <$> a <*> b + +g = (-) +g = 1 - 1 +g = (-1) +g = (-a) +g = -(1) + +bar = catMaybes $ fmap (\q -> (q,) . Just <$> baz q) waz diff --git a/test/fixtures/haskell/corpus/expressions.diffA-B.txt b/test/fixtures/haskell/corpus/expressions.diffA-B.txt new file mode 100644 index 000000000..8cdc708f5 --- /dev/null +++ b/test/fixtures/haskell/corpus/expressions.diffA-B.txt @@ -0,0 +1,479 @@ +(Module + (Empty) + (Statements + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (VariableIdentifier) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (App + (VariableIdentifier) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (App + (App + (VariableIdentifier) + (VariableIdentifier)) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (ConstructorIdentifier) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (ConstructorIdentifier) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (App + (App + (ConstructorIdentifier) + (VariableIdentifier)) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (UnitConstructor))) + (Function + (VariableIdentifier) + (Statements + (EnumFrom + { (Integer) + ->(Integer) }))) + (Function + (VariableIdentifier) + (Statements + (EnumFromThen + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }))) + (Function + (VariableIdentifier) + (Statements + (EnumFromTo + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }))) + (Function + (VariableIdentifier) + (Statements + (EnumFromThenTo + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (ListComprehension + (VariableIdentifier) + (Generator + (VariableIdentifier) + (VariableIdentifier))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (VariableIdentifier))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (ListComprehension + (VariableIdentifier) + (Generator + (VariableIdentifier) + (Array + (Array + (Tuple + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }) + (Tuple + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) })) + (Array + (Tuple + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }) + (Tuple + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) })))) + (Generator + (TuplePattern + { (Integer) + ->(Integer) } + (VariableIdentifier)) + (VariableIdentifier))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + (Integer) + (Integer) + {+(Integer)+} + {+(Integer)+})) + (Generator + (VariableIdentifier) + (EnumFromTo + (Integer) + { (Integer) + ->(Integer) }))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (ListComprehension + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + {-(Integer)-} + (Integer) + {+(Integer)+}))) + (Generator + (VariableIdentifier) + (EnumFrom + { (Integer) + ->(Integer) }))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (App + (VariableIdentifier) + { (Integer) + ->(Integer) }) + (ListComprehension + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + (Integer) + (Integer)))) + (Generator + (VariableIdentifier) + (EnumFrom + (Integer))))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (RightOperatorSection + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (RightOperatorSection + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (LeftOperatorSection + { (VariableIdentifier) + ->(VariableIdentifier) } + (ConstructorOperator + (ConstructorSymbol))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (LeftOperatorSection + { (VariableIdentifier) + ->(VariableIdentifier) } + (ConstructorOperator + (ConstructorSymbol))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (InfixVariableIdentifier)) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (QualifiedConstructorIdentifier + (ModuleIdentifier) + (ConstructorIdentifier)))) + (Function + (VariableIdentifier) + (ConstructorPattern + (Statements + (QualifiedConstructorIdentifier + (ModuleIdentifier) + (ConstructorIdentifier)) + { (VariableIdentifier) + ->(VariableIdentifier) })) + (Statements + (InfixOperatorApp + (ConstructorIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + { (VariableIdentifier) + ->(VariableIdentifier) } + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (TextElement) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + { (VariableIdentifier) + ->(VariableIdentifier) } + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (TextElement) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + { (VariableIdentifier) + ->(VariableIdentifier) } + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (TextElement) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + { (VariableIdentifier) + ->(VariableIdentifier) } + (VariableOperator + (VariableSymbol)) + (TextElement))))))))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Do + (BindPattern + { (VariableIdentifier) + ->(VariableIdentifier) } + (InfixOperatorApp + { (VariableIdentifier) + ->(VariableIdentifier) } + (VariableOperator + (VariableSymbol)) + { (VariableIdentifier) + ->(VariableIdentifier) })) + (BindPattern + { (VariableIdentifier) + ->(VariableIdentifier) } + (InfixOperatorApp + { (VariableIdentifier) + ->(VariableIdentifier) } + (VariableOperator + (VariableSymbol)) + { (VariableIdentifier) + ->(VariableIdentifier) }))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Lambda + (VariableIdentifier) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Lambda + (ConstructorPattern + (Statements + (ConstructorIdentifier) + (VariableIdentifier))) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Lambda + (VariableIdentifier) + (InfixOperatorApp + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Lambda + (Statements + (VariableIdentifier) + (VariableIdentifier) + (VariableIdentifier)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (VariableIdentifier)))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (VariableOperator + (VariableSymbol)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (InfixOperatorApp + (Integer) + (VariableOperator + (VariableSymbol)) + (Integer)))) + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(PrefixNegation + {+(Integer)+})+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(PrefixNegation + {+(VariableIdentifier)+})+})+})+} + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (PrefixNegation + (Integer)))) + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(InfixOperatorApp + {+(VariableIdentifier)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(App + {+(App + {+(VariableIdentifier)+} + {+(Lambda + {+(VariableIdentifier)+} + {+(InfixOperatorApp + {+(Tuple + {+(VariableIdentifier)+})+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(InfixOperatorApp + {+(ConstructorIdentifier)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(App + {+(VariableIdentifier)+} + {+(VariableIdentifier)+})+})+})+})+})+} + {+(VariableIdentifier)+})+})+})+})+} + {-(Function + {-(VariableIdentifier)-} + {-(Statements + {-(PrefixNegation + {-(VariableIdentifier)-})-})-})-} + {-(Function + {-(VariableIdentifier)-} + {-(Statements + {-(PrefixNegation + {-(Integer)-})-})-})-} + {-(Function + {-(VariableIdentifier)-} + {-(Statements + {-(InfixOperatorApp + {-(VariableIdentifier)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(App + {-(App + {-(VariableIdentifier)-} + {-(Lambda + {-(VariableIdentifier)-} + {-(InfixOperatorApp + {-(Tuple + {-(VariableIdentifier)-})-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(InfixOperatorApp + {-(ConstructorIdentifier)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(App + {-(VariableIdentifier)-} + {-(VariableIdentifier)-})-})-})-})-})-} + {-(VariableIdentifier)-})-})-})-})-})) diff --git a/test/fixtures/haskell/corpus/expressions.diffB-A.txt b/test/fixtures/haskell/corpus/expressions.diffB-A.txt new file mode 100644 index 000000000..6ba694ba3 --- /dev/null +++ b/test/fixtures/haskell/corpus/expressions.diffB-A.txt @@ -0,0 +1,540 @@ +(Module + (Empty) + (Statements + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (VariableIdentifier) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (App + (VariableIdentifier) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (App + (App + (VariableIdentifier) + (VariableIdentifier)) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (ConstructorIdentifier) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (ConstructorIdentifier) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (App + (App + (ConstructorIdentifier) + (VariableIdentifier)) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (UnitConstructor))) + (Function + (VariableIdentifier) + (Statements + (EnumFrom + { (Integer) + ->(Integer) }))) + (Function + (VariableIdentifier) + (Statements + (EnumFromThen + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }))) + (Function + (VariableIdentifier) + (Statements + (EnumFromTo + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }))) + (Function + (VariableIdentifier) + (Statements + (EnumFromThenTo + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (ListComprehension + (VariableIdentifier) + (Generator + (VariableIdentifier) + (VariableIdentifier))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (VariableIdentifier))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (ListComprehension + (VariableIdentifier) + (Generator + (VariableIdentifier) + (Array + (Array + (Tuple + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }) + (Tuple + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) })) + (Array + (Tuple + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }) + (Tuple + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) })))) + (Generator + (TuplePattern + { (Integer) + ->(Integer) } + (VariableIdentifier)) + (VariableIdentifier))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + (Integer) + (Integer) + {-(Integer)-} + {-(Integer)-})) + (Generator + (VariableIdentifier) + (EnumFromTo + (Integer) + { (Integer) + ->(Integer) }))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (ListComprehension + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + {+(Integer)+} + (Integer) + {-(Integer)-}))) + (Generator + (VariableIdentifier) + (EnumFrom + { (Integer) + ->(Integer) }))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (App + (App + (VariableIdentifier) + { (Integer) + ->(Integer) }) + (ListComprehension + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + (Integer) + (Integer)))) + (Generator + (VariableIdentifier) + (EnumFrom + (Integer))))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (RightOperatorSection + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (RightOperatorSection + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (LeftOperatorSection + { (VariableIdentifier) + ->(VariableIdentifier) } + (ConstructorOperator + (ConstructorSymbol))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (LeftOperatorSection + { (VariableIdentifier) + ->(VariableIdentifier) } + (ConstructorOperator + (ConstructorSymbol))))) + {-(Function + {-(VariableIdentifier)-} + {-(Statements + {-(InfixOperatorApp + {-(VariableIdentifier)-} + {-(VariableOperator + {-(InfixVariableIdentifier)-})-} + {-(VariableIdentifier)-})-})-})-} + {-(Function + {-(VariableIdentifier)-} + {-(Statements + {-(QualifiedConstructorIdentifier + {-(ModuleIdentifier)-} + {-(ConstructorIdentifier)-})-})-})-} + {-(Function + {-(VariableIdentifier)-} + {-(ConstructorPattern + {-(Statements + {-(QualifiedConstructorIdentifier + {-(ModuleIdentifier)-} + {-(ConstructorIdentifier)-})-} + {-(VariableIdentifier)-})-})-} + {-(Statements + {-(InfixOperatorApp + {-(ConstructorIdentifier)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(InfixOperatorApp + {-(VariableIdentifier)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(InfixOperatorApp + {-(TextElement)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(InfixOperatorApp + {-(VariableIdentifier)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(InfixOperatorApp + {-(TextElement)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(InfixOperatorApp + {-(VariableIdentifier)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(InfixOperatorApp + {-(TextElement)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(InfixOperatorApp + {-(VariableIdentifier)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(TextElement)-})-})-})-})-})-})-})-})-})-})-} + (Function + (VariableIdentifier) + (Statements + {+(InfixOperatorApp + {+(VariableIdentifier)+} + {+(VariableOperator + {+(InfixVariableIdentifier)+})+} + {+(VariableIdentifier)+})+} + {-(Do + {-(BindPattern + {-(VariableIdentifier)-} + {-(InfixOperatorApp + {-(VariableIdentifier)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(VariableIdentifier)-})-})-} + {-(BindPattern + {-(VariableIdentifier)-} + {-(InfixOperatorApp + {-(VariableIdentifier)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(VariableIdentifier)-})-})-})-})) + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(QualifiedConstructorIdentifier + {+(ModuleIdentifier)+} + {+(ConstructorIdentifier)+})+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(ConstructorPattern + {+(Statements + {+(QualifiedConstructorIdentifier + {+(ModuleIdentifier)+} + {+(ConstructorIdentifier)+})+} + {+(VariableIdentifier)+})+})+} + {+(Statements + {+(InfixOperatorApp + {+(ConstructorIdentifier)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(InfixOperatorApp + {+(VariableIdentifier)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(InfixOperatorApp + {+(TextElement)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(InfixOperatorApp + {+(VariableIdentifier)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(InfixOperatorApp + {+(TextElement)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(InfixOperatorApp + {+(VariableIdentifier)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(InfixOperatorApp + {+(TextElement)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(InfixOperatorApp + {+(VariableIdentifier)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(TextElement)+})+})+})+})+})+})+})+})+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(Do + {+(BindPattern + {+(VariableIdentifier)+} + {+(InfixOperatorApp + {+(VariableIdentifier)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(VariableIdentifier)+})+})+} + {+(BindPattern + {+(VariableIdentifier)+} + {+(InfixOperatorApp + {+(VariableIdentifier)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(VariableIdentifier)+})+})+})+})+})+} + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Lambda + (VariableIdentifier) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Lambda + (ConstructorPattern + (Statements + (ConstructorIdentifier) + (VariableIdentifier))) + (VariableIdentifier)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Lambda + (VariableIdentifier) + (InfixOperatorApp + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Lambda + (Statements + (VariableIdentifier) + (VariableIdentifier) + (VariableIdentifier)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (VariableIdentifier)))))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (VariableOperator + (VariableSymbol)))) + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (InfixOperatorApp + (Integer) + (VariableOperator + (VariableSymbol)) + (Integer)))) + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(PrefixNegation + {+(Integer)+})+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(PrefixNegation + {+(VariableIdentifier)+})+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(PrefixNegation + {+(Integer)+})+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(InfixOperatorApp + {+(VariableIdentifier)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(App + {+(App + {+(VariableIdentifier)+} + {+(Lambda + {+(VariableIdentifier)+} + {+(InfixOperatorApp + {+(Tuple + {+(VariableIdentifier)+})+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(InfixOperatorApp + {+(ConstructorIdentifier)+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(App + {+(VariableIdentifier)+} + {+(VariableIdentifier)+})+})+})+})+})+} + {+(VariableIdentifier)+})+})+})+})+} + {-(Function + {-(VariableIdentifier)-} + {-(Statements + {-(PrefixNegation + {-(Integer)-})-})-})-} + {-(Function + {-(VariableIdentifier)-} + {-(Statements + {-(PrefixNegation + {-(VariableIdentifier)-})-})-})-} + {-(Function + {-(VariableIdentifier)-} + {-(Statements + {-(PrefixNegation + {-(Integer)-})-})-})-} + {-(Function + {-(VariableIdentifier)-} + {-(Statements + {-(InfixOperatorApp + {-(VariableIdentifier)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(App + {-(App + {-(VariableIdentifier)-} + {-(Lambda + {-(VariableIdentifier)-} + {-(InfixOperatorApp + {-(Tuple + {-(VariableIdentifier)-})-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(InfixOperatorApp + {-(ConstructorIdentifier)-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(App + {-(VariableIdentifier)-} + {-(VariableIdentifier)-})-})-})-})-})-} + {-(VariableIdentifier)-})-})-})-})-})) diff --git a/test/fixtures/haskell/corpus/expressions.parseA.txt b/test/fixtures/haskell/corpus/expressions.parseA.txt new file mode 100644 index 000000000..1cea51c29 --- /dev/null +++ b/test/fixtures/haskell/corpus/expressions.parseA.txt @@ -0,0 +1,381 @@ +(Module + (Empty) + (Statements + (Function + (VariableIdentifier) + (Statements + (App + (VariableIdentifier) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (App + (App + (VariableIdentifier) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (App + (App + (App + (VariableIdentifier) + (VariableIdentifier)) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (App + (ConstructorIdentifier) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (App + (ConstructorIdentifier) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (App + (App + (App + (ConstructorIdentifier) + (VariableIdentifier)) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (UnitConstructor))) + (Function + (VariableIdentifier) + (Statements + (EnumFrom + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (EnumFromThen + (Integer) + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (EnumFromTo + (Integer) + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (EnumFromThenTo + (Integer) + (Integer) + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (ListComprehension + (VariableIdentifier) + (Generator + (VariableIdentifier) + (VariableIdentifier))))) + (Function + (VariableIdentifier) + (Statements + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (VariableIdentifier))))) + (Function + (VariableIdentifier) + (Statements + (ListComprehension + (VariableIdentifier) + (Generator + (VariableIdentifier) + (Array + (Array + (Tuple + (Integer) + (Integer)) + (Tuple + (Integer) + (Integer))) + (Array + (Tuple + (Integer) + (Integer)) + (Tuple + (Integer) + (Integer))))) + (Generator + (TuplePattern + (Integer) + (VariableIdentifier)) + (VariableIdentifier))))) + (Function + (VariableIdentifier) + (Statements + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + (Integer) + (Integer))) + (Generator + (VariableIdentifier) + (EnumFromTo + (Integer) + (Integer)))))) + (Function + (VariableIdentifier) + (Statements + (ListComprehension + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + (Integer) + (Integer)))) + (Generator + (VariableIdentifier) + (EnumFrom + (Integer)))))) + (Function + (VariableIdentifier) + (Statements + (App + (App + (VariableIdentifier) + (Integer)) + (ListComprehension + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + (Integer) + (Integer)))) + (Generator + (VariableIdentifier) + (EnumFrom + (Integer))))))) + (Function + (VariableIdentifier) + (Statements + (RightOperatorSection + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (RightOperatorSection + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (LeftOperatorSection + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol))))) + (Function + (VariableIdentifier) + (Statements + (LeftOperatorSection + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol))))) + (Function + (VariableIdentifier) + (Statements + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (InfixVariableIdentifier)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (QualifiedConstructorIdentifier + (ModuleIdentifier) + (ConstructorIdentifier)))) + (Function + (VariableIdentifier) + (ConstructorPattern + (Statements + (QualifiedConstructorIdentifier + (ModuleIdentifier) + (ConstructorIdentifier)) + (VariableIdentifier))) + (Statements + (InfixOperatorApp + (ConstructorIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (TextElement) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (TextElement) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (TextElement) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (TextElement))))))))))) + (Function + (VariableIdentifier) + (Statements + (Do + (BindPattern + (VariableIdentifier) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (VariableIdentifier))) + (BindPattern + (VariableIdentifier) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (VariableIdentifier)))))) + (Function + (VariableIdentifier) + (Statements + (Lambda + (VariableIdentifier) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (Lambda + (ConstructorPattern + (Statements + (ConstructorIdentifier) + (VariableIdentifier))) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (Lambda + (VariableIdentifier) + (InfixOperatorApp + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))))) + (Function + (VariableIdentifier) + (Statements + (Lambda + (Statements + (VariableIdentifier) + (VariableIdentifier) + (VariableIdentifier)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (VariableIdentifier)))))) + (Function + (VariableIdentifier) + (Statements + (VariableOperator + (VariableSymbol)))) + (Function + (VariableIdentifier) + (Statements + (InfixOperatorApp + (Integer) + (VariableOperator + (VariableSymbol)) + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (PrefixNegation + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (PrefixNegation + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (PrefixNegation + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (App + (App + (VariableIdentifier) + (Lambda + (VariableIdentifier) + (InfixOperatorApp + (Tuple + (VariableIdentifier)) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (ConstructorIdentifier) + (VariableOperator + (VariableSymbol)) + (App + (VariableIdentifier) + (VariableIdentifier)))))) + (VariableIdentifier))))))) diff --git a/test/fixtures/haskell/corpus/expressions.parseB.txt b/test/fixtures/haskell/corpus/expressions.parseB.txt new file mode 100644 index 000000000..fd949667e --- /dev/null +++ b/test/fixtures/haskell/corpus/expressions.parseB.txt @@ -0,0 +1,383 @@ +(Module + (Empty) + (Statements + (Function + (VariableIdentifier) + (Statements + (App + (VariableIdentifier) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (App + (App + (VariableIdentifier) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (App + (App + (App + (VariableIdentifier) + (VariableIdentifier)) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (App + (ConstructorIdentifier) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (App + (ConstructorIdentifier) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (App + (App + (App + (ConstructorIdentifier) + (VariableIdentifier)) + (VariableIdentifier)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (UnitConstructor))) + (Function + (VariableIdentifier) + (Statements + (EnumFrom + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (EnumFromThen + (Integer) + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (EnumFromTo + (Integer) + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (EnumFromThenTo + (Integer) + (Integer) + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (ListComprehension + (VariableIdentifier) + (Generator + (VariableIdentifier) + (VariableIdentifier))))) + (Function + (VariableIdentifier) + (Statements + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (VariableIdentifier))))) + (Function + (VariableIdentifier) + (Statements + (ListComprehension + (VariableIdentifier) + (Generator + (VariableIdentifier) + (Array + (Array + (Tuple + (Integer) + (Integer)) + (Tuple + (Integer) + (Integer))) + (Array + (Tuple + (Integer) + (Integer)) + (Tuple + (Integer) + (Integer))))) + (Generator + (TuplePattern + (Integer) + (VariableIdentifier)) + (VariableIdentifier))))) + (Function + (VariableIdentifier) + (Statements + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + (Integer) + (Integer) + (Integer) + (Integer))) + (Generator + (VariableIdentifier) + (EnumFromTo + (Integer) + (Integer)))))) + (Function + (VariableIdentifier) + (Statements + (ListComprehension + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + (Integer) + (Integer)))) + (Generator + (VariableIdentifier) + (EnumFrom + (Integer)))))) + (Function + (VariableIdentifier) + (Statements + (App + (App + (VariableIdentifier) + (Integer)) + (ListComprehension + (ListComprehension + (Tuple + (VariableIdentifier) + (VariableIdentifier)) + (Generator + (VariableIdentifier) + (Array + (Integer) + (Integer)))) + (Generator + (VariableIdentifier) + (EnumFrom + (Integer))))))) + (Function + (VariableIdentifier) + (Statements + (RightOperatorSection + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (RightOperatorSection + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (LeftOperatorSection + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol))))) + (Function + (VariableIdentifier) + (Statements + (LeftOperatorSection + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol))))) + (Function + (VariableIdentifier) + (Statements + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (InfixVariableIdentifier)) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (QualifiedConstructorIdentifier + (ModuleIdentifier) + (ConstructorIdentifier)))) + (Function + (VariableIdentifier) + (ConstructorPattern + (Statements + (QualifiedConstructorIdentifier + (ModuleIdentifier) + (ConstructorIdentifier)) + (VariableIdentifier))) + (Statements + (InfixOperatorApp + (ConstructorIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (TextElement) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (TextElement) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (TextElement) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (TextElement))))))))))) + (Function + (VariableIdentifier) + (Statements + (Do + (BindPattern + (VariableIdentifier) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (VariableIdentifier))) + (BindPattern + (VariableIdentifier) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (VariableIdentifier)))))) + (Function + (VariableIdentifier) + (Statements + (Lambda + (VariableIdentifier) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (Lambda + (ConstructorPattern + (Statements + (ConstructorIdentifier) + (VariableIdentifier))) + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (Lambda + (VariableIdentifier) + (InfixOperatorApp + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (ConstructorOperator + (ConstructorSymbol)) + (VariableIdentifier)))))) + (Function + (VariableIdentifier) + (Statements + (Lambda + (Statements + (VariableIdentifier) + (VariableIdentifier) + (VariableIdentifier)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (VariableIdentifier)))))) + (Function + (VariableIdentifier) + (Statements + (VariableOperator + (VariableSymbol)))) + (Function + (VariableIdentifier) + (Statements + (InfixOperatorApp + (Integer) + (VariableOperator + (VariableSymbol)) + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (PrefixNegation + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (PrefixNegation + (VariableIdentifier)))) + (Function + (VariableIdentifier) + (Statements + (PrefixNegation + (Integer)))) + (Function + (VariableIdentifier) + (Statements + (InfixOperatorApp + (VariableIdentifier) + (VariableOperator + (VariableSymbol)) + (App + (App + (VariableIdentifier) + (Lambda + (VariableIdentifier) + (InfixOperatorApp + (Tuple + (VariableIdentifier)) + (VariableOperator + (VariableSymbol)) + (InfixOperatorApp + (ConstructorIdentifier) + (VariableOperator + (VariableSymbol)) + (App + (VariableIdentifier) + (VariableIdentifier)))))) + (VariableIdentifier))))))) diff --git a/test/fixtures/haskell/corpus/import-declaration.A.hs b/test/fixtures/haskell/corpus/import-declaration.A.hs new file mode 100644 index 000000000..69a77ad89 --- /dev/null +++ b/test/fixtures/haskell/corpus/import-declaration.A.hs @@ -0,0 +1,34 @@ +module A where + +import Maybe +import Either() +import Data.Maybe (Maybe(..)) +import Data.Aeson ((.:)) +import Control.Comonad.Cofree ((:<)) +import Data.Maybe (fromMaybe, fromJust) +import Data.Maybe (Maybe(..), fromMaybe, fromJust) + +import qualified Data.Maybe +import qualified Either () +import qualified Data.Function (fix) + +import Data.Maybe as DM (Maybe(..)) + +import qualified Data.Maybe as DM +import qualified Either as E () +import qualified Data.Aeson as JSON +import qualified Data.Aeson as D.A + +import Data.Maybe as DM (Maybe(..), fromMaybe) +import qualified Data.Maybe as M (Maybe(..), fromMaybe) + +import GHC.Prim (Proxy#, proxy#) + +import "hint" HLint.Default + +import Data.Maybe hiding (Maybe(..), fromMaybe) + +import qualified Data.Maybe hiding () +import qualified Data.Either hiding (Either(..), decodeEither) +import qualified Data.Function hiding (fix) +import qualified Data.List as DL hiding (head) diff --git a/test/fixtures/haskell/corpus/import-declaration.B.hs b/test/fixtures/haskell/corpus/import-declaration.B.hs new file mode 100644 index 000000000..2049f6c69 --- /dev/null +++ b/test/fixtures/haskell/corpus/import-declaration.B.hs @@ -0,0 +1,34 @@ +module A where + +import Data.Maybe +import Data.Either() +import Data.Util.Maybe (Maybe(..)) +import Data.Util.Aeson ((.:)) +import Control.Util.Comonad.Cofree ((:<)) +import Data.Util.Maybe (fromMaybe, fromJust) +import Data.Util.Maybe (Maybe(..), fromJust, fromMaybe) + +import qualified Data.Util.Maybe +import qualified Data.Either () +import qualified Data.Util.Function (fix) + +import Data.Util.Maybe as DM (Maybe(..)) + +import qualified Data.Util.Maybe as DM +import qualified Data.Either as E () +import qualified Data.Util.Aeson as JSON +import qualified Data.Util.Aeson as D.A + +import Data.Util.Maybe as DM (Maybe(..), fromMaybe) +import qualified Data.Util.Maybe as UM (Maybe(..), fromMaybe) + +import GHC.Prim (Box#, box#) + +import "hlint" HLint.Util.Default + +import Data.Util.Maybe hiding (Maybe(..), fromMaybe) + +import qualified Data.Util.Maybe hiding () +import qualified Data.Util.Either hiding (Either(..), decodeEither) +import qualified Data.Util.Function hiding (fix) +import qualified Data.Util.List as DL hiding (head) diff --git a/test/fixtures/haskell/corpus/import-declaration.diffA-B.txt b/test/fixtures/haskell/corpus/import-declaration.diffA-B.txt new file mode 100644 index 000000000..bae5ac4a0 --- /dev/null +++ b/test/fixtures/haskell/corpus/import-declaration.diffA-B.txt @@ -0,0 +1,412 @@ +(Module + (ModuleIdentifier) + (Statements + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(VariableOperator + {+(VariableSymbol)+})+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(ConstructorOperator + {+(ConstructorSymbol)+})+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(VariableIdentifier)+})+} + {+(Import + {+(VariableIdentifier)+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+} + {+(Import + {+(VariableIdentifier)+})+} + {+(Import + {+(VariableIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(VariableIdentifier)+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+} + {+(Import + {+(VariableIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+} + {+(Import + {+(VariableIdentifier)+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(PrimitiveConstructorIdentifier)+})+} + {+(Import + {+(PrimitiveVariableIdentifier)+})+})+} + {+(ImportDeclaration + {+(TextElement)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(HiddenImport + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+} + {+(HiddenImport + {+(VariableIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(HiddenImport + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+} + {+(HiddenImport + {+(VariableIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(HiddenImport + {+(VariableIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+} + {+(HiddenImport + {+(VariableIdentifier)+})+})+} + {-(ImportDeclaration + {-(Empty)-} + {-(ModuleIdentifier)-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(ModuleIdentifier)-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(VariableOperator + {-(VariableSymbol)-})-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(ConstructorOperator + {-(ConstructorSymbol)-})-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(VariableIdentifier)-})-} + {-(Import + {-(VariableIdentifier)-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-} + {-(Import + {-(VariableIdentifier)-})-} + {-(Import + {-(VariableIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ModuleIdentifier)-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(VariableIdentifier)-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-} + {-(Import + {-(VariableIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-} + {-(Import + {-(VariableIdentifier)-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(PrimitiveConstructorIdentifier)-})-} + {-(Import + {-(PrimitiveVariableIdentifier)-})-})-} + {-(ImportDeclaration + {-(TextElement)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(HiddenImport + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-} + {-(HiddenImport + {-(VariableIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(HiddenImport + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-} + {-(HiddenImport + {-(VariableIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(HiddenImport + {-(VariableIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-} + {-(HiddenImport + {-(VariableIdentifier)-})-})-})) diff --git a/test/fixtures/haskell/corpus/import-declaration.diffB-A.txt b/test/fixtures/haskell/corpus/import-declaration.diffB-A.txt new file mode 100644 index 000000000..2396c65c3 --- /dev/null +++ b/test/fixtures/haskell/corpus/import-declaration.diffB-A.txt @@ -0,0 +1,412 @@ +(Module + (ModuleIdentifier) + (Statements + {+(ImportDeclaration + {+(Empty)+} + {+(ModuleIdentifier)+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(ModuleIdentifier)+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(VariableOperator + {+(VariableSymbol)+})+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(ConstructorOperator + {+(ConstructorSymbol)+})+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(VariableIdentifier)+})+} + {+(Import + {+(VariableIdentifier)+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+} + {+(Import + {+(VariableIdentifier)+})+} + {+(Import + {+(VariableIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ModuleIdentifier)+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(VariableIdentifier)+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+} + {+(Import + {+(VariableIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+} + {+(Import + {+(VariableIdentifier)+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(Import + {+(PrimitiveConstructorIdentifier)+})+} + {+(Import + {+(PrimitiveVariableIdentifier)+})+})+} + {+(ImportDeclaration + {+(TextElement)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+} + {+(ImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(HiddenImport + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+} + {+(HiddenImport + {+(VariableIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(HiddenImport + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(AllConstructors)+})+})+} + {+(HiddenImport + {+(VariableIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(HiddenImport + {+(VariableIdentifier)+})+})+} + {+(QualifiedImportDeclaration + {+(Empty)+} + {+(ImportAlias + {+(QualifiedModuleIdentifier + {+(ModuleIdentifier)+} + {+(ModuleIdentifier)+})+} + {+(ModuleIdentifier)+})+} + {+(HiddenImport + {+(VariableIdentifier)+})+})+} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(VariableOperator + {-(VariableSymbol)-})-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(ConstructorOperator + {-(ConstructorSymbol)-})-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(VariableIdentifier)-})-} + {-(Import + {-(VariableIdentifier)-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-} + {-(Import + {-(VariableIdentifier)-})-} + {-(Import + {-(VariableIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(VariableIdentifier)-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-} + {-(Import + {-(VariableIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-} + {-(Import + {-(VariableIdentifier)-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(Import + {-(PrimitiveConstructorIdentifier)-})-} + {-(Import + {-(PrimitiveVariableIdentifier)-})-})-} + {-(ImportDeclaration + {-(TextElement)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-} + {-(ImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(HiddenImport + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-} + {-(HiddenImport + {-(VariableIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(HiddenImport + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(AllConstructors)-})-})-} + {-(HiddenImport + {-(VariableIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(HiddenImport + {-(VariableIdentifier)-})-})-} + {-(QualifiedImportDeclaration + {-(Empty)-} + {-(ImportAlias + {-(QualifiedModuleIdentifier + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-} + {-(ModuleIdentifier)-})-} + {-(ModuleIdentifier)-})-} + {-(HiddenImport + {-(VariableIdentifier)-})-})-})) diff --git a/test/fixtures/haskell/corpus/import-declaration.parseA.txt b/test/fixtures/haskell/corpus/import-declaration.parseA.txt new file mode 100644 index 000000000..b7cfc8467 --- /dev/null +++ b/test/fixtures/haskell/corpus/import-declaration.parseA.txt @@ -0,0 +1,194 @@ +(Module + (ModuleIdentifier) + (Statements + (ImportDeclaration + (Empty) + (ModuleIdentifier)) + (ImportDeclaration + (Empty) + (ModuleIdentifier)) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (Statements + (TypeConstructorIdentifier) + (AllConstructors)))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (VariableOperator + (VariableSymbol)))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (ConstructorOperator + (ConstructorSymbol)))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (VariableIdentifier)) + (Import + (VariableIdentifier))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (Statements + (TypeConstructorIdentifier) + (AllConstructors))) + (Import + (VariableIdentifier)) + (Import + (VariableIdentifier))) + (QualifiedImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier))) + (QualifiedImportDeclaration + (Empty) + (ModuleIdentifier)) + (QualifiedImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (VariableIdentifier))) + (ImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier)) + (Import + (Statements + (TypeConstructorIdentifier) + (AllConstructors)))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (ModuleIdentifier) + (ModuleIdentifier))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)))) + (ImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier)) + (Import + (Statements + (TypeConstructorIdentifier) + (AllConstructors))) + (Import + (VariableIdentifier))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier)) + (Import + (Statements + (TypeConstructorIdentifier) + (AllConstructors))) + (Import + (VariableIdentifier))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (PrimitiveConstructorIdentifier)) + (Import + (PrimitiveVariableIdentifier))) + (ImportDeclaration + (TextElement) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (HiddenImport + (Statements + (TypeConstructorIdentifier) + (AllConstructors))) + (HiddenImport + (VariableIdentifier))) + (QualifiedImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier))) + (QualifiedImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (HiddenImport + (Statements + (TypeConstructorIdentifier) + (AllConstructors))) + (HiddenImport + (VariableIdentifier))) + (QualifiedImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (HiddenImport + (VariableIdentifier))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier)) + (HiddenImport + (VariableIdentifier))))) diff --git a/test/fixtures/haskell/corpus/import-declaration.parseB.txt b/test/fixtures/haskell/corpus/import-declaration.parseB.txt new file mode 100644 index 000000000..b42341119 --- /dev/null +++ b/test/fixtures/haskell/corpus/import-declaration.parseB.txt @@ -0,0 +1,221 @@ +(Module + (ModuleIdentifier) + (Statements + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (Statements + (TypeConstructorIdentifier) + (AllConstructors)))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (VariableOperator + (VariableSymbol)))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (ConstructorOperator + (ConstructorSymbol)))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (VariableIdentifier)) + (Import + (VariableIdentifier))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (Statements + (TypeConstructorIdentifier) + (AllConstructors))) + (Import + (VariableIdentifier)) + (Import + (VariableIdentifier))) + (QualifiedImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier))) + (QualifiedImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier))) + (QualifiedImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (VariableIdentifier))) + (ImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier)) + (Import + (Statements + (TypeConstructorIdentifier) + (AllConstructors)))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)))) + (ImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier)) + (Import + (Statements + (TypeConstructorIdentifier) + (AllConstructors))) + (Import + (VariableIdentifier))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier)) + (Import + (Statements + (TypeConstructorIdentifier) + (AllConstructors))) + (Import + (VariableIdentifier))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier)) + (Import + (PrimitiveConstructorIdentifier)) + (Import + (PrimitiveVariableIdentifier))) + (ImportDeclaration + (TextElement) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier))) + (ImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (HiddenImport + (Statements + (TypeConstructorIdentifier) + (AllConstructors))) + (HiddenImport + (VariableIdentifier))) + (QualifiedImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier))) + (QualifiedImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (HiddenImport + (Statements + (TypeConstructorIdentifier) + (AllConstructors))) + (HiddenImport + (VariableIdentifier))) + (QualifiedImportDeclaration + (Empty) + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (HiddenImport + (VariableIdentifier))) + (QualifiedImportDeclaration + (Empty) + (ImportAlias + (QualifiedModuleIdentifier + (ModuleIdentifier) + (ModuleIdentifier) + (ModuleIdentifier)) + (ModuleIdentifier)) + (HiddenImport + (VariableIdentifier))))) diff --git a/test/fixtures/haskell/corpus/literals.diffA-B.txt b/test/fixtures/haskell/corpus/literals.diffA-B.txt index 4f0defa69..316dd79d5 100644 --- a/test/fixtures/haskell/corpus/literals.diffA-B.txt +++ b/test/fixtures/haskell/corpus/literals.diffA-B.txt @@ -1,10 +1,11 @@ (Module (ModuleIdentifier) (Statements - {+(Function - {+(VariableIdentifier)+} - {+(Statements - {+(Integer)+})+})+} + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Integer))) {+(Function {+(VariableIdentifier)+} {+(Statements @@ -283,10 +284,6 @@ {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} - {-(Function - {-(VariableIdentifier)-} - {-(Statements - {-(Integer)-})-})-} {-(Function {-(VariableIdentifier)-} {-(Statements diff --git a/test/fixtures/haskell/corpus/literals.diffB-A.txt b/test/fixtures/haskell/corpus/literals.diffB-A.txt index aec6b2b9f..316dd79d5 100644 --- a/test/fixtures/haskell/corpus/literals.diffB-A.txt +++ b/test/fixtures/haskell/corpus/literals.diffB-A.txt @@ -1,10 +1,11 @@ (Module (ModuleIdentifier) (Statements - {+(Function - {+(VariableIdentifier)+} - {+(Statements - {+(Integer)+})+})+} + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Integer))) {+(Function {+(VariableIdentifier)+} {+(Statements @@ -121,12 +122,10 @@ {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} - (Function - { (VariableIdentifier) - ->(VariableIdentifier) } - (Statements - {+(Character)+} - {-(Integer)-})) + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(Character)+})+})+} {+(Function {+(VariableIdentifier)+} {+(Statements diff --git a/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt b/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt index e6eb37bf6..49c3707a2 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt @@ -13,11 +13,9 @@ (Empty)) (NewType (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (Statements { (TypeConstructorIdentifier) ->(TypeConstructorIdentifier) }) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt b/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt index e6eb37bf6..49c3707a2 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt @@ -13,11 +13,9 @@ (Empty)) (NewType (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (Statements { (TypeConstructorIdentifier) ->(TypeConstructorIdentifier) }) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt b/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt index 31b758185..91efd1345 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt @@ -11,11 +11,9 @@ (Empty)) (NewType (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (Statements (TypeConstructorIdentifier)) (Constructor diff --git a/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt b/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt index 31b758185..91efd1345 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt @@ -11,11 +11,9 @@ (Empty)) (NewType (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (Statements (TypeConstructorIdentifier)) (Constructor diff --git a/test/fixtures/haskell/corpus/standalone-deriving-declaration.A.hs b/test/fixtures/haskell/corpus/standalone-deriving-declaration.A.hs new file mode 100644 index 000000000..cb4233642 --- /dev/null +++ b/test/fixtures/haskell/corpus/standalone-deriving-declaration.A.hs @@ -0,0 +1,4 @@ +deriving instance Eq b => Eq (Bar b) +deriving instance Baz a (m a b c) => Baz a (Bar m a b c) +deriving instance Bar Baz foo => BazFail (BarEval foo bix waz) +deriving instance Bar (Foo (Baz waz)) bix => BazHeap bix (BarEval bix wax) diff --git a/test/fixtures/haskell/corpus/standalone-deriving-declaration.B.hs b/test/fixtures/haskell/corpus/standalone-deriving-declaration.B.hs new file mode 100644 index 000000000..c371c20af --- /dev/null +++ b/test/fixtures/haskell/corpus/standalone-deriving-declaration.B.hs @@ -0,0 +1,4 @@ +deriving instance Eq a => Eq (Foo a) +deriving instance Bar a (m a b c) => Bar a (Baz m a b c) +deriving instance Foo Baz foo => BazFail (FooEval foo bix waz) +deriving instance Far (Boo (Baz waz)) bix => BooHeap bix (FarEval bix wax) diff --git a/test/fixtures/haskell/corpus/standalone-deriving-declaration.diffA-B.txt b/test/fixtures/haskell/corpus/standalone-deriving-declaration.diffA-B.txt new file mode 100644 index 000000000..819ea7306 --- /dev/null +++ b/test/fixtures/haskell/corpus/standalone-deriving-declaration.diffA-B.txt @@ -0,0 +1,72 @@ +(Module + (Empty) + (Statements + (StandaloneDerivingInstance + (Context' + (Class + (TypeClassIdentifier) + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })) + (TypeClassIdentifier) + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })) + (StandaloneDerivingInstance + (Context' + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeVariableIdentifier) + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (Statements + (TypeVariableIdentifier) + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) + (StandaloneDerivingInstance + (Context' + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (StandaloneDerivingInstance + (Context' + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) + (TypeVariableIdentifier))) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (Statements + (TypeVariableIdentifier) + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier)))))) diff --git a/test/fixtures/haskell/corpus/standalone-deriving-declaration.diffB-A.txt b/test/fixtures/haskell/corpus/standalone-deriving-declaration.diffB-A.txt new file mode 100644 index 000000000..819ea7306 --- /dev/null +++ b/test/fixtures/haskell/corpus/standalone-deriving-declaration.diffB-A.txt @@ -0,0 +1,72 @@ +(Module + (Empty) + (Statements + (StandaloneDerivingInstance + (Context' + (Class + (TypeClassIdentifier) + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })) + (TypeClassIdentifier) + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })) + (StandaloneDerivingInstance + (Context' + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeVariableIdentifier) + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (Statements + (TypeVariableIdentifier) + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) + (StandaloneDerivingInstance + (Context' + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (StandaloneDerivingInstance + (Context' + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) + (TypeVariableIdentifier))) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (Statements + (TypeVariableIdentifier) + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier)))))) diff --git a/test/fixtures/haskell/corpus/standalone-deriving-declaration.parseA.txt b/test/fixtures/haskell/corpus/standalone-deriving-declaration.parseA.txt new file mode 100644 index 000000000..7e560508e --- /dev/null +++ b/test/fixtures/haskell/corpus/standalone-deriving-declaration.parseA.txt @@ -0,0 +1,60 @@ +(Module + (Empty) + (Statements + (StandaloneDerivingInstance + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) + (StandaloneDerivingInstance + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) + (TypeClassIdentifier) + (Statements + (TypeVariableIdentifier) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) + (StandaloneDerivingInstance + (Context' + (Class + (TypeClassIdentifier) + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (StandaloneDerivingInstance + (Context' + (Class + (TypeClassIdentifier) + (Statements + (TypeConstructorIdentifier) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (Statements + (TypeVariableIdentifier) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))))) diff --git a/test/fixtures/haskell/corpus/standalone-deriving-declaration.parseB.txt b/test/fixtures/haskell/corpus/standalone-deriving-declaration.parseB.txt new file mode 100644 index 000000000..7e560508e --- /dev/null +++ b/test/fixtures/haskell/corpus/standalone-deriving-declaration.parseB.txt @@ -0,0 +1,60 @@ +(Module + (Empty) + (Statements + (StandaloneDerivingInstance + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) + (StandaloneDerivingInstance + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) + (TypeClassIdentifier) + (Statements + (TypeVariableIdentifier) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) + (StandaloneDerivingInstance + (Context' + (Class + (TypeClassIdentifier) + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (StandaloneDerivingInstance + (Context' + (Class + (TypeClassIdentifier) + (Statements + (TypeConstructorIdentifier) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (Statements + (TypeVariableIdentifier) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))))) diff --git a/test/fixtures/haskell/corpus/type-signatures.A.hs b/test/fixtures/haskell/corpus/type-signatures.A.hs index 7f05bc1d5..6ff019c42 100644 --- a/test/fixtures/haskell/corpus/type-signatures.A.hs +++ b/test/fixtures/haskell/corpus/type-signatures.A.hs @@ -10,3 +10,13 @@ f :: a -> B c (D (E g ': h)) -> I [J k] (L m (N (O p ': q))) f :: forall a. [a] -> [a] f :: forall a b. (a, b) -> [a] apply :: proxy c -> (forall g . c g => g a -> b) -> Union fs a -> b + +f :: a ~ Int => a +f :: (a ~ Int) => a +sumCollects :: forall c1 c2. (B c1, B c2, E c1 ~ E c2) => c1 -> c2 -> c2 + +foo :: (Bar m) => Baz [Fiz Fuzz, Wiz, Wax, Woz] bar => a -> Baz m +bar :: (Baz '[Foo Wix a] biz, Waz woo) => Out a -> [Foo] -> Baz biz Waz + +foo :: (f :< Bar) => Bar -> f +yield :: ((Yield a b) :< e) => a diff --git a/test/fixtures/haskell/corpus/type-signatures.B.hs b/test/fixtures/haskell/corpus/type-signatures.B.hs index 4390ea80e..f3914a929 100644 --- a/test/fixtures/haskell/corpus/type-signatures.B.hs +++ b/test/fixtures/haskell/corpus/type-signatures.B.hs @@ -9,3 +9,13 @@ g :: b -> B a (D (E g ': h)) -> I [J k] (L m (O (N p ': q))) g :: forall a. [a] -> [a] g :: forall a b. (a, b) -> [a] apply :: proxy d -> (forall g . d g => g a -> b) -> Union fs a -> b + +g :: a ~ Int => a +g :: (a ~ Int) => a +sumCollects :: forall d1 d2. (B d1, B d2, E d1 ~ E d2) => d1 -> d2 -> d2 + +bar :: (Bar m) => Baz [Fiz Fuzz, Wiz, Wax, Woz] bar => a -> Waz m +foo :: (Baz '[Foo Wix a] biz, Waz woo) => Out a -> [Foo] -> Waz biz Baz + +bar :: (f :< Bar) => Bar -> f +yield :: ((Yield b c) :< e) => b diff --git a/test/fixtures/haskell/corpus/type-signatures.diffA-B.txt b/test/fixtures/haskell/corpus/type-signatures.diffA-B.txt index 5174da51a..21fb0dd52 100644 --- a/test/fixtures/haskell/corpus/type-signatures.diffA-B.txt +++ b/test/fixtures/haskell/corpus/type-signatures.diffA-B.txt @@ -32,11 +32,9 @@ {+(TypeSignature {+(VariableIdentifier)+} {+(Context' - {+(Statements - {+(Class - {+(TypeClassIdentifier)+} - {+(TypeParameters - {+(TypeVariableIdentifier)+})+})+})+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} {+(FunctionType {+(Type {+(TypeVariableIdentifier)+} @@ -232,6 +230,161 @@ {+(TypeVariableIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(EqualityConstraint + {+(TypeVariableIdentifier)+} + {+(TypeConstructorIdentifier)+})+})+} + {+(TypeVariableIdentifier)+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(EqualityConstraint + {+(TypeVariableIdentifier)+} + {+(TypeConstructorIdentifier)+})+})+} + {+(TypeVariableIdentifier)+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(ScopedTypeVariables + {+(Statements + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(Context' + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(EqualityConstraint + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(Array + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeConstructorIdentifier)+})+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeVariableIdentifier)+})+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(QuotedName + {+(Array + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+})+})+} + {+(TypeVariableIdentifier)+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} + {+(FunctionType + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(Array + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+} + {+(TypeConstructorIdentifier)+})+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(Statements + {+(TypeVariableIdentifier)+} + {+(ConstructorOperator + {+(ConstructorSymbol)+})+} + {+(TypeConstructorIdentifier)+})+})+} + {+(FunctionType + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(ConstructorOperator + {+(ConstructorSymbol)+})+} + {+(TypeVariableIdentifier)+})+})+} + {+(TypeVariableIdentifier)+})+} {-(TypeSignature {-(VariableIdentifier)-} {-(FunctionType @@ -266,17 +419,13 @@ {-(TypeSignature {-(VariableIdentifier)-} {-(Context' - {-(Statements - {-(Class - {-(TypeClassIdentifier)-} - {-(TypeParameters - {-(TypeVariableIdentifier)-})-})-})-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} {-(Context' - {-(Statements - {-(Class - {-(TypeClassIdentifier)-} - {-(TypeParameters - {-(TypeVariableIdentifier)-})-})-})-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} {-(FunctionType {-(Type {-(TypeVariableIdentifier)-} @@ -471,4 +620,159 @@ {-(Type {-(TypeVariableIdentifier)-} {-(TypeParameters)-} - {-(Empty)-})-})-})-})-})-})) + {-(Empty)-})-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(EqualityConstraint + {-(TypeVariableIdentifier)-} + {-(TypeConstructorIdentifier)-})-})-} + {-(TypeVariableIdentifier)-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(EqualityConstraint + {-(TypeVariableIdentifier)-} + {-(TypeConstructorIdentifier)-})-})-} + {-(TypeVariableIdentifier)-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(ScopedTypeVariables + {-(Statements + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(Context' + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(EqualityConstraint + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(Array + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeConstructorIdentifier)-})-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeVariableIdentifier)-})-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(QuotedName + {-(Array + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-})-})-} + {-(TypeVariableIdentifier)-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} + {-(FunctionType + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(Array + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-} + {-(TypeConstructorIdentifier)-})-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Statements + {-(TypeVariableIdentifier)-} + {-(ConstructorOperator + {-(ConstructorSymbol)-})-} + {-(TypeConstructorIdentifier)-})-})-} + {-(FunctionType + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(ConstructorOperator + {-(ConstructorSymbol)-})-} + {-(TypeVariableIdentifier)-})-})-} + {-(TypeVariableIdentifier)-})-})) diff --git a/test/fixtures/haskell/corpus/type-signatures.diffB-A.txt b/test/fixtures/haskell/corpus/type-signatures.diffB-A.txt index 1d511880c..3a597a43f 100644 --- a/test/fixtures/haskell/corpus/type-signatures.diffB-A.txt +++ b/test/fixtures/haskell/corpus/type-signatures.diffB-A.txt @@ -63,17 +63,13 @@ {+(TypeSignature {+(VariableIdentifier)+} {+(Context' - {+(Statements - {+(Class - {+(TypeClassIdentifier)+} - {+(TypeParameters - {+(TypeVariableIdentifier)+})+})+})+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} {+(Context' - {+(Statements - {+(Class - {+(TypeClassIdentifier)+} - {+(TypeParameters - {+(TypeVariableIdentifier)+})+})+})+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} {+(FunctionType {+(Type {+(TypeVariableIdentifier)+} @@ -98,11 +94,9 @@ { (VariableIdentifier) ->(VariableIdentifier) } {-(Context' - {-(Statements - {-(Class - {-(TypeClassIdentifier)-} - {-(TypeParameters - {-(TypeVariableIdentifier)-})-})-})-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} (FunctionType (Type { (TypeVariableIdentifier) @@ -278,9 +272,162 @@ {+(TypeVariableIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+})+})+})+})+} - {-(TypeSignature - {-(VariableIdentifier)-} - {-(FunctionType + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(EqualityConstraint + {+(TypeVariableIdentifier)+} + {+(TypeConstructorIdentifier)+})+})+} + {+(TypeVariableIdentifier)+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(EqualityConstraint + {+(TypeVariableIdentifier)+} + {+(TypeConstructorIdentifier)+})+})+} + {+(TypeVariableIdentifier)+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(ScopedTypeVariables + {+(Statements + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(Context' + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(EqualityConstraint + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(Array + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeConstructorIdentifier)+})+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeVariableIdentifier)+})+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(QuotedName + {+(Array + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+})+})+} + {+(TypeVariableIdentifier)+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} + {+(FunctionType + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(Array + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+} + {+(TypeConstructorIdentifier)+})+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(Statements + {+(TypeVariableIdentifier)+} + {+(ConstructorOperator + {+(ConstructorSymbol)+})+} + {+(TypeConstructorIdentifier)+})+})+} + {+(FunctionType + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + (TypeSignature + { (VariableIdentifier) + ->(VariableIdentifier) } + {+(Context' + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(ConstructorOperator + {+(ConstructorSymbol)+})+} + {+(TypeVariableIdentifier)+})+})+} + { (FunctionType {-(Type {-(TypeConstructorIdentifier)-} {-(TypeParameters)-} @@ -288,7 +435,8 @@ {-(Type {-(TypeConstructorIdentifier)-} {-(TypeParameters)-} - {-(Empty)-})-})-})-} + {-(Empty)-})-}) + ->(TypeVariableIdentifier) }) {-(TypeSignature {-(VariableIdentifier)-} {-(FunctionType @@ -463,4 +611,159 @@ {-(Type {-(TypeVariableIdentifier)-} {-(TypeParameters)-} - {-(Empty)-})-})-})-})-})-})) + {-(Empty)-})-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(EqualityConstraint + {-(TypeVariableIdentifier)-} + {-(TypeConstructorIdentifier)-})-})-} + {-(TypeVariableIdentifier)-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(EqualityConstraint + {-(TypeVariableIdentifier)-} + {-(TypeConstructorIdentifier)-})-})-} + {-(TypeVariableIdentifier)-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(ScopedTypeVariables + {-(Statements + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(Context' + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(EqualityConstraint + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(Array + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeConstructorIdentifier)-})-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeVariableIdentifier)-})-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(QuotedName + {-(Array + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-})-})-} + {-(TypeVariableIdentifier)-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} + {-(FunctionType + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(Array + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-} + {-(TypeConstructorIdentifier)-})-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Statements + {-(TypeVariableIdentifier)-} + {-(ConstructorOperator + {-(ConstructorSymbol)-})-} + {-(TypeConstructorIdentifier)-})-})-} + {-(FunctionType + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(ConstructorOperator + {-(ConstructorSymbol)-})-} + {-(TypeVariableIdentifier)-})-})-} + {-(TypeVariableIdentifier)-})-})) diff --git a/test/fixtures/haskell/corpus/type-signatures.parseA.txt b/test/fixtures/haskell/corpus/type-signatures.parseA.txt index 3dceadee9..d7f1176fc 100644 --- a/test/fixtures/haskell/corpus/type-signatures.parseA.txt +++ b/test/fixtures/haskell/corpus/type-signatures.parseA.txt @@ -62,17 +62,13 @@ (TypeSignature (VariableIdentifier) (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (FunctionType (Type (TypeVariableIdentifier) @@ -267,4 +263,159 @@ (Type (TypeVariableIdentifier) (TypeParameters) - (Empty)))))))) + (Empty)))))) + (TypeSignature + (VariableIdentifier) + (Context' + (EqualityConstraint + (TypeVariableIdentifier) + (TypeConstructorIdentifier))) + (TypeVariableIdentifier)) + (TypeSignature + (VariableIdentifier) + (Context' + (EqualityConstraint + (TypeVariableIdentifier) + (TypeConstructorIdentifier))) + (TypeVariableIdentifier)) + (TypeSignature + (VariableIdentifier) + (ScopedTypeVariables + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (EqualityConstraint + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (Context' + (Class + (TypeClassIdentifier) + (Array + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeConstructorIdentifier)) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))) + (TypeVariableIdentifier))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (Context' + (Statements + (Class + (TypeClassIdentifier) + (QuotedName + (Array + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) + (Empty)))) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)))) + (FunctionType + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (FunctionType + (Type + (Array + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeConstructorIdentifier)) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (Context' + (Statements + (TypeVariableIdentifier) + (ConstructorOperator + (ConstructorSymbol)) + (TypeConstructorIdentifier))) + (FunctionType + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (ConstructorOperator + (ConstructorSymbol)) + (TypeVariableIdentifier))) + (TypeVariableIdentifier)))) diff --git a/test/fixtures/haskell/corpus/type-signatures.parseB.txt b/test/fixtures/haskell/corpus/type-signatures.parseB.txt index 107692d14..2df1e295a 100644 --- a/test/fixtures/haskell/corpus/type-signatures.parseB.txt +++ b/test/fixtures/haskell/corpus/type-signatures.parseB.txt @@ -31,11 +31,9 @@ (TypeSignature (VariableIdentifier) (Context' - (Statements - (Class - (TypeClassIdentifier) - (TypeParameters - (TypeVariableIdentifier))))) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) (FunctionType (Type (TypeVariableIdentifier) @@ -230,4 +228,159 @@ (Type (TypeVariableIdentifier) (TypeParameters) - (Empty)))))))) + (Empty)))))) + (TypeSignature + (VariableIdentifier) + (Context' + (EqualityConstraint + (TypeVariableIdentifier) + (TypeConstructorIdentifier))) + (TypeVariableIdentifier)) + (TypeSignature + (VariableIdentifier) + (Context' + (EqualityConstraint + (TypeVariableIdentifier) + (TypeConstructorIdentifier))) + (TypeVariableIdentifier)) + (TypeSignature + (VariableIdentifier) + (ScopedTypeVariables + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (EqualityConstraint + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (Context' + (Class + (TypeClassIdentifier) + (Array + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeConstructorIdentifier)) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))) + (TypeVariableIdentifier))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (Context' + (Statements + (Class + (TypeClassIdentifier) + (QuotedName + (Array + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) + (Empty)))) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)))) + (FunctionType + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (FunctionType + (Type + (Array + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeConstructorIdentifier)) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (Context' + (Statements + (TypeVariableIdentifier) + (ConstructorOperator + (ConstructorSymbol)) + (TypeConstructorIdentifier))) + (FunctionType + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (ConstructorOperator + (ConstructorSymbol)) + (TypeVariableIdentifier))) + (TypeVariableIdentifier)))) diff --git a/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt b/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt index 8716e6a76..4fff50387 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt @@ -52,17 +52,17 @@ (TypeConstructorIdentifier)) (TypePattern (TupleConstructor))) + (TypeSynonym + (Statements + (TypeConstructorIdentifier)) + (TypePattern + { (FunctionConstructor) + ->(TupleConstructor) })) {+(TypeSynonym {+(Statements {+(TypeConstructorIdentifier)+})+} {+(TypePattern - {+(TupleConstructor)+})+})+} - (TypeSynonym - (Statements - { (TypeConstructorIdentifier) - ->(TypeConstructorIdentifier) }) - (TypePattern - (FunctionConstructor))) + {+(FunctionConstructor)+})+})+} (TypeSynonym (Statements (TypeConstructorIdentifier)) @@ -151,8 +151,7 @@ { (TypeConstructorIdentifier) ->(TypeConstructorIdentifier) }) (Context' - (Statements - (TypeConstructorIdentifier))) + (TypeConstructorIdentifier)) (TypePattern (Statements { (TypeConstructorIdentifier) diff --git a/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt b/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt index 2db9cebc4..d03474db8 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt @@ -52,11 +52,12 @@ (TypeConstructorIdentifier)) (TypePattern (TupleConstructor))) - {+(TypeSynonym - {+(Statements - {+(TypeConstructorIdentifier)+})+} - {+(TypePattern - {+(FunctionConstructor)+})+})+} + (TypeSynonym + (Statements + (TypeConstructorIdentifier)) + (TypePattern + { (TupleConstructor) + ->(FunctionConstructor) })) {+(TypeSynonym {+(Statements {+(TypeConstructorIdentifier)+})+} @@ -114,11 +115,14 @@ {+(TypeConstructorIdentifier)+} {+(TypeVariableIdentifier)+})+})+} {+(Empty)+})+})+})+})+})+} - {+(TypeSynonym - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(TypeConstructorIdentifier)+})+} - {+(TextElement)+})+} + (TypeSynonym + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + {+(TypeConstructorIdentifier)+}) + { (TypePattern + {-(FunctionConstructor)-}) + ->(TextElement) }) {+(TypeSynonym {+(Statements {+(TypeConstructorIdentifier)+} @@ -135,8 +139,7 @@ {+(Statements {+(TypeConstructorIdentifier)+})+} {+(Context' - {+(Statements - {+(TypeConstructorIdentifier)+})+})+} + {+(TypeConstructorIdentifier)+})+} {+(TypePattern {+(Statements {+(TypeConstructorIdentifier)+} @@ -168,16 +171,6 @@ {+(TypeConstructorIdentifier)+} {+(TypeVariableIdentifier)+} {+(TypeVariableIdentifier)+})+})+})+})+} - {-(TypeSynonym - {-(Statements - {-(TypeConstructorIdentifier)-})-} - {-(TypePattern - {-(TupleConstructor)-})-})-} - {-(TypeSynonym - {-(Statements - {-(TypeConstructorIdentifier)-})-} - {-(TypePattern - {-(FunctionConstructor)-})-})-} {-(TypeSynonym {-(Statements {-(TypeConstructorIdentifier)-})-} @@ -256,8 +249,7 @@ {-(Statements {-(TypeConstructorIdentifier)-})-} {-(Context' - {-(Statements - {-(TypeConstructorIdentifier)-})-})-} + {-(TypeConstructorIdentifier)-})-} {-(TypePattern {-(Statements {-(TypeConstructorIdentifier)-} diff --git a/test/fixtures/haskell/corpus/type-synonyms.parseA.txt b/test/fixtures/haskell/corpus/type-synonyms.parseA.txt index 02c4c5d07..25807ecdf 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.parseA.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.parseA.txt @@ -128,8 +128,7 @@ (Statements (TypeConstructorIdentifier)) (Context' - (Statements - (TypeConstructorIdentifier))) + (TypeConstructorIdentifier)) (TypePattern (Statements (TypeConstructorIdentifier) diff --git a/test/fixtures/haskell/corpus/type-synonyms.parseB.txt b/test/fixtures/haskell/corpus/type-synonyms.parseB.txt index 1188f81e4..804a2b607 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.parseB.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.parseB.txt @@ -130,8 +130,7 @@ (Statements (TypeConstructorIdentifier)) (Context' - (Statements - (TypeConstructorIdentifier))) + (TypeConstructorIdentifier)) (TypePattern (Statements (TypeConstructorIdentifier) diff --git a/vendor/haskell-tree-sitter b/vendor/haskell-tree-sitter index d21ac9e3c..0b065125c 160000 --- a/vendor/haskell-tree-sitter +++ b/vendor/haskell-tree-sitter @@ -1 +1 @@ -Subproject commit d21ac9e3c2730cf785ecee31b3c152cfff559dd2 +Subproject commit 0b065125cc1318a3daa65dc26819d3be97286688