1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00

Bump to the latest tree-sitter* packages.

This commit is contained in:
Rob Rix 2019-09-27 14:02:49 -04:00
parent cf1320586d
commit bd73cd0e1d
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
4 changed files with 21 additions and 20 deletions

View File

@ -23,9 +23,10 @@ common haskell
build-depends: base ^>=4.12
, fused-effects ^>= 0.5
, semantic-core ^>= 0.0
, semantic-source ^>= 0.0
, text ^>= 1.2.3
, tree-sitter == 0.3.0.0
, tree-sitter-python == 0.4.0.0
, tree-sitter ^>= 0.4
, tree-sitter-python ^>= 0.5
ghc-options:
-Weverything

View File

@ -25,9 +25,9 @@ import Data.String (IsString)
import Data.Text (Text)
import GHC.Generics
import GHC.Records
import Source.Span (Span)
import qualified Source.Span as Source
import qualified TreeSitter.Python.AST as Py
import TreeSitter.Span (Span)
import qualified TreeSitter.Span as TreeSitter
newtype SourcePath = SourcePath { rawPath :: Text }
deriving stock (Eq, Show)
@ -90,7 +90,7 @@ locate :: ( HasField "ann" syntax Span
) => syntax -> t a -> m (t a)
locate syn item = do
fp <- asks @SourcePath rawPath
let locFromTSSpan (TreeSitter.Span (TreeSitter.Pos a b) (TreeSitter.Pos c d))
let locFromTSSpan (Source.Span (Source.Pos a b) (Source.Pos c d))
= Data.Loc.Loc fp (Data.Loc.Span (Data.Loc.Pos a b) (Data.Loc.Pos c d))
pure (Core.annAt (locFromTSSpan (getField @"ann" syn)) item)
@ -103,7 +103,7 @@ newtype CompileSum py = CompileSum py
instance (Generic py, GCompileSum (Rep py)) => Compile (CompileSum py) where
compileCC (CompileSum a) cc = gcompileCCSum (from a) cc
deriving via CompileSum (Either l r) instance (Compile l, Compile r) => Compile (Either l r)
deriving via CompileSum ((l :+: r) Span) instance (Compile (l Span), Compile (r Span)) => Compile ((l :+: r) Span)
instance Compile (Py.AssertStatement Span)
instance Compile (Py.Attribute Span)
@ -198,8 +198,8 @@ instance Compile (Py.Identifier Span) where
instance Compile (Py.IfStatement Span) where
compileCC it@Py.IfStatement{ condition, consequence, alternative} cc =
locate it =<< (if' <$> compile condition <*> compileCC consequence cc <*> foldr clause cc alternative)
where clause (Right Py.ElseClause{ body }) _ = compileCC body cc
clause (Left Py.ElifClause{ condition, consequence }) rest =
where clause (R1 Py.ElseClause{ body }) _ = compileCC body cc
clause (L1 Py.ElifClause{ condition, consequence }) rest =
if' <$> compile condition <*> compileCC consequence cc <*> rest

View File

@ -32,8 +32,8 @@ library
, fused-effects ^>= 0.5
, semantic-source ^>= 0.0
, text ^>= 1.2.3.1
, tree-sitter == 0.3.0.0
, tree-sitter-python == 0.4.0.0
, tree-sitter ^>= 0.4
, tree-sitter-python ^>= 0.5
hs-source-dirs: src
default-language: Haskell2010
ghc-options:

View File

@ -56,7 +56,7 @@ common dependencies
, fused-effects ^>= 0.5.0.0
, fused-effects-exceptions ^>= 0.2.0.0
, hashable ^>= 1.2.7.0
, tree-sitter == 0.3.0.0
, tree-sitter ^>= 0.4
, mtl ^>= 2.2.2
, network ^>= 2.8.0.0
, pathtype ^>= 0.8.1
@ -310,15 +310,15 @@ library
, unliftio-core ^>= 0.1.2.0
, unordered-containers ^>= 0.2.9.0
, vector ^>= 0.12.0.2
, tree-sitter-go == 0.2.0.0
, tree-sitter-haskell == 0.2.0.0
, tree-sitter-json == 0.2.0.0
, tree-sitter-php == 0.2.0.0
, tree-sitter-python == 0.4.0.0
, tree-sitter-ruby == 0.2.0.0
, tree-sitter-typescript == 0.2.1.0
, tree-sitter-tsx == 0.2.1.0
, tree-sitter-java == 0.2.0.0
, tree-sitter-go ^>= 0.2
, tree-sitter-haskell ^>= 0.2
, tree-sitter-json ^>= 0.2
, tree-sitter-php ^>= 0.2
, tree-sitter-python ^>= 0.5
, tree-sitter-ruby ^>= 0.2
, tree-sitter-typescript ^>= 0.2.1
, tree-sitter-tsx ^>= 0.2.1
, tree-sitter-java ^>= 0.2
if flag(release)
cpp-options: -DCOMPUTE_GIT_SHA