on master help sign in
Relax naming rules for packages.

Naming conventions for Idris packages in an iPKG file now follow the same rules for executables. Unquoted names must be valid namespaced Idris identifiers e.g. ``package my.first.package``. Quoted package names allow for packages to be given valid file names, for example, ``package "my-first-package"``.

commit22c1e98e307401db4cf6a55086622de3ca229343 authorJan de Muijnck-Hughes <jfdm@st-andrews.ac.uk> dateThu 19 May 2016, 09:45 (10 years ago) parent6bfcfbe
7 files changed+22−13
CHANGELOG.md+10−4 docs/reference/packages.rst+2−1 docs/tutorial/packages.rst+3−2 idris.cabal+1−1 src/Pkg/PParser.hs+2−1 test/pkg001/run+3−3 test/pkg001/test.ipkg → test/pkg001/test-pkg.ipkg+1−1
CHANGELOG.md+10−4
@@ -16,14 +16,14 @@
1616 ```
1717 [PlusNatSemi] Semigroup Nat where
1818 (<+>) x y = x + y
19−
19+
2020 [MultNatSemi] Semigroup Nat where
2121 (<+>) x y = x * y
22−
22+
2323 -- use PlusNatSemi as the parent implementation
2424 [PlusNatMonoid] Monoid Nat using PlusNatSemi where
2525 neutral = 0
26−
26+
2727 -- use MultNatSemi as the parent implementation
2828 [MultNatMonoid] Monoid Nat using MultNatSemi where
2929 neutral = 1
@@ -107,6 +107,12 @@
107107 not, leading to a contradiction. The new fine-grained equality
108108 prevents this.
109109
110+* Naming conventions for Idris packages in an iPKG file now follow the
111+ same rules for executables. Unquoted names must be valid namespaced
112+ Idris identifiers e.g. ``package my.first.package``. Quoted package
113+ names allow for packages to be given valid file names, for example,
114+ ``package "my-first-package"``.
115+
110116## Reflection changes
111117
112118* The implicit coercion from String to TTName was removed.
@@ -278,7 +284,7 @@
278284 package names that the idris project depends on. This reduces bloat in the
279285 `opts` option with multiple package declarations.
280286* iPKG files now allow `executable = "your filename here"` in addition to the
281− existing `executable = yourFilenameHere` style. While the unquoted version is
287+ Existing `Executable = yourFilenameHere` style. While the unquoted version is
282288 limited to filenames that look like namespaced Idris identifiers
283289 (`your.filename.here`), the quoted version accepts any valid filename.
284290* Add definition command (`\d` in Vim, `Ctrl-Alt-A` in Atom, `C-c C-s` in Emacs)
docs/reference/packages.rst+2−1
@@ -15,7 +15,8 @@ Package Descriptions
1515A package description includes the following:
1616
1717+ A header, consisting of the keyword package followed by the package
18− name. Package names can be any valid Idris identifier.
18+ name. Package names can be any valid Idris identifier. The iPKG
19+ format also takes a quoted version that accepts any valid filename.
1920+ Fields describing package contents, ``<field> = <value>``
2021
2122At least one field must be the modules field, where the value is a
docs/tutorial/packages.rst+3−2
@@ -4,7 +4,7 @@ Packages
44
55
66Idris includes a simple build system for building packages and executables from a named package description file.
7−These files can be used with the Idris compiler to manage the development process.
7+These files can be used with the Idris compiler to manage the development process .
88
99Package Descriptions
1010====================
@@ -12,7 +12,8 @@ Package Descriptions
1212A package description includes the following:
1313
1414+ A header, consisting of the keyword package followed by the package
15− name. Package names can be any valid Idris identifier.
15+ name. Package names can be any valid Idris identifier. The iPKG
16+ format also takes a quoted version that accepts any valid filename.
1617+ Fields describing package contents, ``<field> = <value>``
1718
1819At least one field must be the modules field, where the value is a
idris.cabal+1−1
@@ -671,7 +671,7 @@ Extra-source-files:
671671 test/primitives006/expected
672672
673673 test/pkg001/run
674− test/pkg001/test.ipkg
674+ test/pkg001/test-pkg.ipkg
675675 test/pkg001/*.idr
676676 test/pkg001/expected
677677
src/Pkg/PParser.hs+2−1
@@ -56,7 +56,8 @@ parseDesc fp = do
5656
5757pPkg :: PParser PkgDesc
5858pPkg = do
59− reserved "package"; p <- fst <$> identifier
59+ reserved "package"
60+ p <- filename
6061 st <- get
6162 put (st { pkgname = p })
6263 some pClause
test/pkg001/run+3−3
@@ -1,5 +1,5 @@
11#!/usr/bin/env bash
2−${IDRIS:-idris} $@ --build test.ipkg
2+${IDRIS:-idris} $@ --build test-pkg.ipkg
33rm -f *.ibc
4−${IDRIS:-idris} $@ --build test.ipkg --quiet
5−${IDRIS:-idris} $@ --build test.ipkg --logging-categories "elab" --log 1
4+${IDRIS:-idris} $@ --build test-pkg.ipkg --quiet
5+${IDRIS:-idris} $@ --build test-pkg.ipkg --logging-categories "elab" --log 1
test/pkg001/test.ipkg → test/pkg001/test-pkg.ipkgrenamed+1−1
@@ -1,4 +1,4 @@
1−package test
1+package "test-pkg"
22
33pkgs = effects
44