awakesecurity / language-ninja Goto Github PK
View Code? Open in Web Editor NEWA Haskell library for parsing, pretty-printing, and evaluating the Ninja build language.
License: Other
A Haskell library for parsing, pretty-printing, and evaluating the Ninja build language.
License: Other
Title is self-explanatory
This is especially useful once #12 is done.
The title says it all.
We should remove IR.ninjaPhonys :: HashMap Target (HashSet Target)
and replace it by switching IR.buildRule :: Rule
to Maybe Rule
.
It would probably be good to throw an error (or display a warning) if a parsed Ninja file uses a feature inconsistent with its ninja_required_version
variable.
The Cabal file says this library has only been tested with GHC 8.0, which was a long time ago! Additionally, many dependencies (e.g. megaparsec
) have jumped a few major versions.
git tag -s release-<version> -m "Version <version>"
, git push --tags
, and make a request against the GitHub API to add data from the changelog to the GitHub release.@since
attributes
@since
attribute, but it would also be nice to warn the maintainer if an @since
attribute has not been bumped even though the underlying definition has changed. Of course, there will be false positives due to changes that are backwards-compatible, but this is better than nothing.The lexer/parser/types should be updated for compatibility with implicit outputs, added in Ninja 1.7 and documented here.
Lexeme
to support implicit outputsAST.Ninja
to support implicit outputsThe current lexer/parser is well-optimized, but it is unclear that it is correct. We should have another parser, written using megaparsec
, that is more obviously correct and easier to test. This also requires adding polymorphic annotation fields to all the datatypes. For example, this datatype:
data Foo = MkFoo { _fooBar :: Bar, _fooBaz :: Baz }
would become this datatype:
data Foo ann = MkFoo { _fooAnn :: ann, _fooBar :: Bar, _fooBaz :: Baz }
instance Annotated Foo where { ... }
where Annotated
is defined by:
class (Functor t) => Annotated (t :: * -> *) where
annotation :: Lens' (t ann) ann
The old, fast parser would then have type Text -> Parser (PNinja ())
, whereas the new megaparsec
parser would have type Text -> Parser (PNinja (Maybe Pos))
, for example. This would allow pretty-printing such that the output is identical to the parsed input, which is important for diagnostics, testing, and formatting tools.
I'm installing on Ubuntu 14.04 but it seems like Cabal doesn't like any of the available versions of Haskell for the requirement even though the versions appear to fall within the range. What am I doing wrong?
$ cabal install
Warning: language-ninja.cabal: Ignoring unknown section type: custom-setup
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: language-ninja-0.1.0
rejecting: base-4.6.0.1/installed-8aa... (conflict: language-ninja =>
base>=4.8 && <5.0)
rejecting: base-4.10.0.0, 4.9.1.0, 4.9.0.0, 4.8.2.0, 4.8.1.0, 4.8.0.0,
4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0,
4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0,
3.0.3.2, 3.0.3.1 (global constraint requires installed instance)
The title says it all.
Release checklist:
FIXME
comments.@since
annotations to all public functions.-Weverything
.doctest
.tasty-lens
.ninja2nix
into a separate project.ninja-lex
ninja-parse
ninja-evaluate
smallcheck-lens
and tasty-lens
need base
version bumps.
README.md
et al. to extra-*-files
.github/CONTRIBUTING.md
git
tag (non-lightweight) at the appropriate version.Control.Exception.Lens
provides a nice approach for modeling exception subtyping using prisms. Instead of an ether
type like this:
(MonadExcept IOException m, MonadException CompileError m) => ...
... you would have:
(AsIOException e, AsCompileError e, MonadException e m) => ...
See this thread for more details:
https://www.reddit.com/r/haskell/comments/2utxua/prisms_and_monaderrors/?st=j4aqwbyx&sh=1c57491b
... and:
https://hackage.haskell.org/package/lens-4.15.3/docs/Control-Exception-Lens.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.