mirror of
https://github.com/github/semantic.git
synced 2024-12-21 05:41:54 +03:00
034bb562d4
This patch adds the `Matcher` monad, which is capable of filtering any recursive data structure, bottom-up, yielding a list of (or an optional) result. These functions are probably going to be used over `Term` values, so API is provided to wrap common projection functions. The API was more or less copied directly from that of Clang's AST matching facilities. There are a lot of things we can do in the future: * Binding results yielded in matchers to associated names, for future transformation stages to look up and modify. * Actual transformation stages. * Optimizations. This is not very fast. A million thanks to @robrix, whose sage advice managed to turn my kooky idea for an API into something really special and exciting.
52 lines
2.1 KiB
Haskell
52 lines
2.1 KiB
Haskell
module Main where
|
|
|
|
import qualified Analysis.Go.Spec
|
|
import qualified Analysis.PHP.Spec
|
|
import qualified Analysis.Python.Spec
|
|
import qualified Analysis.Ruby.Spec
|
|
import qualified Analysis.TypeScript.Spec
|
|
import qualified Assigning.Assignment.Spec
|
|
import qualified Data.Diff.Spec
|
|
import qualified Data.Functor.Classes.Generic.Spec
|
|
import qualified Data.Mergeable.Spec
|
|
import qualified Data.Source.Spec
|
|
import qualified Data.Term.Spec
|
|
import qualified Diffing.Algorithm.RWS.Spec
|
|
import qualified Diffing.Algorithm.SES.Spec
|
|
import qualified Diffing.Interpreter.Spec
|
|
import qualified Integration.Spec
|
|
import qualified Matching.Go.Spec
|
|
import qualified Rendering.TOC.Spec
|
|
import qualified Rendering.Imports.Spec
|
|
import qualified Semantic.Spec
|
|
import qualified Semantic.CLI.Spec
|
|
import qualified Semantic.IO.Spec
|
|
import qualified Semantic.Stat.Spec
|
|
import Test.Hspec
|
|
|
|
main :: IO ()
|
|
main = hspec $ do
|
|
describe "Semantic.Stat" Semantic.Stat.Spec.spec
|
|
parallel $ do
|
|
describe "Analysis.Go" Analysis.Go.Spec.spec
|
|
describe "Analysis.PHP" Analysis.PHP.Spec.spec
|
|
describe "Analysis.Python" Analysis.Python.Spec.spec
|
|
describe "Analysis.Ruby" Analysis.Ruby.Spec.spec
|
|
describe "Analysis.TypeScript" Analysis.TypeScript.Spec.spec
|
|
describe "Assigning.Assignment" Assigning.Assignment.Spec.spec
|
|
describe "Data.Diff" Data.Diff.Spec.spec
|
|
describe "Data.Functor.Classes.Generic" Data.Functor.Classes.Generic.Spec.spec
|
|
describe "Data.Mergeable" Data.Mergeable.Spec.spec
|
|
describe "Data.Source" Data.Source.Spec.spec
|
|
describe "Data.Term" Data.Term.Spec.spec
|
|
describe "Diffing.Algorithm.RWS" Diffing.Algorithm.RWS.Spec.spec
|
|
describe "Diffing.Algorithm.SES" Diffing.Algorithm.SES.Spec.spec
|
|
describe "Diffing.Interpreter" Diffing.Interpreter.Spec.spec
|
|
describe "Matching" Matching.Go.Spec.spec
|
|
describe "Rendering.TOC" Rendering.TOC.Spec.spec
|
|
describe "Rendering.Imports" Rendering.Imports.Spec.spec
|
|
describe "Semantic" Semantic.Spec.spec
|
|
describe "Semantic.CLI" Semantic.CLI.Spec.spec
|
|
describe "Semantic.IO" Semantic.IO.Spec.spec
|
|
describe "Integration" Integration.Spec.spec
|