From 04575d4a0161546d85bd15cd37f770acb207827d Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Tue, 6 Mar 2018 15:16:46 -0800 Subject: [PATCH 1/4] ++haskell-tree-sitter --- vendor/haskell-tree-sitter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/haskell-tree-sitter b/vendor/haskell-tree-sitter index a7c77ef54..19fd85947 160000 --- a/vendor/haskell-tree-sitter +++ b/vendor/haskell-tree-sitter @@ -1 +1 @@ -Subproject commit a7c77ef5459e4f610bd82ce203984f408bc106c2 +Subproject commit 19fd8594796a26b26c0545897fd46f547f316be8 From 4d24e418196e854ec92062c55c85565ceaa5709a Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Tue, 6 Mar 2018 15:46:55 -0800 Subject: [PATCH 2/4] Update Go assignment for dot and blank imports --- src/Language/Go/Assignment.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Language/Go/Assignment.hs b/src/Language/Go/Assignment.hs index da08c6b53..ec092a038 100644 --- a/src/Language/Go/Assignment.hs +++ b/src/Language/Go/Assignment.hs @@ -382,10 +382,14 @@ importDeclaration :: Assignment importDeclaration = makeTerm'' <$> symbol ImportDeclaration <*> children (manyTerm (importSpec <|> importSpecList)) where importSpec = makeTerm <$> symbol ImportSpec <*> children (namedImport <|> plainImport) - namedImport = flip Declaration.Import <$> expression <*> expression <*> pure [] - plainImport = Declaration.Import <$> expression <*> emptyTerm <*> pure [] + namedImport = flip Declaration.Import <$> expression' <*> expression' <*> pure [] + plainImport = Declaration.Import <$> expression' <*> emptyTerm <*> pure [] importSpecList = makeTerm <$> symbol ImportSpecList <*> children (manyTerm (importSpec <|> comment)) + expression' = expression <|> dotImport <|> blankImport + dotImport = makeTerm <$> symbol Dot <*> (Syntax.Identifier <$> source) + blankImport = makeTerm <$> symbol BlankIdentifier <*> (Syntax.Identifier <$> source) + indexExpression :: Assignment indexExpression = makeTerm <$> symbol IndexExpression <*> children (Expression.Subscript <$> expression <*> manyTerm expression) From a0ec9e7c07ec5220dad70c0aa463bd7a27bdb909 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Tue, 6 Mar 2018 15:47:22 -0800 Subject: [PATCH 3/4] Go import test changes --- test/fixtures/go/grouped-import-declarations.diffA-B.txt | 2 +- test/fixtures/go/grouped-import-declarations.diffB-A.txt | 2 +- test/fixtures/go/grouped-import-declarations.parseA.txt | 2 +- test/fixtures/go/grouped-import-declarations.parseB.txt | 2 +- test/fixtures/go/single-import-declarations.diffA-B.txt | 2 +- test/fixtures/go/single-import-declarations.diffB-A.txt | 2 +- test/fixtures/go/single-import-declarations.parseA.txt | 2 +- test/fixtures/go/single-import-declarations.parseB.txt | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/fixtures/go/grouped-import-declarations.diffA-B.txt b/test/fixtures/go/grouped-import-declarations.diffA-B.txt index 92b8da44a..8afc35606 100644 --- a/test/fixtures/go/grouped-import-declarations.diffA-B.txt +++ b/test/fixtures/go/grouped-import-declarations.diffA-B.txt @@ -9,7 +9,7 @@ (Import { (TextElement) ->(TextElement) } - (Empty)) + (Identifier)) (Import { (TextElement) ->(TextElement) } diff --git a/test/fixtures/go/grouped-import-declarations.diffB-A.txt b/test/fixtures/go/grouped-import-declarations.diffB-A.txt index 92b8da44a..8afc35606 100644 --- a/test/fixtures/go/grouped-import-declarations.diffB-A.txt +++ b/test/fixtures/go/grouped-import-declarations.diffB-A.txt @@ -9,7 +9,7 @@ (Import { (TextElement) ->(TextElement) } - (Empty)) + (Identifier)) (Import { (TextElement) ->(TextElement) } diff --git a/test/fixtures/go/grouped-import-declarations.parseA.txt b/test/fixtures/go/grouped-import-declarations.parseA.txt index 1d9129058..213f60624 100644 --- a/test/fixtures/go/grouped-import-declarations.parseA.txt +++ b/test/fixtures/go/grouped-import-declarations.parseA.txt @@ -7,7 +7,7 @@ (Empty)) (Import (TextElement) - (Empty)) + (Identifier)) (Import (TextElement) (Identifier))) diff --git a/test/fixtures/go/grouped-import-declarations.parseB.txt b/test/fixtures/go/grouped-import-declarations.parseB.txt index 1d9129058..213f60624 100644 --- a/test/fixtures/go/grouped-import-declarations.parseB.txt +++ b/test/fixtures/go/grouped-import-declarations.parseB.txt @@ -7,7 +7,7 @@ (Empty)) (Import (TextElement) - (Empty)) + (Identifier)) (Import (TextElement) (Identifier))) diff --git a/test/fixtures/go/single-import-declarations.diffA-B.txt b/test/fixtures/go/single-import-declarations.diffA-B.txt index 1deb3d52b..654f94319 100644 --- a/test/fixtures/go/single-import-declarations.diffA-B.txt +++ b/test/fixtures/go/single-import-declarations.diffA-B.txt @@ -8,7 +8,7 @@ (Import { (TextElement) ->(TextElement) } - (Empty)) + (Identifier)) (Import { (TextElement) ->(TextElement) } diff --git a/test/fixtures/go/single-import-declarations.diffB-A.txt b/test/fixtures/go/single-import-declarations.diffB-A.txt index 1deb3d52b..654f94319 100644 --- a/test/fixtures/go/single-import-declarations.diffB-A.txt +++ b/test/fixtures/go/single-import-declarations.diffB-A.txt @@ -8,7 +8,7 @@ (Import { (TextElement) ->(TextElement) } - (Empty)) + (Identifier)) (Import { (TextElement) ->(TextElement) } diff --git a/test/fixtures/go/single-import-declarations.parseA.txt b/test/fixtures/go/single-import-declarations.parseA.txt index f596e2a0e..31339bde0 100644 --- a/test/fixtures/go/single-import-declarations.parseA.txt +++ b/test/fixtures/go/single-import-declarations.parseA.txt @@ -6,7 +6,7 @@ (Empty)) (Import (TextElement) - (Empty)) + (Identifier)) (Import (TextElement) (Identifier)) diff --git a/test/fixtures/go/single-import-declarations.parseB.txt b/test/fixtures/go/single-import-declarations.parseB.txt index f596e2a0e..31339bde0 100644 --- a/test/fixtures/go/single-import-declarations.parseB.txt +++ b/test/fixtures/go/single-import-declarations.parseB.txt @@ -6,7 +6,7 @@ (Empty)) (Import (TextElement) - (Empty)) + (Identifier)) (Import (TextElement) (Identifier)) From 25b9826faa47e7efe1d1f86b598bd596b5a18a9c Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Tue, 6 Mar 2018 15:47:48 -0800 Subject: [PATCH 4/4] Go function/method parameter list changes --- .../go/function-declarations.diffA-B.txt | 10 ++++---- .../go/function-declarations.diffB-A.txt | 10 ++++---- .../go/function-declarations.parseA.txt | 10 ++++---- .../go/function-declarations.parseB.txt | 10 ++++---- .../fixtures/go/function-literals.diffA-B.txt | 10 ++++---- .../fixtures/go/function-literals.diffB-A.txt | 10 ++++---- test/fixtures/go/function-literals.parseA.txt | 6 +++-- test/fixtures/go/function-literals.parseB.txt | 6 +++-- test/fixtures/go/function-types.diffA-B.txt | 23 +++++++++++-------- test/fixtures/go/function-types.diffB-A.txt | 23 +++++++++++-------- test/fixtures/go/function-types.parseA.txt | 15 ++++++++---- test/fixtures/go/function-types.parseB.txt | 12 ++++++---- .../go/method-declarations.diffA-B.txt | 7 +++--- .../go/method-declarations.diffB-A.txt | 7 +++--- .../go/method-declarations.parseA.txt | 5 ++-- .../go/method-declarations.parseB.txt | 5 ++-- .../type-conversion-expressions.diffA-B.txt | 11 +++++---- .../type-conversion-expressions.diffB-A.txt | 11 +++++---- .../go/type-conversion-expressions.parseA.txt | 9 ++++---- .../go/type-conversion-expressions.parseB.txt | 9 ++++---- ...variadic-function-declarations.diffA-B.txt | 3 ++- ...variadic-function-declarations.diffB-A.txt | 3 ++- .../variadic-function-declarations.parseA.txt | 3 ++- .../variadic-function-declarations.parseB.txt | 3 ++- 24 files changed, 130 insertions(+), 91 deletions(-) diff --git a/test/fixtures/go/function-declarations.diffA-B.txt b/test/fixtures/go/function-declarations.diffA-B.txt index 4dc8a5af6..7c6f9b520 100644 --- a/test/fixtures/go/function-declarations.diffA-B.txt +++ b/test/fixtures/go/function-declarations.diffA-B.txt @@ -20,9 +20,9 @@ ( (Identifier) (Identifier)) - (Identifier) - (Identifier) ( + (Identifier) + (Identifier) (Identifier) (Identifier))) ([])) @@ -32,8 +32,10 @@ ->(Identifier) } ([]) ( - (Identifier) - (Identifier)) + ( + (Identifier)) + ( + (Identifier))) ([])) (Function (Empty) diff --git a/test/fixtures/go/function-declarations.diffB-A.txt b/test/fixtures/go/function-declarations.diffB-A.txt index 5d4f8f80e..7e1d0fe63 100644 --- a/test/fixtures/go/function-declarations.diffB-A.txt +++ b/test/fixtures/go/function-declarations.diffB-A.txt @@ -20,9 +20,9 @@ ( (Identifier) (Identifier)) - (Identifier) - (Identifier) ( + (Identifier) + (Identifier) (Identifier) (Identifier))) ([])) @@ -32,8 +32,10 @@ ->(Identifier) } ([]) ( - (Identifier) - (Identifier)) + ( + (Identifier)) + ( + (Identifier))) ([])) (Function (Empty) diff --git a/test/fixtures/go/function-declarations.parseA.txt b/test/fixtures/go/function-declarations.parseA.txt index 1bf16c8bc..952dcfd92 100644 --- a/test/fixtures/go/function-declarations.parseA.txt +++ b/test/fixtures/go/function-declarations.parseA.txt @@ -18,9 +18,9 @@ ( (Identifier) (Identifier)) - (Identifier) - (Identifier) ( + (Identifier) + (Identifier) (Identifier) (Identifier))) ([])) @@ -29,8 +29,10 @@ (Identifier) ([]) ( - (Identifier) - (Identifier)) + ( + (Identifier)) + ( + (Identifier))) ([])) (Function (Empty) diff --git a/test/fixtures/go/function-declarations.parseB.txt b/test/fixtures/go/function-declarations.parseB.txt index a79f41647..41d9114c0 100644 --- a/test/fixtures/go/function-declarations.parseB.txt +++ b/test/fixtures/go/function-declarations.parseB.txt @@ -18,9 +18,9 @@ ( (Identifier) (Identifier)) - (Identifier) - (Identifier) ( + (Identifier) + (Identifier) (Identifier) (Identifier))) ([])) @@ -29,8 +29,10 @@ (Identifier) ([]) ( - (Identifier) - (Identifier)) + ( + (Identifier)) + ( + (Identifier))) ([])) (Function (Empty) diff --git a/test/fixtures/go/function-literals.diffA-B.txt b/test/fixtures/go/function-literals.diffA-B.txt index eba62a683..eaa36d816 100644 --- a/test/fixtures/go/function-literals.diffA-B.txt +++ b/test/fixtures/go/function-literals.diffA-B.txt @@ -16,10 +16,12 @@ { (Identifier) ->(Identifier) }) ( - { (Identifier) - ->(Identifier) } - { (Identifier) - ->(Identifier) }) + ( + { (Identifier) + ->(Identifier) }) + ( + { (Identifier) + ->(Identifier) })) (Return ( (Integer) diff --git a/test/fixtures/go/function-literals.diffB-A.txt b/test/fixtures/go/function-literals.diffB-A.txt index eba62a683..eaa36d816 100644 --- a/test/fixtures/go/function-literals.diffB-A.txt +++ b/test/fixtures/go/function-literals.diffB-A.txt @@ -16,10 +16,12 @@ { (Identifier) ->(Identifier) }) ( - { (Identifier) - ->(Identifier) } - { (Identifier) - ->(Identifier) }) + ( + { (Identifier) + ->(Identifier) }) + ( + { (Identifier) + ->(Identifier) })) (Return ( (Integer) diff --git a/test/fixtures/go/function-literals.parseA.txt b/test/fixtures/go/function-literals.parseA.txt index d4269bf7a..d093df3ed 100644 --- a/test/fixtures/go/function-literals.parseA.txt +++ b/test/fixtures/go/function-literals.parseA.txt @@ -14,8 +14,10 @@ (Identifier) (Identifier)) ( - (Identifier) - (Identifier)) + ( + (Identifier)) + ( + (Identifier))) (Return ( (Integer) diff --git a/test/fixtures/go/function-literals.parseB.txt b/test/fixtures/go/function-literals.parseB.txt index d4269bf7a..d093df3ed 100644 --- a/test/fixtures/go/function-literals.parseB.txt +++ b/test/fixtures/go/function-literals.parseB.txt @@ -14,8 +14,10 @@ (Identifier) (Identifier)) ( - (Identifier) - (Identifier)) + ( + (Identifier)) + ( + (Identifier))) (Return ( (Integer) diff --git a/test/fixtures/go/function-types.diffA-B.txt b/test/fixtures/go/function-types.diffA-B.txt index de2e4fc12..deb33ed0f 100644 --- a/test/fixtures/go/function-types.diffA-B.txt +++ b/test/fixtures/go/function-types.diffA-B.txt @@ -10,8 +10,9 @@ { (Identifier) ->(Identifier) } (Function - { (Identifier) - ->(Identifier) } + ( + { (Identifier) + ->(Identifier) }) { (Identifier) ->(Identifier) })) (Type @@ -19,13 +20,17 @@ ->(Identifier) } (Function ( - {-(Identifier)-} - (Identifier) - {+(Identifier)+}) - ( + {-( + {-(Identifier)-})-} + ( + (Identifier)) {+( + {+(Identifier)+})+}) + ( + ( {+(BidirectionalChannel - {+(Identifier)+})+})+} - {-(Identifier)-} - (Identifier)) + {+(Identifier)+})+} + {-(Identifier)-}) + ( + (Identifier))) (Empty)))))) diff --git a/test/fixtures/go/function-types.diffB-A.txt b/test/fixtures/go/function-types.diffB-A.txt index bd19f9608..df745aa68 100644 --- a/test/fixtures/go/function-types.diffB-A.txt +++ b/test/fixtures/go/function-types.diffB-A.txt @@ -10,8 +10,9 @@ { (Identifier) ->(Identifier) } (Function - { (Identifier) - ->(Identifier) } + ( + { (Identifier) + ->(Identifier) }) { (Identifier) ->(Identifier) })) (Type @@ -19,13 +20,17 @@ ->(Identifier) } (Function ( - {-(Identifier)-} - (Identifier) - {+(Identifier)+}) - ( - {+(Identifier)+} {-( + {-(Identifier)-})-} + ( + (Identifier)) + {+( + {+(Identifier)+})+}) + ( + ( + {+(Identifier)+} {-(BidirectionalChannel - {-(Identifier)-})-})-} - (Identifier)) + {-(Identifier)-})-}) + ( + (Identifier))) (Empty)))))) diff --git a/test/fixtures/go/function-types.parseA.txt b/test/fixtures/go/function-types.parseA.txt index 30d48a317..674e28742 100644 --- a/test/fixtures/go/function-types.parseA.txt +++ b/test/fixtures/go/function-types.parseA.txt @@ -9,15 +9,20 @@ (Type (Identifier) (Function - (Identifier) + ( + (Identifier)) (Identifier))) (Type (Identifier) (Function ( - (Identifier) - (Identifier)) + ( + (Identifier)) + ( + (Identifier))) ( - (Identifier) - (Identifier)) + ( + (Identifier)) + ( + (Identifier))) (Empty)))))) diff --git a/test/fixtures/go/function-types.parseB.txt b/test/fixtures/go/function-types.parseB.txt index a22f99210..5710485e2 100644 --- a/test/fixtures/go/function-types.parseB.txt +++ b/test/fixtures/go/function-types.parseB.txt @@ -9,17 +9,21 @@ (Type (Identifier) (Function - (Identifier) + ( + (Identifier)) (Identifier))) (Type (Identifier) (Function ( - (Identifier) - (Identifier)) + ( + (Identifier)) + ( + (Identifier))) ( ( (BidirectionalChannel (Identifier))) - (Identifier)) + ( + (Identifier))) (Empty)))))) diff --git a/test/fixtures/go/method-declarations.diffA-B.txt b/test/fixtures/go/method-declarations.diffA-B.txt index 61013e143..f02e16c27 100644 --- a/test/fixtures/go/method-declarations.diffA-B.txt +++ b/test/fixtures/go/method-declarations.diffA-B.txt @@ -127,8 +127,7 @@ ( { (Identifier) ->(Identifier) } - ( - { (Identifier) - ->(Identifier) } - (Identifier))) + { (Identifier) + ->(Identifier) } + (Identifier)) ([]))) diff --git a/test/fixtures/go/method-declarations.diffB-A.txt b/test/fixtures/go/method-declarations.diffB-A.txt index 025698b0e..0b5a44637 100644 --- a/test/fixtures/go/method-declarations.diffB-A.txt +++ b/test/fixtures/go/method-declarations.diffB-A.txt @@ -127,8 +127,7 @@ ( { (Identifier) ->(Identifier) } - ( - { (Identifier) - ->(Identifier) } - (Identifier))) + { (Identifier) + ->(Identifier) } + (Identifier)) ([]))) diff --git a/test/fixtures/go/method-declarations.parseA.txt b/test/fixtures/go/method-declarations.parseA.txt index b722151ac..fd96cd611 100644 --- a/test/fixtures/go/method-declarations.parseA.txt +++ b/test/fixtures/go/method-declarations.parseA.txt @@ -92,7 +92,6 @@ (Identifier) ( (Identifier) - ( - (Identifier) - (Identifier))) + (Identifier) + (Identifier)) ([]))) diff --git a/test/fixtures/go/method-declarations.parseB.txt b/test/fixtures/go/method-declarations.parseB.txt index d841638f3..8f9246647 100644 --- a/test/fixtures/go/method-declarations.parseB.txt +++ b/test/fixtures/go/method-declarations.parseB.txt @@ -106,7 +106,6 @@ (Identifier) ( (Identifier) - ( - (Identifier) - (Identifier))) + (Identifier) + (Identifier)) ([]))) diff --git a/test/fixtures/go/type-conversion-expressions.diffA-B.txt b/test/fixtures/go/type-conversion-expressions.diffA-B.txt index 6b7ae6ced..631d33a2f 100644 --- a/test/fixtures/go/type-conversion-expressions.diffA-B.txt +++ b/test/fixtures/go/type-conversion-expressions.diffA-B.txt @@ -6,11 +6,12 @@ (Identifier) ([]) ( - (TypeConversion - (Pointer - (Identifier)) - { (Identifier) - ->(Identifier) }) + (Pointer + (Call + (Identifier) + { (Identifier) + ->(Identifier) } + (Empty))) (Call (Pointer (Identifier)) diff --git a/test/fixtures/go/type-conversion-expressions.diffB-A.txt b/test/fixtures/go/type-conversion-expressions.diffB-A.txt index 6b7ae6ced..631d33a2f 100644 --- a/test/fixtures/go/type-conversion-expressions.diffB-A.txt +++ b/test/fixtures/go/type-conversion-expressions.diffB-A.txt @@ -6,11 +6,12 @@ (Identifier) ([]) ( - (TypeConversion - (Pointer - (Identifier)) - { (Identifier) - ->(Identifier) }) + (Pointer + (Call + (Identifier) + { (Identifier) + ->(Identifier) } + (Empty))) (Call (Pointer (Identifier)) diff --git a/test/fixtures/go/type-conversion-expressions.parseA.txt b/test/fixtures/go/type-conversion-expressions.parseA.txt index 2fe766090..5ed2e0c9d 100644 --- a/test/fixtures/go/type-conversion-expressions.parseA.txt +++ b/test/fixtures/go/type-conversion-expressions.parseA.txt @@ -6,10 +6,11 @@ (Identifier) ([]) ( - (TypeConversion - (Pointer - (Identifier)) - (Identifier)) + (Pointer + (Call + (Identifier) + (Identifier) + (Empty))) (Call (Pointer (Identifier)) diff --git a/test/fixtures/go/type-conversion-expressions.parseB.txt b/test/fixtures/go/type-conversion-expressions.parseB.txt index 2fe766090..5ed2e0c9d 100644 --- a/test/fixtures/go/type-conversion-expressions.parseB.txt +++ b/test/fixtures/go/type-conversion-expressions.parseB.txt @@ -6,10 +6,11 @@ (Identifier) ([]) ( - (TypeConversion - (Pointer - (Identifier)) - (Identifier)) + (Pointer + (Call + (Identifier) + (Identifier) + (Empty))) (Call (Pointer (Identifier)) diff --git a/test/fixtures/go/variadic-function-declarations.diffA-B.txt b/test/fixtures/go/variadic-function-declarations.diffA-B.txt index 1391474f2..b66ed9a13 100644 --- a/test/fixtures/go/variadic-function-declarations.diffA-B.txt +++ b/test/fixtures/go/variadic-function-declarations.diffA-B.txt @@ -28,7 +28,8 @@ { (Identifier) ->(Identifier) } ( - (Identifier) + ( + (Identifier)) (Variadic (Identifier) (Empty))) diff --git a/test/fixtures/go/variadic-function-declarations.diffB-A.txt b/test/fixtures/go/variadic-function-declarations.diffB-A.txt index 1391474f2..b66ed9a13 100644 --- a/test/fixtures/go/variadic-function-declarations.diffB-A.txt +++ b/test/fixtures/go/variadic-function-declarations.diffB-A.txt @@ -28,7 +28,8 @@ { (Identifier) ->(Identifier) } ( - (Identifier) + ( + (Identifier)) (Variadic (Identifier) (Empty))) diff --git a/test/fixtures/go/variadic-function-declarations.parseA.txt b/test/fixtures/go/variadic-function-declarations.parseA.txt index 67b4e3475..9c0534c47 100644 --- a/test/fixtures/go/variadic-function-declarations.parseA.txt +++ b/test/fixtures/go/variadic-function-declarations.parseA.txt @@ -25,7 +25,8 @@ (Empty) (Identifier) ( - (Identifier) + ( + (Identifier)) (Variadic (Identifier) (Empty))) diff --git a/test/fixtures/go/variadic-function-declarations.parseB.txt b/test/fixtures/go/variadic-function-declarations.parseB.txt index 67b4e3475..9c0534c47 100644 --- a/test/fixtures/go/variadic-function-declarations.parseB.txt +++ b/test/fixtures/go/variadic-function-declarations.parseB.txt @@ -25,7 +25,8 @@ (Empty) (Identifier) ( - (Identifier) + ( + (Identifier)) (Variadic (Identifier) (Empty)))