Commit Graph

1201 Commits

Author SHA1 Message Date
G. Allais
310a8f12cd
[ new ] missing buffer primitives (#2893) 2023-02-26 17:50:52 +00:00
Andre Videla
0f4464a690 add logs to linear check 2023-02-25 22:29:34 +00:00
Andre Videla
891c1751ed add tests 2023-02-25 12:19:29 +00:00
Alex1005a
a9ad1dd0cc
[ contrib ] Performance improvement gcd in Data.Nat.Factor (#2886) 2023-02-22 12:08:49 +00:00
G. Allais
dc1b5387b8
[ re #2832 ] warn about conflicting fixity declarations (#2889) 2023-02-19 16:29:10 +00:00
pinselimo
2dbb824a93
[ doc ] Add constructor docstrings (#2789)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2023-02-19 10:15:39 +00:00
Guillaume Allais
3bccf8e212 [ fix ] highlight record constructor 2023-02-13 15:41:56 +00:00
Guillaume Allais
f76c4c4307 [ fix ] respect visibility in forward data declarations 2023-02-08 22:00:25 +00:00
Justus Matthiesen
6edbfc59a5 [ test ] non-terminating function from issue #2448 2023-02-08 16:13:04 +00:00
Justus Matthiesen
914d68858b [ termination ] faithful implementation of size-change graph termination analysis
- call sequences in termination errors now carry location information
- new error message (`BadPath`) for late-starting loops
- [ fix ] transitive closure of size-change graphs no longer ignores function arguments
- update existing tests accordingly
2023-02-08 16:13:04 +00:00
Justus Matthiesen
2b54c23073 [ test ] examples from termination paper 2023-02-08 16:13:04 +00:00
G. Allais
fba9f16a1c
[ fix ] positivity checker: assert_total & Lazy (#2876) 2023-02-07 12:35:33 +00:00
Steve Dunham
464797944a [ error ] Fix location of type errors in do block pattern matching 2023-02-04 23:07:49 +00:00
Guillaume Allais
21fa60ae6a [ re #2871 ] Fix the resolvedN issue for good 2023-02-04 16:10:47 +00:00
Stefan Höck
f6a731695d
[ new ] constructor plus trivial impl for Interpolation (#2871)
* [ new ] constructor plus trivial impl for Interpolation

* [ doc ] update CHANGELOG

* [ test ] adjust expected test output
2023-02-04 07:47:28 -06:00
Mathew Polzin
ad12f8335c
[ new ] popen/pclose for the NodeJS backend. (#2857)
* implement popen and pclose (to an extent) for NodeJS

* bring node020 back into tests.

* ah, I see what was being done here. Fix the idris for the test.

* fix test's unreachable clause warning

* fix expectation

* Add note to CHANGELOG

* small tweaks to get popen into merge-ready state.
2023-01-30 09:38:42 -06:00
G. Allais
966a4813fb
[ fix ] respect totality annotations for data (#2862) 2023-01-26 11:03:22 +00:00
Denis Buzdalov
f4b44ba109 [ prelude ] Make some higher-kinded functions be tc-inlined 2023-01-25 16:51:11 +00:00
Marek L
7ec96cea7f [ doc ] Remove typo from Prelude.plus doc string and
reformat doc string for `Prelude.minus`
2023-01-24 23:35:03 +00:00
Mathew Polzin
4bedaac811
[ fix ] make color output toggling simpler and also more robust. (#2848)
* make color output toggling simpler and also more robust

* don't unintentionally assert that tests are run in an environment where colors are turned on.

* Update src/Idris/Env.idr
2023-01-22 13:35:57 -06:00
Denis Buzdalov
936b7270ae [ prelude ] Add lacking implementation of Traversable for Pair 2023-01-09 15:56:21 +00:00
Stefan Höck
8db12f5a49
[ performance ] improve some Char functions (#2839) 2023-01-06 09:08:38 +00:00
Steve Dunham
a84a5a32d9 Fix at-pattern leak in recursive with blocks (#2834) 2022-12-28 09:08:09 +00:00
Zoe Stafford
d82c5d633f
Merge pull request #2815 from mjustus/test_pkg017_ignore
[ cleanup ] ignore generated file
2022-12-22 15:02:50 +00:00
Guillaume Allais
1092804726 [ fix #2821 ] Failing blocks should force delayed holes 2022-12-21 11:16:26 +00:00
G. Allais
0194539ef7
[ new ] __LOC__, __FILE__, __LINE__, __COL__ magic debug strings (#2819)
* [ new ] __LOC__, __FILE__, __LINE__, __COL__ magic debug strings

* [ fix ] the point is to test whitespace being ignored

* [ fix ] golden values
2022-12-17 18:12:39 +00:00
G. Allais
2f55a3ef8a
[ fix ] elaboration of records' telescopes of parameters (#2816) 2022-12-15 17:55:50 +00:00
Justus Matthiesen
5718be2b45 [ cleanup ] ignore generated file 2022-12-12 14:47:33 +00:00
Justus Matthiesen
e673d05a67
[ fix ] jump-to-definition (":name-at" IDE command) (#2811) 2022-12-09 17:02:57 +00:00
Markus Pfeiffer
c3bbdb30a1
Add mustWork in GADT data declaration parser (#2805)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-12-09 16:04:11 +00:00
locriacyber
cb30d7cda8
Install *.ttm on idris2 --install (#2796)
Co-authored-by: Justus Matthiesen <mail@justusmatthiesen.com>
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-12-08 21:06:17 +00:00
Ruslan
d44ddc7f11
Let qualified do-notation apply to pure and to idiom brackets (#2786) 2022-12-07 22:27:58 +00:00
Ellis Kesterton
9931f35b6b
Improve parser error messages when using reserved identifiers in decls (#2803)
Co-authored-by: Ellis Kesterton <erk4@st-andrews.ac.uk>
2022-12-07 16:09:26 +00:00
Guillaume Allais
001f48fba8 [ test ] for io_bind inlining 2022-12-06 11:55:28 +00:00
G. Allais
fcbd9e9190
[ fix #2794 ] Do not ignore notinline lets in identity detection (#2795) 2022-12-06 11:41:30 +00:00
G. Allais
85bb822f3b
[ perf ] manually eta-expand unsaturated io_bind calls (#2785) 2022-12-01 15:31:00 +00:00
Steve Dunham
f443723f4e [ parser ] fix issue where indentation is not checked in record parameters 2022-11-25 08:22:37 +00:00
Steve Dunham
56a9bc6be4 [ error ] Improve locality of parse errors in implicit arguments 2022-11-21 10:40:40 +00:00
Tim Engler
bff18428b4 Added seqL to Control.App and updated docs to fix #2761
Also updated test real002 to use the actual Control.App from
libs/base/Control/App.idr. Before it was using a different version that
existed within its test directory, tests/idris2/real002/Control/App.idr
2022-11-21 10:39:43 +00:00
Hattori, Hiroki
5c9f8e36a1
[ RefC ] Add 16 and 32 bit access to base/Data.Buffer . (#2609)
* Fix symbom mangling

* Revert "Fix symbom mangling"

This reverts commit 6481e80155.

* Fix typo

* [RefC] Add missed prims of setBuffer* .

* [ fix ] formatting

* [ re #2609 ] Use 'UInt' instead of 'Word'

More descriptive/to the point / Less assumed knowledge.

There are no *LE suffixes for UInt8, since endianness is to do with
multiple bytes and UInt8 is a single one.

Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
Co-authored-by: Thomas E. Hansen <teh6@st-andrews.ac.uk>
2022-11-15 12:15:06 +01:00
CodingCellist
70ef197cf6
[ base ] Deprecate setByte in favour of setBits8 (#2764)
* [ base ] Deprecate setByte in favour of setBits8
           Deprecate getByte; fix Core.Binary.Prims

Along with `setByte`, the `getByte` function should similarly be
deprecated since it also assumes the value will have the given size,
rather than guaranteeing it in the type.

CI highlighted some required changes in `Core.Binary.Prims` thanks to
`-Werror`. The fix was to add some `cast` calls where the old `getByte`
and `setByte` used to be.

The RefC buffer test will need updating once we remove the functions
completely. Added a note for future peeps.
2022-11-15 10:42:07 +01:00
Denis Buzdalov
f5f7e2eb80 [ error ] Make failing IAlternative w/ FirstSuccess print all errors 2022-11-15 10:28:59 +01:00
Steve Dunham
85c93c8018 [ error ] Add FC for errors on interface constructors (#2769) 2022-11-12 22:17:42 -08:00
Steve Dunham
ea733181c5 [ error ] Add an FC to record constructors for better error messages (#2769) 2022-11-12 21:59:16 -08:00
Thomas E. Hansen
643c4be55f [ re #2649 ] Describe test naming pattern 2022-11-11 09:33:09 +01:00
Stefan Höck
9c9ffe4a31
[ fix ] isue 2745 (#2747)
* [ fix ] .ipkg install dir

* [ test ] .ipkg install dir

* [ doc ] update CHECKLIST

* [ doc ] add explanation to pkg016 test

* [ cleanup ] no need to clutter CHECKLIST
2022-11-02 12:01:19 +00:00
G. Allais
4cd38a8c5d
[ new ] deriving Show (#2741) 2022-11-02 11:57:07 +00:00
Zoe Stafford
078445b178
Merge pull request #2744 from dunhamsteve/bang-fc
[ parser ] Better error messages for type mismatch on bang expressions
2022-11-02 07:06:11 +00:00
Steve Dunham
3c0eadee07 [ parser ] Better error messages for type mismatch on bang expressions 2022-11-01 20:18:33 -07:00
G. Allais
19d0cbcd37
[ new ] put TTC files in a version-tagged directory (#2684) 2022-11-01 18:11:18 +00:00
Edwin Brady
e125c9014f
Prepare release 0.6.0 (#2733)
* Prepare release 0.6.0

* Fix bootstrap chez

* Correct version in bootstrap chez
2022-10-27 16:32:16 +01:00
Stefan Höck
57c589ca80
[ performance ] More stack safety in the Prelude (#2704) 2022-10-26 09:54:53 +01:00
Aleksei Volkov
c906720ee3
[ base ] Change Reader to fix search for MonadReader instance (#2729) 2022-10-22 19:13:52 +01:00
Guillaume Allais
542ebeae97 [ fix 2726 ] more peeling of Erased 2022-10-22 10:07:39 +01:00
CodingCellist
47c2de3148
[ repl ] Add the ability to get detailed help, e.g. :help :help (#2722)
A common issue for users is that the behaviour of the various repl
commands are not documented anywhere despite some of them having complex
behaviour (e.g. `:set` which accepts a specific set of options). This
implements the ability to call `:?|:h|:help` on repl commands to request
detailed help for a specific repl command, while preserving the
behaviour that calling the help command without any arguments prints the
general help text.

Generic help is defined as the first line of the help text.
Detailed help is defined as the entire help text.

This means that `:help :t`, for example, does not error (there is no
detailed help) but instead just prints the single line of help text.

* [ repl ] Use unlines for detailed help (see #2087)

  Ideally, the lines affected should be multiline strings. But for some
  arcane reason, newlines in those get swallowed in Nix and Windows
  **CI** only Ô.o
  This was already documented in issue #2087.

* [ new ] --except for golden testing lib

  To allow CI to pass despite #2087

Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-10-21 14:35:33 +02:00
Guillaume Allais
a39783be8e [ fix #2721 ] Don't reflow doc lines
I don't think there's a good solution at least until we start
parsing these comments so let's just keep them as they were written
by the library writer.
2022-10-19 09:09:11 +01:00
QDelta
e0a19aa01e
[ fix #2719 ] --only behavior in Test.Golden (#2720)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-10-18 12:36:09 +01:00
G. Allais
51d00638b0
[ cosmetic ] Say when you start compiling the executable (#2714) 2022-10-14 16:21:19 +01:00
G. Allais
30866fa892
[ new ] do not split on dotted patterns (#2706) 2022-10-14 16:21:06 +01:00
Steve Dunham
b15be4a70a [ new ] Allow forward declarations of records 2022-10-14 14:58:29 +01:00
CodingCellist
bb602643b1
[ fix #2712 ] Don't consider CyclicMeta recoverable (#2713) 2022-10-14 14:57:55 +01:00
Thomas E. Hansen
6823915dd0 [ tests ] Check REPL help text and module import cmds
The help text check is for making sure we update it when modifying
things, more than anything else.
2022-10-13 11:31:05 +02:00
Denis Buzdalov
3ca065b85d [ fix #2088 ] Make %runElab expression propagate its rig to check 2022-10-07 10:55:22 +02:00
Zoe Stafford
c69f439c2d
[ cleanup ] Compiler/* modules (#2694)
* cleanup(Compiler/*)
cleanup some messy/unclear code
Also use primitives directly where possible, instead of idris's wrappers

* Fix tests
2022-10-06 10:17:38 +02:00
CodingCellist
23eea52c50
[ fix ] also usleep in the producer of channels006 to guarantee correct output (#2702)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-10-05 12:03:20 +01:00
G. Allais
1f3809c49a
[ re #2675 ] Do not build libs/{contribs,papers} during bootstrap (#2677)
Co-authored-by: Ben Hormann <benhormann@users.noreply.github.com>
2022-10-04 13:37:45 +01:00
Zoe Stafford
138452273c
Merge pull request #2701 from stefan-hoeck/snocfold
[ performance ] efficient foldr and foldMap for SnocList
2022-10-04 12:52:39 +01:00
stefan-hoeck
0e956249cc [ performance ] efficient foldr and foldMap for SnocList 2022-10-04 12:19:32 +02:00
Sam Phillips
bacc418aa0 Remove codegen option from channel tests 2022-10-04 10:24:27 +02:00
Sam Phillips
54a426356a Move channel tests to allschemes 2022-10-04 10:24:27 +02:00
Sam Phillips
abe2e94b5b Add channel tests from Chez to Racket 2022-10-04 10:24:27 +02:00
Sam Phillips
795eeb23c5 Make Racket backend channels behave same as Chez.
Add tests for both that demonstrate equivalent behavior.
2022-10-04 10:24:27 +02:00
Stefan Höck
b697cea6e2
[ refactor ] use BitsXY for enum types during codegen (#2692)
* [ refactor ] use Bits32 for enum types during codegen

* [ test ] add test case

* [ test ] restore vmcode test result

* [ fix ] more B32 conversions

* [ refactor ] flexible ENUM representation

* [ text ] fix codegen test
2022-09-30 08:16:32 +01:00
stefan-hoeck
2344004d9d [ test ] add another test case 2022-09-29 16:34:41 +02:00
stefan-hoeck
0543779200 [ performance ] constant fold prim__integerToNat 2022-09-29 16:30:03 +02:00
Stefan Höck
7eebeff905
[ fix ] natToFinLt is O(n) (#2689) 2022-09-29 14:36:32 +01:00
André Videla
162d9e942b
Merge pull request #2686 from dunhamsteve/lexer-issue
[ fix ] Lexer reports incorrect column numbers
2022-09-27 16:00:27 +01:00
stefan-hoeck
eb7b7912b9 [ test ] fix node args test 2022-09-27 08:28:01 +02:00
Steve Dunham
f03f184af9 [ parse ] Add fc to IPragma for better error messages 2022-09-25 16:09:53 +01:00
G. Allais
81ea363ae8
[ base ] deriving Traversable (#2678) 2022-09-24 12:43:49 +01:00
Guillaume Allais
5631608782 [ base ] deriving Foldable 2022-09-24 10:20:25 +01:00
CodingCellist
7f0dad21f8
[ debug ] Log when stuck because fn out of scope (#2673)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-09-22 13:12:47 +01:00
Guillaume Allais
2adc3319f6 [ parse ] better error messages for records 2022-09-22 12:25:20 +01:00
Stefan Höck
08f24e79fd
[ performance ] constant folding for all integral expressions (#2662) 2022-09-21 10:05:02 +01:00
Steve Dunham
1142f73e05 Add indentation checks when parsing args in implDecl 2022-09-20 23:57:54 +01:00
Steve Dunham
03d6c5f637
[ new ] Handle forward declarations of implementations (#2668)
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2022-09-20 21:08:50 +01:00
Steve Dunham
669f49e23e [ parser ] Make commitKeyword fail fatally 2022-09-16 11:39:53 +01:00
G. Allais
55926f30c5
[ fix #2655 ] Add support for DataOpts in records (#2658) 2022-09-14 14:57:04 +01:00
Zoe Stafford
02dfd6ff6c
Trans deps v3 (#2584)
* make `depends` collect all transitive dependencies

This happens by installing the (modified) ipkg file along with ttc files

* [ fix ] parsing a package shouldn't always set sourceDir

* linter *sigh*

* Fix test, add changelog

`asDepends` has been changed to `setSrc` as that is for me more intuitive

in idris2/pkg006 the version field was removed from the ipkgs of bar-baz and quux
as idris now expects the version to match the folder

idris2/pkg010 explicitly disables incremental compilation, to prevent extra log info

* (hopefully) fix idris2/pkg13 test on windows

* Actually install the version
This should make things start working

* [ fix ] use backtracking to resolve transitive dependencies

* [ fix ] use backtracking to resolve dependencies

* [ fix ] test pkg006

* Fix missing import

Co-authored-by: stefan-hoeck <hock@zhaw.ch>
2022-09-09 07:08:39 +01:00
Zoe Stafford
a001333947
Warning for shadowed local bindings (#2623)
* Warning for shadowed local bindings

* [ lint ]

* Remove name shadowing in compiler src

* [ fix ] spelling & test cases

Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-09-07 20:59:28 +01:00
Steve Dunham
9646b31f2b [ test ] Fix timing issue in interactive045 test 2022-09-06 10:05:34 +01:00
Steve Dunham
90e46ef340 Add test case for lexer issue and fix other instance. 2022-09-05 13:47:41 -07:00
G. Allais
ece1198074
[ fix #1742 ] Do not use uppercase names as pattern variables (#2642) 2022-09-05 12:45:51 +01:00
Steve Dunham
351b5ba720 [ parser ] Fix issue where Alt drops incoming commit tag 2022-09-05 12:44:02 +01:00
Steve Dunham
2e45902048 [ parser ] Better error messages inside if statements. 2022-09-05 12:44:02 +01:00
Steve Dunham
150673622b [ test ] Add a sleep 1 to the interactive044 test to work around a race condition 2022-09-04 09:17:22 +01:00
Guillaume Allais
f678043854 [ test ] add tricky test case ported from Agda 2022-09-02 16:06:40 +01:00
Guillaume Allais
552f27f813 [ fix #2640 ] Do not shadow function name during case split 2022-09-02 11:55:15 +01:00
Guillaume Allais
6891490ed2 [ fix ] support for implicits in Deriving.Functor
A lot of refactoring to bring these. That's hopefully the last
feature that was needed...
2022-08-29 18:35:24 +01:00
Mathew Polzin
23e3695d74 Add test for auto implicit case splitting. 2022-08-16 09:23:19 +02:00
Zoe Stafford
86c060ef13
Reimplement %nomangle in terms of %export (#2604)
* Reimplement %nomangle in terms of %export
Also deprecate %nomangle

* [ lint ] fix linter errors
2022-08-15 13:26:06 +01:00
Guillaume Allais
4672305fc3 [ fix ] more filtering of invalid datatypes 2022-08-13 11:29:19 +01:00
Nil Geisweiller
719b5ad17f
[ cleanup ] Remove extraneous show and simplify printLn (#2618) 2022-08-10 21:22:58 +01:00
Justus Matthiesen
a30209d492
[ fix ] Remove stray ")" in Show instance for Term (#2611) 2022-08-08 15:24:07 +01:00
Steve Dunham
f4dc7f4221 Merge branch 'main' into issue-2557 2022-08-03 07:13:04 -07:00
Steve Dunham
4088dd863b Rebuild TTC if they don't contain needed incremental data (related to #2560) 2022-08-03 07:12:46 -07:00
Guillaume Allais
a4b99bd81c [ refactor ] introduce allSemanticHighlighting
Side effect: all the aspects are now sorted by ranges as we are
merging the PosMaps instead of appending the lists.
2022-07-19 15:01:20 +01:00
G. Allais
84a504738c
[ doc ] add comments to generated javascript (#2594) 2022-07-18 17:30:56 +01:00
Guillaume Allais
8ecb1aaf95 Revert "Fix issue with case inside a type."
This reverts commit 50ca28c068.
2022-07-18 15:58:29 +01:00
Steve Dunham
50ca28c068 Fix issue with case inside a type. 2022-07-18 14:17:14 +01:00
G. Allais
0cbbf97b79
[ new ] extend Deriving.Functor to (non-strictly) positive functors (#2591) 2022-07-18 14:10:46 +01:00
Mathew Polzin
4a348c1f95 Public export remaining function to allow for proofs involving parsing numbers. 2022-07-18 14:10:05 +01:00
Steve Dunham
a0d9e2bbba
Update tests using base64 utility to also work on macos (#2536)
* Update tests using base64 utility to also work on macos

* Fix invocation of base64 in refc/buffer test.
2022-07-13 06:46:31 -07:00
G. Allais
1f41c8b44d
[ close #647 ] Already fixed (#2581) 2022-07-08 14:16:25 +01:00
Guillaume Allais
ac2ef882f6 [ fix #2573 ] Solve constraints before looking at eq type 2022-07-07 20:36:05 +01:00
Guillaume Allais
19bc798952 [ re #2526 ] Update golden value 2022-07-07 20:34:54 +01:00
Guillaume Allais
d19dbfffff [ fix #2229 ] better warning 2022-07-07 16:42:34 +01:00
G. Allais
4874bf2114
[ fix ] handle implicit arguments in Deriving.Functor (#2572) 2022-07-07 09:55:13 +01:00
Stefan Höck
5a962929e7
[ fix ] issue 2537 (#2538)
Co-authored-by: Zoe Stafford <zoepolarsax@gmail.com>
2022-07-07 09:54:52 +01:00
Guillaume Allais
7db20d38a3 [ cleanup ] Fewer assert_total in deriving Functor 2022-07-04 12:03:49 +01:00
G. Allais
aeeb338e6c
[ new ] deriving Functor (#2568) 2022-07-04 08:58:18 +01:00
Ruslan
dbba32ea09
Fix an eta issue in elaborator-reflection (#2449)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
Co-authored-by: Denis Buzdalov <public@buzden.ru>
2022-06-30 22:01:31 +01:00
Steve Dunham
0454dfd66a Address issue #2557 Incremental compilation is used when .so files are missing. 2022-06-25 19:56:56 -07:00
G. Allais
4024857d20
[ base ] Various Language.Reflection improvements (#2554) 2022-06-22 13:07:27 +01:00
Guillaume Allais
e5802204b6 [ fix ] holes in record types 2022-06-17 10:17:40 +01:00
Guillaume Allais
2060535d08 [ new ] name hints for primitive types 2022-06-14 16:07:37 +01:00
Guillaume Allais
7bd7f1da9c [ fix ] resugaring of DPair 2022-06-08 22:44:55 +01:00
György Kurucz
79a2f677d4 [ re #1282 ] Improve unelaboration of case expressions 2022-06-08 17:01:36 +01:00
Zoe Stafford
b9001439b3 Revert "Transitive dependencies v2 (#2496)"
This reverts commit 51f952714d.
2022-06-08 06:35:39 +01:00
Zoe Stafford
51f952714d
Transitive dependencies v2 (#2496)
* make `depends` collect all transitive dependencies

This happens by installing the (modified) ipkg file along with ttc files

* [ fix ] parsing a package shouldn't always set sourceDir

* linter *sigh*

* Fix test, add changelog

`asDepends` has been changed to `setSrc` as that is for me more intuitive

in idris2/pkg006 the version field was removed from the ipkgs of bar-baz and quux
as idris now expects the version to match the folder

idris2/pkg010 explicitly disables incremental compilation, to prevent extra log info

* (hopefully) fix idris2/pkg13 test on windows

* Actually install the version
This should make things start working
2022-06-07 14:31:14 +01:00
G. Allais
5e9a90bd97
[ fix ] semantic highlighting in IDE mode (#2509)
* [ fix ] semantic highlighting in IDE mode

Bring back (?) highlighting of goals

* [ debug ] better logging: add length

* [ test ] turns out lengths are not needed!
2022-05-28 11:23:07 +01:00
Denis Buzdalov
599027a893 [ fix ] Make able to interpret result of a macro as a function 2022-05-27 09:36:44 +01:00
Xerz
e9f562f435
[ prelude ] Add Range implementation for Char (#2505) 2022-05-27 07:57:59 +01:00
G. Allais
607a2a2110
[ IDE ] refine command (#2490) 2022-05-25 11:29:03 +01:00
Zoe Stafford
932a24baa1 Revert "make depends collect all transitive dependencies (#2469)"
This reverts commit fde6269c7e.
2022-05-21 06:49:07 +01:00
Zoe Stafford
fde6269c7e
make depends collect all transitive dependencies (#2469)
* make `depends` collect all transitive dependencies

This happens by installing the (modified) ipkg file along with ttc files

* [ fix ] parsing a package shouldn't always set sourceDir

* linter *sigh*

* Fix test, add changelog

`asDepends` has been changed to `setSrc` as that is for me more intuitive

in idris2/pkg006 the version field was removed from the ipkgs of bar-baz and quux
as idris now expects the version to match the folder

idris2/pkg010 explicitly disables incremental compilation, to prevent extra log info

* (hopefully) fix idris2/pkg13 test on windows
2022-05-20 16:20:54 +01:00
G. Allais
fdbd858d97
[ refactoring ] expose some internals needed by Katla (#2480) 2022-05-16 20:37:08 +01:00
Joel Berkeley
bf87b623ef
add scanr; scanr1; unsnoc for Vect (#2471)
* add `scanr` and `scanr1` for `Vect`

* add tests

* tests

* docstring

* typos

* add unsnoc

* simplify unsnoc

* docstring

* typos
2022-05-12 17:54:34 +01:00
Guillaume Allais
7c784dd89c [ fix ] missing rigs in doc type signatures 2022-05-12 10:25:54 +01:00
G. Allais
f80fc184e3
[ new ] :exec for RefC (#2466) 2022-05-10 15:09:53 +01:00
Jesse Nava
db13a35bf5 [ fix ] Ensure casting from String to Double results in floating numbers on scheme backends 2022-05-09 18:36:17 +01:00
György Kurucz
7a5f63eab0 [ fix ] Add missing cases for BITS types in extractInt
e79e4277 ("[ fix ] Make Bits types use int switch statement in RefC")
made the RefC backend generate code calling `extractInt` with Bits
types, bit did not add the extra cases to `extractInt`. This commit adds
the missing cases.

Fixes #2452
2022-05-04 10:18:58 +01:00
G. Allais
4256cd15fd
[ highlighting ] case trees in :di (#2440) 2022-04-29 12:52:23 +01:00
Steve Dunham
04e65529f6 Better parse error for missing paren after with 2022-04-29 08:59:40 +01:00
vfrinken
b1f45f2748
RefC backend improvements (#2425)
* RefC backend improvements

1. OnCollect had the wrong number of arguments. The code creator expects
   3 arguments, but onCollect in prim.h expected 4 arguments. The first of which
   was an erased arguments. That is now fixed.

2. OnCollect did not call `newReference` when creating a new reference to the pointer
   and the freeing function

3. OnCollect and OnCollectAny still had a spurious printf statement

Those issues have been fixed, the test case can be found in
  tests/refc/garbageCollect

4. The IORef mechanism expects that the %World token will be passed around
   consistently. This is not the case. States in Control.App make use of
   IORefs, but the function created from Control.App.prim_app_bind
   had the world token erased to NULL.
   Now, IORefs are managed using a global variable,
   IORef_Storage * global_IORef_Storage;
   referenced in cBackend.h, defined in the created .c file, and set to NULL
   in main();

5. While multithreading and forking is still not supported, compiling a program
   that makes use of Control.App demands a C implementation of prim_fork.
   Files support/refc/threads.c and support/refc/threads.h provide a
   dummy implementation for it, so that Control.App programs compile and run.

A test for these 2 issues is given in tests/refc/issue2424

* format changes

to make the linter happy

* format changes

to make the linter happy

* format changes

to make the linter happy

* spelling mistake braket -> bracket

Co-authored-by: Volkmar Frinken <volkmar@onutechnology.com>
2022-04-27 13:59:32 +01:00
G. Allais
05baf44b5b
[ refactor ] Index Pretty over the type of annotations (#2371) 2022-04-27 12:26:59 +01:00
Guillaume Allais
81ba322a4b Revert "[ fix ] search should solve auto implicits before implicits"
This reverts commit 6dd68e8924.
because of issue #2437
2022-04-27 11:00:51 +01:00
Guillaume Allais
6dd68e8924 [ fix ] search should solve auto implicits before implicits 2022-04-26 15:07:51 +01:00
G. Allais
22b98f231e
[ fix ] highlight unambiguous names in `with' (#2423) 2022-04-22 13:34:05 +01:00
G. Allais
98b1062772
[ fix ] :printdef support for P(D)Pair & Equal (#2416) 2022-04-15 20:39:46 +01:00
Guillaume Allais
ec4cf3d48c [ fix ] pretty printing of misspellings 2022-04-15 20:18:48 +01:00
Guillaume Allais
0986cf177b [ parse ] better error message for list literals
I got fed up with being puzzled whenever edwin's trailing commas
and my leading commas clash and the error location is the opening
square bracket rather than the repeated comma.
2022-04-15 11:33:20 +01:00
Guillaume Allais
b4662a8537 [ fix ] show keywords & bound variables 2022-04-14 12:17:11 +01:00
Guillaume Allais
e0f5f541e2 [ fix #2402 ] Check totality before exiting failing block 2022-04-08 13:21:46 +01:00
Guillaume Allais
55d6c50706 [ fix ] make 'failing' whitespace-insentitive 2022-04-07 13:59:27 +01:00
Mathew Polzin
c91a768486
System NodeJS additions (#2401) 2022-04-07 10:09:30 +01:00
G. Allais
79e733b848
[ new ] multi-with elaborated as nested withs (#2403) 2022-04-07 09:30:23 +01:00
Thomas E. Hansen
a644a85a57 [ base ] public export quantifier functions 2022-04-04 13:24:12 +02:00
G. Allais
4b6936d615
[ fix ] allow refined implicit patterns in with clauses (#2393) 2022-04-03 10:45:29 +01:00
Guillaume Allais
ad78457869 [ fix ] location information in with clauses 2022-04-01 11:41:48 +01:00
Guillaume Allais
bc9a319ddf [ parser ] bunched args in implementation implicits 2022-03-31 15:46:44 +01:00
Denis Buzdalov
2538b1e82b
[ syntax ] Require indent for blocks like mutual and failing (#2387) 2022-03-31 12:54:38 +01:00
Denis Buzdalov
03f23b0457 [ error ] Improve the indented non-empty block's error message 2022-03-31 10:44:06 +01:00
Guillaume Allais
921d3b7b50 [ parser ] better error messages for Haskellers 2022-03-31 10:43:46 +01:00
Zoe Stafford
8c7fc581c6 Fix prim__div_Double on Node/js backend
problem was found by @kuruczgy on the idris discord

Also add tests
2022-03-26 19:00:46 +00:00
G. Allais
2aa0069e63
[ doc ] also display definition's visibility (#2374) 2022-03-24 23:11:10 +00:00
Denis Buzdalov
e8d3d788c1
[ base ] Add some more properties, functions and interface implementations (#2361) 2022-03-23 13:33:13 +00:00
Giuseppe Lomurno
f38feaa48d Clean path in more Core.Directory functions 2022-03-23 12:49:36 +00:00
G. Allais
35b2362487
[ new ] failing blocks (#2360) 2022-03-23 12:01:13 +00:00
Ohad Kammar
319c7f7b86
Move Syntax.PreorderReasoning into base (#2368) 2022-03-22 20:58:36 +00:00
G. Allais
0dfa7d8d79
[ doc ] prettier :di (#2356) 2022-03-18 08:45:18 +00:00
Joel Berkeley
fc45f7d888
[ base ] add insertAt for List (#2336) 2022-03-17 18:23:47 +00:00
Denis Buzdalov
05d64483f6 [ refactor ] Factor out a type for primitive types out of Constant 2022-03-10 23:07:20 +00:00
Guillaume Allais
14f2196d15 [ doc ] return module header docs 2022-03-09 13:31:30 +00:00
stefan-hoeck
51eb854a60 [ fix ] euclidian mod and div for scheme backends 2022-03-08 17:40:29 +00:00
stefan-hoeck
405f80946b [ fix ] euclidian div and mod for JS backend 2022-03-08 17:40:29 +00:00
G. Allais
1c396744d9
[ doc ] :printdef for interface implementations (#2340) 2022-03-07 11:47:20 +00:00
Joel Berkeley
0ab0ecb199
add replaceAt for List (#2335) 2022-03-03 23:40:18 +00:00
Joel Berkeley
f436388a6b
adopt backend implementations of pow (#2334) 2022-03-03 23:39:25 +00:00
Jan de Muijnck-Hughes
4ba3bb6670
[ fix ] Literate things (#2312)
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2022-02-18 11:29:52 +00:00
Balazs Komuves
3345460fe9
[ fix #2176 ] Records in where-blocks are in the wrong namespace (#2187) 2022-02-16 15:43:50 +00:00
Joel Berkeley
5abc01453d
add deleteAt for List (#2317) 2022-02-11 09:28:36 +00:00
Guillaume Allais
bec4a0a88e [ re #499 ] quantity-aware with-clauses 2022-02-09 09:19:40 +00:00
Robert Wright
1776efa8a5 Allow Type-level String operations 2022-02-03 16:10:47 +00:00
madman-bob
0ee9632e45
[ refactor ] Abstract Prelude.elem to work with all Foldables (#2294) 2022-02-01 21:34:29 +00:00
Stefan Höck
44245e1683
[ fix ] issue #2288 (#2289) 2022-01-28 09:01:09 +00:00
Stefan Höck
f1d56a4e0f
[ syntax ] Namespaced idiom brackets (#2284) 2022-01-24 16:18:36 +00:00
James Cook
e82600c4d6
[ opt ] transform rule making List.length tail-recursive. (#2100) 2022-01-24 16:12:29 +00:00
octeep
f137d96cd6 update refc/buffer to check how many bytes have been read 2022-01-24 15:58:32 +00:00
Mathew Polzin
35a84e505d
[fix #2033] determining when to rebuild modules (#2188) 2022-01-21 10:26:20 +00:00
Guillaume Allais
877025d524 [ fix ] properly decorating pragmas / keywords 2022-01-20 17:55:09 +00:00
Jason Dagit
50c5be30d7 RefC: add test for issue1778 2022-01-20 14:10:57 +00:00
Zoe Stafford
5e42bbfcc9
Merge pull request #2274 from octeep/main
make readBufferData return the number of bytes that have been read
2022-01-20 13:11:13 +00:00
Robert Wright
d85016b64d Add Fin modular arithmetic Num instance 2022-01-20 10:13:20 +00:00
Mathew Polzin
e7ed760016
[ new ] optional language version field to ipkg files. (#2256) 2022-01-20 10:05:53 +00:00
MarcelineVQ
6d10ca09b4 [ base ] add Show for Ordering 2022-01-19 22:12:36 +00:00
octeep
f7bcd1f0b2 make readBufferData return the number of bytes that have been read 2022-01-19 17:35:14 +00:00
Robert Wright
76d1936fad Add Singleton type 2022-01-19 14:22:40 +00:00
Mathew Polzin
4220c644cf
Add a few missing NodeJS FFI functions to System (#2271)
* support for system command via node backend.

* Add env var set/unset

* fix env unset function

* Update libs/base/System.idr

* modify system test to cover node and chez.

* Add base tests for env get/set
2022-01-18 22:43:03 -08:00
Edwin Brady
26a47ddafe
Make prim_js2idris_array iterative (#2267)
I was getting a stack overflow on the tailrec002 test, caused by this
primitive being recursive. I've made it iterative. I'm no JS expert but
I've tested its behaviour against the old version.
2022-01-16 19:15:26 +00:00
Vincent de Haan
3a38424e69 Minor fix in documentation 2022-01-11 22:36:22 +01:00
Jason Dagit
1d7207fe05
[ fix #2202 ] Use SnocList in parser state to avoid quadratic slowdown (#2203)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-01-11 16:06:19 +00:00
Steven Dunham
e8660cab97 [ tests ] Add test case for #2243 2022-01-07 21:53:46 -08:00
Jason Dagit
78ff2059f3 system_info_os001: Add all the OSs that System.Info.os knows about 2021-12-25 21:52:21 -08:00
alissa-tung
158cb1c75e [ nodejs ] pid 2021-12-22 22:25:21 +08:00
Ohad Kammar
3c532ea35d
[ refactor ] IDE protocol as a separate module hierarchy (#2171) 2021-12-16 22:09:00 +00:00
Denis Buzdalov
a09c5082c5
[ base ] Use Fin n as index in Bits (#2192) 2021-12-16 18:26:52 +00:00
teggot
d3aed0404c
[ fix #1959 ] use modern record update syntax (#2196) 2021-12-16 18:23:18 +00:00
Balazs Komuves
3463adbc48
[ fix #2032 ] Slow typechecking on Int operation when Data.Fin.fromInteger is in scope (#2189) 2021-12-13 13:47:53 +00:00
Balazs Komuves
6cc20a9974
[ fix #2138] Add an %unhide pragma (#2181)
* add %unhide pragma

* add a test case

* clean up

* more consistent English usage (+fix some typos)

* add a warning for unhiding not-already-hidden names

* move `unhide` (and `hide`) to the bottom of the source file to avoid having to forward-declare `recordWarning`
2021-12-11 18:03:36 -08:00
Balazs Komuves
c3ec522077
[ fix #1404 ] Totality annotation for data type definitions (#2179)
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
Co-authored-by: stefan-hoeck <hock@zhaw.ch>
2021-12-08 16:08:26 +00:00
Balazs Komuves
e511bc6884
[ fix #2098 ] Allow unclosed comment blocks (#2173) 2021-12-07 15:46:38 +00:00
Balazs Komuves
5e775aaa41
[ fix #1945 ] Add default support for record fields (#2175) 2021-12-06 21:21:42 +00:00
Balazs Komuves
3f3912e934
[ fix #2065 ] Use postfix projections if prefix ones are off (#2169) 2021-12-06 18:14:13 +00:00
Guillaume ALLAIS
32140f577f [ fix ] resugaring of snoc lists 2021-12-02 12:49:07 +00:00
G. Allais
059f74ad0b
[ fix #1861 ] rewrite_impl is linear (#2150) 2021-11-25 17:07:05 +00:00
Guillaume ALLAIS
500df117c1 [ fix #1741 ] Do not replace names in as-patterns 2021-11-25 16:04:44 +00:00
Guillaume ALLAIS
56e599de9c [ re #1987 ] test case 2021-11-25 15:12:54 +00:00
Guillaume ALLAIS
8e8988ff5a [ re #1191 ] test case 2021-11-24 21:15:43 +00:00
Guillaume ALLAIS
662f1eabc5 [ re #215 ] test case 2021-11-24 20:28:07 +00:00
Guillaume ALLAIS
63bf9f2900 [ re #1852 ] Partial fix without the Hole UN refactoring 2021-11-24 10:54:32 +00:00
Denis Buzdalov
ab3862798b [ fix ] Use right reflection constructor name for unambiguing with 2021-11-23 16:42:51 +00:00
claymager
283f9bd00f
[ fix ] Forbid "." as namespace identifier (#2134) 2021-11-22 12:13:08 +00:00
Guillaume ALLAIS
0bc18bd34a [ fix #2072 ] correctly handle fixity in printer 2021-11-19 17:42:07 +00:00
Guillaume ALLAIS
f99b875d7e [ fix #2095 ] error on duplicated updates 2021-11-19 16:30:35 +00:00
G. Allais
489e8c7cbc
[ re #2038 ] doc for reserved symbols (#2126) 2021-11-18 18:13:20 +00:00
Mathew Polzin
0eba4c691e
Add %deprecate pragma (#2086) 2021-11-17 10:41:03 +00:00
André Videla
cc45ff957a
Merge pull request #2085 from andrevidela/string-parser-position
Show the line and column in diagnostic message in String.Parser
2021-11-15 11:09:57 +00:00
Mathew Polzin
d2ce85ea05
Merge pull request #2096 from madman-bob/system-run
Add the `System` `run` function
2021-11-10 08:58:39 -08:00
Robert Wright
2ee10d9b34 Add Alternating List odds and evens functions 2021-11-10 08:40:25 +00:00
André Videla
9e6678e3d3
Merge pull request #2102 from madman-bob/list-singleton
Add List singleton function
2021-11-10 00:46:40 +00:00
André Videla
7f932036e9 Show the line and column in diagnostic message
This also updates the error message of some common combinators
2021-11-10 00:44:09 +00:00
Zoe Stafford
3063218d46
[ new ] Add %nomangle (#2063)
This is (for once) not a breaking changes, instead backends will need to opt in to this change, using the utilities in Compiler.NoMangle. See the js backend for an example of how to do this.

This is the first step to being able to use idris to create libraries usable by other languages.
2021-11-09 16:23:50 +00:00
Edwin Brady
2f6ec76223
Get information about names in reflection (#2110)
* Only normalise a search goal if it's fast

While we do end up normalising it anyway on success, there might be
things blocking it that make the intermediate terms very big, so only do
it speculatively to see if it's quick.

* Get information about names in reflection

Currently this is only whether it's a function, or data or type
constructor. I expect more may be useful/possible.
2021-11-07 15:06:53 +00:00
Robert Wright
921bc24a2a Add List singleton function 2021-11-05 16:08:54 +00:00
Robert Wright
4732486bbc Add System run function 2021-11-05 11:59:17 +00:00
Robert Wright
dc47df688c Add System.File fRead function 2021-11-05 11:59:17 +00:00
Robert Wright
c1fc487bec Return error code from pclose 2021-11-05 11:59:17 +00:00
Robert Wright
c964f8d8bc Add System escapeCmd function 2021-11-05 11:59:17 +00:00
G. Allais
668c221474
[ re #2032 ] faster version of fromInteger (#2090) 2021-11-02 17:43:01 +00:00
G. Allais
15cc8243f7
[ re #2001 ] Make some prelude interfaces total (#2083)
The prelude interfaces that have default definitions for all of
their fields are declared total so that users are forced to think
about meeting the minimal requirements for an implementation to be
valid.
2021-11-02 15:34:52 +00:00
Robert Wright
12955bc5bc Add takeUntil Data.String.Parser parser 2021-11-01 13:54:46 +00:00
Edwin Brady
d531cc8dea
Cumulativity preparation: Add field for universe level to TType (#2076)
* Add field for universe level to TType

This doesn't do anything yet, other than introduce new universe
variables whenever we introduce a new type, but it's the first step
towards checking the universe hierarchy. Next step is to add constraints
when checking pi, unifying/converting types, and when adding data
constructors.

* TTC version increment

Thought I'd done this, but apparently I didn't save the file. Oops!

* Add structure for universe constraints

* Fix display of ambiguity errors

We need to store the Context in errors at the point where the error
occurs, or we might get some nonsense in the message. There's still a
couple of places in Error where we don't do this right. This fixes one
of them, and improves a few messages in the process.
2021-10-31 00:00:16 +01:00
Edwin Brady
2df3ecc2e3
Fix display of ambiguity errors (#2075)
We need to store the Context in errors at the point where the error
occurs, or we might get some nonsense in the message. There's still a
couple of places in Error where we don't do this right. This fixes one
of them, and improves a few messages in the process.
2021-10-30 23:08:53 +01:00
madman-bob
a6a64c6ddf
[ contrib ] Alternating lists of known parity (#2043) 2021-10-30 00:12:44 +01:00
Guillaume ALLAIS
a8d5e005e1 [ fix #2070 ] Look under MaybeMispelling when failing quickly 2021-10-29 17:57:55 +01:00
G. Allais
ac7a4644b8
[ fix #2046 ] only refold positive integers as nats (#2064) 2021-10-26 17:16:31 +01:00
Ellis Kesterton
9c2ce646f9
[ fix #2002 ] implicits used in record update (#2007) 2021-10-26 17:15:29 +01:00
CodingCellist
4a1bb310a7
[ fix #1175 ] case-splitting for inline case blocks (#2010) 2021-10-26 15:51:52 +01:00
Alissa Tung
1bd81dfbbb
[ fix #2053 ] do not show ambiguous private names (#2056)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-10-26 15:51:34 +01:00