1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 10:03:22 +03:00
Commit Graph

491 Commits

Author SHA1 Message Date
Paul Cadman
721ea4612d [test] Add Anoma Haskell backend for VP 2022-04-11 13:17:13 +02:00
Paul Cadman
d023ced9e4 [test] Update VP example 2022-04-11 13:17:13 +02:00
caryoscelus
3d3ba9d282 emacs mode: keep buffer saved after highlighting 2022-04-11 13:17:13 +02:00
Jan Mas Rovira
464749de5a fix #29 2022-04-11 13:08:37 +02:00
Paul Cadman
caf4065644 [test] Add Anoma Haskell backend for VP 2022-04-11 11:09:45 +02:00
Paul Cadman
498c6ab087 [test] Update VP example 2022-04-11 11:09:45 +02:00
Jonathan Prieto-Cubides
18c2d4c037 w.i.p refactoring ansi/text pretty printer 2022-04-08 18:54:19 +02:00
Jan Mas Rovira
f31bc6347a add generic pretty utilities 2022-04-08 17:05:32 +02:00
caryoscelus
3f557271bd emacs mode: keep buffer saved after highlighting 2022-04-08 15:46:19 +01:00
Jonathan Prieto-Cubides
048674f807 w.i.p Add global option --no-color 2022-04-08 16:36:48 +02:00
Jonathan Prieto-Cubides
3f1fda221f Merge branch 'dev' of github.com:heliaxdev/minijuvix into FixREADME 2022-04-08 14:40:09 +02:00
Jonathan Prieto-Cubides
1f98240e49 [ README ] Add badges and grammar 2022-04-08 13:35:04 +02:00
Paul Cadman
90f607e6ce [typecheck] Shortcircuit clause pattern check errors
In the following case:

```
module WrongConstructorArity;
  inductive T {
    A : T;
  };

  f : T → T;
  f (A i) ≔ i;
end;
```

The typechecker fails when checking the clause `f (A i) := i` because of
the extra constructor argument. However if typechecking continues then
the variable `i` on the rhs does not have a type so we must short-circuit.
2022-04-08 13:32:11 +02:00
Paul Cadman
2b283a2b8b [minihaskell] Output ANSI codes only if handle supports it
This adds `ansi-terminal` dependency to the Main target but this is
already a transitive dependency of `prettyprinter-ansi-terminal`.

We want to add this support globally which we will do in https://github.com/heliaxdev/minijuvix/issues/38.
2022-04-08 12:23:20 +01:00
Paul Cadman
a476de53ec [minihaskell] Do not add id suffix to top-level modules and main
For minihaskell the name of the output file needs to match the module
name. So we must not add the usual '_<nameid>' suffix to top level
names.

Additionally the main function in a haskell file is the entry-point to
the haskell program. So the suffix must not be added in this case also.
2022-04-08 13:06:59 +02:00
Jonathan Prieto-Cubides
4779cba90e Merge branch 'parserInfoTable' into dev 2022-04-08 12:54:53 +02:00
Jonathan Prieto-Cubides
e6ea03a6eb Fix test suite 2022-04-08 12:46:37 +02:00
Jonathan Prieto-Cubides
beb2556111 w.i.p Fixing test suite 2022-04-07 18:10:53 +02:00
Jonathan Prieto-Cubides
4c58b82588 Make Ormolu happy and Hlint 2022-04-07 12:53:05 +02:00
Jonathan Prieto-Cubides
7c9fdb656a Fix compilation 2022-04-07 12:49:08 +02:00
Jonathan Prieto-Cubides
86162090ce merging conflicts 2022-04-07 12:13:03 +02:00
Jonathan Prieto-Cubides
0137ef264e w.i.p 2022-04-07 11:59:23 +02:00
Jan Mas Rovira
d9b1a6a0b5 wip 2022-04-07 09:43:41 +02:00
Jonathan Prieto-Cubides
290d700723 Better to use kbd 2022-04-07 08:48:54 +02:00
Paul Cadman
f5af32b23b [emacs] Add message if no goto information is found 2022-04-06 17:30:21 +01:00
Paul Cadman
8d38e29837 [emacs] Use 'evil hook instead of 'evil-maps 2022-04-06 17:18:12 +01:00
Paul Cadman
78055df99d [emacs] Remove extra evil-define-key 2022-04-06 17:09:00 +01:00
Paul Cadman
d42a9da0e5 [emacs] Add load and goto def keybindings 2022-04-06 17:01:45 +01:00
Jonathan Prieto-Cubides
482c8ecc77 Fix typo 2022-04-06 16:52:38 +02:00
Jan Mas Rovira
220218dae4 fix 2022-04-06 16:39:29 +02:00
Jan Mas Rovira
e1c0bdd8be add evil kbds 2022-04-06 16:37:19 +02:00
Jan Mas Rovira
510d00a4ba wip 2022-04-06 15:10:29 +02:00
Paul Cadman
3af9cb95ac
Restore correct handling of TypeAny and add positive typecheck tests (#34)
* [ format ] AbstractToMicroJuvix

* [ CI ] fixes

* [ CI ] fixes

* [ CI ] Using GHC 9.0 for Hlint

* [ CI ] Use static-checks for Dev as well

* [test] Add positive test for typechecker

* [test] Improve positive typechecker error output

* [typecheck] Restore correct handling of TypeAny

I mistakenly removed the matchTypes function in
https://github.com/heliaxdev/minijuvix/pull/22. This caused the handling
of TypeAny to break.

Literals have type TypeAny and so should be valid when matching against
any other type. The tests have been updated to reflect this.

* [test] Add positive MicroJuvix typecheck tests

* [ ormolu ] fixes

Co-authored-by: Jonathan Prieto-Cubides <jonathan.cubides@uib.no>
2022-04-05 22:02:03 +02:00
Paul Cadman
e6307dfdf4
Add action hints for autocompletion (#35)
* [ format ] AbstractToMicroJuvix

* [ CI ] fixes

* [ CI ] fixes

* [ CI ] Using GHC 9.0 for Hlint

* [ CI ] Use static-checks for Dev as well

* [app] Add action hints for autocompletion

Using `action "file"` means that the autocompletion for that part of the
command will prompt the user with a list of files.

Without these action hints the user would have to type out the whole
path to the file without autocompletion assistance.

Co-authored-by: Jonathan Prieto-Cubides <jonathan.cubides@uib.no>
2022-04-05 20:03:02 +02:00
Jonathan Prieto-Cubides
4d918cd1fd [ CI ] New jobs: ormolu and hlint 2022-04-05 19:57:21 +02:00
Jan Mas Rovira
61edba2414 [minijuvix-mode] save buffer and clear annotation before loading 2022-04-05 16:24:38 +02:00
Jan Mas Rovira
5f9887e69c define ParserResult and refactor 2022-04-05 16:12:13 +02:00
Jan Mas Rovira
22b5de42f3 setup InfoTable for parser 2022-04-05 00:46:04 +02:00
Jonathan Prieto-Cubides
37905fd0f9 Remove missused import 2022-04-04 19:17:43 +02:00
Jonathan Cubides
3fe3cc4305
Merge branch 'main' into dev 2022-04-04 19:11:26 +02:00
Paul Cadman
2b8f430afb
[doc] Add docs for enabling CLI autocompletion (#31) 2022-04-04 18:30:38 +02:00
Jonathan Prieto-Cubides
a038999170 [ CI ] Add hlint check 2022-04-04 18:18:42 +02:00
Jonathan Prieto-Cubides
a2f65f7c48 [ hlint ] fix some hints 2022-04-04 18:03:56 +02:00
Jonathan Prieto-Cubides
a224d94709 [ pre-commit ] Add support and hooks 2022-04-04 17:44:08 +02:00
Paul Cadman
743b5b153a
Merge pull request #30 from heliaxdev/typecheck-errors
Output multiple typechecker errors and add source location to error messages
2022-04-04 15:05:55 +01:00
Paul Cadman
edcddcd3ce [concrete] Add HasLoc for LiteralLoc 2022-04-04 14:59:56 +01:00
Paul Cadman
b7ce2939f2 [prelude] Remove Control.Monad from export
Control.Monad is already exported by Control.Monad.Extra
2022-04-04 14:59:56 +01:00
Paul Cadman
5bbe6cbfb2 [test] Add test for multiple type errors
Add test for literals
2022-04-04 14:59:56 +01:00
Paul Cadman
916af49007 [typecheck] Add concrete name location to type error messages for expression 2022-04-04 14:59:56 +01:00
Paul Cadman
3cfb47e38c [typecheck] Add function name to pattern type errors 2022-04-04 14:59:56 +01:00