1
1
mirror of https://github.com/github/semantic.git synced 2024-11-22 23:29:37 +03:00

Pin to the tree-sitter-ql used in the latest Hackage package.

This commit is contained in:
Patrick Thomson 2020-06-30 11:17:47 -04:00
parent 7083c98e5d
commit cd5fe18219
3 changed files with 53 additions and 18 deletions

View File

@ -199,12 +199,6 @@ tree_sitter_node_types_archive(
version = "0.16.2",
)
tree_sitter_node_types_archive(
name = "tree-sitter-ql",
sha256 = "b43dca6676dd95eb817bf5e8933183591f48169f6466382463f199ba6132b5c5",
version = "1.1.0",
)
# Download lingo (which has its own Bazel build instructions).
git_repository(
@ -226,3 +220,13 @@ exports_files(["src/node-types.json"])
remote = "https://github.com/tree-sitter/tree-sitter-ruby.git",
shallow_since = "1576688803 -0800",
)
new_git_repository(
name = "tree-sitter-ql",
build_file_content = """
exports_files(["src/node-types.json"])
""",
commit = "c0d674abed8836bb5a4770f547343ef100f88c24",
remote = "https://github.com/tree-sitter/tree-sitter-ql.git",
shallow_since = "1585868745 -0700",
)

View File

@ -117,6 +117,14 @@ instance ToTags CodeQL.DatatypeBranch where
} = yieldTag text P.CLASS P.DEFINITION ann byteRange >> gtags t
tags _ = pure ()
instance ToTags CodeQL.ClasslessPredicateCall where
tags
CodeQL.ClasslessPredicateCall
{ extraChildren
} = for_ extraChildren $ \x -> case x of
EPrj t@CodeQL.AritylessPredicateExpr {} -> tags t
_ -> pure ()
instance ToTags CodeQL.QualifiedRhs where
tags
t@CodeQL.QualifiedRhs
@ -142,54 +150,74 @@ instance ToTags CodeQL.Aggregate
instance ToTags CodeQL.AnnotArg
instance ToTags CodeQL.Annotation
instance ToTags CodeQL.AnnotName
instance ToTags CodeQL.Any
instance ToTags CodeQL.As
instance ToTags CodeQL.Asc
instance ToTags CodeQL.AsExpr
instance ToTags CodeQL.AsExprs
instance ToTags CodeQL.Avg
instance ToTags CodeQL.Body
instance ToTags CodeQL.Bool
instance ToTags CodeQL.CallBody
instance ToTags CodeQL.CallOrUnqualAggExpr
instance ToTags CodeQL.Boolean
instance ToTags CodeQL.Charpred
instance ToTags CodeQL.ClassMember
instance ToTags CodeQL.ClassName
instance ToTags CodeQL.Closure
instance ToTags CodeQL.Compop
instance ToTags CodeQL.CompTerm
instance ToTags CodeQL.Concat
instance ToTags CodeQL.Conjunction
instance ToTags CodeQL.Count
instance ToTags CodeQL.Class
instance ToTags CodeQL.DatatypeBranches
instance ToTags CodeQL.Date
instance ToTags CodeQL.Dbtype
instance ToTags CodeQL.Desc
instance ToTags CodeQL.Direction
instance ToTags CodeQL.Disjunction
instance ToTags CodeQL.Empty
instance ToTags CodeQL.Eq
instance ToTags CodeQL.Exists
instance ToTags CodeQL.ExprAggregateBody
instance ToTags CodeQL.Extends
instance ToTags CodeQL.False
instance ToTags CodeQL.Field
instance ToTags CodeQL.Float
instance ToTags CodeQL.Forall
instance ToTags CodeQL.Forex
instance ToTags CodeQL.FullAggregateBody
instance ToTags CodeQL.Ge
instance ToTags CodeQL.Gt
instance ToTags CodeQL.HigherOrderTerm
instance ToTags CodeQL.IfTerm
instance ToTags CodeQL.Implication
instance ToTags CodeQL.ImportDirective
instance ToTags CodeQL.Import
instance ToTags CodeQL.ImportModuleExpr
instance ToTags CodeQL.Imprt
instance ToTags CodeQL.In
instance ToTags CodeQL.InExpr
instance ToTags CodeQL.InstanceOf
instance ToTags CodeQL.Instanceof
instance ToTags CodeQL.Integer
instance ToTags CodeQL.Le
instance ToTags CodeQL.Literal
instance ToTags CodeQL.LiteralId
instance ToTags CodeQL.Lt
instance ToTags CodeQL.Max
instance ToTags CodeQL.Mod
instance ToTags CodeQL.ModuleAliasBody
instance ToTags CodeQL.ModuleExpr
instance ToTags CodeQL.ModuleMember
instance ToTags CodeQL.ModuleName
instance ToTags CodeQL.Min
instance ToTags CodeQL.Minus
instance ToTags CodeQL.MulExpr
instance ToTags CodeQL.Mulop
instance ToTags CodeQL.Ne
instance ToTags CodeQL.Negation
instance ToTags CodeQL.Newtype
instance ToTags CodeQL.None
instance ToTags CodeQL.Not
instance ToTags CodeQL.OrderBy
instance ToTags CodeQL.OrderBys
instance ToTags CodeQL.ParExpr
@ -199,7 +227,6 @@ instance ToTags CodeQL.PredicateAliasBody
instance ToTags CodeQL.PredicateExpr
instance ToTags CodeQL.PredicateName
instance ToTags CodeQL.PrefixCast
instance ToTags CodeQL.PrimitiveType
instance ToTags CodeQL.Ql
instance ToTags CodeQL.Qldoc
instance ToTags CodeQL.QualifiedExpr
@ -207,25 +234,29 @@ instance ToTags CodeQL.QualModuleExpr
instance ToTags CodeQL.Quantified
instance ToTags CodeQL.Quantifier
instance ToTags CodeQL.Range
instance ToTags CodeQL.Rank
instance ToTags CodeQL.Result
instance ToTags CodeQL.ReturnType
instance ToTags CodeQL.Select
instance ToTags CodeQL.SetLiteral
instance ToTags CodeQL.SimpleId
instance ToTags CodeQL.Slash
instance ToTags CodeQL.SpecialCall
instance ToTags CodeQL.SpecialId
instance ToTags CodeQL.Star
instance ToTags CodeQL.Strictconcat
instance ToTags CodeQL.Strictcount
instance ToTags CodeQL.Strictsum
instance ToTags CodeQL.String
instance ToTags CodeQL.Sum
instance ToTags CodeQL.Super
instance ToTags CodeQL.SuperRef
instance ToTags CodeQL.This
instance ToTags CodeQL.True
instance ToTags CodeQL.TypeAliasBody
instance ToTags CodeQL.TypeUnionBody
instance ToTags CodeQL.TypeLiteral
instance ToTags CodeQL.UnaryExpr
instance ToTags CodeQL.Underscore
instance ToTags CodeQL.Unop
instance ToTags CodeQL.UnqualAggBody
instance ToTags CodeQL.VarDecl
instance ToTags CodeQL.Variable
instance ToTags CodeQL.VarName

View File

@ -45,7 +45,7 @@ renderDiff ref new = unsafePerformIO $ do
{-# NOINLINE renderDiff #-}
testForParseFixture :: (String, [Blob] -> ParseC TaskC Builder, [File Language], Path.RelFile) -> TestTree
testForParseFixture :: (String, [Blob] -> ParseC TaskC Builder, [File Language], Path.AbsRelFile) -> TestTree
testForParseFixture (format, runParse, files, expected) =
goldenVsStringDiff
("parse fixture renders to " <> format)
@ -53,11 +53,11 @@ testForParseFixture (format, runParse, files, expected) =
(Path.toString expected)
(fmap toLazyByteString . runTaskOrDie $ readBlobs (FilesFromPaths files) >>= runParse)
parseFixtures :: [(String, [Blob] -> ParseC TaskC Builder, [File Language], Path.RelFile)]
parseFixtures :: [(String, [Blob] -> ParseC TaskC Builder, [File Language], Path.AbsRelFile)]
parseFixtures =
[ ("s-expression", run . parseTermBuilder TermSExpression, path, Path.relFile "semantic/test/fixtures/ruby/corpus/and-or.parseA.txt")
, ("symbols", run . parseSymbolsBuilder Serializing.Format.JSON, path'', Path.relFile "semantic/test/fixtures/cli/parse-tree.symbols.json")
, ("protobuf symbols", run . parseSymbolsBuilder Serializing.Format.Proto, path'', Path.relFile "semantic/test/fixtures/cli/parse-tree.symbols.protobuf.bin")
[ ("s-expression", run . parseTermBuilder TermSExpression, path, Path.absRel "semantic/test/fixtures/ruby/corpus/and-or.parseA.txt")
, ("symbols", run . parseSymbolsBuilder Serializing.Format.JSON, path'', Path.absRel "semantic/test/fixtures/cli/parse-tree.symbols.json")
, ("protobuf symbols", run . parseSymbolsBuilder Serializing.Format.Proto, path'', Path.absRel "semantic/test/fixtures/cli/parse-tree.symbols.protobuf.bin")
]
where path = [File (Path.absRel "semantic/test/fixtures/ruby/corpus/and-or.A.rb") lowerBound Ruby]
path'' = [File (Path.absRel "semantic/test/fixtures/ruby/corpus/method-declaration.A.rb") lowerBound Ruby]