1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-14 17:32:00 +03:00
Commit Graph

561 Commits

Author SHA1 Message Date
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
Paul Cadman
638b20b967 [concrete] Adds location info to Literal 2022-04-04 14:59:56 +01:00
Paul Cadman
c9b0193fb4 [typecheck] Add the definition loc to microjuvix names
This is used in type errors
2022-04-04 14:59:56 +01:00
Jan Mas Rovira
49a91c404f [typechecker] throw in expressions, collect in clauses 2022-04-04 14:59:56 +01:00
Paul Cadman
68b1af07e4 [typecheck] Wrap type errors in NonEmpty 2022-04-04 14:59:56 +01:00
Paul Cadman
658bdf076c [typecheck] Return all errors encountered during typechecking
Any expression that fails typechecking is assigned TypeAny so
typechecking can proceed.
2022-04-04 14:59:56 +01:00
Jonathan Prieto-Cubides
eaad611bbf [ CI ] Add Haskell Github Action with Stack test and ormolu check 2022-04-04 15:55:15 +02:00
Jonathan Cubides
fd3622a274
Adds many new features (w.i.p v0.1.2) (#28)
* add references to the syntax and cleanup code

* [make] add .PHONY to Makefile targets

* [parser] add parser / pretty for axiom backends

* Pairing progress

* [scoper] Add support for Axiom backends

* [parser] Fix foreign block parsing

* [ app ] adds --no-colors flag for the scope command

* [ghc] upgrade to ghc 9.2.2

* use GHC2021

* [doc] Remove out-of-date comment

* [test] Add ambiguity tests

* [scoper] Improve resolution of local symbols

* [error] WIP improving ambiguity error messages

* [ clean-up ] new lab folder for experimentation

* [ app ] ixes the lint warning

* [ Termination ] removes Alga dependency

* [error] Add message for ambiguous symbol error

* [error] Add ambiguous module message

* [scoper] Remove ErrGeneric

* [test] Add test to suite

* [test] show diff when ast's are different

* [ lab ] folder organization

* [ Makefile ] add targets with --watch option (stack cmds) and remove unused things

* [ app ] add --version flag and fixed warnings and formatting

* [test] remove fromRightIO to fix ambiguity error

* [test] Add test of shadowing public open

* [scoper] Add visibility annotation for Name

* prepare buildIntoTable

* [ Concrete ] add instance of hashable for refs.

* add InfoTableBuilder effect

* [ scoper ] add InfoTableBuilder effect

* [ CHANGELOG ] updated v0.1.1

* [ README ] org version now

* fix package.yaml

* fix readme

* [microjuvix] implement basic typechecker

* add simple test for MicroJuvix type checker

* fix checking for constructors apps in patterns

* [scope] Move InfoTable to a new module

* [abstract] Make Iden use references instead of Name

* [abstract] Add InfoTable for abstract syntax

* [scoper] Add function clauses to scoped InfoTable

* [abstract] Add InfoTableBuilder for scoped to abstract

* [main] Fix callsites of translateModule

* [doc] Remove empty docs

* [scoper] Update emptyInfoTable with missing field

* rename some functions

* [minihaskell] add compilation to MiniHaskell

* [microjuvix] improve wrong type message

* Add a validity predicate example written in MiniJuvix

* [typecheck] Add error infrastructure for type errors

Add a pretty error for mismatched constructor type in a pattern match

* [test] Adds negative typecheck test for constructor

* [app] Adds microjuvix subcommands for printing / typechecking

* [typecheck] Add error message for ctor match args mistmatch

* [typecheck] Add descriptive messages for remainng errors

* [typecheck] Updates to error message copy

* [typecheck] fix merge conflicts:

* [highlight] add basic support for highlighting symbols

* [minijuvix-mode] add minijuvix-mode and basic description in the readme

* [readme] improve formatting

* automatically detect the root of the project and add --show-root flag

Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
Co-authored-by: Paul Cadman <git@paulcadman.dev>
Co-authored-by: Paul Cadman <pcadman@gmail.com>
2022-04-01 13:00:15 +02:00
janmasrovira
22cf1cce99
Merge pull request #27 from heliaxdev/detect-root
automatically detect the root of the project and add --show-root flag
2022-04-01 12:56:04 +02:00
Jan Mas Rovira
6bcd62a4d6 automatically detect the root of the project and add --show-root flag 2022-04-01 12:32:15 +02:00
janmasrovira
351e058bcd
Merge pull request #26 from heliaxdev/highlight
add basic emacs-mode and highlighting for well-scoped modules
2022-04-01 12:00:26 +02:00
Jan Mas Rovira
b404df9edb [readme] improve formatting 2022-04-01 11:17:11 +02:00
Jan Mas Rovira
6f2588c165 [minijuvix-mode] add minijuvix-mode and basic description in the readme 2022-04-01 11:15:53 +02:00
Jan Mas Rovira
9708dd3fe3 [highlight] add basic support for highlighting symbols 2022-04-01 01:11:55 +02:00
Paul Cadman
5eb4299de7
Merge pull request #22 from heliaxdev/typecheck-errors
Improve typechecker error messages
2022-03-31 10:02:31 +01:00
Paul Cadman
07333ecbe9 [typecheck] fix merge conflicts: 2022-03-31 09:36:21 +01:00
Paul Cadman
d297322b7d [typecheck] Updates to error message copy 2022-03-31 09:30:56 +01:00
Paul Cadman
a030b97e8f [typecheck] Add descriptive messages for remainng errors 2022-03-31 09:30:54 +01:00
Paul Cadman
b41b4c4e84 [typecheck] Add error message for ctor match args mistmatch 2022-03-31 09:29:27 +01:00
Paul Cadman
e37fa7a8dc [app] Adds microjuvix subcommands for printing / typechecking 2022-03-31 09:28:20 +01:00
Paul Cadman
615f7d11c0 [test] Adds negative typecheck test for constructor 2022-03-31 09:28:20 +01:00
Paul Cadman
fc2cd3f03f [typecheck] Add error infrastructure for type errors
Add a pretty error for mismatched constructor type in a pattern match
2022-03-31 09:28:16 +01:00
Jonathan Prieto-Cubides
6ba1a4f4ff Add a validity predicate example written in MiniJuvix 2022-03-30 19:09:43 +02:00
Jan Mas Rovira
91482119c1 [microjuvix] improve wrong type message 2022-03-30 18:37:40 +02:00
Jan Mas Rovira
f121fe0d39 [minihaskell] add compilation to MiniHaskell 2022-03-30 16:03:56 +02:00
Paul Cadman
d60bc30179
Merge pull request #20 from heliaxdev/wip4-rebase
Use refs in Abstract AST and add refs InfoTable to translateModule return
2022-03-29 14:18:55 +01:00
Jan Mas Rovira
1c59cd1502 rename some functions 2022-03-29 15:18:17 +02:00
Paul Cadman
53f66b09f2 [scoper] Update emptyInfoTable with missing field 2022-03-29 13:50:32 +01:00
Paul Cadman
c2f6d1529c [doc] Remove empty docs 2022-03-29 13:49:49 +01:00
Paul Cadman
0e3fb402d5 [main] Fix callsites of translateModule 2022-03-29 11:58:48 +01:00
Paul Cadman
9fea7b1ba0 [abstract] Add InfoTableBuilder for scoped to abstract 2022-03-29 11:58:48 +01:00