Commit Graph

681 Commits

Author SHA1 Message Date
Sventimir
4920601fe9
Add tests for Nat ranges and fix bad range [1,2..1] behaviour. (#1794)
Co-authored-by: Marcin Pastudzki <marcin.pastudzki@gmail.com>
2021-07-28 06:52:59 +01:00
Mathew Polzin
b03395debe
Merge pull request #1603 from ska80/remove-realpath-notes
Remove all mentions of `realpath` from docs
2021-07-26 12:38:39 -07:00
Guillaume ALLAIS
13ef8ba707 [ fix #1782 ] remove the case-specific code
I can't make sense of this code, it seems to try to convert the
case function corresponding to `let (a, b) = f n in ...` into a
different case function where `f n` and `(a, b)` have been unified.
But if `f n` is a bona fide stuck computation, there's no chance of
this happening.

Just turning this off solves the #1782 and only breaks one function
in the whole of the idris2 repo (I would have expected our current
termination oracle to be too weak to detect it as valid anyway!)
and one in frex (which, again, should not have been seen as terminating).

Also fixes #1460
2021-07-26 17:03:16 +01:00
Guillaume ALLAIS
d0c0698c45 [ re #1771 ] Check parameters for positive uses
It's fine to allow positive occurences in (strictly positive)
parameters but we do need to check that these occurences are
strictly positive!
2021-07-23 13:30:24 +01:00
Guillaume ALLAIS
b24a9a51df [ re #1771 ] Fix another Erased-related issue (in nameIn) 2021-07-23 13:30:24 +01:00
Guillaume ALLAIS
230f42b697 [ re #1771 ] Do not use Erased to go under binders
In the `MkFix : f (Fix f) -> Fix f` example, using `Erased` for `f`
makes the type reduce to `[__] (Fix [__]) -> Fix [__]` and because
`[__] e1 ... en` computes to `[__]`, we end up with `[__] -> Fix [__]`
which does not reference `Fix` anymore.
2021-07-23 13:30:24 +01:00
André Videla
5389f8c2a8
Merge pull request #1770 from andrevidela/fix-if-then-else-interpolation
Fix #1767
2021-07-22 16:35:11 +00:00
Edwin Brady
e633a9fa6e Correct error018 test
I expect I got my local versions inconsistent while working on this...
2021-07-22 13:36:03 +01:00
Edwin Brady
edefd543f7 A bit of refactoring of argument elaboration order
In theory argument elaboration order doesn't matter, but in practice we
sometimes make choices for performance reasons, like helping with
disambiguation by knowing the target type.

This was kind of messy, now we can more clearly see what's going on.
Also, more importantly, it gives us a bit more control which we
sometimes need. For example, if we go choose to go right to left for
some performance heuristic it might turn out we don't have enough
information yet, in which case we need to delay and try again later.

Fixes #1743
2021-07-22 13:36:03 +01:00
André Videla
bab3897a9b move basic053->interpolation002, move basic061->basic053 2021-07-22 12:17:53 +00:00
André Videla
1276f47cf6 Fix #1767
The `if then else` syntax expects a block for the `then` and `else`
parts. Before this patch, the token `InterpEnd` was not a valid
follow up token to end a block. This adds `InterpEnd` as a closing
token for blocks, allowing `if then else` in interpolation slices
without additional parens.
2021-07-22 12:17:53 +00:00
André Videla
5576d30c27
Merge pull request #1736 from stepancheg/test-discovery
Implement test discovery
2021-07-22 08:56:02 +00:00
Edwin Brady
68db9fe0fe Add reg048 files
Odd, I thought I added these before, but it's probably because I got in
a mess with git and didn't re-add once I resolved that.
2021-07-19 00:21:28 +01:00
Edwin Brady
2068eb271b Better ordering of delayed elaborators
Instead of having an arbitrary looking priority number, record explicit
reasons for the delay, which helps order them sensibly when rerunning
them. Mostly this allows us to choose which ones to rerun, where it
helps, and helps order things to get better error messages.
2021-07-19 00:21:28 +01:00
Stiopa Koltsov
7325002dec Implement test discovery
`testInDir dir ...` lists all directories in `dir` which contains
`run` files, and such directories are considered tests.

This is done to make test addition/maintenance cheaper.

Convert some test directories to `testInDir`, but not all of them
because
* some directories are listed in several test groups
* other directories are have some tests disabled
2021-07-17 16:53:43 +01:00
Stiopa Koltsov
4eff6ac916 System.Directory.listDir
This function is what users want 99.9% of time.
2021-07-17 14:58:57 +01:00
Stiopa Koltsov
c7629e20fe Skip dot and dot-dot in nextDirEntry
These entries returned by `readdir` are legacy of Unix API, we don't
really need them. Most APIs do not return them (for example Java
`Files.newDirectoryStream` or Python `os.listdir`).
2021-07-17 14:58:28 +01:00
Stiopa Koltsov
0ecf74e434 System.Directory.nextDirEntry
* add `nextDirEntry` which returns `Maybe String`, so `Nothing` on
  the end of directory unlike `dirEntry` which returns unspecified error
  on the end of directory
* `dirEntry` is deprecated now, but not removed because compiler depends on it
* native implementation of `dirEntry` is patched to explicitly reset `errno`
  before the `readdir` call: without it end of directory and error were
  indistinguishable
* test added
2021-07-17 14:57:27 +01:00
Stepan Koltsov
ce44d3b50a
Change semantics of lines and unlines function to match Haskell and other languages (#1585)
* Add trailing newline on non-empty list in unlines

There are several reasons to do that:
* a line in a text file is something which ends with newline,
  and the last line is not special
* `unlines []` should be different from `unlines [""]`
* `unlines (a ++ b) = unlines a ++ unlines b`
* Haskell does it

* Change lines function behaviour
2021-07-17 14:54:23 +01:00
Ruslan Feizerakhmanov
ee063a5412
Apply "qualified do" notation to bangs and comprehensions (#1700)
* Propagate 'do qualification' to inner bangs and comprehensions

* Minor

* Remove banner in test

* Move tests from reg045 to reg047

* Move mbNS from Desugar.idr to Name.idr, renaming it to mbApplyNS
2021-07-17 14:52:22 +01:00
Kamil Shakirov
c4b41ee1ff Remove all mentions of realpath from docs
`realpath` is no longer needed to run executables.
2021-07-16 21:20:11 +06:00
Stiopa Koltsov
c4ed1395d9 Replace per signal counter with per signal flag
Operating system counter stores signals as flag set without counter.
So sending two signals to a process may result to one or two signal
handler invocation. Queueing signals inside Idris could give users
false sense of signals being are queue, while they are not.

In particular, test for signal could not work reliably for that
reason.

Also, practically we usually don't need have more than once signal
event.

This is follow-up to #1660. CC @mattpolzin
2021-07-16 11:31:53 +01:00
Giuseppe Lomurno
37c700907e Removed leak of internal names from test reflection010 2021-07-16 04:28:58 +02:00
Giuseppe Lomurno
07c62e9eef Fixed wrong reflection of records and parameters 2021-07-16 04:28:52 +02:00
Edwin Brady
f4cc2f1ea8
Merge pull request #1721 from edwinb/AliasQli-master
Updated: add doublePow to primitives
2021-07-15 23:17:53 +01:00
Stiopa Koltsov
c80a502627 Return Bool from IOArray.writeArray
As suggested in #1677.

Crashing on out-of-bounds might be more practical, but we can
reconsider it later.
2021-07-15 22:16:22 +01:00
Edwin Brady
f51aa22046 Bring #1719 up to date with latest changes 2021-07-15 22:04:49 +01:00
Edwin Brady
50c0116780
Merge pull request #1718 from edwinb/Russoul-unification
Postpone when instantiating if type is unknown
2021-07-15 21:16:00 +01:00
André Videla
e45d792283
Merge pull request #1701 from mattpolzin/alternative-errors
Show error output from multiple alternative parsing branches.
2021-07-15 20:06:25 +00:00
Edwin Brady
a709f6d369 Fix/reorganise tests 2021-07-15 20:24:40 +01:00
Edwin Brady
d9a56c5fd1 Merge branch 'unification' of https://github.com/Russoul/Idris2 into Russoul-unification 2021-07-15 20:24:27 +01:00
Mathew Polzin
948a5ba9df noticed I was not _quite_ retaining existing behavior around Alt error processing so fixed that. updated tests. 2021-07-15 12:05:23 -07:00
Edwin Brady
b192be32b8 Merge branch 'name-quote-single-brace' of https://github.com/buzden/Idris2 into buzden-name-quote-single-brace 2021-07-15 17:57:41 +01:00
Edwin Brady
b8082f4ed7
Merge pull request #1714 from edwinb/lodi-thread-data
fix arity for blodwen-set-thread-data
2021-07-15 16:21:31 +01:00
Edwin Brady
62586627d8 fix arity for blodwen-set-thread-data
This is an update of PR #540, thanks to @lodi
2021-07-15 15:02:43 +01:00
Mathew Polzin
289f1cc954 merge w/ upstream. 2021-07-15 06:29:56 -07:00
Edwin Brady
86aaed5ae1
Merge branch 'master' into fix-unquote-thing 2021-07-15 14:13:25 +01:00
Edwin Brady
35f23ac1d6
Merge pull request #1712 from edwinb/MarcelineVQ-elab-name-changes
Add more name reflections
2021-07-15 14:08:31 +01:00
Edwin Brady
9b0ebcd08b Merge branch 'elab-name-changes' of https://github.com/MarcelineVQ/Idris2 into MarcelineVQ-elab-name-changes 2021-07-15 13:16:47 +01:00
Guillaume ALLAIS
efcf44e8ba [ cosmetic ] use the whole range when underlining the problem 2021-07-15 07:32:43 +01:00
Mathew Polzin
221dadeb20 set default alt error count to 1 and create a config option that sets it to any number. 2021-07-14 20:23:29 -07:00
Mathew Polzin
1f21e787b1 Use commit to reduce the alternative parsing space as soon as an opening paren is encountered. 2021-07-14 17:22:40 -07:00
Edwin Brady
8cd265cf47
Merge pull request #1698 from stepancheg/move-rm-rf-build
Move rm -rf to the beginning of the test
2021-07-14 16:00:46 +01:00
Edwin Brady
5cb77ad675
Merge pull request #1704 from edwinb/with-params
Fix 'with' under implicit parameters
2021-07-14 15:56:58 +01:00
Edwin Brady
1dbc9a7143 Fix 'with' under implicit parameters
The 'with' type and application need to treat the parameters with the
same plicity, but the application has just always treated them as
explicit since it never looked. It's easiest just to make them all
explicit, since this isn't a user visible type. Fixes #1695.
2021-07-14 14:51:52 +01:00
Mathew Polzin
830e5dc12d Fix bug with what value was propagated from rhs of alt parse failure and add test case for '@' as value constructor. 2021-07-14 00:25:02 -07:00
Stiopa Koltsov
9f61e542b4 Move rm -rf to the beginning of the test
While the discussion about how to refactor test framework is not
finished (#1654), make this change: move `rm -rf build` in the
beginning of the test. For these reasons:

* it is useful to inspect the contents of the `build` directory
  especially after the test failure
* if build crashes mid-test (e.g. process killed), next run should
  not be affected by the `build` directory from the previous run
2021-07-13 22:54:53 +01:00
Johann Rudloff
d5abff4e46
[ fix #1260 ] Use blodwen-stringbytelen instead of C's strlen (#1261) 2021-07-13 11:52:15 +01:00
Niklas Larsson
eb0c59c908
Enable incremental compilation on Windows. (#1694) 2021-07-13 11:29:34 +01:00
CodingCellist
80e7e179ad
[ fix #1652 ] Save casefnty to TTC (#1686) 2021-07-13 11:04:07 +01:00