mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
Merge remote-tracking branch 'remote/main' into builtin-task
This commit is contained in:
commit
eca453d07f
367 changed files with 14084 additions and 12080 deletions
|
@ -11,6 +11,7 @@ cargo-fuzz = true
|
|||
|
||||
[dependencies]
|
||||
test_syntax = { path = "../../test_syntax" }
|
||||
roc_parse = { path = "../../parse" }
|
||||
|
||||
bumpalo = { version = "3.12.0", features = ["collections"] }
|
||||
libfuzzer-sys = "0.4"
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
#![no_main]
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use bumpalo::Bump;
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use roc_parse::ast::Malformed;
|
||||
use test_syntax::test_helpers::Input;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
if let Ok(input) = std::str::from_utf8(data) {
|
||||
let input = Input::Expr(input);
|
||||
let arena = Bump::new();
|
||||
if input.parse_in(&arena).is_ok() {
|
||||
input.check_invariants(|_| (), true);
|
||||
let ast = input.parse_in(&arena);
|
||||
if let Ok(ast) = ast {
|
||||
if !ast.is_malformed() {
|
||||
input.check_invariants(|_| (), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
35
crates/compiler/test_syntax/src/bin/minimize.rs
Normal file
35
crates/compiler/test_syntax/src/bin/minimize.rs
Normal file
|
@ -0,0 +1,35 @@
|
|||
//! Generate a minimized version of a given input, by removing parts of it.
|
||||
//! This is useful for debugging, when you have a large input that causes a failure,
|
||||
//! and you want to find the smallest input that still causes the failure.
|
||||
//!
|
||||
//! Typical usage:
|
||||
//! `cargo run --release --bin minimize -- full <file_that_triggers_parsing_bug>`
|
||||
//!
|
||||
//! This tool will churn on that for a while, and eventually print out a minimized version
|
||||
//! of the input that still triggers the bug.
|
||||
//!
|
||||
//! Note that `--release` is important, as this tool is very slow in debug mode.
|
||||
|
||||
use test_syntax::{minimize::print_minimizations, test_helpers::InputKind};
|
||||
|
||||
fn main() {
|
||||
let args = std::env::args().collect::<Vec<String>>();
|
||||
if args.len() != 3 {
|
||||
eprintln!("Usage: {} [expr|full|moduledefs|header] <input>", args[0]);
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
let kind = match args[1].as_str() {
|
||||
"expr" => InputKind::Expr,
|
||||
"full" => InputKind::Full,
|
||||
"moduledefs" => InputKind::ModuleDefs,
|
||||
"header" => InputKind::Header,
|
||||
_ => {
|
||||
eprintln!("Invalid input kind: {}", args[1]);
|
||||
std::process::exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
let text = std::fs::read_to_string(&args[2]).unwrap();
|
||||
print_minimizations(&text, kind);
|
||||
}
|
|
@ -1 +1,2 @@
|
|||
pub mod minimize;
|
||||
pub mod test_helpers;
|
||||
|
|
211
crates/compiler/test_syntax/src/minimize.rs
Normal file
211
crates/compiler/test_syntax/src/minimize.rs
Normal file
|
@ -0,0 +1,211 @@
|
|||
//! Generate a minimized version of a given input, by removing parts of it.
|
||||
//! This is useful for debugging, when you have a large input that causes a failure,
|
||||
//! and you want to find the smallest input that still causes the failure.
|
||||
//!
|
||||
//! Most users will want to use the binary instead of this module directly.
|
||||
//! e.g. `cargo run --release --bin minimize -- full <file_that_triggers_parsing_bug>`
|
||||
|
||||
use crate::test_helpers::{Input, InputKind};
|
||||
use bumpalo::Bump;
|
||||
use roc_parse::{ast::Malformed, remove_spaces::RemoveSpaces};
|
||||
|
||||
pub fn print_minimizations(text: &str, kind: InputKind) {
|
||||
let Some(original_error) = round_trip_once_and_extract_error(text, kind) else {
|
||||
eprintln!("No error found");
|
||||
return;
|
||||
};
|
||||
|
||||
eprintln!("Error found: {}", original_error);
|
||||
eprintln!("Proceeding with minimization");
|
||||
|
||||
let mut s = text.to_string();
|
||||
|
||||
loop {
|
||||
let mut found = false;
|
||||
for update in candidate_minimizations(s.clone()) {
|
||||
let mut new_s = String::with_capacity(s.len());
|
||||
let mut offset = 0;
|
||||
for (start, end, replacement) in update.replacements.clone() {
|
||||
new_s.push_str(&s[offset..start]);
|
||||
new_s.push_str(&replacement);
|
||||
offset = end;
|
||||
}
|
||||
new_s.push_str(&s[offset..]);
|
||||
|
||||
assert!(
|
||||
new_s.len() < s.len(),
|
||||
"replacements: {:?}",
|
||||
update.replacements
|
||||
);
|
||||
|
||||
if let Some(result) = round_trip_once_and_extract_error(&new_s, kind) {
|
||||
if result == original_error {
|
||||
eprintln!("Successfully minimized, new length: {}", new_s.len());
|
||||
s = new_s;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !found {
|
||||
eprintln!("No more minimizations found");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
eprintln!("Final result:");
|
||||
println!("{}", s);
|
||||
}
|
||||
|
||||
fn round_trip_once_and_extract_error(text: &str, kind: InputKind) -> Option<String> {
|
||||
let input = kind.with_text(text);
|
||||
let res = std::panic::catch_unwind(|| round_trip_once(input));
|
||||
|
||||
match res {
|
||||
Ok(res) => res,
|
||||
Err(e) => {
|
||||
if let Some(s) = e.downcast_ref::<&'static str>() {
|
||||
return Some(s.to_string());
|
||||
}
|
||||
if let Some(s) = e.downcast_ref::<String>() {
|
||||
return Some(s.clone());
|
||||
}
|
||||
Some("Panic during parsing".to_string())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn round_trip_once(input: Input<'_>) -> Option<String> {
|
||||
let arena = Bump::new();
|
||||
|
||||
let actual = match input.parse_in(&arena) {
|
||||
Ok(a) => a,
|
||||
Err(e) => {
|
||||
return Some(format!(
|
||||
"Initial parse failed: {:?}",
|
||||
e.remove_spaces(&arena)
|
||||
))
|
||||
}
|
||||
};
|
||||
|
||||
if actual.is_malformed() {
|
||||
return Some("Initial parse is malformed".to_string());
|
||||
}
|
||||
|
||||
let output = actual.format();
|
||||
|
||||
let reparsed_ast = match output.as_ref().parse_in(&arena) {
|
||||
Ok(r) => r,
|
||||
Err(e) => return Some(format!("Reparse failed: {:?}", e.remove_spaces(&arena))),
|
||||
};
|
||||
|
||||
let ast_normalized = actual.remove_spaces(&arena);
|
||||
let reparsed_ast_normalized = reparsed_ast.remove_spaces(&arena);
|
||||
|
||||
if format!("{ast_normalized:?}") != format!("{reparsed_ast_normalized:?}") {
|
||||
return Some("Different ast".to_string());
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
struct Update {
|
||||
replacements: Vec<(usize, usize, String)>,
|
||||
}
|
||||
|
||||
fn candidate_minimizations(s: String) -> Box<dyn Iterator<Item = Update>> {
|
||||
let mut line_offsets = vec![0];
|
||||
line_offsets.extend(s.match_indices('\n').map(|(i, _)| i + 1));
|
||||
let line_count = line_offsets.len();
|
||||
let s_len = s.len();
|
||||
|
||||
let line_indents = line_offsets
|
||||
.iter()
|
||||
.map(|&offset| s[offset..].chars().take_while(|&c| c == ' ').count())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let line_offsets_clone = line_offsets.clone();
|
||||
|
||||
// first, try to remove every group of 1, 2, 3, ... lines - in reverse order (so, trying removing n lines first, then n-1, etc)
|
||||
let line_removals = (1..=line_count).rev().flat_map(move |n| {
|
||||
let line_offsets_clone = line_offsets.clone();
|
||||
(0..line_count - n).map(move |start| {
|
||||
let end = start + n;
|
||||
let start_offset = line_offsets_clone[start];
|
||||
let end_offset = line_offsets_clone[end];
|
||||
let replacement = String::new();
|
||||
let replacements = vec![(start_offset, end_offset, replacement)];
|
||||
Update { replacements }
|
||||
})
|
||||
});
|
||||
|
||||
let line_offsets = line_offsets_clone;
|
||||
let line_offsets_clone = line_offsets.clone();
|
||||
|
||||
// then, try to dedent every group of 1, 2, 3, ... lines - in reverse order (so, trying dedenting n lines first, then n-1, etc)
|
||||
// just remove one space at a time, for now
|
||||
let line_dedents = (1..=line_count).rev().flat_map(move |n| {
|
||||
let line_offsets_clone = line_offsets.clone();
|
||||
let line_indents_clone = line_indents.clone();
|
||||
(0..line_count - n).filter_map(move |start| {
|
||||
// first check if all lines are either zero-width or have greater than zero indent
|
||||
let end = start + n;
|
||||
for i in start..end {
|
||||
if line_indents_clone[i] == 0
|
||||
&& line_offsets_clone[i] + 1
|
||||
< line_offsets_clone.get(i + 1).cloned().unwrap_or(s_len)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
let mut replacements = vec![];
|
||||
for i in start..end {
|
||||
let offset = line_offsets_clone[i];
|
||||
let indent = line_indents_clone[i];
|
||||
if indent > 0 {
|
||||
replacements.push((offset, offset + 1, String::new()));
|
||||
}
|
||||
}
|
||||
Some(Update { replacements })
|
||||
})
|
||||
});
|
||||
|
||||
// then, try to select every range of 1, 2, 3, ... lines - in normal order this time!
|
||||
// we remove the lines before and after the range
|
||||
let line_selects = (1..line_count - 1).flat_map(move |n| {
|
||||
assert!(n > 0);
|
||||
let line_offsets_clone = line_offsets_clone.clone();
|
||||
(0..line_count - n).map(move |start| {
|
||||
let end = start + n;
|
||||
let start_offset = line_offsets_clone[start];
|
||||
let end_offset = line_offsets_clone[end];
|
||||
assert!(end_offset > start_offset);
|
||||
assert!(start_offset > 0 || end_offset < s_len);
|
||||
let replacements = vec![
|
||||
(0, start_offset, String::new()),
|
||||
(end_offset, s_len, String::new()),
|
||||
];
|
||||
Update { replacements }
|
||||
})
|
||||
});
|
||||
|
||||
// then, try to remove every range of 1, 2, 3, ... characters - in reverse order (so, trying removing n characters first, then n-1, etc)
|
||||
let charseq_removals = (1..s.len()).rev().flat_map(move |n| {
|
||||
(0..s.len() - n).map(move |start| {
|
||||
let end = start + n;
|
||||
let replacement = String::new();
|
||||
let replacements = vec![(start, end, replacement)];
|
||||
Update { replacements }
|
||||
})
|
||||
});
|
||||
|
||||
Box::new(
|
||||
line_removals
|
||||
.chain(line_dedents)
|
||||
.chain(line_selects)
|
||||
.chain(charseq_removals)
|
||||
.filter(|u| !u.replacements.is_empty()),
|
||||
)
|
||||
}
|
|
@ -4,12 +4,12 @@ use roc_parse::{
|
|||
ast::{Defs, Expr, Malformed, Module},
|
||||
module::parse_module_defs,
|
||||
parser::{Parser, SyntaxError},
|
||||
remove_spaces::RemoveSpaces,
|
||||
state::State,
|
||||
test_helpers::{parse_defs_with, parse_expr_with, parse_header_with},
|
||||
};
|
||||
use roc_test_utils::assert_multiline_str_eq;
|
||||
|
||||
use roc_fmt::spaces::RemoveSpaces;
|
||||
use roc_fmt::Buf;
|
||||
|
||||
/// Source code to parse. Usually in the form of a test case.
|
||||
|
@ -28,6 +28,25 @@ pub enum Input<'a> {
|
|||
Full(&'a str),
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
pub enum InputKind {
|
||||
Header,
|
||||
ModuleDefs,
|
||||
Expr,
|
||||
Full,
|
||||
}
|
||||
|
||||
impl InputKind {
|
||||
pub fn with_text(self, text: &str) -> Input {
|
||||
match self {
|
||||
InputKind::Header => Input::Header(text),
|
||||
InputKind::ModuleDefs => Input::ModuleDefs(text),
|
||||
InputKind::Expr => Input::Expr(text),
|
||||
InputKind::Full => Input::Full(text),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Owned version of `Input`
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum InputOwned {
|
||||
|
@ -38,7 +57,7 @@ pub enum InputOwned {
|
|||
}
|
||||
|
||||
impl InputOwned {
|
||||
fn as_ref(&self) -> Input {
|
||||
pub fn as_ref(&self) -> Input {
|
||||
match self {
|
||||
InputOwned::Header(s) => Input::Header(s),
|
||||
InputOwned::ModuleDefs(s) => Input::ModuleDefs(s),
|
||||
|
@ -64,7 +83,7 @@ pub enum Output<'a> {
|
|||
}
|
||||
|
||||
impl<'a> Output<'a> {
|
||||
fn format(&self) -> InputOwned {
|
||||
pub fn format(&self) -> InputOwned {
|
||||
let arena = Bump::new();
|
||||
let mut buf = Buf::new_in(&arena);
|
||||
match self {
|
||||
|
@ -172,7 +191,7 @@ impl<'a> Input<'a> {
|
|||
|
||||
let (header, defs) = header.upgrade_header_imports(arena);
|
||||
|
||||
let module_defs = parse_module_defs(arena, state, defs).unwrap();
|
||||
let module_defs = parse_module_defs(arena, state, defs)?;
|
||||
|
||||
Ok(Output::Full {
|
||||
header,
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Expr(BackpassContinue(@8), @0)
|
|
@ -0,0 +1,2 @@
|
|||
u:i
|
||||
e<-x
|
|
@ -0,0 +1 @@
|
|||
Expr(BadExprEnd(@4), @0)
|
|
@ -1 +1 @@
|
|||
Expr(DefMissingFinalExpr2(Start(@11), @11), @0)
|
||||
Expr(IndentEnd(@11), @0)
|
|
@ -0,0 +1 @@
|
|||
Expr(BadExprEnd(@3), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Start(@0), @0)
|
||||
Expr(IndentEnd(@12), @0)
|
|
@ -1 +1 @@
|
|||
Expr(If(Else(@16), @0), @0)
|
||||
Expr(If(Else(@17), @0), @0)
|
|
@ -1 +1 @@
|
|||
Expr(List(End(@6), @0), @0)
|
||||
Expr(List(End(@7), @0), @0)
|
|
@ -0,0 +1 @@
|
|||
Expr(InParens(Expr(BadExprEnd(@8), @5), @4), @0)
|
|
@ -0,0 +1,3 @@
|
|||
a : e
|
||||
Na := e
|
||||
e0
|
|
@ -0,0 +1 @@
|
|||
Expr(BadExprEnd(@11), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Closure(Pattern(PInParens(End(@4), @1), @1), @0), @0)
|
||||
Expr(Closure(Pattern(PInParens(End(@5), @1), @1), @0), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Closure(Pattern(PInParens(End(@5), @1), @1), @0), @0)
|
||||
Expr(Closure(Pattern(PInParens(End(@6), @1), @1), @0), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Closure(Pattern(PInParens(End(@2), @1), @1), @0), @0)
|
||||
Expr(Closure(Pattern(PInParens(End(@3), @1), @1), @0), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Closure(Pattern(PInParens(End(@4), @1), @1), @0), @0)
|
||||
Expr(Closure(Pattern(PInParens(End(@5), @1), @1), @0), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Type(TRecord(End(@13), @4), @4), @0)
|
||||
Expr(Type(TRecord(End(@14), @4), @4), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Type(TRecord(End(@5), @4), @4), @0)
|
||||
Expr(Type(TRecord(End(@6), @4), @4), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Type(TRecord(End(@16), @4), @4), @0)
|
||||
Expr(Type(TRecord(End(@17), @4), @4), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Type(TTagUnion(End(@9), @4), @4), @0)
|
||||
Expr(Type(TTagUnion(End(@10), @4), @4), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Type(TTagUnion(End(@5), @4), @4), @0)
|
||||
Expr(Type(TTagUnion(End(@6), @4), @4), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Type(TInParens(End(@9), @4), @4), @0)
|
||||
Expr(Type(TInParens(End(@10), @4), @4), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Type(TInParens(End(@5), @4), @4), @0)
|
||||
Expr(Type(TInParens(End(@6), @4), @4), @0)
|
|
@ -1 +1 @@
|
|||
Expr(Closure(Arrow(@10), @4), @0)
|
||||
Expr(Closure(IndentArrow(@10), @4), @0)
|
|
@ -0,0 +1 @@
|
|||
Expr(Import(EndNewline(@15), @0), @0)
|
|
@ -0,0 +1 @@
|
|||
import svg.Path a
|
|
@ -1 +1 @@
|
|||
Expr(When(Arrow(@26), @0), @0)
|
||||
Expr(When(IndentPattern(@26), @0), @0)
|
|
@ -1 +1 @@
|
|||
Expr(BadExprEnd(@22), @0)
|
||||
Expr(BadOperator("->", @24), @0)
|
|
@ -1 +1 @@
|
|||
Expr(When(Branch(BadOperator("->", @34), @19), @0), @0)
|
||||
Expr(When(IndentPattern(@34), @0), @0)
|
|
@ -1 +1 @@
|
|||
Expr(When(Branch(BadOperator("->", @28), @19), @0), @0)
|
||||
Expr(When(IndentPattern(@28), @0), @0)
|
|
@ -1 +1 @@
|
|||
Expr(DefMissingFinalExpr2(ElmStyleFunction(@18-22, @23), @11), @0)
|
||||
Expr(BadExprEnd(@11), @0)
|
|
@ -1 +1 @@
|
|||
Expr(BadOperator("->", @9), @0)
|
||||
Expr(BadExprEnd(@8), @0)
|
|
@ -0,0 +1,3 @@
|
|||
when x is
|
||||
bar.and -> 1
|
||||
_ -> 4
|
|
@ -1,40 +1,45 @@
|
|||
When(
|
||||
@5-6 Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
},
|
||||
SpaceAfter(
|
||||
When(
|
||||
@5-6 Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
},
|
||||
[
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@14-21 SpaceBefore(
|
||||
Malformed(
|
||||
"bar.and",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @25-26 Num(
|
||||
"1",
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@31-32 SpaceBefore(
|
||||
Underscore(
|
||||
"",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @36-37 Num(
|
||||
"4",
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
],
|
||||
),
|
||||
[
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@14-21 SpaceBefore(
|
||||
Malformed(
|
||||
"bar.and",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @25-26 Num(
|
||||
"1",
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@31-32 SpaceBefore(
|
||||
Underscore(
|
||||
"",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @36-37 Num(
|
||||
"4",
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
when x is
|
||||
Foo.and -> 1
|
||||
_ -> 4
|
|
@ -1,40 +1,45 @@
|
|||
When(
|
||||
@5-6 Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
},
|
||||
SpaceAfter(
|
||||
When(
|
||||
@5-6 Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
},
|
||||
[
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@14-21 SpaceBefore(
|
||||
Malformed(
|
||||
"Foo.and",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @25-26 Num(
|
||||
"1",
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@31-32 SpaceBefore(
|
||||
Underscore(
|
||||
"",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @36-37 Num(
|
||||
"4",
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
],
|
||||
),
|
||||
[
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@14-21 SpaceBefore(
|
||||
Malformed(
|
||||
"Foo.and",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @25-26 Num(
|
||||
"1",
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@31-32 SpaceBefore(
|
||||
Underscore(
|
||||
"",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @36-37 Num(
|
||||
"4",
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,63 +1,68 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-43,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Ability {
|
||||
header: TypeHeader {
|
||||
name: @0-4 "Hash",
|
||||
vars: [],
|
||||
},
|
||||
loc_implements: @5-15 Implements,
|
||||
members: [
|
||||
AbilityMember {
|
||||
name: @18-22 SpaceBefore(
|
||||
"hash",
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
typ: @25-43 Function(
|
||||
[
|
||||
@25-26 SpaceAfter(
|
||||
BoundVariable(
|
||||
"a",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
@40-43 Apply(
|
||||
"",
|
||||
"U64",
|
||||
[],
|
||||
),
|
||||
),
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-43,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Ability {
|
||||
header: TypeHeader {
|
||||
name: @0-4 "Hash",
|
||||
vars: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@45-46 SpaceBefore(
|
||||
Num(
|
||||
"1",
|
||||
loc_implements: @5-15 Implements,
|
||||
members: [
|
||||
AbilityMember {
|
||||
name: @18-22 SpaceBefore(
|
||||
"hash",
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
typ: @25-43 Function(
|
||||
[
|
||||
@25-26 SpaceAfter(
|
||||
BoundVariable(
|
||||
"a",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
@40-43 Apply(
|
||||
"",
|
||||
"U64",
|
||||
[],
|
||||
),
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@45-46 SpaceBefore(
|
||||
Num(
|
||||
"1",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,78 +1,83 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-52,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Ability {
|
||||
header: TypeHeader {
|
||||
name: @0-4 "Hash",
|
||||
vars: [],
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-52,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Ability {
|
||||
header: TypeHeader {
|
||||
name: @0-4 "Hash",
|
||||
vars: [],
|
||||
},
|
||||
loc_implements: @5-15 Implements,
|
||||
members: [
|
||||
AbilityMember {
|
||||
name: @18-22 SpaceBefore(
|
||||
"hash",
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
typ: @25-33 Function(
|
||||
[
|
||||
@25-26 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
],
|
||||
@30-33 Apply(
|
||||
"",
|
||||
"U64",
|
||||
[],
|
||||
),
|
||||
),
|
||||
},
|
||||
AbilityMember {
|
||||
name: @36-41 SpaceBefore(
|
||||
"hash2",
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
typ: @44-52 Function(
|
||||
[
|
||||
@44-45 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
],
|
||||
@49-52 Apply(
|
||||
"",
|
||||
"U64",
|
||||
[],
|
||||
),
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
loc_implements: @5-15 Implements,
|
||||
members: [
|
||||
AbilityMember {
|
||||
name: @18-22 SpaceBefore(
|
||||
"hash",
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
typ: @25-33 Function(
|
||||
[
|
||||
@25-26 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
],
|
||||
@30-33 Apply(
|
||||
"",
|
||||
"U64",
|
||||
[],
|
||||
),
|
||||
),
|
||||
},
|
||||
AbilityMember {
|
||||
name: @36-41 SpaceBefore(
|
||||
"hash2",
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
typ: @44-52 Function(
|
||||
[
|
||||
@44-45 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
],
|
||||
@49-52 Apply(
|
||||
"",
|
||||
"U64",
|
||||
[],
|
||||
),
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@54-55 SpaceBefore(
|
||||
Num(
|
||||
"1",
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@54-55 SpaceBefore(
|
||||
Num(
|
||||
"1",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
Hash implements hash : a -> U64 where a implements Hash
|
||||
|
||||
1
|
|
@ -1,67 +1,72 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-55,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Ability {
|
||||
header: TypeHeader {
|
||||
name: @0-4 "Hash",
|
||||
vars: [],
|
||||
},
|
||||
loc_implements: @5-15 Implements,
|
||||
members: [
|
||||
AbilityMember {
|
||||
name: @16-20 "hash",
|
||||
typ: @23-55 Where(
|
||||
@23-31 Function(
|
||||
[
|
||||
@23-24 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
],
|
||||
@28-31 Apply(
|
||||
"",
|
||||
"U64",
|
||||
[],
|
||||
),
|
||||
),
|
||||
[
|
||||
@38-55 ImplementsClause {
|
||||
var: @38-39 "a",
|
||||
abilities: [
|
||||
@51-55 Apply(
|
||||
"",
|
||||
"Hash",
|
||||
[],
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-55,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Ability {
|
||||
header: TypeHeader {
|
||||
name: @0-4 "Hash",
|
||||
vars: [],
|
||||
},
|
||||
loc_implements: @5-15 Implements,
|
||||
members: [
|
||||
AbilityMember {
|
||||
name: @16-20 "hash",
|
||||
typ: @23-55 Where(
|
||||
@23-31 Function(
|
||||
[
|
||||
@23-24 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@57-58 SpaceBefore(
|
||||
Num(
|
||||
"1",
|
||||
@28-31 Apply(
|
||||
"",
|
||||
"U64",
|
||||
[],
|
||||
),
|
||||
),
|
||||
[
|
||||
@38-55 ImplementsClause {
|
||||
var: @38-39 "a",
|
||||
abilities: [
|
||||
@51-55 Apply(
|
||||
"",
|
||||
"Hash",
|
||||
[],
|
||||
),
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@57-58 SpaceBefore(
|
||||
Num(
|
||||
"1",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
Ab1 implements ab1 : a -> {} where a implements Ab1
|
||||
|
||||
Ab2 implements ab2 : a -> {} where a implements Ab2
|
||||
|
||||
1
|
|
@ -1,110 +1,115 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
Index(1),
|
||||
],
|
||||
regions: [
|
||||
@0-51,
|
||||
@53-104,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 0, length = 2),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 2, length = 0),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
type_defs: [
|
||||
Ability {
|
||||
header: TypeHeader {
|
||||
name: @0-3 "Ab1",
|
||||
vars: [],
|
||||
},
|
||||
loc_implements: @4-14 Implements,
|
||||
members: [
|
||||
AbilityMember {
|
||||
name: @15-18 "ab1",
|
||||
typ: @21-51 Where(
|
||||
@21-28 Function(
|
||||
[
|
||||
@21-22 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
],
|
||||
@26-28 Record {
|
||||
fields: [],
|
||||
ext: None,
|
||||
},
|
||||
),
|
||||
[
|
||||
@35-51 ImplementsClause {
|
||||
var: @35-36 "a",
|
||||
abilities: [
|
||||
@48-51 Apply(
|
||||
"",
|
||||
"Ab1",
|
||||
[],
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
Index(1),
|
||||
],
|
||||
regions: [
|
||||
@0-51,
|
||||
@53-104,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 0, length = 2),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 2, length = 0),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
type_defs: [
|
||||
Ability {
|
||||
header: TypeHeader {
|
||||
name: @0-3 "Ab1",
|
||||
vars: [],
|
||||
},
|
||||
loc_implements: @4-14 Implements,
|
||||
members: [
|
||||
AbilityMember {
|
||||
name: @15-18 "ab1",
|
||||
typ: @21-51 Where(
|
||||
@21-28 Function(
|
||||
[
|
||||
@21-22 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
Ability {
|
||||
header: TypeHeader {
|
||||
name: @53-56 "Ab2",
|
||||
vars: [],
|
||||
},
|
||||
loc_implements: @57-67 Implements,
|
||||
members: [
|
||||
AbilityMember {
|
||||
name: @68-71 "ab2",
|
||||
typ: @74-104 Where(
|
||||
@74-81 Function(
|
||||
@26-28 Record {
|
||||
fields: [],
|
||||
ext: None,
|
||||
},
|
||||
),
|
||||
[
|
||||
@74-75 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
@35-51 ImplementsClause {
|
||||
var: @35-36 "a",
|
||||
abilities: [
|
||||
@48-51 Apply(
|
||||
"",
|
||||
"Ab1",
|
||||
[],
|
||||
),
|
||||
],
|
||||
},
|
||||
],
|
||||
@79-81 Record {
|
||||
fields: [],
|
||||
ext: None,
|
||||
},
|
||||
),
|
||||
[
|
||||
@88-104 ImplementsClause {
|
||||
var: @88-89 "a",
|
||||
abilities: [
|
||||
@101-104 Apply(
|
||||
"",
|
||||
"Ab2",
|
||||
[],
|
||||
},
|
||||
],
|
||||
},
|
||||
Ability {
|
||||
header: TypeHeader {
|
||||
name: @53-56 "Ab2",
|
||||
vars: [],
|
||||
},
|
||||
loc_implements: @57-67 Implements,
|
||||
members: [
|
||||
AbilityMember {
|
||||
name: @68-71 "ab2",
|
||||
typ: @74-104 Where(
|
||||
@74-81 Function(
|
||||
[
|
||||
@74-75 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@106-107 SpaceBefore(
|
||||
Num(
|
||||
"1",
|
||||
@79-81 Record {
|
||||
fields: [],
|
||||
ext: None,
|
||||
},
|
||||
),
|
||||
[
|
||||
@88-104 ImplementsClause {
|
||||
var: @88-89 "a",
|
||||
abilities: [
|
||||
@101-104 Apply(
|
||||
"",
|
||||
"Ab2",
|
||||
[],
|
||||
),
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@106-107 SpaceBefore(
|
||||
Num(
|
||||
"1",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,78 +1,83 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-49,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
AnnotatedBody {
|
||||
ann_pattern: @0-8 RecordDestructure(
|
||||
[
|
||||
@2-3 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@5-7 Identifier {
|
||||
ident: "y",
|
||||
},
|
||||
],
|
||||
),
|
||||
ann_type: @11-14 Apply(
|
||||
"",
|
||||
"Foo",
|
||||
[],
|
||||
),
|
||||
comment: None,
|
||||
body_pattern: @15-23 RecordDestructure(
|
||||
[
|
||||
@17-18 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@20-21 Identifier {
|
||||
ident: "y",
|
||||
},
|
||||
],
|
||||
),
|
||||
body_expr: @26-49 Record(
|
||||
[
|
||||
@28-37 RequiredValue(
|
||||
@28-29 "x",
|
||||
[],
|
||||
@32-37 Str(
|
||||
PlainLine(
|
||||
"foo",
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-49,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
AnnotatedBody {
|
||||
ann_pattern: @0-8 RecordDestructure(
|
||||
[
|
||||
@2-3 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@5-7 Identifier {
|
||||
ident: "y",
|
||||
},
|
||||
],
|
||||
),
|
||||
ann_type: @11-14 Apply(
|
||||
"",
|
||||
"Foo",
|
||||
[],
|
||||
),
|
||||
comment: None,
|
||||
body_pattern: @15-23 RecordDestructure(
|
||||
[
|
||||
@17-18 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@20-22 Identifier {
|
||||
ident: "y",
|
||||
},
|
||||
],
|
||||
),
|
||||
body_expr: @26-49 Record(
|
||||
[
|
||||
@28-37 RequiredValue(
|
||||
@28-29 "x",
|
||||
[],
|
||||
@32-37 Str(
|
||||
PlainLine(
|
||||
"foo",
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@39-47 RequiredValue(
|
||||
@39-40 "y",
|
||||
[],
|
||||
@43-47 Float(
|
||||
"3.14",
|
||||
@39-47 RequiredValue(
|
||||
@39-40 "y",
|
||||
[],
|
||||
@43-47 Float(
|
||||
"3.14",
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
@51-52 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
],
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
@51-52 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,79 +1,84 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-46,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
AnnotatedBody {
|
||||
ann_pattern: @0-8 Apply(
|
||||
@0-6 Tag(
|
||||
"UserId",
|
||||
),
|
||||
[
|
||||
@7-8 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
],
|
||||
),
|
||||
ann_type: @11-25 TagUnion {
|
||||
ext: None,
|
||||
tags: [
|
||||
@13-23 Apply {
|
||||
name: @13-19 "UserId",
|
||||
args: [
|
||||
@20-23 Apply(
|
||||
"",
|
||||
"I64",
|
||||
[],
|
||||
),
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
comment: None,
|
||||
body_pattern: @26-34 Apply(
|
||||
@26-32 Tag(
|
||||
"UserId",
|
||||
),
|
||||
[
|
||||
@33-34 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
],
|
||||
),
|
||||
body_expr: @37-46 Apply(
|
||||
@37-43 Tag(
|
||||
"UserId",
|
||||
),
|
||||
[
|
||||
@44-46 Num(
|
||||
"42",
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-46,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
AnnotatedBody {
|
||||
ann_pattern: @0-8 Apply(
|
||||
@0-6 Tag(
|
||||
"UserId",
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
@48-49 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
[
|
||||
@7-8 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
],
|
||||
),
|
||||
ann_type: @11-25 TagUnion {
|
||||
ext: None,
|
||||
tags: [
|
||||
@13-23 Apply {
|
||||
name: @13-19 "UserId",
|
||||
args: [
|
||||
@20-23 Apply(
|
||||
"",
|
||||
"I64",
|
||||
[],
|
||||
),
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
comment: None,
|
||||
body_pattern: @26-34 Apply(
|
||||
@26-32 Tag(
|
||||
"UserId",
|
||||
),
|
||||
[
|
||||
@33-34 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
],
|
||||
),
|
||||
body_expr: @37-46 Apply(
|
||||
@37-43 Tag(
|
||||
"UserId",
|
||||
),
|
||||
[
|
||||
@44-46 Num(
|
||||
"42",
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
@48-49 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,70 +1,75 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-41,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
AnnotatedBody {
|
||||
ann_pattern: @0-8 Tuple(
|
||||
[
|
||||
@2-3 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@5-6 Identifier {
|
||||
ident: "y",
|
||||
},
|
||||
],
|
||||
),
|
||||
ann_type: @11-14 Apply(
|
||||
"",
|
||||
"Foo",
|
||||
[],
|
||||
),
|
||||
comment: None,
|
||||
body_pattern: @15-23 Tuple(
|
||||
[
|
||||
@17-18 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@20-21 Identifier {
|
||||
ident: "y",
|
||||
},
|
||||
],
|
||||
),
|
||||
body_expr: @26-41 Tuple(
|
||||
[
|
||||
@28-33 Str(
|
||||
PlainLine(
|
||||
"foo",
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-41,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
AnnotatedBody {
|
||||
ann_pattern: @0-8 Tuple(
|
||||
[
|
||||
@2-3 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@5-6 Identifier {
|
||||
ident: "y",
|
||||
},
|
||||
],
|
||||
),
|
||||
ann_type: @11-14 Apply(
|
||||
"",
|
||||
"Foo",
|
||||
[],
|
||||
),
|
||||
comment: None,
|
||||
body_pattern: @15-23 Tuple(
|
||||
[
|
||||
@17-18 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@20-21 Identifier {
|
||||
ident: "y",
|
||||
},
|
||||
],
|
||||
),
|
||||
body_expr: @26-41 Tuple(
|
||||
[
|
||||
@28-33 Str(
|
||||
PlainLine(
|
||||
"foo",
|
||||
),
|
||||
),
|
||||
),
|
||||
@35-39 Float(
|
||||
"3.14",
|
||||
),
|
||||
],
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
@43-44 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
@35-39 Float(
|
||||
"3.14",
|
||||
),
|
||||
],
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
@43-44 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
## first line of docs
|
||||
## second line
|
||||
## third line
|
||||
## fourth line
|
||||
##
|
||||
## sixth line after doc new line
|
||||
x = 5
|
||||
|
||||
42
|
|
@ -1,40 +1,45 @@
|
|||
SpaceBefore(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@107-112,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@107-108 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@111-112 Num(
|
||||
"5",
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@107-112,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@107-108 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@111-112 Num(
|
||||
"5",
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@114-116 SpaceBefore(
|
||||
Num(
|
||||
"42",
|
||||
),
|
||||
],
|
||||
},
|
||||
@114-116 SpaceBefore(
|
||||
Num(
|
||||
"42",
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
DocComment(
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-4,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Annotation(
|
||||
@0-1 Identifier {
|
||||
ident: "a",
|
||||
},
|
||||
@3-4 SpaceBefore(
|
||||
BoundVariable(
|
||||
"c",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@5-6 Num(
|
||||
"0",
|
||||
),
|
||||
)
|
|
@ -1,3 +0,0 @@
|
|||
f
|
||||
-5
|
||||
2
|
|
@ -1,25 +0,0 @@
|
|||
Apply(
|
||||
@0-1 SpaceAfter(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "f",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
@2-4 Num(
|
||||
"-5",
|
||||
),
|
||||
@5-6 SpaceBefore(
|
||||
Num(
|
||||
"2",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
Space,
|
||||
)
|
|
@ -1,3 +0,0 @@
|
|||
f
|
||||
-5
|
||||
2
|
|
@ -1,3 +0,0 @@
|
|||
a
|
||||
&& (\x -> x)
|
||||
8
|
|
@ -1,35 +0,0 @@
|
|||
BinOps(
|
||||
[
|
||||
(
|
||||
@0-1 Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
@2-4 And,
|
||||
),
|
||||
],
|
||||
@5-12 Apply(
|
||||
@5-10 Closure(
|
||||
[
|
||||
@6-7 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
],
|
||||
@9-10 Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
},
|
||||
),
|
||||
[
|
||||
@11-12 SpaceBefore(
|
||||
Num(
|
||||
"8",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
)
|
|
@ -1,2 +0,0 @@
|
|||
a && \x->x
|
||||
8
|
|
@ -0,0 +1,8 @@
|
|||
Model position : {
|
||||
evaluated : Set position,
|
||||
openSet : Set position,
|
||||
costs : Dict.Dict position F64,
|
||||
cameFrom : Dict.Dict position position,
|
||||
}
|
||||
|
||||
a
|
|
@ -0,0 +1,130 @@
|
|||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-164,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-5 "Model",
|
||||
vars: [
|
||||
@6-14 Identifier {
|
||||
ident: "position",
|
||||
},
|
||||
],
|
||||
},
|
||||
ann: @21-164 Record {
|
||||
fields: [
|
||||
@23-47 SpaceAfter(
|
||||
RequiredValue(
|
||||
@23-32 "evaluated",
|
||||
[],
|
||||
@35-47 Apply(
|
||||
"",
|
||||
"Set",
|
||||
[
|
||||
@39-47 BoundVariable(
|
||||
"position",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
@54-76 SpaceAfter(
|
||||
RequiredValue(
|
||||
@54-61 "openSet",
|
||||
[],
|
||||
@64-76 Apply(
|
||||
"",
|
||||
"Set",
|
||||
[
|
||||
@68-76 BoundVariable(
|
||||
"position",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
@83-113 SpaceAfter(
|
||||
RequiredValue(
|
||||
@83-88 "costs",
|
||||
[],
|
||||
@91-113 Apply(
|
||||
"Dict",
|
||||
"Dict",
|
||||
[
|
||||
@101-109 BoundVariable(
|
||||
"position",
|
||||
),
|
||||
@110-113 Apply(
|
||||
"",
|
||||
"F64",
|
||||
[],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
@120-158 SpaceAfter(
|
||||
RequiredValue(
|
||||
@120-128 "cameFrom",
|
||||
[],
|
||||
@131-158 Apply(
|
||||
"Dict",
|
||||
"Dict",
|
||||
[
|
||||
@141-149 BoundVariable(
|
||||
"position",
|
||||
),
|
||||
@150-158 BoundVariable(
|
||||
"position",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
ext: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@166-167 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,8 @@
|
|||
Model position :
|
||||
{ evaluated : Set position
|
||||
, openSet : Set position
|
||||
, costs : Dict.Dict position F64
|
||||
, cameFrom : Dict.Dict position position
|
||||
}
|
||||
|
||||
a
|
|
@ -1 +0,0 @@
|
|||
foo = 1 # comment after
|
|
@ -1,4 +0,0 @@
|
|||
Z #
|
||||
h
|
||||
: a
|
||||
j
|
|
@ -1,54 +0,0 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-7,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "Z",
|
||||
vars: [
|
||||
@3-4 SpaceAfter(
|
||||
SpaceBefore(
|
||||
Identifier {
|
||||
ident: "h",
|
||||
},
|
||||
[
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @6-7 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@8-9 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "j",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -1,4 +0,0 @@
|
|||
Z#
|
||||
h
|
||||
:a
|
||||
j
|
|
@ -1,197 +1,50 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
Index(2147483649),
|
||||
Index(2147483650),
|
||||
Index(2147483651),
|
||||
Index(2147483652),
|
||||
],
|
||||
regions: [
|
||||
@0-12,
|
||||
@13-28,
|
||||
@29-45,
|
||||
@46-74,
|
||||
@75-101,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 0, length = 1),
|
||||
Slice(start = 1, length = 1),
|
||||
Slice(start = 2, length = 1),
|
||||
Slice(start = 3, length = 1),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 1, length = 0),
|
||||
Slice(start = 2, length = 0),
|
||||
Slice(start = 3, length = 0),
|
||||
Slice(start = 4, length = 0),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
Newline,
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-1 Underscore(
|
||||
"",
|
||||
),
|
||||
@4-12 Apply(
|
||||
@4-9 Crash,
|
||||
[
|
||||
@10-12 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
Body(
|
||||
@13-14 Underscore(
|
||||
"",
|
||||
),
|
||||
@17-28 Apply(
|
||||
@17-22 Crash,
|
||||
[
|
||||
@23-25 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
@26-28 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
Body(
|
||||
@29-30 Underscore(
|
||||
"",
|
||||
),
|
||||
@33-45 Apply(
|
||||
@33-38 Crash,
|
||||
[
|
||||
@39-41 Num(
|
||||
"15",
|
||||
),
|
||||
@42-45 Num(
|
||||
"123",
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
Body(
|
||||
@46-47 Underscore(
|
||||
"",
|
||||
),
|
||||
@50-74 Apply(
|
||||
@50-53 Var {
|
||||
module_name: "",
|
||||
ident: "try",
|
||||
},
|
||||
[
|
||||
@54-57 Var {
|
||||
module_name: "",
|
||||
ident: "foo",
|
||||
},
|
||||
@59-73 ParensAround(
|
||||
Closure(
|
||||
[
|
||||
@60-61 Underscore(
|
||||
"",
|
||||
),
|
||||
],
|
||||
@65-73 Apply(
|
||||
@65-70 Crash,
|
||||
[
|
||||
@71-73 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
Body(
|
||||
@75-76 Underscore(
|
||||
"",
|
||||
),
|
||||
@81-101 SpaceBefore(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@81-93,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@81-82 Underscore(
|
||||
"",
|
||||
),
|
||||
@85-93 Apply(
|
||||
@85-90 Crash,
|
||||
[
|
||||
@91-93 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@96-101 SpaceBefore(
|
||||
Crash,
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
Index(2147483649),
|
||||
Index(2147483650),
|
||||
Index(2147483651),
|
||||
Index(2147483652),
|
||||
],
|
||||
regions: [
|
||||
@0-12,
|
||||
@13-28,
|
||||
@29-45,
|
||||
@46-74,
|
||||
@75-101,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 0, length = 1),
|
||||
Slice(start = 1, length = 1),
|
||||
Slice(start = 2, length = 1),
|
||||
Slice(start = 3, length = 1),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 1, length = 0),
|
||||
Slice(start = 2, length = 0),
|
||||
Slice(start = 3, length = 0),
|
||||
Slice(start = 4, length = 0),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
Newline,
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-1 Underscore(
|
||||
"",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@103-118 SpaceBefore(
|
||||
Record(
|
||||
[
|
||||
@105-116 RequiredValue(
|
||||
@105-106 "f",
|
||||
[],
|
||||
@108-116 Apply(
|
||||
@108-113 Crash,
|
||||
@4-12 Apply(
|
||||
@4-9 Crash,
|
||||
[
|
||||
@114-116 Str(
|
||||
@10-12 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
|
@ -200,11 +53,163 @@ Defs(
|
|||
Space,
|
||||
),
|
||||
),
|
||||
Body(
|
||||
@13-14 Underscore(
|
||||
"",
|
||||
),
|
||||
@17-28 Apply(
|
||||
@17-22 Crash,
|
||||
[
|
||||
@23-25 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
@26-28 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
Body(
|
||||
@29-30 Underscore(
|
||||
"",
|
||||
),
|
||||
@33-45 Apply(
|
||||
@33-38 Crash,
|
||||
[
|
||||
@39-41 Num(
|
||||
"15",
|
||||
),
|
||||
@42-45 Num(
|
||||
"123",
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
Body(
|
||||
@46-47 Underscore(
|
||||
"",
|
||||
),
|
||||
@50-74 Apply(
|
||||
@50-53 Var {
|
||||
module_name: "",
|
||||
ident: "try",
|
||||
},
|
||||
[
|
||||
@54-57 Var {
|
||||
module_name: "",
|
||||
ident: "foo",
|
||||
},
|
||||
@59-73 ParensAround(
|
||||
Closure(
|
||||
[
|
||||
@60-61 Underscore(
|
||||
"",
|
||||
),
|
||||
],
|
||||
@65-73 Apply(
|
||||
@65-70 Crash,
|
||||
[
|
||||
@71-73 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
Body(
|
||||
@75-76 Underscore(
|
||||
"",
|
||||
),
|
||||
@81-101 SpaceBefore(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@81-93,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@81-82 Underscore(
|
||||
"",
|
||||
),
|
||||
@85-93 Apply(
|
||||
@85-90 Crash,
|
||||
[
|
||||
@91-93 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@96-101 SpaceBefore(
|
||||
Crash,
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@103-118 SpaceBefore(
|
||||
Record(
|
||||
[
|
||||
@105-116 RequiredValue(
|
||||
@105-106 "f",
|
||||
[],
|
||||
@108-116 Apply(
|
||||
@108-113 Crash,
|
||||
[
|
||||
@114-116 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
dbg 1 == 1
|
||||
|
||||
4
|
|
@ -1,24 +1,34 @@
|
|||
Dbg(
|
||||
@4-10 BinOps(
|
||||
[
|
||||
(
|
||||
@4-5 Num(
|
||||
SpaceBefore(
|
||||
SpaceAfter(
|
||||
Dbg(
|
||||
@5-11 BinOps(
|
||||
[
|
||||
(
|
||||
@5-6 Num(
|
||||
"1",
|
||||
),
|
||||
@7-9 Equals,
|
||||
),
|
||||
],
|
||||
@10-11 Num(
|
||||
"1",
|
||||
),
|
||||
@6-8 Equals,
|
||||
),
|
||||
],
|
||||
@9-10 Num(
|
||||
"1",
|
||||
),
|
||||
),
|
||||
@12-13 SpaceBefore(
|
||||
Num(
|
||||
"4",
|
||||
@13-14 SpaceBefore(
|
||||
Num(
|
||||
"4",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
dbg 1 == 1
|
||||
|
||||
4
|
||||
|
|
|
@ -1,26 +1,31 @@
|
|||
Dbg(
|
||||
@4-16 Tuple(
|
||||
[
|
||||
@5-6 Num(
|
||||
"5",
|
||||
),
|
||||
@12-15 SpaceBefore(
|
||||
Num(
|
||||
"666",
|
||||
SpaceAfter(
|
||||
Dbg(
|
||||
@4-16 Tuple(
|
||||
[
|
||||
@5-6 Num(
|
||||
"5",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
@18-19 SpaceBefore(
|
||||
Num(
|
||||
"4",
|
||||
@12-15 SpaceBefore(
|
||||
Num(
|
||||
"666",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
@18-19 SpaceBefore(
|
||||
Num(
|
||||
"4",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-3,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Annotation(
|
||||
@0-1 Identifier {
|
||||
ident: "a",
|
||||
},
|
||||
@2-3 BoundVariable(
|
||||
"b",
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@4-5 Var {
|
||||
module_name: "",
|
||||
ident: "i",
|
||||
},
|
||||
)
|
|
@ -0,0 +1,9 @@
|
|||
main =
|
||||
a = "Foo"
|
||||
Stdout.line! a
|
||||
|
||||
printBar!
|
||||
|
||||
printBar =
|
||||
b = "Bar"
|
||||
Stdout.line b
|
|
@ -0,0 +1,159 @@
|
|||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
Index(2147483649),
|
||||
],
|
||||
regions: [
|
||||
@24-150,
|
||||
@176-266,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 0, length = 2),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 2, length = 1),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@24-28 Identifier {
|
||||
ident: "main",
|
||||
},
|
||||
@59-150 SpaceBefore(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
Index(2147483649),
|
||||
],
|
||||
regions: [
|
||||
@59-68,
|
||||
@97-111,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 0, length = 1),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 1, length = 0),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@59-60 Identifier {
|
||||
ident: "a",
|
||||
},
|
||||
@63-68 Str(
|
||||
PlainLine(
|
||||
"Foo",
|
||||
),
|
||||
),
|
||||
),
|
||||
Stmt(
|
||||
@97-111 Apply(
|
||||
@97-108 TaskAwaitBang(
|
||||
Var {
|
||||
module_name: "Stdout",
|
||||
ident: "line",
|
||||
},
|
||||
),
|
||||
[
|
||||
@110-111 Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@141-150 SpaceBefore(
|
||||
TaskAwaitBang(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "printBar",
|
||||
},
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
Body(
|
||||
@176-184 Identifier {
|
||||
ident: "printBar",
|
||||
},
|
||||
@215-266 SpaceBefore(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@215-224,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@215-216 Identifier {
|
||||
ident: "b",
|
||||
},
|
||||
@219-224 Str(
|
||||
PlainLine(
|
||||
"Bar",
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@253-266 SpaceBefore(
|
||||
Apply(
|
||||
@253-264 Var {
|
||||
module_name: "Stdout",
|
||||
ident: "line",
|
||||
},
|
||||
[
|
||||
@265-266 Var {
|
||||
module_name: "",
|
||||
ident: "b",
|
||||
},
|
||||
],
|
||||
Space,
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
main =
|
||||
a = "Foo"
|
||||
Stdout.line! a
|
||||
|
||||
printBar!
|
||||
|
||||
printBar =
|
||||
b = "Bar"
|
||||
Stdout.line b
|
|
@ -1,54 +1,59 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-36,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-5 Apply(
|
||||
@0-5 Tag(
|
||||
"Email",
|
||||
),
|
||||
[
|
||||
@6-9 Identifier {
|
||||
ident: "str",
|
||||
},
|
||||
],
|
||||
),
|
||||
@12-36 Apply(
|
||||
@12-17 Tag(
|
||||
"Email",
|
||||
),
|
||||
[
|
||||
@18-36 Str(
|
||||
PlainLine(
|
||||
"blah@example.com",
|
||||
),
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-36,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-9 Apply(
|
||||
@0-5 Tag(
|
||||
"Email",
|
||||
),
|
||||
],
|
||||
Space,
|
||||
[
|
||||
@6-9 Identifier {
|
||||
ident: "str",
|
||||
},
|
||||
],
|
||||
),
|
||||
@12-36 Apply(
|
||||
@12-17 Tag(
|
||||
"Email",
|
||||
),
|
||||
[
|
||||
@18-36 Str(
|
||||
PlainLine(
|
||||
"blah@example.com",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@37-40 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "str",
|
||||
],
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
@37-40 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "str",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,40 +1,45 @@
|
|||
SpaceBefore(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@48-53,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@48-49 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@52-53 Num(
|
||||
"5",
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@48-53,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@48-49 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@52-53 Num(
|
||||
"5",
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@55-57 SpaceBefore(
|
||||
Num(
|
||||
"42",
|
||||
),
|
||||
],
|
||||
},
|
||||
@55-57 SpaceBefore(
|
||||
Num(
|
||||
"42",
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
LineComment(
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
hosted Foo exposes [] imports []
|
|
@ -1 +0,0 @@
|
|||
module []
|
|
@ -1 +0,0 @@
|
|||
package [] {}
|
|
@ -1 +0,0 @@
|
|||
platform "rtfeldman/blah" requires {} { main : {} } exposes [] packages {} imports [] provides []
|
|
@ -0,0 +1 @@
|
|||
""
|
|
@ -1,5 +1,10 @@
|
|||
Str(
|
||||
PlainLine(
|
||||
"",
|
||||
SpaceAfter(
|
||||
Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
expect
|
||||
1 == 1
|
||||
expect 1 == 1
|
||||
|
||||
4
|
|
@ -1,24 +1,50 @@
|
|||
Expect(
|
||||
@7-13 BinOps(
|
||||
[
|
||||
(
|
||||
@7-8 Num(
|
||||
"1",
|
||||
),
|
||||
@9-11 Equals,
|
||||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-13,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Expect {
|
||||
condition: @7-13 BinOps(
|
||||
[
|
||||
(
|
||||
@7-8 Num(
|
||||
"1",
|
||||
),
|
||||
@9-11 Equals,
|
||||
),
|
||||
],
|
||||
@12-13 Num(
|
||||
"1",
|
||||
),
|
||||
),
|
||||
preceding_comment: …,
|
||||
},
|
||||
],
|
||||
},
|
||||
@15-16 SpaceBefore(
|
||||
Num(
|
||||
"4",
|
||||
),
|
||||
],
|
||||
@12-13 Num(
|
||||
"1",
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
@15-16 SpaceBefore(
|
||||
Num(
|
||||
"4",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
|
@ -0,0 +1,453 @@
|
|||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-644,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 1),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Expect {
|
||||
condition: @11-644 SpaceBefore(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
Index(2147483649),
|
||||
Index(2147483650),
|
||||
],
|
||||
regions: [
|
||||
@11-118,
|
||||
@124-252,
|
||||
@258-556,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 0, length = 2),
|
||||
Slice(start = 2, length = 2),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 2, length = 0),
|
||||
Slice(start = 4, length = 0),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
Newline,
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
AnnotatedBody {
|
||||
ann_pattern: @11-15 Identifier {
|
||||
ident: "html",
|
||||
},
|
||||
ann_type: @18-25 Apply(
|
||||
"",
|
||||
"Html",
|
||||
[
|
||||
@23-25 Record {
|
||||
fields: [],
|
||||
ext: None,
|
||||
},
|
||||
],
|
||||
),
|
||||
comment: None,
|
||||
body_pattern: @30-34 Identifier {
|
||||
ident: "html",
|
||||
},
|
||||
body_expr: @45-118 SpaceBefore(
|
||||
Apply(
|
||||
@45-52 Tag(
|
||||
"Element",
|
||||
),
|
||||
[
|
||||
@53-56 Str(
|
||||
PlainLine(
|
||||
"a",
|
||||
),
|
||||
),
|
||||
@57-59 Num(
|
||||
"43",
|
||||
),
|
||||
@60-105 List(
|
||||
[
|
||||
@61-104 Apply(
|
||||
@61-69 Tag(
|
||||
"HtmlAttr",
|
||||
),
|
||||
[
|
||||
@70-76 Str(
|
||||
PlainLine(
|
||||
"href",
|
||||
),
|
||||
),
|
||||
@77-104 Str(
|
||||
PlainLine(
|
||||
"https://www.roc-lang.org/",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
],
|
||||
),
|
||||
@106-118 List(
|
||||
[
|
||||
@107-117 Apply(
|
||||
@107-111 Tag(
|
||||
"Text",
|
||||
),
|
||||
[
|
||||
@112-117 Str(
|
||||
PlainLine(
|
||||
"Roc",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
},
|
||||
AnnotatedBody {
|
||||
ann_pattern: @124-130 Identifier {
|
||||
ident: "actual",
|
||||
},
|
||||
ann_type: @133-185 Record {
|
||||
fields: [
|
||||
@135-160 RequiredValue(
|
||||
@135-140 "nodes",
|
||||
[],
|
||||
@143-160 Apply(
|
||||
"",
|
||||
"List",
|
||||
[
|
||||
@148-160 Apply(
|
||||
"",
|
||||
"RenderedNode",
|
||||
[],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@162-183 RequiredValue(
|
||||
@162-172 "siblingIds",
|
||||
[],
|
||||
@175-183 Apply(
|
||||
"",
|
||||
"List",
|
||||
[
|
||||
@180-183 Apply(
|
||||
"",
|
||||
"U64",
|
||||
[],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
ext: None,
|
||||
},
|
||||
comment: None,
|
||||
body_pattern: @190-196 Identifier {
|
||||
ident: "actual",
|
||||
},
|
||||
body_expr: @207-252 SpaceBefore(
|
||||
Apply(
|
||||
@207-217 Var {
|
||||
module_name: "",
|
||||
ident: "indexNodes",
|
||||
},
|
||||
[
|
||||
@218-247 Record(
|
||||
[
|
||||
@220-229 RequiredValue(
|
||||
@220-225 "nodes",
|
||||
[],
|
||||
@227-229 List(
|
||||
[],
|
||||
),
|
||||
),
|
||||
@231-245 RequiredValue(
|
||||
@231-241 "siblingIds",
|
||||
[],
|
||||
@243-245 List(
|
||||
[],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@248-252 Var {
|
||||
module_name: "",
|
||||
ident: "html",
|
||||
},
|
||||
],
|
||||
Space,
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
},
|
||||
AnnotatedBody {
|
||||
ann_pattern: @258-266 Identifier {
|
||||
ident: "expected",
|
||||
},
|
||||
ann_type: @269-321 Record {
|
||||
fields: [
|
||||
@271-296 RequiredValue(
|
||||
@271-276 "nodes",
|
||||
[],
|
||||
@279-296 Apply(
|
||||
"",
|
||||
"List",
|
||||
[
|
||||
@284-296 Apply(
|
||||
"",
|
||||
"RenderedNode",
|
||||
[],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@298-319 RequiredValue(
|
||||
@298-308 "siblingIds",
|
||||
[],
|
||||
@311-319 Apply(
|
||||
"",
|
||||
"List",
|
||||
[
|
||||
@316-319 Apply(
|
||||
"",
|
||||
"U64",
|
||||
[],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
ext: None,
|
||||
},
|
||||
comment: None,
|
||||
body_pattern: @326-334 Identifier {
|
||||
ident: "expected",
|
||||
},
|
||||
body_expr: @337-556 Record(
|
||||
Collection {
|
||||
items: [
|
||||
@347-524 SpaceBefore(
|
||||
RequiredValue(
|
||||
@347-352 "nodes",
|
||||
[],
|
||||
@354-524 List(
|
||||
Collection {
|
||||
items: [
|
||||
@368-386 SpaceBefore(
|
||||
Apply(
|
||||
@368-380 Tag(
|
||||
"RenderedText",
|
||||
),
|
||||
[
|
||||
@381-386 Str(
|
||||
PlainLine(
|
||||
"Roc",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
@400-513 SpaceBefore(
|
||||
Apply(
|
||||
@400-415 Tag(
|
||||
"RenderedElement",
|
||||
),
|
||||
[
|
||||
@416-419 Str(
|
||||
PlainLine(
|
||||
"a",
|
||||
),
|
||||
),
|
||||
@420-509 RecordUpdate {
|
||||
update: @422-440 Var {
|
||||
module_name: "",
|
||||
ident: "emptyRenderedAttrs",
|
||||
},
|
||||
fields: [
|
||||
@443-507 RequiredValue(
|
||||
@443-452 "htmlAttrs",
|
||||
[],
|
||||
@454-507 Apply(
|
||||
@454-467 Var {
|
||||
module_name: "Dict",
|
||||
ident: "fromList",
|
||||
},
|
||||
[
|
||||
@468-507 List(
|
||||
[
|
||||
@469-506 Tuple(
|
||||
[
|
||||
@470-476 Str(
|
||||
PlainLine(
|
||||
"href",
|
||||
),
|
||||
),
|
||||
@478-505 Str(
|
||||
PlainLine(
|
||||
"https://www.roc-lang.org/",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@510-513 List(
|
||||
[
|
||||
@511-512 Num(
|
||||
"0",
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
final_comments: [
|
||||
Newline,
|
||||
],
|
||||
},
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
@534-549 SpaceBefore(
|
||||
RequiredValue(
|
||||
@534-544 "siblingIds",
|
||||
[],
|
||||
@546-549 List(
|
||||
[
|
||||
@547-548 Num(
|
||||
"1",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
final_comments: [
|
||||
Newline,
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
@562-644 SpaceBefore(
|
||||
BinOps(
|
||||
[
|
||||
(
|
||||
@563-593 SpaceAfter(
|
||||
ParensAround(
|
||||
BinOps(
|
||||
[
|
||||
(
|
||||
@563-575 RecordAccess(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "actual",
|
||||
},
|
||||
"nodes",
|
||||
),
|
||||
@576-578 Equals,
|
||||
),
|
||||
],
|
||||
@579-593 RecordAccess(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "expected",
|
||||
},
|
||||
"nodes",
|
||||
),
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
@599-601 And,
|
||||
),
|
||||
],
|
||||
@603-643 ParensAround(
|
||||
BinOps(
|
||||
[
|
||||
(
|
||||
@603-620 RecordAccess(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "actual",
|
||||
},
|
||||
"siblingIds",
|
||||
),
|
||||
@621-623 Equals,
|
||||
),
|
||||
],
|
||||
@624-643 RecordAccess(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "expected",
|
||||
},
|
||||
"siblingIds",
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
preceding_comment: …,
|
||||
},
|
||||
],
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
expect
|
||||
html : Html {}
|
||||
html =
|
||||
Element "a" 43 [HtmlAttr "href" "https://www.roc-lang.org/"] [Text "Roc"]
|
||||
|
||||
actual : { nodes : List RenderedNode, siblingIds : List U64 }
|
||||
actual =
|
||||
indexNodes { nodes: [], siblingIds: [] } html
|
||||
|
||||
expected : { nodes : List RenderedNode, siblingIds : List U64 }
|
||||
expected = {
|
||||
nodes: [
|
||||
RenderedText "Roc",
|
||||
RenderedElement "a" { emptyRenderedAttrs & htmlAttrs: Dict.fromList [("href", "https://www.roc-lang.org/")] } [0],
|
||||
],
|
||||
siblingIds: [1],
|
||||
}
|
||||
|
||||
(actual.nodes == expected.nodes)
|
||||
&& (actual.siblingIds == expected.siblingIds)
|
|
@ -1,2 +0,0 @@
|
|||
# expecting some effects
|
||||
expect-fx 5 == 2
|
|
@ -9,12 +9,13 @@ Defs {
|
|||
Slice(start = 0, length = 1),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 1, length = 0),
|
||||
Slice(start = 1, length = 1),
|
||||
],
|
||||
spaces: [
|
||||
LineComment(
|
||||
" expecting some effects",
|
||||
),
|
||||
Newline,
|
||||
],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
|
@ -32,7 +33,7 @@ Defs {
|
|||
"2",
|
||||
),
|
||||
),
|
||||
preceding_comment: @25-25,
|
||||
preceding_comment: @0-24,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
x = 5
|
||||
|
||||
expect x == y
|
||||
|
||||
expect y == z
|
||||
|
||||
42
|
|
@ -0,0 +1,91 @@
|
|||
SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
Index(2147483649),
|
||||
Index(2147483650),
|
||||
],
|
||||
regions: [
|
||||
@0-5,
|
||||
@7-20,
|
||||
@22-35,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 0, length = 2),
|
||||
Slice(start = 2, length = 2),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 2, length = 0),
|
||||
Slice(start = 4, length = 0),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
Newline,
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-1 Identifier {
|
||||
ident: "x",
|
||||
},
|
||||
@4-5 Num(
|
||||
"5",
|
||||
),
|
||||
),
|
||||
Expect {
|
||||
condition: @14-20 BinOps(
|
||||
[
|
||||
(
|
||||
@14-15 Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
},
|
||||
@16-18 Equals,
|
||||
),
|
||||
],
|
||||
@19-20 Var {
|
||||
module_name: "",
|
||||
ident: "y",
|
||||
},
|
||||
),
|
||||
preceding_comment: @7-7,
|
||||
},
|
||||
Expect {
|
||||
condition: @29-35 BinOps(
|
||||
[
|
||||
(
|
||||
@29-30 Var {
|
||||
module_name: "",
|
||||
ident: "y",
|
||||
},
|
||||
@31-33 Equals,
|
||||
),
|
||||
],
|
||||
@34-35 Var {
|
||||
module_name: "",
|
||||
ident: "z",
|
||||
},
|
||||
),
|
||||
preceding_comment: @22-22,
|
||||
},
|
||||
],
|
||||
},
|
||||
@37-39 SpaceBefore(
|
||||
Num(
|
||||
"42",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,7 @@
|
|||
x = 5
|
||||
|
||||
expect x == y
|
||||
|
||||
expect y == z
|
||||
|
||||
42
|
|
@ -0,0 +1,6 @@
|
|||
if foo then
|
||||
x = a # 1
|
||||
x # 2
|
||||
else
|
||||
# 3
|
||||
c # 4
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue