packages feed

peg-matching-0.1.0.0: peg-matching.cabal

cabal-version: 2.2

name:           peg-matching
version:        0.1.0.0
synopsis:       Syntax tree matching and rewriting with Parsing Expression Grammars
description:
    @peg-matching@ is a library for parsing, analysing, matching and rewriting
    syntax trees using Parsing Expression Grammars (PEGs) together with a
    dedicated pattern language. It is aimed at research and experimentation
    with syntax-driven transformations over abstract syntax trees.
    .
    The library provides:
    .
    * PEG grammars and their syntax trees ("Syntax.Peg", "Syntax.ParsedTree");
    .
    * parsers for grammars, patterns and inputs ("Parser.Peg", "Parser.Pattern",
      "Parser.ParsedTree");
    .
    * semantic validation, including left-recursion and duplicate-rule detection
      ("Semantic.Peg", "Semantic.Pattern");
    .
    * pattern matching with subtree capture and tree rewriting ("Match.Capture",
      "Match.Rewrite");
    .
    * quasi-quoters for embedding grammars and patterns in Haskell source
      ("Quote.Peg", "Quote.Pattern");
    .
    * a high-level pipeline tying it all together ("Pipeline.MatchPipeline").
    .
    See the README for a worked example.
category:       Language, Parsing
homepage:       https://github.com/lives-group/peg-matching#readme
bug-reports:    https://github.com/lives-group/peg-matching/issues
author:         Guilherme Drummond
maintainer:     Rodrigo Ribeiro <rodrigo.ribeiro@ufop.edu.br>
copyright:      2025 Guilherme Drummond, Rodrigo Ribeiro
license:        BSD-3-Clause
license-file:   LICENSE
build-type:     Simple
tested-with:    GHC == 9.10.3
extra-doc-files:
    README.md
    CHANGELOG.md
extra-source-files:
    input/peg/*.peg
    input/pattern/*.pat
    input/file/*.txt
    input/file/*.py

source-repository head
  type: git
  location: https://github.com/lives-group/peg-matching

library
  exposed-modules:
      -- Syntax
      Syntax.Base
      Syntax.Peg
      Syntax.Pattern
      Syntax.ParsedTree
      -- Parser
      Parser.Base
      Parser.Peg
      Parser.Pattern
      Parser.ParsedTree
      -- Semantic
      Semantic.Peg
      Semantic.Pattern
      -- Match
      Match.Capture
      Match.Rewrite
      -- Pipeline
      Pipeline.MatchPipeline
      -- Quote
      Quote.Base
      Quote.Peg
      Quote.Pattern
  other-modules:
      Paths_peg_matching
  autogen-modules:
      Paths_peg_matching
  hs-source-dirs:
      src
  ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
  build-depends:
      base >=4.17 && <5
    , algebraic-graphs >=0.7 && <0.9
    , megaparsec >=9.0 && <10
    , parser-combinators >=1.3 && <1.4
    , pretty >=1.1 && <1.2
    , syb >=0.7 && <0.8
    , template-haskell >=2.19 && <2.24
  default-language: Haskell2010
  default-extensions:
      TupleSections
    , InstanceSigs
    , FlexibleInstances
    , DeriveDataTypeable
    , TemplateHaskell
    , QuasiQuotes

test-suite peg-matching-test
  type: exitcode-stdio-1.0
  main-is: Main.hs
  other-modules:
      Paths_peg_matching
  autogen-modules:
      Paths_peg_matching
  hs-source-dirs:
      test
  ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
  build-depends:
      base >=4.17 && <5
    , megaparsec >=9.0 && <10
    , peg-matching
    , tasty >=1.4 && <1.6
    , tasty-hunit >=0.10 && <0.11
  default-language: Haskell2010