1
1
mirror of https://github.com/tweag/nickel.git synced 2024-11-10 10:46:49 +03:00
Commit Graph

1012 Commits

Author SHA1 Message Date
Yann Hamdaoui
ade1504388 Typechecking of parametrized list type 2021-01-21 17:55:17 +01:00
Yann Hamdaoui
a519b9d748 Parsing of parametrized list type 2021-01-21 17:55:07 +01:00
Yann Hamdaoui
ac336b7eed Make the list type parametrized 2021-01-21 17:54:36 +01:00
Yann Hamdaoui
34e0151b68 Add regression tests for typechecking loop 2021-01-21 17:08:11 +01:00
Yann Hamdaoui
58f76b5da5 Avoid cycles in the unification table
Unification of a type unification variable with itself was introducing a cycle in the unification table, leading to `get_root` looping. Fixed by this commit.
2021-01-21 17:08:06 +01:00
Yann Hamdaoui
f7f3509e41 Fix swapped mapping Ctrl+D/Ctrl+C in REPL 2021-01-20 19:25:17 +01:00
Yann Hamdaoui
aa240c8740 Remove parser::extended and use directly LALRPOP's parser 2021-01-20 18:33:47 +01:00
Eelco Dolstra
31edf23a28
Merge remote-tracking branch 'origin/feature/repl-toplevel-let' 2021-01-20 13:22:06 +01:00
Eelco Dolstra
bab81af43e
Merge pull request #266 from tweag/syntax/metavalues-pipe
Pipe syntax for metavalues
2021-01-20 12:40:06 +01:00
Eelco Dolstra
c9ff24a314
Merge pull request #267 from tweag/task/reintroduce-blame-tag
Make `blame` and `tag` available in the stdlib
2021-01-20 12:38:21 +01:00
Yann Hamdaoui
ed8f4342f1
Merge pull request #265 from tweag/feature/ascii-escape-sequence
ASCII escape sequences
2021-01-20 11:28:10 +00:00
Yann Hamdaoui
0ebe3656bd Check ignoring ascii escaping in multiline str 2021-01-20 12:18:58 +01:00
Yann Hamdaoui
0ccaa6868c Use assert_matches! for better failed tests messages 2021-01-20 12:14:08 +01:00
Yann Hamdaoui
d9ac2c8861 Make %tag% and %blame% available as contracts.xxx builtins 2021-01-20 11:38:05 +01:00
Yann Hamdaoui
0ced2375a7 Adapt the stdlib to metavalues' pipe syntax 2021-01-20 11:13:08 +01:00
Yann Hamdaoui
8c9919eb83 Implement metavalues' pipe syntax 2021-01-20 11:13:04 +01:00
Yann Hamdaoui
7447cedb24 Add constructor for MetaValue 2021-01-20 11:11:53 +01:00
Yann Hamdaoui
3f205f32d7 Add helper for smart indentation of documentation 2021-01-20 11:11:38 +01:00
Yann Hamdaoui
2964ea1970 Add tokens for metavalue's pipe syntax 2021-01-20 11:10:55 +01:00
Yann Hamdaoui
75a7b4cb24 Fix panic when typechecking in REPL 2021-01-19 17:01:23 +01:00
Yann Hamdaoui
83a9741087 Add tests for ASCII escape sequences 2021-01-19 12:54:14 +01:00
Yann Hamdaoui
3122cc2a51 Escape fields and tags in error messages 2021-01-19 12:54:10 +01:00
Yann Hamdaoui
b74398f0d3 Support ASCII escape sequence 2021-01-19 12:48:36 +01:00
Yann Hamdaoui
26371984c1 Improve documentation of repl mod 2021-01-19 11:08:06 +01:00
Yann Hamdaoui
5b0d6449f6 Support for toplevel lets in REPL 2021-01-19 11:07:53 +01:00
Yann Hamdaoui
8b73569b43 Remove unused use 2021-01-19 10:43:57 +01:00
Yann Hamdaoui
098ea125f2 Add helpers to insert in environment 2021-01-19 10:43:36 +01:00
Yann Hamdaoui
eb7a9a9451 Avoid using the cache when not needed 2021-01-19 10:43:36 +01:00
Yann Hamdaoui
c2e47e9092 Add a parser accepting toplevel let definitions 2021-01-19 10:43:22 +01:00
Yann Hamdaoui
ac0a3d1695 Support multiline editing in REPL 2021-01-18 15:10:40 +01:00
Yann Hamdaoui
cad238ebc8 Add rustyline-derive dependency 2021-01-18 14:52:06 +01:00
Rok Garbas
2f81ae7da7
Merge pull request #262 from tweag/build-nickel-on-different-rust-channels
Build nickel on different rust channels
2021-01-18 13:31:19 +01:00
Rok Garbas
b28be15655
Update flake.nix
Co-authored-by: Yann Hamdaoui <yann.hamdaoui@gmail.com>
2021-01-18 13:17:08 +01:00
Yann Hamdaoui
4e269befd8 Make Ctrl+D end the input in REPL 2021-01-18 11:21:03 +01:00
Yann Hamdaoui
14693273bd consistent case and style in REPL errors messages 2021-01-15 18:28:04 +01:00
Yann Hamdaoui
6d1c2648af Support REPL history + fix comments 2021-01-15 18:03:59 +01:00
Yann Hamdaoui
77c8df3208 Set Emacs mode by default for REPL 2021-01-15 18:03:59 +01:00
Yann Hamdaoui
7f7c3abddb Improve command parsing and help messages 2021-01-15 18:03:59 +01:00
Yann Hamdaoui
627cf2fa31 Improve help output and add :exit in REPL 2021-01-15 18:03:59 +01:00
Yann Hamdaoui
544bdc2e59 Add a dedicated error type for the REPL 2021-01-15 18:03:59 +01:00
Yann Hamdaoui
c9c0d0b1b1 Refactor query subcommand / implement it in REPL
Take the code which format the result of a query subcommand out of main. Implement the corresponding query command in the REPL.
2021-01-15 18:03:59 +01:00
Yann Hamdaoui
664d6a7f1a Improvements and smallfixes REPL 2021-01-15 18:03:59 +01:00
Yann Hamdaoui
5f295ffb24 Use ansi_term instead of termcolors
Termcolors directly write to an ouput stream, while rustyline expect the prompt and other output to be provided as ANSI-color strings, which are automatically converted if needed. This commit switch to ansi_term which directly produces strings
2021-01-15 18:03:59 +01:00
Yann Hamdaoui
6fa196d458 Add help command to REPL 2021-01-15 18:03:59 +01:00
Yann Hamdaoui
a0d061f9cf If REPL fails to load, return errcode 1 2021-01-15 18:03:59 +01:00
Yann Hamdaoui
eb6ead4f0c Add termcolor dependency 2021-01-15 18:03:59 +01:00
Yann Hamdaoui
4f371f2243 Implement basic a REPL native frontend 2021-01-15 18:03:59 +01:00
Yann Hamdaoui
3ff04b99d3 Fix cache::add_tmp()
cache::add_tmp() was not clearing the previous parsed term from the term cache, causing the first added snippet to be always returned even if later calls should have erased it.
2021-01-15 18:03:59 +01:00
Yann Hamdaoui
755cc043fa Move report out of the Program struct
Take the report() method, which prints a formatted error message on the terminal, out of the Program structure to make it availabel to the rustyline REPL frontend.
2021-01-15 18:03:59 +01:00
Yann Hamdaoui
b1a67f79eb Enable rustyline REPL frontend by default 2021-01-15 18:03:59 +01:00