diff --git a/compiler+runtime/src/cpp/jank/analyze/processor.cpp b/compiler+runtime/src/cpp/jank/analyze/processor.cpp index 9c8d9e0de..76342110a 100644 --- a/compiler+runtime/src/cpp/jank/analyze/processor.cpp +++ b/compiler+runtime/src/cpp/jank/analyze/processor.cpp @@ -33,18 +33,18 @@ namespace jank::analyze }; }; specials = { - { make_box("def"), make_fn(&processor::analyze_def) }, - { make_box("fn*"), make_fn(&processor::analyze_fn) }, - { make_box("recur"), make_fn(&processor::analyze_recur) }, - { make_box("do"), make_fn(&processor::analyze_do) }, - { make_box("let*"), make_fn(&processor::analyze_let) }, - { make_box("loop*"), make_fn(&processor::analyze_loop) }, - { make_box("if"), make_fn(&processor::analyze_if) }, - { make_box("quote"), make_fn(&processor::analyze_quote) }, - { make_box("var"), make_fn(&processor::analyze_var_call) }, - { make_box("throw"), make_fn(&processor::analyze_throw) }, - { make_box("try"), make_fn(&processor::analyze_try) }, - { make_box("native/raw"), make_fn(&processor::analyze_native_raw) }, + { make_box("def"), make_fn(&processor::analyze_def)}, + { make_box("fn*"), make_fn(&processor::analyze_fn)}, + { make_box("recur"), make_fn(&processor::analyze_recur)}, + { make_box("do"), make_fn(&processor::analyze_do)}, + { make_box("let*"), make_fn(&processor::analyze_let)}, + { make_box("loop*"), make_fn(&processor::analyze_loop)}, + { make_box("if"), make_fn(&processor::analyze_if)}, + { make_box("quote"), make_fn(&processor::analyze_quote)}, + { make_box("var"), make_fn(&processor::analyze_var_call)}, + { make_box("throw"), make_fn(&processor::analyze_throw)}, + { make_box("try"), make_fn(&processor::analyze_try)}, + {make_box("native/raw"), make_fn(&processor::analyze_native_raw)}, }; } @@ -154,7 +154,7 @@ namespace jank::analyze } return make_box(expr::def{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, qualified_sym, value_expr }); @@ -206,7 +206,7 @@ namespace jank::analyze } return make_box(expr::local_reference{ - expression_base{ {}, expr_type, current_frame, needs_box }, + expression_base{{}, expr_type, current_frame, needs_box}, sym, unwrapped_local.binding }); @@ -228,7 +228,7 @@ namespace jank::analyze current_frame->lift_var(qualified_sym); } return make_box(expr::var_deref{ - expression_base{ {}, expr_type, current_frame }, + expression_base{{}, expr_type, current_frame}, qualified_sym, unwrapped_var }); @@ -326,7 +326,7 @@ namespace jank::analyze fn_ctx->is_variadic = is_variadic; fn_ctx->param_count = param_symbols.size(); expr::do_ body_do{ - expression_base{ {}, expression_type::return_statement, frame } + expression_base{{}, expression_type::return_statement, frame} }; size_t const form_count{ list->count() - 1 }; size_t i{}; @@ -351,10 +351,10 @@ namespace jank::analyze } return { - expr::function_arity{ std::move(param_symbols), + expr::function_arity{std::move(param_symbols), std::move(body_do), std::move(frame), - std::move(fn_ctx) } + std::move(fn_ctx)} }; } @@ -503,7 +503,7 @@ namespace jank::analyze .to_string())))); auto ret(make_box(expr::function{ - expression_base{ {}, expr_type, current_frame }, + expression_base{{}, expr_type, current_frame}, name, unique_name, std::move(arities), @@ -578,7 +578,7 @@ namespace jank::analyze fn_ctx.unwrap()->is_tail_recursive = true; return make_box(expr::recur{ - expression_base{ {}, expr_type, current_frame }, + expression_base{{}, expr_type, current_frame}, make_box(list->data.rest()), arg_exprs }); @@ -865,7 +865,7 @@ namespace jank::analyze } return make_box(expr::if_{ - expression_base{ {}, expr_type, current_frame, needs_box }, + expression_base{{}, expr_type, current_frame, needs_box}, condition_expr.expect_ok(), then_expr.expect_ok(), else_expr_opt @@ -919,7 +919,7 @@ namespace jank::analyze } return make_box(expr::var_ref{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, qualified_sym, found_var.unwrap() }); @@ -935,7 +935,7 @@ namespace jank::analyze auto const qualified_sym( current_frame->lift_var(make_box(o->n->name->name, o->name->name))); return make_box(expr::var_ref{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, qualified_sym, o }); @@ -961,7 +961,7 @@ namespace jank::analyze } return make_box(expr::throw_{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, arg_expr.unwrap_move() }); } @@ -974,7 +974,7 @@ namespace jank::analyze native_bool const) { expr::try_ ret{ - expression_base{ {}, expr_type, current_frame } + expression_base{{}, expr_type, current_frame} }; /* Clojure JVM doesn't support recur across try/catch/finally, so we don't either. */ @@ -1166,8 +1166,8 @@ namespace jank::analyze /* Once we've found the start of an interpolation, we begin lexing/parsing at that * spot, so we can get a jank value. */ read::lex::processor l_prc{ - { code_str->data.data() + next_interp + interp_start.size(), - code_str->data.data() + code_str->data.size() } + {code_str->data.data() + next_interp + interp_start.size(), + code_str->data.data() + code_str->data.size()} }; read::parse::processor p_prc{ l_prc.begin(), l_prc.end() }; auto parsed_obj(p_prc.next()); @@ -1217,7 +1217,7 @@ namespace jank::analyze } return make_box(expr::native_raw{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, std::move(chunks) }); } @@ -1231,7 +1231,7 @@ namespace jank::analyze { current_frame->lift_constant(o); return make_box(expr::primitive_literal{ - expression_base{ {}, expr_type, current_frame, needs_box }, + expression_base{{}, expr_type, current_frame, needs_box}, o }); } @@ -1265,7 +1265,7 @@ namespace jank::analyze { /* Eval the literal to resolve exprs such as quotes. */ auto const pre_eval_expr(make_box(expr::vector{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, std::move(exprs), o->meta })); @@ -1275,13 +1275,13 @@ namespace jank::analyze current_frame->lift_constant(o); return make_box(expr::primitive_literal{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, o }); } return make_box(expr::vector{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, std::move(exprs), o->meta }); @@ -1314,7 +1314,7 @@ namespace jank::analyze /* TODO: Uniqueness check. */ return make_box(expr::map{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, std::move(exprs), o->meta }); @@ -1348,7 +1348,7 @@ namespace jank::analyze { /* Eval the literal to resolve exprs such as quotes. */ auto const pre_eval_expr(make_box(expr::set{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, std::move(exprs), o->meta })); @@ -1358,13 +1358,13 @@ namespace jank::analyze current_frame->lift_constant(o); return make_box(expr::primitive_literal{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, o }); } return make_box(expr::set{ - expression_base{ {}, expr_type, current_frame, true }, + expression_base{{}, expr_type, current_frame, true}, std::move(exprs), o->meta }); @@ -1489,7 +1489,7 @@ namespace jank::analyze } return make_box(expr::call{ - expression_base{ {}, expr_type, current_frame, needs_ret_box }, + expression_base{{}, expr_type, current_frame, needs_ret_box}, source, make_box(o->data.rest()), arg_exprs, diff --git a/compiler+runtime/src/cpp/jank/evaluate.cpp b/compiler+runtime/src/cpp/jank/evaluate.cpp index a8e1c8559..c8f3e6f65 100644 --- a/compiler+runtime/src/cpp/jank/evaluate.cpp +++ b/compiler+runtime/src/cpp/jank/evaluate.cpp @@ -52,10 +52,10 @@ namespace jank::evaluate if(exprs.empty()) { return wrap_expression(analyze::expr::primitive_literal{ - analyze::expression_base{ {}, + analyze::expression_base{{}, analyze::expression_type::return_statement, an_prc.root_frame, - true }, + true}, runtime::obj::nil::nil_const() }); } diff --git a/compiler+runtime/src/cpp/jank/read/parse.cpp b/compiler+runtime/src/cpp/jank/read/parse.cpp index a0cb7fe45..51ff0da67 100644 --- a/compiler+runtime/src/cpp/jank/read/parse.cpp +++ b/compiler+runtime/src/cpp/jank/read/parse.cpp @@ -344,9 +344,7 @@ namespace jank::read::parse ++token_current; auto const sv(boost::get(token.data)); - return object_source_info{ make_box(sv), - token, - token }; + return object_source_info{ make_box(sv), token, token }; } processor::object_result processor::parse_meta_hint() diff --git a/compiler+runtime/src/cpp/jank/runtime/util.cpp b/compiler+runtime/src/cpp/jank/runtime/util.cpp index 2a9d3de6a..74bcf844a 100644 --- a/compiler+runtime/src/cpp/jank/runtime/util.cpp +++ b/compiler+runtime/src/cpp/jank/runtime/util.cpp @@ -51,59 +51,59 @@ namespace jank::runtime } static native_unordered_map const munge_chars{ - { '-', "_" }, - { ':', "_COLON_" }, - { '+', "_PLUS_" }, - { '>', "_GT_" }, - { '<', "_LT_" }, - { '=', "_EQ_" }, - { '~', "_TILDE_" }, - { '!', "_BANG_" }, - { '@', "_CIRCA_" }, - { '#', "_SHARP_" }, - { '\'', "_SQUOTE_" }, - { '"', "_DQUOTE_" }, - { '%', "_PERC_" }, - { '^', "_CARET_" }, - { '&', "_AMP_" }, - { '*', "_STAR_" }, - { '|', "_BAR_" }, - { '{', "_LBRACE_" }, - { '}', "_RBRACE_" }, - { '[', "_LBRACK_" }, - { ']', "_RBRACK_" }, - { '/', "_SLASH_" }, - { '\\', "_BSLASH_" }, - { '?', "_QMARK_" } + { '-', "_"}, + { ':', "_COLON_"}, + { '+', "_PLUS_"}, + { '>', "_GT_"}, + { '<', "_LT_"}, + { '=', "_EQ_"}, + { '~', "_TILDE_"}, + { '!', "_BANG_"}, + { '@', "_CIRCA_"}, + { '#', "_SHARP_"}, + {'\'', "_SQUOTE_"}, + { '"', "_DQUOTE_"}, + { '%', "_PERC_"}, + { '^', "_CARET_"}, + { '&', "_AMP_"}, + { '*', "_STAR_"}, + { '|', "_BAR_"}, + { '{', "_LBRACE_"}, + { '}', "_RBRACE_"}, + { '[', "_LBRACK_"}, + { ']', "_RBRACK_"}, + { '/', "_SLASH_"}, + {'\\', "_BSLASH_"}, + { '?', "_QMARK_"} }; /* This is sorted from longest to shortest so we can check for the longest first. This * allows some entries to be prefixes of others without ambiguity. */ static native_vector> const demunge_chars{ - { "_LBRACE_", '{' }, - { "_RBRACE_", '}' }, - { "_LBRACK_", '[' }, - { "_RBRACK_", ']' }, - { "_BSLASH_", '\\' }, - { "_SQUOTE_", '\'' }, - { "_DQUOTE_", '"' }, - { "_QMARK_", '?' }, - { "_COLON_", ':' }, - { "_TILDE_", '~' }, - { "_CIRCA_", '@' }, - { "_SHARP_", '#' }, - { "_CARET_", '^' }, - { "_SLASH_", '/' }, - { "_PERC_", '%' }, - { "_PLUS_", '+' }, - { "_BANG_", '!' }, - { "_STAR_", '*' }, - { "_AMP_", '&' }, - { "_BAR_", '|' }, - { "_GT_", '>' }, - { "_LT_", '<' }, - { "_EQ_", '=' }, - { "_", '-' }, + {"_LBRACE_", '{'}, + {"_RBRACE_", '}'}, + {"_LBRACK_", '['}, + {"_RBRACK_", ']'}, + {"_BSLASH_", '\\'}, + {"_SQUOTE_", '\''}, + {"_DQUOTE_", '"'}, + { "_QMARK_", '?'}, + { "_COLON_", ':'}, + { "_TILDE_", '~'}, + { "_CIRCA_", '@'}, + { "_SHARP_", '#'}, + { "_CARET_", '^'}, + { "_SLASH_", '/'}, + { "_PERC_", '%'}, + { "_PLUS_", '+'}, + { "_BANG_", '!'}, + { "_STAR_", '*'}, + { "_AMP_", '&'}, + { "_BAR_", '|'}, + { "_GT_", '>'}, + { "_LT_", '<'}, + { "_EQ_", '='}, + { "_", '-'}, }; /* https://en.cppreference.com/w/cpp/keyword */ diff --git a/compiler+runtime/test/cpp/jank/read/lex.cpp b/compiler+runtime/test/cpp/jank/read/lex.cpp index f24d0363a..1917f0e9b 100644 --- a/compiler+runtime/test/cpp/jank/read/lex.cpp +++ b/compiler+runtime/test/cpp/jank/read/lex.cpp @@ -117,7 +117,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 1, token_kind::comment, ""sv } + {0, 1, token_kind::comment, ""sv} })); } @@ -127,8 +127,8 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 1, token_kind::comment, ""sv }, - { 2, 1, token_kind::comment, ""sv } + {0, 1, token_kind::comment, ""sv}, + {2, 1, token_kind::comment, ""sv} })); } @@ -138,7 +138,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 12, token_kind::comment, " Hello hello"sv } + {0, 12, token_kind::comment, " Hello hello"sv} })); } @@ -148,7 +148,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 22, token_kind::comment, " Hello hello ; \"hi hi\""sv } + {0, 22, token_kind::comment, " Hello hello ; \"hi hi\""sv} })); } @@ -158,7 +158,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 17, token_kind::comment, " Hello hello 12"sv } + {0, 17, token_kind::comment, " Hello hello 12"sv} })); } @@ -168,9 +168,9 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 1, token_kind::integer, 1ll }, - { 2, 1, token_kind::integer, 2ll }, - { 4, 5, token_kind::comment, " meow"sv } + {0, 1, token_kind::integer, 1ll}, + {2, 1, token_kind::integer, 2ll}, + {4, 5, token_kind::comment, " meow"sv} })); } @@ -180,9 +180,9 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 1, token_kind::integer, 1ll }, - { 2, 5, token_kind::comment, " meow"sv }, - { 9, 1, token_kind::integer, 2ll } + {0, 1, token_kind::integer, 1ll}, + {2, 5, token_kind::comment, " meow"sv}, + {9, 1, token_kind::integer, 2ll} })); } } @@ -195,8 +195,8 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::open_paren }, - { 1, token_kind::close_paren } + {0, token_kind::open_paren}, + {1, token_kind::close_paren} })); } @@ -206,10 +206,10 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::open_paren }, - { 1, token_kind::open_paren }, - { 2, token_kind::close_paren }, - { 3, token_kind::close_paren } + {0, token_kind::open_paren}, + {1, token_kind::open_paren}, + {2, token_kind::close_paren}, + {3, token_kind::close_paren} })); } @@ -221,7 +221,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::open_paren } + {0, token_kind::open_paren} })); } @@ -231,7 +231,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::close_paren } + {0, token_kind::close_paren} })); } } @@ -245,8 +245,8 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::open_square_bracket }, - { 1, token_kind::close_square_bracket } + {0, token_kind::open_square_bracket}, + {1, token_kind::close_square_bracket} })); } @@ -256,10 +256,10 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::open_square_bracket }, - { 1, token_kind::open_square_bracket }, - { 2, token_kind::close_square_bracket }, - { 3, token_kind::close_square_bracket } + {0, token_kind::open_square_bracket}, + {1, token_kind::open_square_bracket}, + {2, token_kind::close_square_bracket}, + {3, token_kind::close_square_bracket} })); } @@ -290,7 +290,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::open_square_bracket } + {0, token_kind::open_square_bracket} })); } @@ -300,7 +300,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::close_square_bracket } + {0, token_kind::close_square_bracket} })); } } @@ -314,7 +314,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 3, token_kind::nil } + {0, 3, token_kind::nil} })); } @@ -324,7 +324,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 4, token_kind::symbol, "nili"sv } + {0, 4, token_kind::symbol, "nili"sv} })); } @@ -334,7 +334,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 4, token_kind::symbol, "onil"sv } + {0, 4, token_kind::symbol, "onil"sv} })); } } @@ -347,8 +347,8 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 4, token_kind::boolean, true }, - { 5, 5, token_kind::boolean, false } + {0, 4, token_kind::boolean, true}, + {5, 5, token_kind::boolean, false} })); } @@ -358,8 +358,8 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 5, token_kind::symbol, "true-"sv }, - { 6, 6, token_kind::symbol, "falsey"sv } + {0, 5, token_kind::symbol, "true-"sv}, + {6, 6, token_kind::symbol, "falsey"sv} })); } @@ -369,8 +369,8 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 6, token_kind::symbol, "sotrue"sv }, - { 7, 6, token_kind::symbol, "ffalse"sv } + {0, 6, token_kind::symbol, "sotrue"sv}, + {7, 6, token_kind::symbol, "ffalse"sv} })); } } @@ -383,7 +383,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::integer, 0ll } + {0, token_kind::integer, 0ll} })); } @@ -393,7 +393,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 4, token_kind::integer, 1234ll } + {0, 4, token_kind::integer, 1234ll} })); } @@ -403,7 +403,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::integer, -1ll } + {0, 2, token_kind::integer, -1ll} })); } @@ -413,7 +413,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 5, token_kind::integer, -1234ll } + {0, 5, token_kind::integer, -1234ll} })); } @@ -453,7 +453,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::real, 0.0l } + {0, 2, token_kind::real, 0.0l} })); } @@ -463,7 +463,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 3, token_kind::real, 0.0l } + {0, 3, token_kind::real, 0.0l} })); } @@ -473,7 +473,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 3, token_kind::real, -1.0l } + {0, 3, token_kind::real, -1.0l} })); } @@ -483,7 +483,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 4, token_kind::real, -1.5l } + {0, 4, token_kind::real, -1.5l} })); } @@ -493,7 +493,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 10, token_kind::real, -1234.1234l } + {0, 10, token_kind::real, -1234.1234l} })); } @@ -606,7 +606,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::character, "\\a"sv } + {0, 2, token_kind::character, "\\a"sv} })); } @@ -616,7 +616,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::character, "\\1"sv } + {0, 2, token_kind::character, "\\1"sv} })); } @@ -648,10 +648,10 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::character, "\\1"sv }, - { 3, 8, token_kind::character, "\\newline"sv }, - { 11, 2, token_kind::character, "\\'"sv }, - { 14, 2, token_kind::character, "\\\\"sv } + { 0, 2, token_kind::character, "\\1"sv}, + { 3, 8, token_kind::character, "\\newline"sv}, + {11, 2, token_kind::character, "\\'"sv}, + {14, 2, token_kind::character, "\\\\"sv} })); } @@ -676,7 +676,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::symbol, "a"sv } + {0, token_kind::symbol, "a"sv} })); } @@ -686,7 +686,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 3, token_kind::symbol, "abc"sv } + {0, 3, token_kind::symbol, "abc"sv} })); } @@ -696,7 +696,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::symbol, "/"sv } + {0, token_kind::symbol, "/"sv} })); } @@ -706,7 +706,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_results({ - error{ 0, "invalid symbol" }, + error{0, "invalid symbol"}, })); } @@ -716,7 +716,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_results({ - error{ 0, "invalid symbol" }, + error{0, "invalid symbol"}, })); } @@ -726,7 +726,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 6, token_kind::symbol, "abc123"sv } + {0, 6, token_kind::symbol, "abc123"sv} })); } @@ -736,7 +736,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 22, token_kind::symbol, "abc_.123/-foo+?=!&<>#%"sv } + {0, 22, token_kind::symbol, "abc_.123/-foo+?=!&<>#%"sv} })); } @@ -746,7 +746,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, token_kind::symbol, "-"sv } + {0, token_kind::symbol, "-"sv} })); } @@ -756,7 +756,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 5, token_kind::symbol, "-main"sv } + {0, 5, token_kind::symbol, "-main"sv} })); } @@ -780,7 +780,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::keyword, "a"sv } + {0, 2, token_kind::keyword, "a"sv} })); } @@ -790,7 +790,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 4, token_kind::keyword, "abc"sv } + {0, 4, token_kind::keyword, "abc"sv} })); } @@ -800,7 +800,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_results({ - error{ 0, "invalid keyword: expected non-whitespace character after :" } + error{0, "invalid keyword: expected non-whitespace character after :"} })); } @@ -810,7 +810,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::keyword, "/"sv } + {0, 2, token_kind::keyword, "/"sv} })); } @@ -820,7 +820,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_results({ - error{ 0, "invalid keyword: starts with /" }, + error{0, "invalid keyword: starts with /"}, })); } @@ -830,7 +830,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_results({ - error{ 0, "invalid keyword: starts with /" }, + error{0, "invalid keyword: starts with /"}, })); } @@ -840,7 +840,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 7, token_kind::keyword, "abc123"sv } + {0, 7, token_kind::keyword, "abc123"sv} })); } @@ -850,7 +850,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 21, token_kind::keyword, "abc_.123/-foo+?=!&<>"sv } + {0, 21, token_kind::keyword, "abc_.123/-foo+?=!&<>"sv} })); } @@ -860,7 +860,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 9, token_kind::keyword, ":foo-bar"sv } + {0, 9, token_kind::keyword, ":foo-bar"sv} })); } @@ -870,7 +870,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 9, token_kind::keyword, ":foo/bar"sv } + {0, 9, token_kind::keyword, ":foo/bar"sv} })); } @@ -907,7 +907,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::string, ""sv } + {0, 2, token_kind::string, ""sv} })); } SUBCASE("Single-char") @@ -916,7 +916,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 3, token_kind::string, "a"sv } + {0, 3, token_kind::string, "a"sv} })); } @@ -926,7 +926,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 5, token_kind::string, "abc"sv } + {0, 5, token_kind::string, "abc"sv} })); } @@ -936,7 +936,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 5, token_kind::string, "123"sv } + {0, 5, token_kind::string, "123"sv} })); } @@ -946,7 +946,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 40, token_kind::string, "and then() there was abc_123/-foo?!&<>"sv } + {0, 40, token_kind::string, "and then() there was abc_123/-foo?!&<>"sv} })); } @@ -956,7 +956,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 15, token_kind::string, "foo\nbar\nspam\t"sv } + {0, 15, token_kind::string, "foo\nbar\nspam\t"sv} })); } @@ -966,7 +966,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 20, token_kind::escaped_string, "foo\\\"\\nbar\\nspam\\t"sv } + {0, 20, token_kind::escaped_string, "foo\\\"\\nbar\\nspam\\t"sv} })); } @@ -976,7 +976,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_results({ - error{ 0, "unterminated string" }, + error{0, "unterminated string"}, })); } } @@ -989,7 +989,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 1, token_kind::meta_hint } + {0, 1, token_kind::meta_hint} })); } @@ -1013,7 +1013,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 1, token_kind::reader_macro } + {0, 1, token_kind::reader_macro} })); } @@ -1025,7 +1025,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::reader_macro_comment } + {0, 2, token_kind::reader_macro_comment} })); } @@ -1035,9 +1035,9 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::reader_macro_comment }, - { 2, 1, token_kind::open_square_bracket }, - { 3, 1, token_kind::close_square_bracket } + {0, 2, token_kind::reader_macro_comment}, + {2, 1, token_kind::open_square_bracket}, + {3, 1, token_kind::close_square_bracket} })); } } @@ -1050,7 +1050,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::reader_macro_conditional } + {0, 2, token_kind::reader_macro_conditional} })); } @@ -1060,9 +1060,9 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::reader_macro_conditional }, - { 2, 1, token_kind::open_paren }, - { 3, 1, token_kind::close_paren } + {0, 2, token_kind::reader_macro_conditional}, + {2, 1, token_kind::open_paren}, + {3, 1, token_kind::close_paren} })); } } @@ -1075,9 +1075,9 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 1, token_kind::reader_macro }, - { 1, 1, token_kind::open_curly_bracket }, - { 2, 1, token_kind::close_curly_bracket } + {0, 1, token_kind::reader_macro}, + {1, 1, token_kind::open_curly_bracket}, + {2, 1, token_kind::close_curly_bracket} })); } @@ -1089,9 +1089,9 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 1, token_kind::reader_macro }, - { 2, 1, token_kind::open_curly_bracket }, - { 3, 1, token_kind::close_curly_bracket } + {0, 1, token_kind::reader_macro}, + {2, 1, token_kind::open_curly_bracket}, + {3, 1, token_kind::close_curly_bracket} })); } } @@ -1105,7 +1105,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 1, token_kind::syntax_quote } + {0, 1, token_kind::syntax_quote} })); } @@ -1128,7 +1128,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 1, token_kind::unquote } + {0, 1, token_kind::unquote} })); } @@ -1152,7 +1152,7 @@ namespace jank::read::lex native_vector> tokens(p.begin(), p.end()); CHECK(tokens == make_tokens({ - { 0, 2, token_kind::unquote_splice } + {0, 2, token_kind::unquote_splice} })); }