This project is mirrored from https://github.com/haskell/Cabal.
Pull mirroring updated .
- 27 Mar, 2008 4 commits
-
-
Duncan Coutts authored
Despite appearances this is actually not completely pointless. For the Cabal-1.4 branch we need the *Verbose fields to have the same types as they did in Cabal-1.2, becuase lots of Setup.hs scripts use them and our change to make them all have type Flag makes many Setup.hs scripts fail. A solution for the 1.4 branch is to rename the real field and to add the old field back in. To keep as much similarity as possible between the HEAD and 1.4 branches I'm applying the name change in both. On the plus side it's a better name anyway.
-
Duncan Coutts authored
Previously we checked for invalid UTF-8 in the first phase of the parser, which splitting the file up into nested sections and fields. This meant the whole parser falls over if there is invalid UTF-8 anywhere in the file. Sadly there are already packages on hackage with invalid UTF-8 so we would fail when parsing the hackage index. The solution is to move the check into the parsing of the individual fields and making it a warning not an error. We most typically get invalid UTF-8 in free text fields like author name, copyright, description etc so this should work out ok usually. We now get pretty decent error messages, like: Warning: hsx.cabal:5: Invalid UTF-8 text in the 'author' field. The warning type is now structured so that hackage will be able to distinguish general non-fatal warnings from UTF-8 decoding problems which really should be fatal errors for package uploads.
-
Duncan Coutts authored
We have to classify System.Info.{os,arch} strings into the OS and Arch enums. For that purpose we have to be quite permissive since there are lots of ailases that the various Haskell implementations use. However for parsing os and arch names in .cabal files we'd prefer to use canonical names, though we do have to allow the couple aliases already in common use.
-
Duncan Coutts authored
That is the arch and os strings in conditionals in .cabal files, like: if arch(x86_64) Previously the parser used isAlphaNum c || (c `elem` "_-"). This is crucial for arch names like "x86_64". So make the new parser for OS and Arch types use the same string parser as before (there is a string parse part and a separate classification of known OS/Arch values).
-
- 26 Mar, 2008 5 commits
-
-
Ross Paterson authored
Stops it barfing on arch(x86_64).
-
Duncan Coutts authored
-
Duncan Coutts authored
-
Duncan Coutts authored
-
Malcolm.Wallace authored
-
- 25 Mar, 2008 10 commits
-
-
Duncan Coutts authored
I think. It's hard to test since with base as it is we cannot easily compile without that instance being in scope.
-
Malcolm.Wallace authored
-
Malcolm.Wallace authored
-
Malcolm.Wallace authored
-
Malcolm.Wallace authored
-
Malcolm.Wallace authored
-
Malcolm.Wallace authored
-
Malcolm.Wallace authored
-
Duncan Coutts authored
The pretty printer version should be using Text but I've left them as comments for the moment as they do not have corresponding parsers yet.
-
Duncan Coutts authored
-
- 24 Mar, 2008 11 commits
-
-
Duncan Coutts authored
One use was for parsing bools in the installed package info. We can go with the more liberal Text instance for that. The other use is for parsing Haskell strings in quoted string fields. So we keep it for that purpose but restrict the type and rename to parseHaskellString.
-
Duncan Coutts authored
So it accepts the same valid values as parseReadS did, but doesn't fall over on unknown values, returning (OtherCompiler "the_name").
-
Duncan Coutts authored
-
Duncan Coutts authored
-
Duncan Coutts authored
-
Duncan Coutts authored
This means we can now parse unknown extensions without falling over. Indeed if the compiler supports the unknown extension then we can even successfully use it. This gives us some forwards compatability for new extensions.
-
Duncan Coutts authored
That is, extensions the compiler does not support, as opposed to extensions that are unknown to Cabal.
-
Duncan Coutts authored
Read the ghc --supported-languages list using simpleParse rather than reads. It now parses extensions that GHC recognises but Cabal does not as (UnknownExtension theExtensionName). For example this allows people to use the PArr extension which ghc currently supports but which is not a finalised registered extension.
-
Duncan Coutts authored
The parse function is ~15x faster than using reads by using a simple hash table :: Array Char [(String, Extension)]. The hash function is then just 'head' -- the first letter of the extension name.
-
Duncan Coutts authored
-
Duncan Coutts authored
Drop parseReadSQ as that was the last use of it. Still need to add a build warning for UnknownBuildTypes
-
- 23 Mar, 2008 1 commit
-
-
Saizan authored
-
- 21 Mar, 2008 3 commits
-
-
Duncan Coutts authored
Added an UnknownLicense String constructor so that we can remember unknown license names and report them and prevent them from being uploaded to hackage, but not fail hard with a parse error upon encountering an unknown license. This does not add any new licesnes or and new valid parses of existing licenses. The parsing phase now allows an optional version like "GPL-3" however that would still be classified as an unknown license at the moment. The point is it's no longer a parse error but a semantic error instead.
-
Duncan Coutts authored
-
mnislaih authored
I shamelessly stole some code from GHCi for the highlighting.
-
- 20 Mar, 2008 1 commit
-
-
mnislaih authored
-
- 19 Mar, 2008 1 commit
-
-
mnislaih authored
-
- 21 Mar, 2008 4 commits
-
-
Duncan Coutts authored
Initially it's exactly the same format as Read/Show. We can make it more liberal later.
-
Duncan Coutts authored
This is a tad subtle since we actually have two ways of parsing compiler flavours. One expects, or at least allows lower case names like "ghc" and "nhc98", the other uses Read/Show which gives "GHC" and "NHC". What we're doing here is only changing the first variety. The cases where we parse using Read (and display using Show) are not changed. At some point we'll switch those over to the more liberal parser, but not yet as we don't want to cause compatibility problems.
-
Duncan Coutts authored
-
Duncan Coutts authored
And change all uses.
-