1
1
mirror of https://github.com/tweag/nickel.git synced 2024-09-11 11:47:03 +03:00

Extraneous whitespace

[skip ci]
This commit is contained in:
Mathieu Boespflug 2022-01-01 09:07:16 +02:00
parent c6a3164b3c
commit b5bec72b44
7 changed files with 10 additions and 13 deletions

View File

@ -133,19 +133,16 @@ for help about a specific subcommand.
packages.
- **Without Nix**: otherwise, follow [this guide][rust-guide] to install Rust
and Cargo first.
2. Build Nickel:
1. Build Nickel:
```console
$ cargo build
```
And voilà! Generated files are placed in `target/debug`.
1. *(optional)* make a symbolic link to the executable:
```console
$ ln -S nickel target/debug/nickel
```
### Tests
```console

View File

@ -6,10 +6,10 @@
let fibonacci = {
f = fun n =>
if n == 0 then
0
0
else if n == 1 then
1
else
else
f (n - 1) + f (n - 2)
}.f in
fibonacci 10

View File

@ -1,6 +1,6 @@
{
server.host.options = "TLS",
firewall.enabled | default = true,
firewall.type = "iptables",
firewall.open_ports = [21, 80, 443],

View File

@ -3,7 +3,7 @@
// `contracts.from_predicate`
let EqualsTo = fun reference_value label value =>
if reference_value == value then
value
value
else
contracts.blame label in
@ -15,4 +15,4 @@ let AlwaysFalse = EqualsTo false in
// Try passing `false` to `not`, or to use the identity function (replacing `!x`
// by `x`) to see contract errors appear.
let not | #AlwaysTrue -> #AlwaysFalse = fun x => !x in
not true
not true

View File

@ -7,7 +7,7 @@ use nickel::{position::TermPos, typecheck::linearization};
/// - Each element has a corresponding span in the source
/// - Spans are either equal (same starting point, same length)
/// or shorter but never intersecting
///
///
/// (start_element_2 >= start_element_1 AND end_element_2 <= end_element_1)
///
/// For any location a binary search is used to efficiently find the index
@ -22,7 +22,7 @@ use nickel::{position::TermPos, typecheck::linearization};
///
/// If neither is possible `None` is returned as no corresponding linearization
/// item could be found.
///
///
pub fn find_linearization_index(
linearization: &[linearization::LinearizationItem<nickel::types::Types>],
locator: (codespan::FileId, ByteIndex),

View File

@ -72,7 +72,7 @@ let Assert = fun l x => x || %blame% l in
(eq_with_ctxt
[[1,2,3,4], [1,0,3,4], [1,2,3,4], [1,2,3,4]]
[[1,2,3,4], [1,2,3,4], [1,2,3,4], [1,2,3,4]]
== false
== false
),
]
|> lists.foldl (fun x y => (x | #Assert) && y) true

View File

@ -120,7 +120,7 @@ let typecheck = [
{a : Num = 1 + a} : {a : Num},
// let_inference
(let x = 1 + 2 in let f = fun x => x + 1 in f x) : Num,
(let x = 1 + 2 in let f = fun x => x + 1 in f x) : Num,
// (let x = 1 + 2 in let f = fun x => x ++ "a" in f x) : Num,
{a = 1, b = 1 + a} : {a : Num, b : Num},
{f = fun x => if x == 0 then 1 else 1 + (f (x + (-1))),}