We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e0cefe4 (latest nightly)
Linux Nopilot 5.15.167.4-microsoft-standard-WSL2 # 1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Oddly I get this error after the tests have already passed. The same example seems to work fine when run from a main instead of test.
0 failed and 3 passed in 200 ms. malloc_consolidate(): unaligned fastbin chunk detected (long pause) Aborted (core dumped)
This is part of a lisp interpreter, trimed down to reproduce the bug.
app [main!] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.19.0/Hj-J_zxz7V9YurCSTFcFdu6cQJie4guzsPMUi5kBYUk.tar.br", } import pf.Stdout import pf.Arg tokenize = |s| s |> Str.replace_each("(", " ( ") |> Str.replace_each(")", " ) ") |> Str.split_on(" ") |> List.drop_if(|e| e == "") expect tokenize("(1 2(3))") == ["(", "1", "2", "(", "3", ")", ")"] Ast : [AtomNode Str, ListNode (List Ast)] ReadErr : [MissingCloseParen, UnexpectedCloseParen] read_from_tokens : List Str -> Result (List Ast) ReadErr read_from_tokens = |tokens| if tokens == [] then Ok([]) else when read_once_from_tokens(tokens) is Ok((ast, more_tokens)) -> when read_from_tokens(more_tokens) is Ok(more_asts) -> Ok(List.prepend(more_asts, ast)) Err(err) -> Err(err) Err(err) -> Err(err) expect read_from_tokens(tokenize("(1 2(3))")) == Ok([ListNode([AtomNode("1"), AtomNode("2"), ListNode([AtomNode("3")])])]) read_once_from_tokens : List Str -> Result (Ast, List Str) ReadErr read_once_from_tokens = |tokens| when tokens is [] -> Ok((AtomNode("Nil"), [])) ["(", .. as rest] -> read_list_from_tokens(rest, []) [")", ..] -> Err(UnexpectedCloseParen) [atom, .. as rest] -> Ok((AtomNode(atom), rest)) read_list_from_tokens : List Str, List Ast -> Result ([ListNode (List Ast)], List Str) ReadErr read_list_from_tokens = |tokens, acc| when tokens is [] -> Err(MissingCloseParen) [")", .. as rest] -> Ok((ListNode(acc), rest)) ["(", .. as rest] -> when read_list_from_tokens(rest, []) is Ok((list_node, next_rest)) -> read_list_from_tokens(next_rest, List.append(acc, list_node)) Err(err) -> Err(err) [atom, .. as rest] -> next_acc = List.concat(acc, [AtomNode(atom)]) read_list_from_tokens(rest, next_acc) main! : List Arg.Arg => Result {} [Exit I32 Str]_ main! = |_args| Stdout.write!("Hello") expect str = "((lambda (b) b) 1)" read_result = str |> tokenize |> read_from_tokens dbg read_result Bool.true
The text was updated successfully, but these errors were encountered:
expect
Thanks for the compact reproduction @raymyers! This is very likely #7799, please follow that issue for updates.
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Roc version
e0cefe4 (latest nightly)
OS
Linux Nopilot 5.15.167.4-microsoft-standard-WSL2 # 1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Error
Oddly I get this error after the tests have already passed. The same example seems to work fine when run from a main instead of test.
Program
This is part of a lisp interpreter, trimed down to reproduce the bug.
The text was updated successfully, but these errors were encountered: