packages feed

purescript-cst 0.1.0.0 → 0.1.1.0

raw patch · 4 files changed

+64/−72 lines, 4 filesdep ~arraydep ~basedep ~base-compatnew-uploader

Dependency ranges changed: array, base, base-compat, bytestring, containers, dlist, filepath, purescript-ast, scientific, semigroups, tasty, tasty-golden, tasty-quickcheck, text

Files

README.md view
@@ -8,4 +8,5 @@  | `purescript` | `purescript-cst` | | --- | --- |-| `0.13.6` | `0.1.0.0` |+| `0.14.0` | `0.1.0.0` |+| `0.14.1` | `0.1.1.0` |
purescript-cst.cabal view
@@ -1,7 +1,7 @@-cabal-version:      1.12+cabal-version:      2.4 name:               purescript-cst-version:            0.1.0.0-license:            BSD3+version:            0.1.1.0+license:            BSD-3-Clause license-file:       LICENSE copyright:     (c) 2013-17 Phil Freeman, (c) 2014-19 Gary Burgess, (c) other contributors (see CONTRIBUTORS.md)@@ -18,30 +18,8 @@ category:           Language build-type:         Simple extra-source-files:-    tests/purs/layout/AdoIn.out-    tests/purs/layout/CaseGuards.out-    tests/purs/layout/CaseWhere.out-    tests/purs/layout/ClassHead.out-    tests/purs/layout/Commas.out-    tests/purs/layout/Delimiter.out-    tests/purs/layout/DoLet.out-    tests/purs/layout/DoOperator.out-    tests/purs/layout/DoWhere.out-    tests/purs/layout/IfThenElseDo.out-    tests/purs/layout/InstanceChainElse.out-    tests/purs/layout/LetGuards.out-    tests/purs/layout/AdoIn.purs-    tests/purs/layout/CaseGuards.purs-    tests/purs/layout/CaseWhere.purs-    tests/purs/layout/ClassHead.purs-    tests/purs/layout/Commas.purs-    tests/purs/layout/Delimiter.purs-    tests/purs/layout/DoLet.purs-    tests/purs/layout/DoOperator.purs-    tests/purs/layout/DoWhere.purs-    tests/purs/layout/IfThenElseDo.purs-    tests/purs/layout/InstanceChainElse.purs-    tests/purs/layout/LetGuards.purs+    tests/purs/**/*.out+    tests/purs/**/*.purs     README.md  source-repository head@@ -64,9 +42,13 @@         Language.PureScript.CST.Types         Language.PureScript.CST.Utils -    build-tools:        happy ==1.19.9+    build-tool-depends: happy:happy ==1.20.0     hs-source-dirs:     src-    other-modules:      Data.Text.PureScript+    other-modules:+        Data.Text.PureScript+        Paths_purescript_cst++    autogen-modules:    Paths_purescript_cst     default-language:   Haskell2010     default-extensions:         BangPatterns ConstraintKinds DataKinds DefaultSignatures@@ -78,42 +60,51 @@         OverloadedStrings ScopedTypeVariables TupleSections TypeFamilies         ViewPatterns -    ghc-options:        -Wall -O2+    ghc-options:        -Wall     build-depends:-        array <0.6,-        base >=4.11 && <4.13,-        containers <0.7,-        dlist <0.9,-        purescript-ast <0.2,-        scientific >=0.3.4.9 && <0.4,-        semigroups >=0.16.2 && <0.19,-        text <1.3+        array >=0.5.4.0 && <0.6,+        base >=4.14.1.0 && <4.15,+        containers >=0.6.2.1 && <0.7,+        dlist >=0.8.0.8 && <0.9,+        purescript-ast ==0.1.1.0,+        scientific >=0.3.6.2 && <0.4,+        semigroups >=0.19.1 && <0.20,+        text >=1.2.4.1 && <1.3  test-suite tests     type:               exitcode-stdio-1.0     main-is:            Main.hs-    build-tools:        happy ==1.19.9+    build-tool-depends: happy:happy ==1.20.0     hs-source-dirs:     tests     other-modules:         TestCst         Paths_purescript_cst      default-language:   Haskell2010-    default-extensions: NoImplicitPrelude LambdaCase OverloadedStrings+    default-extensions:+        BangPatterns ConstraintKinds DataKinds DefaultSignatures+        DeriveFunctor DeriveFoldable DeriveTraversable DeriveGeneric+        DerivingStrategies EmptyDataDecls FlexibleContexts+        FlexibleInstances GeneralizedNewtypeDeriving KindSignatures+        LambdaCase MultiParamTypeClasses NamedFieldPuns NoImplicitPrelude+        PatternGuards PatternSynonyms RankNTypes RecordWildCards+        OverloadedStrings ScopedTypeVariables TupleSections TypeFamilies+        ViewPatterns+     ghc-options:        -Wall     build-depends:-        array <0.6,-        base >=4.11 && <4.13,-        base-compat >=0.6.0 && <0.11,-        bytestring <0.11,-        containers <0.7,-        dlist <0.9,-        filepath <1.5,-        purescript-ast <0.2,+        array >=0.5.4.0 && <0.6,+        base >=4.14.1.0 && <4.15,+        containers >=0.6.2.1 && <0.7,+        dlist >=0.8.0.8 && <0.9,+        purescript-ast ==0.1.1.0,+        scientific >=0.3.6.2 && <0.4,+        semigroups >=0.19.1 && <0.20,+        text >=1.2.4.1 && <1.3,+        base-compat >=0.11.2 && <0.12,         purescript-cst -any,-        scientific >=0.3.4.9 && <0.4,-        semigroups >=0.16.2 && <0.19,-        tasty <1.3,-        tasty-golden <2.4,-        tasty-quickcheck <0.11,-        text <1.3+        bytestring >=0.10.12.0 && <0.11,+        filepath >=1.4.2.1 && <1.5,+        tasty >=1.2.3 && <1.3,+        tasty-golden >=2.3.3.2 && <2.4,+        tasty-quickcheck >=0.10.1.2 && <0.11
src/Language/PureScript/CST/Parser.y view
@@ -35,7 +35,7 @@ import Language.PureScript.PSString (PSString) } -%expect 93+%expect 0  %name parseType type %name parseExpr expr@@ -144,7 +144,7 @@ %%  many(a) :: { NE.NonEmpty a }-  : many1(a) { NE.reverse $1 }+  : many1(a) %shift { NE.reverse $1 }  many1(a) :: { NE.NonEmpty a }   : a { pure $1 }@@ -169,7 +169,7 @@   : sep1(a, s) { separated $1 }  sep1(a, s) :: { [(SourceToken, a)] }-  : a { [(placeholder, $1)] }+  : a %shift { [(placeholder, $1)] }   | sep1(a, s) s a { ($2, $3) : $1 }  delim(a, b, c, d) :: { Delimited b }@@ -291,7 +291,7 @@   | 'false' { toBoolean $1 }  type :: { Type () }-  : type1 { $1 }+  : type1 %shift { $1 }   | type1 '::' type { TypeKinded () $1 $2 $3 }  type1 :: { Type () }@@ -299,7 +299,7 @@   | forall many(typeVarBinding) '.' type1 { TypeForall () $1 $2 $3 $4 }  type2 :: { Type () }-  : type3 { $1 }+  : type3 %shift { $1 }   | type3 '->' type1 { TypeArr () $1 $2 $3 }   | type3 '=>' type1 {% do cs <- toConstraint $1; pure $ TypeConstrained () cs $2 $3 } @@ -308,7 +308,7 @@   | type3 qualOp type4 { TypeOp () $1 (getQualifiedOpName $2) $3 }  type4 :: { Type () }-  : type5 { $1 }+  : type5 %shift { $1 }   | '#' type4 {% addWarning ($1 : toList (flattenType $2)) WarnDeprecatedRowSyntax *> pure (TypeUnaryRow () $1 $2) }  type5 :: { Type () }@@ -359,16 +359,16 @@   | 'forallu' { $1 }  exprWhere :: { Where () }-  : expr { Where $1 Nothing }+  : expr %shift { Where $1 Nothing }   | expr 'where' '\{' manySep(letBinding, '\;') '\}' { Where $1 (Just ($2, $4)) }  expr :: { Expr () }-  : expr1 { $1 }+  : expr1 %shift { $1 }   | expr1 '::' type { ExprTyped () $1 $2 $3 }  expr1 :: { Expr () }-  : expr2 { $1 }-  | expr1 qualOp expr2 { ExprOp () $1 (getQualifiedOpName $2) $3 }+  : expr2 %shift { $1 }+  | expr1 qualOp expr2 %shift { ExprOp () $1 (getQualifiedOpName $2) $3 }  expr2 :: { Expr () }   : expr3 { $1 }@@ -379,7 +379,7 @@   | exprBacktick qualOp expr3 { ExprOp () $1 (getQualifiedOpName $2) $3 }  expr3 :: { Expr () }-  : expr4 { $1 }+  : expr4 %shift { $1 }   | '-' expr3 { ExprNegate () $1 $2 }  expr4 :: { Expr () }@@ -411,7 +411,7 @@       { ExprCase () (CaseOf $1 $2 $3 (pure ($5, $7))) }  expr6 :: { Expr () }-  : expr7 { $1 }+  : expr7 %shift { $1 }   | expr7 '{' '}' { ExprApp () $1 (ExprRecord () (Wrapped $2 Nothing $3)) }   | expr7 '{' sep(recordUpdateOrLabel, ',') '}'       {% toRecordFields $3 >>= \case@@ -574,7 +574,7 @@  binderAtom :: { Binder () }   : '_' { BinderWildcard () $1 }-  | ident { BinderVar () $1 }+  | ident %shift { BinderVar () $1 }   | ident '@' binderAtom { BinderNamed () $1 $2 $3 }   | qualProperName { BinderConstructor () (getQualifiedProperName $1) [] }   | boolean { uncurry (BinderBoolean ()) $1 }
tests/TestCst.hs view
@@ -73,9 +73,9 @@   Right tok : _ ->     pure tok   Left (_, err) : _ ->-    fail $ failMsg <> ": " <> CST.prettyPrintError err+    error $ failMsg <> ": " <> CST.prettyPrintError err   [] ->-    fail "Empty token stream"+    error "Empty token stream"  readTok :: Text -> Gen SourceToken readTok = readTok' "Failed to parse"@@ -89,7 +89,7 @@   SourceToken _ tok <- readTok t   case f tok of     Just a  -> p t a-    Nothing -> fail $ "Failed to lex correctly: " <> show tok+    Nothing -> error $ "Failed to lex correctly: " <> show tok  roundTripTok :: Text -> Gen Bool roundTripTok t = do@@ -106,7 +106,7 @@       chs' -> chs'   case (== a) <$> readMaybe chs of     Just a' -> pure a'-    Nothing -> fail "Failed to `read`"+    Nothing -> error "Failed to `read`"  newtype PSSourceInt = PSSourceInt { unInt :: Text }   deriving (Show, Eq)