Skip to content

Commit

Permalink
Merge pull request #546 from Maurice-Byrne/parser-update
Browse files Browse the repository at this point in the history
Parser update
  • Loading branch information
ozgurakgun committed May 18, 2023
2 parents e093cc5 + ce10201 commit e65c25d
Show file tree
Hide file tree
Showing 389 changed files with 10,658 additions and 6,953 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

strategy:
matrix:
GHC_VERSION: [8.6]
GHC_VERSION: [9.2]
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

strategy:
matrix:
GHC_VERSION: [8.6]
GHC_VERSION: [9.2]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

strategy:
matrix:
GHC_VERSION: [8.6]
GHC_VERSION: [9.2]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ cabal.sandbox.config
.cabal-sandbox
.stack-work
stack.yaml.lock
dist-*/

# test outputs
tests/exhaustive/**/outputs
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SHELL := /bin/bash

# these are default values
# override by calling the makefile like so: "GHC_VERSION=8.6 make"
export GHC_VERSION?=8.6
export GHC_VERSION?=9.0
export BIN_DIR?=${HOME}/.local/bin
export CI?=false
export BUILD_TESTS?=false
Expand All @@ -14,8 +14,8 @@ export LIMIT_TIME?=10
install:
@echo "Using GHC version ${GHC_VERSION} (major version)"
@echo "Set the environment variable GHC_VERSION to change this location."
@echo "For example: \"GHC_VERSION=8.4 make install\""
@echo "Supported versions: 8.4, 8.6"
@echo "For example: \"GHC_VERSION=9.2 make install\""
@echo "Supported version: 9.0 , 9.2"
@echo ""
@echo "Installing executables to ${BIN_DIR}"
@echo "Add this directory to your PATH."
Expand Down Expand Up @@ -47,11 +47,11 @@ install:
.PHONY: test
test:
@if ${COVERAGE}; then \
stack test --coverage --test-arguments '--limit-time ${LIMIT_TIME}';\
stack test --coverage --test-arguments '--hide-successes --limit-time ${LIMIT_TIME}';\
stack hpc report conjure-cp $(find . -name conjure.tix);\
ls .stack-work/install/*/*/*/hpc/combined/custom;\
else\
stack test --test-arguments '--limit-time ${LIMIT_TIME}';\
stack test --test-arguments '--hide-successes --limit-time ${LIMIT_TIME}';\
fi

stack.yaml:
Expand Down
56 changes: 25 additions & 31 deletions conjure-cp.cabal
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@

Cabal-version: 2.4
Name: conjure-cp
Version: 2.4.1
Synopsis: Conjure: The Automated Constraint Modelling Tool
Description: .
Homepage: http://github.com/conjure-cp/conjure
License: BSD3
License: BSD-3-Clause
License-file: LICENSE
Author: Özgür Akgün
Maintainer: ozgurakgun@gmail.com
Category: Constraint Programming
Build-type: Simple
Cabal-version: 1.20

Library
default-language : Haskell2010
Expand Down Expand Up @@ -39,9 +38,17 @@ Library
, Conjure.Language.TH
, Conjure.Language.Type

, Conjure.Language.Lexemes
, Conjure.Language.Attributes
, Conjure.Language.Validator
, Conjure.Language.AST.ASTParser
, Conjure.Language.AST.Helpers
, Conjure.Language.AST.Reformer
, Conjure.Language.AST.Syntax

, Conjure.Language.Expression.Internal.Generated
, Conjure.Language.Expression.DomainSizeOf
, Conjure.Language.Expression.OpTypes

, Conjure.Language.Expression.Op
, Conjure.Language.Expression.Op.Internal.Common
Expand Down Expand Up @@ -141,6 +148,8 @@ Library
, Conjure.Language.ParserC
, Conjure.Language.Pretty
, Conjure.Language.ZeroVal


, Conjure.Process.AttributeAsConstraints
, Conjure.Process.DealWithCuts
, Conjure.Process.Enumerate
Expand Down Expand Up @@ -242,9 +251,9 @@ Library
, Conjure.UI.VarSymBreaking
, Conjure.UI.ParameterGenerator
, Conjure.UI.NormaliseQuantified
, Conjure.UI.TypeScript
, Conjure.UI.ErrorDisplay

build-depends : base
build-depends : base >= 4.12.0
-- the export list have changed
, aeson >= 1.2.2.0
, aeson-typescript
Expand All @@ -253,24 +262,25 @@ Library
-- changes in newline handling
, cmdargs >= 0.10.14
-- a bunch of improvements in 0.5.8.1
, containers >= 0.5.8.1
, containers
, data-default
, directory
, filepath
, hashable
, integer-gmp
-- >= 4.1.1 because of sepEndBy bugfixes
-- < 5 because megaparsec-5 is backwards incompatible
, megaparsec >= 4.1.1 && < 5
, megaparsec ^>= 9.3.0
, mtl
, parallel-io
, pipes
, pretty > 1.1.1.1
, pretty >=1.1.3.6
, prettyprinter
-- >= 2.9 because of the TH fix: https://github.com/nick8325/quickcheck/issues/101
, QuickCheck >= 2.9
, QuickCheck >= 2.14
, random
, safe
, scientific
, scientific >=0.3.7
-- 1.6.7, because of the stderr handling fix
, shelly >= 1.6.7
, split
Expand All @@ -295,25 +305,10 @@ Library
, ansi-terminal >= 0.8.2
, timeit >= 2.0
, primes >= 0.2.1.0
, statistics >= 0.15.2.0

if impl(ghc == 7.8.*)
build-depends: template-haskell == 2.9.*
if impl(ghc == 7.10.*)
build-depends: template-haskell == 2.10.*
if impl(ghc == 8.0.*)
build-depends: template-haskell == 2.11.*
ghc-options: -Wno-redundant-constraints
if impl(ghc == 8.2.*)
build-depends: template-haskell == 2.12.*
if impl(ghc == 8.4.*)
build-depends: template-haskell == 2.13.*
if impl(ghc == 8.6.*)
build-depends: template-haskell == 2.14.*
if impl(ghc == 8.8.*)
build-depends: template-haskell == 2.15.*
if impl(ghc == 8.10.*)
build-depends: template-haskell == 2.16.*
, parser-combinators
, lsp
, lens
, template-haskell

default-extensions:
FlexibleContexts
Expand Down Expand Up @@ -363,7 +358,6 @@ Executable conjure
OverloadedStrings
ScopedTypeVariables
TypeOperators
NoMonadFailDesugaring
ViewPatterns
ghc-options:
-O2
Expand Down Expand Up @@ -396,6 +390,7 @@ Test-Suite conjure-testing
, Conjure.ModelAllSolveAll
, Conjure.TypeCheckAll
, Conjure.ParsePrint
, Conjure.ParserFuzz
, Conjure.Custom
main-is : TestsMain.hs
build-depends : conjure-cp
Expand Down Expand Up @@ -425,7 +420,6 @@ Test-Suite conjure-testing
OverloadedStrings
ScopedTypeVariables
TypeOperators
NoMonadFailDesugaring
ViewPatterns
ghc-options:
-fwarn-incomplete-patterns
Expand Down
8 changes: 0 additions & 8 deletions docs/conjure-help.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,6 @@
<tr><td style='padding-left:2ex;'>&nbsp;<td style='padding-left:1ex; white-space:nowrap;'>--line-width=INT</td><td style='padding-left:2ex;'>Line width to use during pretty printing.<br />Default: 120</td></tr>
<tr><td colspan='3'>General:</td></tr>
<tr><td style='padding-left:2ex;'>&nbsp;<td style='padding-left:1ex; white-space:nowrap;'>--limit-time=INT</td><td style='padding-left:2ex;'>Time limit in seconds (real time).</td></tr>
<tr><td colspan='3'>&nbsp;</tr>
<tr><td colspan='3'>conjure tsdef [OPTIONS]</td></tr>
<tr><td colspan='3' style='padding-left:2ex;'>Generate data type definitions in TypeScript.<br />These can be used when interfacing with Conjure via JSON.</td></tr>
<tr><td colspan='3'>&nbsp;</tr>
<tr><td colspan='3'>Logging &amp; Output:</td></tr>
<tr><td style='padding-left:2ex;'>&nbsp;<td style='padding-left:1ex; white-space:nowrap;'>--log-level=LOGLEVEL</td><td style='padding-left:2ex;'>Log level.</td></tr>
<tr><td colspan='3'>General:</td></tr>
<tr><td style='padding-left:2ex;'>&nbsp;<td style='padding-left:1ex; white-space:nowrap;'>--limit-time=INT</td><td style='padding-left:2ex;'>Limit in seconds of real time.</td></tr>
</table>
</div>
<br />
9 changes: 0 additions & 9 deletions docs/conjure-help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,4 @@
Default: 120
General:
--limit-time=INT Time limit in seconds (real time).

conjure tsdef [OPTIONS]
Generate data type definitions in TypeScript.
These can be used when interfacing with Conjure via JSON.

Logging & Output:
--log-level=LOGLEVEL Log level.
General:
--limit-time=INT Limit in seconds of real time.

12 changes: 0 additions & 12 deletions etc/hs-deps/stack-8.4.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions etc/hs-deps/stack-8.6.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions etc/hs-deps/stack-9.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resolver: lts-19.24
packages:
- '.'
system-ghc: true
install-ghc: true
extra-deps:
- megaparsec-9.3.0
11 changes: 11 additions & 0 deletions etc/hs-deps/stack-9.2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resolver: lts-20.2
packages:
- '.'
system-ghc: true
install-ghc: true
extra-deps:
- megaparsec-9.3.0
- aeson-typescript-0.4.0.0
- shelly-1.10.0
- lsp-1.6.0.0
- co-log-core-0.3.2.0
8 changes: 2 additions & 6 deletions src/Conjure/Bug.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ import Conjure.Prelude
import Conjure.RepositoryVersion ( repositoryVersion )
import Conjure.Language.Pretty

#if __GLASGOW_HASKELL__ >= 800
-- base
import GHC.Stack ( HasCallStack )


-- call this function instead of "error"
bug :: HasCallStack => Doc -> a
#else
bug :: Doc -> a
#endif
bug message = error $ unlines
[ "This should never happen, sorry!"
, ""
Expand Down
1 change: 0 additions & 1 deletion src/Conjure/Compute/DomainOf.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Conjure.Prelude
import Conjure.Bug

import Conjure.Language
import Conjure.Language.Domain ( HasRepresentation(..) )
import Conjure.Language.RepresentationOf ( RepresentationOf(..) )
import Conjure.Compute.DomainUnion

Expand Down

0 comments on commit e65c25d

Please sign in to comment.