cabal-version:       2.4
name:                tree-sitter-ruby
version:             0.4.1.0
synopsis:            Tree-sitter grammar/parser for Ruby
description:         This package provides a parser for Ruby suitable for use with the tree-sitter package.
license:             BSD-3-Clause
homepage:            https://github.com/tree-sitter/haskell-tree-sitter/tree/master/tree-sitter-ruby
author:              Max Brunsfeld, Tim Clem, Rob Rix, Josh Vera, Rick Winfrey, Ayman Nadeem, Patrick Thomson
maintainer:          tclem@github.com
copyright:           2019 GitHub
category:            Tree-sitter, Ruby
build-type:          Simple
data-files:          vendor/tree-sitter-ruby/src/node-types.json

common common
  default-language: Haskell2010
  ghc-options:
    -Weverything
    -Wno-all-missed-specialisations
    -Wno-implicit-prelude
    -Wno-missed-specialisations
    -Wno-missing-import-lists
    -Wno-missing-local-signatures
    -Wno-monomorphism-restriction
    -Wno-name-shadowing
    -Wno-safe
    -Wno-unsafe
  if (impl(ghc >= 8.6))
    ghc-options: -Wno-star-is-type
  if (impl(ghc >= 8.8))
    ghc-options: -Wno-missing-deriving-strategies

library
  import: common
  exposed-modules:     TreeSitter.Ruby
                     , TreeSitter.Ruby.AST
  build-depends:       base              >= 4.12 && < 5
                     , semantic-source  ^>= 0
                     , template-haskell  >= 2.12 && < 2.16
                     , tree-sitter      ^>= 0.8
                     , tree-sitter-ruby-internal

library tree-sitter-ruby-internal
  import: common
  exposed-modules:     TreeSitter.Ruby.Internal
  hs-source-dirs:      internal
  build-depends:       base
                     , tree-sitter
  Include-dirs:        vendor/tree-sitter-ruby/src
  install-includes:    tree_sitter/parser.h
  c-sources:           vendor/tree-sitter-ruby/src/parser.c
                     , vendor/tree-sitter-ruby/src/scanner.cc
  extra-libraries:     stdc++

test-suite test
  import:           common
  type:             exitcode-stdio-1.0
  hs-source-dirs:   test
  main-is:          Test.hs
  build-depends:    base
                  , tree-sitter
                  , tree-sitter-ruby
                  , tree-sitter-test-helpers
                  , bytestring ^>= 0.10.8.2
                  , hedgehog >= 0.6 && <2
                  , pathtype ^>= 0.8.1
                  , text
                  , tasty
                  , tasty-hedgehog
                  , tasty-hunit

executable benchmarks
  import:              common
  hs-source-dirs:      bench
  -- type:                exitcode-stdio-1.0
  main-is:             Main.hs
  other-modules:       Parsing
  ghc-options:         -static -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m"
  build-depends:       base
                     , gauge ^>= 0.2.5
                     , bytestring
                     , Glob
                     , lens >= 4.17 && < 4.19
                     , pathtype ^>= 0.8.1
                     , tree-sitter
                     , tree-sitter-ruby

executable tree-sitter-ruby
  import: common
  hs-source-dirs: app
  ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m"
  main-is: Main.hs
  build-depends:
      base
    , bytestring
    , tree-sitter
    , tree-sitter-ruby

source-repository head
  type:     git
  location: https://github.com/tree-sitter/haskell-tree-sitter
