1
1
mirror of https://github.com/tweag/nickel.git synced 2024-10-06 16:18:08 +03:00
Commit Graph

185 Commits

Author SHA1 Message Date
Yann Hamdaoui
4d7d0620fb
Initial context for typechecking
Typechecking is fed an initial typing environment containing the symbols
defined by the stdlib. On the other hand, the term environment, used to
check for contract equality, was initialized empty, as a simplification
for this recent addition. This commit applies the same treatment for
both environment, and provides typechecking with an initial context
(typing env + term env). As a consequence, a few lines added in the REPL
also fix an earlier shortcoming of contract equality checking, which
wasn't effective in the REPL for symbols defined using top-level let.
2022-09-22 10:40:50 +02:00
Yann Hamdaoui
7bbdbdcb72
Return environment items by reference
The previous API of `Environment::get` was returning an owned value.
This doesn't correspond to the usual API for Rust containers. This
commit changes the API to return a reference instead, and let the caller
decide to clone the value or not.
2022-09-15 16:52:25 +02:00
Tor Hovland
748a244ded ErrorTolerance enum. 2022-09-06 08:13:44 +02:00
Tor Hovland
1f2135942a Remove the lax methods from Cache. Lax is now controlled by Cache::error_tolerant. 2022-09-02 12:47:06 +02:00
Tor Hovland
f0da63ecf2 Toggle error tolerance on/off in Cache. 2022-08-31 12:50:31 +02:00
Yann Hamdaoui
ce0f8e71cf Refactoring of global typing environment
Get rid of the useless separation between the global typing environment
and the current typing environment. It was done for performance reasons,
when cloning environments was expensive: but now, environments support
sharing, instead of having two separate environments, we can just start
for the initial (previously "global") and insert directly into it.

Doing so, rename "global" to "initial", which is now more faithful.
2022-08-09 22:39:11 +02:00
Yann Hamdaoui
50e373f181 Bump version to 0.2.1 2022-08-08 15:31:44 +02:00
Yann Hamdaoui
09e3eb85b7 Fix LSP assigning the Dyn type to untyped values 2022-08-08 15:31:44 +02:00
Yann Hamdaoui
2a2f486087 Nickel version: 0.1.0 -> 0.2.0 2022-08-08 15:31:44 +02:00
Yann Hamdaoui
df67a72a18
Merge pull request #792 from tweag/doc/markdown-linting-2
Enable markdown linting for doc
2022-08-05 13:28:21 +02:00
Yann Hamdaoui
1622fe64b7 Markdown linting of LSP and benches READMEs 2022-08-05 11:55:21 +02:00
Yann Hamdaoui
a9e5ee253b Remove debug eprint statements 2022-08-04 11:49:53 +02:00
Yann Hamdaoui
29d727f91d Fix LSP panicking on fields with contracts
Since the refactoring of the typechecker with a distinct walk phase, the
typechecker now also walk contracts and type annotations. This caused
the LSP to panic in a lot of cases (basically, as soon as a contract is
attached to a field), due to scoping issues and breaking some invariants
of the LSP's linearizer.

This commit fixes that by creating a new proper scope() function for
walking contracts (scope_meta). It also removes the old code that used
to (imperfectly) handle contracts directly in the linearizer, dating
back to when the typechecker didn't process annotations.
2022-07-28 17:57:28 +02:00
francois-caddet
ce1afa2c10
quick and dirty fix of lsp error when position is None (#773)
* try to manage items without position in the lsp

* fix `linearisation::Completed::elem_at` and some code cleaning

Co-authored-by: Yann Hamdaoui <yann.hamdaoui@gmail.com>
2022-07-28 16:47:11 +02:00
Yann Hamdaoui
d453b6c414
Merge pull request #721 from tweag/update-deps
Update dependencies
2022-06-09 13:18:31 +02:00
Yann Hamdaoui
da0f5f3948
Make cache::parse not error tolerant by default 2022-06-03 14:38:27 +02:00
Yann Hamdaoui
74f05ba29b
Update all dependencies + corresponding fixes 2022-06-02 17:19:46 +02:00
Ryota
1a5e1f2411 Fix typo 2022-05-20 23:45:10 +01:00
Erin van der Veen
686d87643f Implement let rec 2022-04-21 15:22:44 +02:00
dependabot[bot]
cc64376f8c
chore(deps): bump ansi-regex in /lsp/client-extension
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 11:52:09 +00:00
dependabot[bot]
3ede618f8e
chore(deps): bump minimist from 1.2.5 to 1.2.6 in /lsp/client-extension
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-30 21:54:12 +00:00
Yann Hamdaoui
ad581b791e Fix binary name of nls, update doc 2022-03-12 10:03:26 +01:00
Yann Hamdaoui
59bbb9036c Prepare NLS for publishing (README,LICENSE) 2022-03-10 00:10:49 +01:00
Yann Hamdaoui
0b1ed40e40 Rename crates nickel* to nickel-lang* 2022-03-06 22:27:57 +01:00
Yann Hamdaoui
bbded9e8e1
Merge pull request #631 from tweag/task/free-vars
Reduce memory leaks by attaching free variables to record fields
2022-03-04 13:17:33 +01:00
francois-caddet
0ff4f88286 fix butal replacement for http(s):// 2022-03-03 17:12:19 +01:00
francois-caddet
feb41abbf2 update comment syntax in anual, rfcs and READMEs 2022-03-03 11:35:18 +01:00
Yann Hamdaoui
95e1191331 Use free variables to limit memory leaks
This commit adds a new transformation pass that annotates each field of
a recursive records with its dependencies on the other fields. This
information is also stored in the associated revertible thunks, which
makes it possible to only add relevant fields to the environment when
performing the fixpoint computation. This should get rid of Rc cycles
causing leaks for everything but actually mutually recursive values.
2022-03-02 22:05:24 +01:00
Yannik Sander
34db319206 Remove debug info in hover overlays 2022-02-05 12:44:06 +01:00
Yannik Sander
d26770ee7d Fix duplicate ids 2022-02-02 14:59:54 +01:00
Yannik Sander
1fe67b6b60 Add structure for function to hold type info 2022-01-27 22:46:50 +01:00
Yannik Sander
d299a9a367 Pass latent binding anchor into scope 2022-01-27 22:23:18 +01:00
Yannik Sander
9b92d35eb7 Fix compile (c/p) error 2022-01-27 22:22:44 +01:00
Yannik Sander
31e38d587e Make declarations point to value explicitly 2022-01-27 21:59:17 +01:00
Yannik Sander
05344979bd Create new inner scope 2022-01-27 20:27:20 +01:00
Yannik Sander
8e314b72fa Walk AST of contract annotations 2022-01-27 19:53:22 +01:00
Yannik Sander
1872875de4 Impl Default for AnalysisHost 2022-01-27 19:52:00 +01:00
Yannik Sander
46eddfc28c Introduce explicit UsageState for unbound names 2022-01-27 14:03:42 +01:00
Yannik Sander
f13148d3d5 Introduce Scope alias for Vec<ScopeId> 2022-01-25 15:13:02 +01:00
Yannik Sander
f1c205adda Initialize new ScopeId for scoped Hosts 2022-01-24 11:22:45 +01:00
Yannik Sander
d09c0c267d Automatically manage scope_ids 2022-01-24 01:13:18 +01:00
Yann Hamdaoui
3e834ec2ed
Merge pull request #572 from tweag/language-server/fix/declaration-resoluton
[language server] Fix off-by-one issue in resolution of declarations
2022-01-20 10:01:57 +01:00
Avi Dessauer
e0cee05dc8
Update lsp/README.md
Co-authored-by: Yann Hamdaoui <yann.hamdaoui@gmail.com>
2022-01-18 13:47:53 -05:00
Avi Dessauer
b1175e877b Editor setup docs 2022-01-18 12:22:57 -05:00
Yannik Sander
62f457da36 Lineraize fun patterns (partially) 2022-01-14 15:51:08 +01:00
Yannik Sander
084e473087 Fix off-by-one issue in resolution of declarations 2022-01-13 15:30:49 +01:00
Yannik Sander
acbd76e0d5 Fix resolving definition for meta 2022-01-12 17:47:43 +01:00
Yannik Sander
ab0ceaeeba Skip locator unpacking 2022-01-11 13:30:34 +01:00
Yannik Sander
da381e9cc0 Use rfind instead of rfold and take locator reference 2022-01-11 13:28:41 +01:00
Yannik Sander
ede28ea530 Convert TermPos to Raw spans throughout nls 2022-01-10 15:22:49 +01:00