Broken commit
This commit is contained in:
parent
41a90dc6bf
commit
99dcfbd976
5 changed files with 38 additions and 19 deletions
|
@ -23,6 +23,9 @@ dependencies:
|
|||
- base >= 4.7 && < 5
|
||||
- containers
|
||||
- parsec
|
||||
- filepath
|
||||
- path
|
||||
- directory
|
||||
|
||||
ghc-options:
|
||||
- -Wall
|
||||
|
|
|
@ -3,19 +3,31 @@ module Ubc.Parse.Syntax.Import
|
|||
parse)
|
||||
where
|
||||
|
||||
import Data.Functor ((<&>))
|
||||
import Text.Parsec (sepBy1, ParsecT, anyChar, many, char, choice, notFollowedBy, oneOf)
|
||||
|
||||
import Text.Parsec (sepBy1, ParsecT)
|
||||
|
||||
import qualified Data.List as List
|
||||
import OsPath as OsPath
|
||||
|
||||
import qualified Ubc.Parse.Syntax.Language as UbcLanguage
|
||||
import System.OsPath (encodeUtf, OsPath)
|
||||
import System.OsPath.Encoding (EncodingException (EncodingError))
|
||||
import Control.Exception (SomeException(SomeException))
|
||||
|
||||
importPath :: Monad m => ParsecT String u m [String]
|
||||
importPath = UbcLanguage.identifier `sepBy1` UbcLanguage.symbol "/"
|
||||
importPath = UbcLanguage.angles (many importChar `sepBy1` char '/')
|
||||
|
||||
parse :: Monad m => ParsecT String u m [String]
|
||||
importChar :: (Monad m) => ParsecT String u m Char
|
||||
importChar = choice
|
||||
[ char '\\' >> oneOf ">/\\"
|
||||
, notFollowedBy (oneOf ">/") >> anyChar
|
||||
]
|
||||
|
||||
parse :: ParsecT String u IO [String]
|
||||
parse = do
|
||||
UbcLanguage.reserved "import"
|
||||
importPath
|
||||
fragments <- importPath
|
||||
case mapM encodeUtf fragments :: Either EncodingException [OsPath] of
|
||||
Left err -> pure ()
|
||||
Right success -> pure ()
|
||||
|
||||
pure []
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#
|
||||
# snapshot: ./custom-snapshot.yaml
|
||||
# snapshot: https://example.com/snapshots/2024-01-01.yaml
|
||||
snapshot: ghc-9.8.2
|
||||
snapshot: nightly-2025-02-16
|
||||
|
||||
# User packages to be built.
|
||||
# Various formats can be used as shown in the example below.
|
||||
|
@ -29,7 +29,6 @@ snapshot: ghc-9.8.2
|
|||
# - auto-update
|
||||
# - wai
|
||||
packages:
|
||||
- .
|
||||
# Dependency packages to be pulled from upstream that are not in the snapshot.
|
||||
# These entries can reference officially published versions as well as
|
||||
# forks / in-progress versions pinned to a git hash. For example:
|
||||
|
@ -41,8 +40,6 @@ packages:
|
|||
#
|
||||
# extra-deps: []
|
||||
extra-deps:
|
||||
- hoogle-5.0.18.4
|
||||
|
||||
# Override default flag values for project packages and extra-deps
|
||||
# flags: {}
|
||||
|
||||
|
|
|
@ -3,12 +3,10 @@
|
|||
# For more information, please see the documentation at:
|
||||
# https://docs.haskellstack.org/en/stable/topics/lock_files
|
||||
|
||||
packages:
|
||||
packages: []
|
||||
snapshots:
|
||||
- completed:
|
||||
hackage: hoogle-5.0.18.4@sha256:aaf0274da7de4e31ade69ad09f57a59ee25b3765cd102e631629850521754984,3333
|
||||
pantry-tree:
|
||||
sha256: 62d0ccb848ecd2b8f29dc782e3d0a9bde57fa626f09e800822229965728f476c
|
||||
size: 3414
|
||||
original:
|
||||
hackage: hoogle-5.0.18.4
|
||||
snapshots: []
|
||||
sha256: bd404e36d2a254aace97d37fba81a785cc6e9b575b36e5e632937a1e14f8d6f6
|
||||
size: 654475
|
||||
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2025/2/16.yaml
|
||||
original: nightly-2025-02-16
|
||||
|
|
|
@ -47,7 +47,10 @@ library
|
|||
build-depends:
|
||||
base >=4.7 && <5
|
||||
, containers
|
||||
, directory
|
||||
, filepath
|
||||
, parsec
|
||||
, path
|
||||
default-language: Haskell2010
|
||||
|
||||
executable ubcc-exe
|
||||
|
@ -62,7 +65,10 @@ executable ubcc-exe
|
|||
build-depends:
|
||||
base >=4.7 && <5
|
||||
, containers
|
||||
, directory
|
||||
, filepath
|
||||
, parsec
|
||||
, path
|
||||
, ubcc
|
||||
default-language: Haskell2010
|
||||
|
||||
|
@ -79,6 +85,9 @@ test-suite ubcc-test
|
|||
build-depends:
|
||||
base >=4.7 && <5
|
||||
, containers
|
||||
, directory
|
||||
, filepath
|
||||
, parsec
|
||||
, path
|
||||
, ubcc
|
||||
default-language: Haskell2010
|
||||
|
|
Loading…
Reference in a new issue