From f1f7b0aecd471c2c7014ed6f3137e911adc2e75d Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Sat, 23 Dec 2023 10:54:33 +0100 Subject: [PATCH 1/6] Add structured output tests --- .../StructuredOutputTests.generated.fs | 507 ++++++++++++++++++ tests/Visp.Compiler.UnitTests/TestUtils.fs | 84 ++- .../Visp.Compiler.UnitTests.fsproj | 1 + ...ays_array-0.structured output.verified.txt | 38 ++ ...s_array2d-0.structured output.verified.txt | 120 +++++ ...s_array2d-1.structured output.verified.txt | 43 ++ ...atom_atom-0.structured output.verified.txt | 57 ++ ...ttributes-0.structured output.verified.txt | 46 ++ ...cros_cond-0.structured output.verified.txt | 27 + ...ead-first-0.structured output.verified.txt | 19 + ...ead-first-1.structured output.verified.txt | 38 ++ ...read-last-0.structured output.verified.txt | 65 +++ ...xpr_cexpr-0.structured output.verified.txt | 27 + ...xpr_cexpr-1.structured output.verified.txt | 50 ++ ...hars_char-0.structured output.verified.txt | 45 ++ ...hars_char-1.structured output.verified.txt | 36 ++ ...hars_char-2.structured output.verified.txt | 21 + ...ions_list-0.structured output.verified.txt | 37 ++ ...-shorthands.structured output.verified.txt | 63 +++ ...s_example-0.structured output.verified.txt | 29 + ...s_example-1.structured output.verified.txt | 101 ++++ ..._example-10.structured output.verified.txt | 39 ++ ..._example-11.structured output.verified.txt | 46 ++ ..._example-12.structured output.verified.txt | 56 ++ ..._example-13.structured output.verified.txt | 57 ++ ..._example-14.structured output.verified.txt | 83 +++ ..._example-15.structured output.verified.txt | 39 ++ ..._example-16.structured output.verified.txt | 61 +++ ..._example-17.structured output.verified.txt | 35 ++ ...s_example-2.structured output.verified.txt | 29 + ...s_example-3.structured output.verified.txt | 32 ++ ...s_example-4.structured output.verified.txt | 56 ++ ...s_example-5.structured output.verified.txt | 153 ++++++ ...s_example-6.structured output.verified.txt | 27 + ...s_example-7.structured output.verified.txt | 46 ++ ...s_example-8.structured output.verified.txt | 45 ++ ...s_example-9.structured output.verified.txt | 69 +++ ...variables-0.structured output.verified.txt | 48 ++ ...in_for-in-0.structured output.verified.txt | 23 + ...in_for-in-1.structured output.verified.txt | 28 + ...in_for-in-2.structured output.verified.txt | 28 + ...in_for-in-3.structured output.verified.txt | 28 + ...in_for-in-4.structured output.verified.txt | 32 ++ ...to_for-to-0.structured output.verified.txt | 112 ++++ ...thod-args-0.structured output.verified.txt | 379 +++++++++++++ ...p_hashmap-0.structured output.verified.txt | 55 ++ ...t_hashset-0.structured output.verified.txt | 35 ++ ...sts_if_if-0.structured output.verified.txt | 30 ++ ...d-example-0.structured output.verified.txt | 115 ++++ ...-in-macro-0.structured output.verified.txt | 33 ++ ...in-macros-0.structured output.verified.txt | 69 +++ ...ond-macro-0.structured output.verified.txt | 57 ++ ...ond-macro-1.structured output.verified.txt | 123 +++++ ...unt-exprs-0.structured output.verified.txt | 56 ++ ...shorthand-0.structured output.verified.txt | 64 +++ ..._my-rinit-0.structured output.verified.txt | 81 +++ ...expansion-0.structured output.verified.txt | 189 +++++++ ...expansion-1.structured output.verified.txt | 325 +++++++++++ ...r-example-0.structured output.verified.txt | 170 ++++++ ...t-example-1.structured output.verified.txt | 232 ++++++++ ...uct-macro-0.structured output.verified.txt | 108 ++++ ...uct-macro-2.structured output.verified.txt | 172 ++++++ ...uct-macro-3.structured output.verified.txt | 182 +++++++ ...tax-macro-0.structured output.verified.txt | 94 ++++ ...tax-macro-2.structured output.verified.txt | 112 ++++ ..._up-macro-0.structured output.verified.txt | 37 ++ ...s-example-0.structured output.verified.txt | 85 +++ ...ile-match-0.structured output.verified.txt | 79 +++ ...mbers_int-0.structured output.verified.txt | 28 + ...uple-args-0.structured output.verified.txt | 45 ++ ...shorthand-0.structured output.verified.txt | 25 + ..._let-values.structured output.verified.txt | 39 ++ ...ing_match-0.structured output.verified.txt | 217 ++++++++ ...ing_match-1.structured output.verified.txt | 139 +++++ ...operators-0.structured output.verified.txt | 112 ++++ ...rsing_props.structured output.verified.txt | 19 + ...s-generic-0.structured output.verified.txt | 109 ++++ ...-to-int32-0.structured output.verified.txt | 53 ++ ...g_strings-0.structured output.verified.txt | 69 +++ ...g_strings-1.structured output.verified.txt | 213 ++++++++ ...rpolation-0.structured output.verified.txt | 60 +++ ...rpolation-1.structured output.verified.txt | 26 + ...-in-macro-0.structured output.verified.txt | 58 ++ ...ing_tuple-0.structured output.verified.txt | 35 ++ ...s_pats_fn-0.structured output.verified.txt | 192 +++++++ ...s_pats_fn-1.structured output.verified.txt | 56 ++ ..._pats_let-0.structured output.verified.txt | 109 ++++ ...ion_quote-0.structured output.verified.txt | 138 +++++ ...omparison-0.structured output.verified.txt | 298 ++++++++++ ...member-fn-0.structured output.verified.txt | 58 ++ ...r-get-set-0.structured output.verified.txt | 166 ++++++ ...pe_record-0.structured output.verified.txt | 77 +++ ...pe_record-1.structured output.verified.txt | 176 ++++++ ...pe_record-2.structured output.verified.txt | 78 +++ ...pe_record-3.structured output.verified.txt | 68 +++ ...pe_record-4.structured output.verified.txt | 55 ++ ...type_type-0.structured output.verified.txt | 46 ++ ...ype-alias-0.structured output.verified.txt | 49 ++ ...ype_union-0.structured output.verified.txt | 134 +++++ ...or_vector-0.structured output.verified.txt | 47 ++ ...ile_while-0.structured output.verified.txt | 60 +++ ...ile_while-1.structured output.verified.txt | 98 ++++ visp/utils/test-generator.visp | 94 ++-- 103 files changed, 8685 insertions(+), 69 deletions(-) create mode 100644 tests/Visp.Compiler.UnitTests/StructuredOutputTests.generated.fs create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_atom_atom-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_attributes_attributes-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_cond-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-last-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-2.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_collections_list-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_dot_dot-shorthands.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-10.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-11.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-12.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-13.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-14.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-15.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-16.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-17.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-2.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-3.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-4.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-5.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-6.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-7.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-8.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-9.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_variables-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-2.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-3.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-4.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-to_for-to-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_functions_apply-method-args-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashmap_hashmap-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashset_hashset-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_if_if-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_and-example-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_bar-parens-in-macro-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_chars-in-macros-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_count-exprs-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_macro-lambda-shorthand-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_my-rinit-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_or-example-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-example-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-2.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-3.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-2.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_up-macro-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_when-unless-example-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_while-match-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_numbers_int-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_call-tuple-args-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_lambda-shorthand-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_let-values.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_operators-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_props.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_seq-as-generic-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_span-to-int32-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_sym-with-arrow-in-macro-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_tuple-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_let-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_quotation_quote-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_custom-comparison-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-fn-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-get-set-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-1.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-2.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-3.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-4.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-alias-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_union-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_vector_vector-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-0.structured output.verified.txt create mode 100644 tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-1.structured output.verified.txt diff --git a/tests/Visp.Compiler.UnitTests/StructuredOutputTests.generated.fs b/tests/Visp.Compiler.UnitTests/StructuredOutputTests.generated.fs new file mode 100644 index 0000000..0113775 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/StructuredOutputTests.generated.fs @@ -0,0 +1,507 @@ +// Copyright 2023 Ville Penttinen +// Distributed under the MIT License. +// https://github.com/vipentti/visp-fs/blob/main/LICENSE.md + +// AUTO GENERATED +// DO NOT MODIFY BY HAND +// generated by test-generator.visp + +namespace StructuredOutputTests + +open Xunit + +[] +module ``tests_while_while-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/while/while-1.visp" + +[] +module ``tests_while_while-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/while/while-0.visp" + +[] +module ``tests_for-to_for-to-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/for-to/for-to-0.visp" + +[] +module ``tests_dot_dot-shorthands`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/dot/dot-shorthands.visp" + +[] +module ``tests_pats_fn-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/pats/fn-1.visp" + +[] +module ``tests_pats_fn-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/pats/fn-0.visp" + +[] +module ``tests_pats_let-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/pats/let-0.visp" + +[] +module ``tests_type_member-get-set-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/type/member-get-set-0.visp" + +[] +module ``tests_type_type-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/type/type-0.visp" + +[] +module ``tests_type_custom-comparison-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/type/custom-comparison-0.visp" + +[] +module ``tests_type_record-2`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/type/record-2.visp" + +[] +module ``tests_type_member-fn-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/type/member-fn-0.visp" + +[] +module ``tests_type_union-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/type/union-0.visp" + +[] +module ``tests_type_record-3`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/type/record-3.visp" + +[] +module ``tests_type_type-alias-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/type/type-alias-0.visp" + +[] +module ``tests_type_record-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/type/record-1.visp" + +[] +module ``tests_type_record-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/type/record-0.visp" + +[] +module ``tests_type_record-4`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/type/record-4.visp" + +[] +module ``tests_functions_apply-method-args-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/functions/apply-method-args-0.visp" + +[] +module ``tests_hashset_hashset-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/hashset/hashset-0.visp" + +[] +module ``tests_parsing_strings-interpolation-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/strings-interpolation-0.visp" + +[] +module ``tests_parsing_strings-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/strings-1.visp" + +[] +module ``tests_parsing_match-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/match-0.visp" + +[] +module ``tests_parsing_sym-with-arrow-in-macro-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/sym-with-arrow-in-macro-0.visp" + +[] +module ``tests_parsing_tuple-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/tuple-0.visp" + +[] +module ``tests_parsing_strings-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/strings-0.visp" + +[] +module ``tests_parsing_lambda-shorthand-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/lambda-shorthand-0.visp" + +[] +module ``tests_parsing_strings-interpolation-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/strings-interpolation-1.visp" + +[] +module ``tests_parsing_props`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/props.visp" + +[] +module ``tests_parsing_operators-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/operators-0.visp" + +[] +module ``tests_parsing_call-tuple-args-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/call-tuple-args-0.visp" + +[] +module ``tests_parsing_span-to-int32-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/span-to-int32-0.visp" + +[] +module ``tests_parsing_let-values`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/let-values.visp" + +[] +module ``tests_parsing_match-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/match-1.visp" + +[] +module ``tests_parsing_seq-as-generic-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/parsing/seq-as-generic-0.visp" + +[] +module ``tests_arrays_array2d-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/arrays/array2d-0.visp" + +[] +module ``tests_arrays_array2d-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/arrays/array2d-1.visp" + +[] +module ``tests_arrays_array-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/arrays/array-0.visp" + +[] +module ``tests_atom_atom-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/atom/atom-0.visp" + +[] +module ``tests_vector_vector-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/vector/vector-0.visp" + +[] +module ``tests_numbers_int-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/numbers/int-0.visp" + +[] +module ``tests_collections_list-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/collections/list-0.visp" + +[] +module ``tests_chars_char-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/chars/char-1.visp" + +[] +module ``tests_chars_char-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/chars/char-0.visp" + +[] +module ``tests_chars_char-2`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/chars/char-2.visp" + +[] +module ``tests_hashmap_hashmap-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/hashmap/hashmap-0.visp" + +[] +module ``tests_cexpr_cexpr-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/cexpr/cexpr-0.visp" + +[] +module ``tests_cexpr_cexpr-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/cexpr/cexpr-1.visp" + +[] +module ``tests_for-in_for-in-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/for-in/for-in-0.visp" + +[] +module ``tests_for-in_for-in-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/for-in/for-in-1.visp" + +[] +module ``tests_for-in_for-in-2`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/for-in/for-in-2.visp" + +[] +module ``tests_for-in_for-in-4`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/for-in/for-in-4.visp" + +[] +module ``tests_for-in_for-in-3`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/for-in/for-in-3.visp" + +[] +module ``tests_attributes_attributes-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/attributes/attributes-0.visp" + +[] +module ``tests_if_if-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/if/if-0.visp" + +[] +module ``tests_quotation_quote-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/quotation/quote-0.visp" + +[] +module ``tests_builtin-macros_thread-first-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/builtin-macros/thread-first-1.visp" + +[] +module ``tests_builtin-macros_thread-first-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/builtin-macros/thread-first-0.visp" + +[] +module ``tests_builtin-macros_thread-last-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/builtin-macros/thread-last-0.visp" + +[] +module ``tests_builtin-macros_cond-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/builtin-macros/cond-0.visp" + +[] +module ``tests_macros_up-macro-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/up-macro-0.visp" + +[] +module ``tests_macros_nested-macro-expansion-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/nested-macro-expansion-0.visp" + +[] +module ``tests_macros_struct-example-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/struct-example-1.visp" + +[] +module ``tests_macros_bar-parens-in-macro-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/bar-parens-in-macro-0.visp" + +[] +module ``tests_macros_count-exprs-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/count-exprs-0.visp" + +[] +module ``tests_macros_syntax-macro-2`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/syntax-macro-2.visp" + +[] +module ``tests_macros_syntax-macro-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/syntax-macro-0.visp" + +[] +module ``tests_macros_nested-macro-expansion-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/nested-macro-expansion-1.visp" + +[] +module ``tests_macros_cond-macro-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/cond-macro-1.visp" + +[] +module ``tests_macros_struct-macro-2`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/struct-macro-2.visp" + +[] +module ``tests_macros_chars-in-macros-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/chars-in-macros-0.visp" + +[] +module ``tests_macros_when-unless-example-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/when-unless-example-0.visp" + +[] +module ``tests_macros_cond-macro-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/cond-macro-0.visp" + +[] +module ``tests_macros_struct-macro-3`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/struct-macro-3.visp" + +[] +module ``tests_macros_my-rinit-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/my-rinit-0.visp" + +[] +module ``tests_macros_macro-lambda-shorthand-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/macro-lambda-shorthand-0.visp" + +[] +module ``tests_macros_struct-macro-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/struct-macro-0.visp" + +[] +module ``tests_macros_and-example-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/and-example-0.visp" + +[] +module ``tests_macros_while-match-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/while-match-0.visp" + +[] +module ``tests_macros_or-example-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/macros/or-example-0.visp" + +[] +module ``tests_examples_example-4`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-4.visp" + +[] +module ``tests_examples_example-11`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-11.visp" + +[] +module ``tests_examples_example-3`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-3.visp" + +[] +module ``tests_examples_example-9`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-9.visp" + +[] +module ``tests_examples_example-10`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-10.visp" + +[] +module ``tests_examples_example-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-0.visp" + +[] +module ``tests_examples_example-15`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-15.visp" + +[] +module ``tests_examples_example-16`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-16.visp" + +[] +module ``tests_examples_example-1`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-1.visp" + +[] +module ``tests_examples_variables-0`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/variables-0.visp" + +[] +module ``tests_examples_example-7`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-7.visp" + +[] +module ``tests_examples_example-2`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-2.visp" + +[] +module ``tests_examples_example-13`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-13.visp" + +[] +module ``tests_examples_example-14`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-14.visp" + +[] +module ``tests_examples_example-6`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-6.visp" + +[] +module ``tests_examples_example-8`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-8.visp" + +[] +module ``tests_examples_example-12`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-12.visp" + +[] +module ``tests_examples_example-17`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-17.visp" + +[] +module ``tests_examples_example-5`` = + [] + let ``structured output`` () = TestUtils.runStructuredOutputTest "tests/examples/example-5.visp" + diff --git a/tests/Visp.Compiler.UnitTests/TestUtils.fs b/tests/Visp.Compiler.UnitTests/TestUtils.fs index c29b81b..14eedd1 100644 --- a/tests/Visp.Compiler.UnitTests/TestUtils.fs +++ b/tests/Visp.Compiler.UnitTests/TestUtils.fs @@ -30,33 +30,63 @@ let parseCoreLibs () = with :? ParseHelpers.SyntaxError as syn -> raise (LexHelpers.syntaxErrorToParseError syn) -let runTest (name: string) = - parseCoreLibs () - let path = getVispFilePath name - let fileName = Path.GetFileName path +let inline private verify (out: string) dir (param: string) = + async { + let task = + Verifier + .Verify(out) + .UseDirectory(dir) + .DisableDiff() + .UseParameters(param) + .ToTask() - let filePathToReplace = - Path.GetDirectoryName path |> Path.TrimEndingDirectorySeparator + return! (task |> Async.AwaitTask) + } - try - let parsed = CoreParser.parseFile path true - - use stream = new StringWriter() - CoreParser.writeToStreamNew parsed stream fileName - - let output = - stream - .ToString() - .Replace(filePathToReplace + "/", "") - .Replace(filePathToReplace + "\\", "") - - Verifier - .Verify(output) - .UseDirectory("snapshots") - .DisableDiff() - .UseParameters(name.Replace('/', '_').Replace('\\', '_')) - .ToTask() - |> Async.AwaitTask - with :? ParseHelpers.SyntaxError as syn -> - raise (LexHelpers.syntaxErrorToParseError syn) +let runStructuredOutputTest (name: string) = + async { + parseCoreLibs () + let path = getVispFilePath name + + try + let parsed = CoreParser.parseFile path true + + let nameParam = name.Replace('/', '_').Replace('\\', '_') + + return! verify (sprintf "%A" parsed) "parsing-snapshots" nameParam + with :? ParseHelpers.SyntaxError as syn -> + return raise <| (LexHelpers.syntaxErrorToParseError syn) + } + +let runWriteTest (name: string) = + async { + parseCoreLibs () + + let path = getVispFilePath name + let fileName = Path.GetFileName path + + let filePathToReplace = + Path.GetDirectoryName path |> Path.TrimEndingDirectorySeparator + + try + let parsed = CoreParser.parseFile path true + + use stream = new StringWriter() + CoreParser.writeToStreamNew parsed stream fileName + + let output = + stream + .ToString() + .Replace(filePathToReplace + "/", "") + .Replace(filePathToReplace + "\\", "") + + let nameParam = name.Replace('/', '_').Replace('\\', '_') + + return! verify output "snapshots" nameParam + + with :? ParseHelpers.SyntaxError as syn -> + return raise <| (LexHelpers.syntaxErrorToParseError syn) + } + +let runTest (name: string) = runWriteTest name diff --git a/tests/Visp.Compiler.UnitTests/Visp.Compiler.UnitTests.fsproj b/tests/Visp.Compiler.UnitTests/Visp.Compiler.UnitTests.fsproj index a034398..ea43e2c 100644 --- a/tests/Visp.Compiler.UnitTests/Visp.Compiler.UnitTests.fsproj +++ b/tests/Visp.Compiler.UnitTests/Visp.Compiler.UnitTests.fsproj @@ -8,6 +8,7 @@ + diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array-0.structured output.verified.txt new file mode 100644 index 0000000..7b8e66c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array-0.structured output.verified.txt @@ -0,0 +1,38 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol arr, (8,5--8,8)), + Collection + (SynCollection + (FsArray, + [Const (Int32 1, (8,12--8,13)); Const (Int32 2, (8,14--8,15)); + Const (Int32 3, (8,16--8,17)); Const (Int32 4, (8,18--8,19)); + Const (Int32 5, (8,20--8,21))], (8,9--8,24))), None, + (8,1--8,24)), (8,0--8,25)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("arr[0] %A", Regular, (10,9--10,20)), (10,9--10,20)); + DotIndex + (Symbol (SynSymbol arr), [Const (Int32 0, (10,24--10,25))], + (10,22--10,30))], (10,1--10,31)), (10,0--10,32)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("arr[1] %A", Regular, (11,9--11,20)), (11,9--11,20)); + DotIndex + (Symbol (SynSymbol arr), [Const (Int32 1, (11,24--11,25))], + (11,22--11,30))], (11,1--11,31)), (11,0--11,32)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (13,0--13,3)), + Symbol (SynSymbol arr), None, (13,0--13,3)), (13,0--13,3)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (13,0--13,3)), (13,0--13,3)); + Symbol (SynSymbol visp_result_todo)], (13,0--13,3)), (13,0--13,3))], + (8,0--13,3))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-0.structured output.verified.txt new file mode 100644 index 0000000..803fa95 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-0.structured output.verified.txt @@ -0,0 +1,120 @@ +ParsedFile + [AnonModule + ([Expr + (TypeAlias + (SynSymbol Grid, Array (2, Ident char, (8,14--8,21)), (8,1--8,21)), + (8,0--8,22)); + Expr + (LetOrUse + (Named (SynSymbol arr, (10,5--10,8)), + FunctionCall + (Symbol (SynSymbol Array2D.create), + [Const (Int32 5, (10,25--10,26)); + Const (Int32 5, (10,27--10,28)); + Const (Char '.', (10,29--10,32))], (10,10--10,32)), None, + (10,1--10,33)), (10,0--10,34)); + Expr + (LetOrUse + (Named (SynSymbol y, (12,5--12,6)), Const (Int32 4, (12,7--12,8)), + None, (12,1--12,8)), (12,0--12,9)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("arr[0,0]=%A", Regular, (14,9--14,22)), (14,9--14,22)); + DotIndex + (Symbol (SynSymbol arr), + [Const (Int32 0, (14,26--14,27)); + Const (Int32 0, (14,28--14,29))], (14,24--14,34))], + (14,1--14,35)), (14,0--14,36)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("arr[1,2]=%A", Regular, (15,9--15,22)), (15,9--15,22)); + DotIndex + (Symbol (SynSymbol arr), + [Const (Int32 1, (15,26--15,27)); + Const (Int32 1, (15,29--15,30))], (15,24--15,35))], + (15,1--15,36)), (15,0--15,37)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("arr[3,3]=%A", Regular, (16,9--16,22)), (16,9--16,22)); + FunctionCall + (Symbol (SynSymbol Array2D.get), + [Symbol (SynSymbol arr); Const (Int32 3, (16,40--16,41)); + Const (Int32 3, (16,42--16,43))], (16,24--16,43))], + (16,1--16,44)), (16,0--16,45)); + Expr + (Set + (DotIndex + (Symbol (SynSymbol arr), + [Const (Int32 2, (18,9--18,10)); Const (Int32 2, (18,12--18,13))], + (18,7--18,18)), Const (Char '#', (18,20--18,23)), (18,1--18,23)), + (18,0--18,24)); + Expr + (Set + (DotIndex + (Symbol (SynSymbol arr), + [Const (Int32 3, (19,9--19,10)); Const (Int32 4, (19,12--19,13))], + (19,7--19,18)), Const (Char '#', (19,20--19,23)), (19,1--19,23)), + (19,0--19,24)); + Expr + (Set + (DotIndex + (Symbol (SynSymbol arr), + [Const (Int32 4, (20,9--20,10)); Const (Int32 4, (20,12--20,13))], + (20,7--20,18)), Const (Char '#', (20,20--20,23)), (20,1--20,23)), + (20,0--20,24)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("arr[3,4]=%A", Regular, (21,9--21,22)), (21,9--21,22)); + ThreadLast + ([Expr (Symbol (SynSymbol arr), (21,28--21,31)); + Index + ([Op + (Infix + (SynSymbol -, + [Symbol (SynSymbol y); + Const (Int32 1, (21,39--21,40))], (21,35--21,40))); + Op + (Infix + (SynSymbol +, + [Const (Int32 1, (21,46--21,47)); + Const (Int32 1, (21,48--21,49)); + Const (Int32 1, (21,50--21,51)); + Const (Int32 1, (21,52--21,53))], (21,44--21,53)))], + (21,32--21,55))], (21,24--21,55))], (21,1--21,56)), + (21,0--21,57)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("arr[4,4]=%A", Regular, (22,9--22,22)), (22,9--22,22)); + ThreadLast + ([Expr (Symbol (SynSymbol arr), (22,28--22,31)); + Index + ([Symbol (SynSymbol y); + Op + (Infix + (SynSymbol +, + [Const (Int32 1, (22,40--22,41)); + Const (Int32 1, (22,42--22,43)); + Const (Int32 1, (22,44--22,45)); + Const (Int32 1, (22,46--22,47))], (22,38--22,47)))], + (22,32--22,49))], (22,24--22,49))], (22,1--22,50)), + (22,0--22,51)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (25,0--25,3)), + Symbol (SynSymbol arr), None, (25,0--25,3)), (25,0--25,3)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (25,0--25,3)), (25,0--25,3)); + Symbol (SynSymbol visp_result_todo)], (25,0--25,3)), (25,0--25,3))], + (8,0--25,3))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-1.structured output.verified.txt new file mode 100644 index 0000000..e1e030b --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-1.structured output.verified.txt @@ -0,0 +1,43 @@ +ParsedFile + [AnonModule + ([Expr + (TypeAlias + (SynSymbol Grid, Array (2, Ident char, (8,14--8,21)), (8,1--8,21)), + (8,0--8,22)); + Expr + (LetOrUse + (Named (SynSymbol arr, (10,5--10,8)), + FunctionCall + (Symbol (SynSymbol Array2D.create), + [Const (Int32 5, (10,25--10,26)); + Const (Int32 5, (10,27--10,28)); + Const (Char '.', (10,29--10,32))], (10,10--10,32)), None, + (10,1--10,33)), (10,0--10,34)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("arr[*,0]=%A", Regular, (12,9--12,22)), (12,9--12,22)); + DotIndex + (Symbol (SynSymbol arr), + [Symbol (SynSymbol *); Const (Int32 0, (12,28--12,29))], + (12,24--12,34))], (12,1--12,35)), (12,0--12,36)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("arr[0,*]=%A", Regular, (13,9--13,22)), (13,9--13,22)); + DotIndex + (Symbol (SynSymbol arr), + [Const (Int32 0, (13,26--13,27)); Symbol (SynSymbol *)], + (13,24--13,34))], (13,1--13,35)), (13,0--13,36)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (15,0--15,3)), + Symbol (SynSymbol arr), None, (15,0--15,3)), (15,0--15,3)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (15,0--15,3)), (15,0--15,3)); + Symbol (SynSymbol visp_result_todo)], (15,0--15,3)), (15,0--15,3))], + (8,0--15,3))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_atom_atom-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_atom_atom-0.structured output.verified.txt new file mode 100644 index 0000000..41538e0 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_atom_atom-0.structured output.verified.txt @@ -0,0 +1,57 @@ +ParsedFile + [AnonModule + ([HashDirective + (ParsedHashDirective + ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), + (9,0--9,12)); + Expr + (FunctionDef + (SynSymbol inc, None, + Args + (List + [Typed + (Named (SynSymbol v, (11,10--11,11)), Ident Value, + (11,9--11,19))], (11,8--11,20)), + [FunctionCall + (Symbol (SynSymbol Value.from), + [Op + (Infix + (SynSymbol +, + [Const (Int64 1L, (12,19--12,21)); + FunctionCall + (Symbol (SynSymbol unwrapInt), [Symbol (SynSymbol v)], + (12,23--12,34))], (12,17--12,35)))], (12,5--12,36))], + (11,1--12,37)), (11,0--12,38)); + Expr + (LetOrUse + (Named (SynSymbol count, (13,5--13,10)), + Atom (Const (Int64 0L, (13,17--13,19)), (13,12--13,19)), None, + (13,1--13,20)), (13,0--13,21)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("count is %O", Regular, (15,9--15,22)), (15,9--15,22)); + Deref (true, Symbol (SynSymbol count), (15,23--15,29))], + (15,1--15,29)), (15,0--15,30)); + Expr + (FunctionCall + (Symbol (SynSymbol swap!), + [Symbol (SynSymbol count); Symbol (SynSymbol inc)], (17,1--17,16)), + (17,0--17,17)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (19,0--19,30)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("count is %O", Regular, (19,9--19,22)), + (19,9--19,22)); + Deref (true, Symbol (SynSymbol count), (19,23--19,29))], + (19,1--19,29)), None, (19,0--19,30)), (19,0--19,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (19,0--19,30)), (19,0--19,30)); + Symbol (SynSymbol visp_result_todo)], (19,0--19,30)), + (19,0--19,30))], (9,0--19,30))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_attributes_attributes-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_attributes_attributes-0.structured output.verified.txt new file mode 100644 index 0000000..b9507ba --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_attributes_attributes-0.structured output.verified.txt @@ -0,0 +1,46 @@ +ParsedFile + [AnonModule + ([Expr + (Type + (SynSymbol TestStruct, + Args + (Tuple + [Typed + (Named (SynSymbol value, (9,20--9,25)), Ident int, + (9,19--9,31))], (9,18--9,32)), + [Member + (SynSymbol _.Value, Symbol (SynSymbol value), (10,5--10,25))], + [{ Attributes = + [{ TypeName = Ident Struct + ArgExpr = Const (Unit, (8,3--8,9)) + Range = (8,3--8,9) }; { TypeName = Ident NoEquality + ArgExpr = Const (Unit, (8,12--8,22)) + Range = (8,12--8,22) }; + { TypeName = Ident NoComparison + ArgExpr = Const (Unit, (8,25--8,37)) + Range = (8,25--8,37) }] + Range = (8,1--8,38) }], (8,1--10,26)), (8,0--11,3)); + Expr + (LetOrUse + (Named (SynSymbol xx, (13,5--13,7)), + New + (Ident TestStruct, [Const (Int32 99, (13,24--13,26))], + (13,9--13,26)), None, (13,1--13,27)), (13,0--13,28)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Value is %i", Regular, (15,9--15,22)), (15,9--15,22)); + DotProperty + (Symbol (SynSymbol xx), SynSymbol Value, (15,24--15,33))], + (15,1--15,34)), (15,0--15,35)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (17,0--17,2)), + Const (Unit, (17,0--17,2)), None, (17,0--17,2)), (17,0--17,2)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,0--17,2)), (17,0--17,2)); + Symbol (SynSymbol visp_result_todo)], (17,0--17,2)), (17,0--17,2))], + (8,0--17,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_cond-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_cond-0.structured output.verified.txt new file mode 100644 index 0000000..6c86855 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_cond-0.structured output.verified.txt @@ -0,0 +1,27 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (8,0--14,6)), + SyntaxMacroCall + (SynMacroCall + (SynSymbol cond, + [Symbol (SynSymbol cond); + List + (Paren, + [Symbol (SynSymbol >); Const (Int32 0, (9,5--9,6)); + Const (Int32 0, (9,7--9,8))], (9,2--9,9)); + Const (Int32 1, (10,4--10,5)); + List + (Paren, + [Symbol (SynSymbol <); Const (Int32 0, (11,5--11,6)); + Const (Int32 0, (11,7--11,8))], (11,2--11,9)); + Const (Int32 2, (12,4--12,5)); Keyword (SynKeyword :else); + Const (Int32 3, (14,4--14,5))], (8,1--14,5))), None, + (8,0--14,6)), (8,0--14,6)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (8,0--14,6)), (8,0--14,6)); + Symbol (SynSymbol visp_result_todo)], (8,0--14,6)), (8,0--14,6))], + (8,0--14,6))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-0.structured output.verified.txt new file mode 100644 index 0000000..9a41030 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-0.structured output.verified.txt @@ -0,0 +1,19 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (7,0--7,31)), + ThreadFirst + ([Const (String ("return me", Regular, (7,4--7,15)), (7,4--7,15)); + LambdaDef + (SynLambda + (Args + (List [Named (SynSymbol arg, (7,21--7,24))], + (7,20--7,25)), [Symbol (SynSymbol arg)], (7,17--7,29)))], + (7,1--7,30)), None, (7,0--7,31)), (7,0--7,31)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (7,0--7,31)), (7,0--7,31)); + Symbol (SynSymbol visp_result_todo)], (7,0--7,31)), (7,0--7,31))], + (7,0--7,31))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-1.structured output.verified.txt new file mode 100644 index 0000000..a5c1d8c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-1.structured output.verified.txt @@ -0,0 +1,38 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol identity, None, + Args (List [Named (SynSymbol arg, (9,14--9,17))], (9,13--9,18)), + [Symbol (SynSymbol arg)], (9,1--9,22)), (9,0--9,23)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (11,0--17,6)), + ThreadFirst + ([Const + (String ("return me", Regular, (11,4--11,15)), (11,4--11,15)); + FunctionCall (Symbol (SynSymbol identity), [], (12,5--12,13)); + LambdaDef + (SynLambda + (Args + (List [Named (SynSymbol arg, (13,9--13,12))], + (13,8--13,13)), [Symbol (SynSymbol arg)], + (13,5--13,17))); + LambdaDef + (SynLambda + (Args + (List [Named (SynSymbol arg, (14,9--14,12))], + (14,8--14,13)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("arg is %O", Regular, (15,15--15,26)), + (15,15--15,26)); Symbol (SynSymbol arg)], + (15,7--15,30)); Symbol (SynSymbol arg)], (14,5--16,9)))], + (11,1--17,5)), None, (11,0--17,6)), (11,0--17,6)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (11,0--17,6)), (11,0--17,6)); + Symbol (SynSymbol visp_result_todo)], (11,0--17,6)), (11,0--17,6))], + (9,0--17,6))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-last-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-last-0.structured output.verified.txt new file mode 100644 index 0000000..a72621f --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-last-0.structured output.verified.txt @@ -0,0 +1,65 @@ +ParsedFile + [AnonModule + ([Open (SynSymbol System.Text.RegularExpressions, (8,1--8,36)); + Expr + (LetOrUse + (Named (SynSymbol rx, (9,5--9,7)), + New + (Ident Regex, + [Const + (String ("Game (\d+):", Regular, (9,19--9,32)), (9,19--9,32)); + DotProperty + (Symbol (SynSymbol RegexOptions), SynSymbol Compiled, + (9,34--9,57))], (9,9--9,58)), None, (9,1--9,59)), + (9,0--9,60)); + Expr + (LetOrUse + (Named (SynSymbol ms, (11,5--11,7)), + DotMethod + (Symbol (SynSymbol rx), SynSymbol Match, + [Const + (String ("Game 1:", Regular, (11,19--11,28)), (11,19--11,28))], + Tuple, (11,9--11,28)), None, (11,1--11,29)), (11,0--11,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Groups %A", Regular, (13,9--13,20)), (13,9--13,20)); + DotProperty + (Symbol (SynSymbol ms), SynSymbol Groups, (13,22--13,32))], + (13,1--13,33)), (13,0--13,34)); + Expr + (LetOrUse + (Named (SynSymbol gamePrefix, (15,5--15,15)), + DotIndex + (DotProperty + (Symbol (SynSymbol ms), SynSymbol Groups, (15,23--15,34)), + [Const (Int32 0, (15,19--15,20))], (15,17--15,35)), None, + (15,1--15,36)), (15,0--15,37)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Game Prefix %A", Regular, (17,9--17,25)), + (17,9--17,25)); Symbol (SynSymbol gamePrefix)], (17,1--17,36)), + (17,0--17,37)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (19,0--19,48)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Game Prefix %A", Regular, (19,9--19,25)), + (19,9--19,25)); + ThreadLast + ([Expr (Symbol (SynSymbol ms), (19,31--19,33)); + Property (SynSymbol Groups, (19,34--19,41)); + Index ([Const (Int32 0, (19,44--19,45))], (19,42--19,46))], + (19,27--19,46))], (19,1--19,47)), None, (19,0--19,48)), + (19,0--19,48)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (19,0--19,48)), (19,0--19,48)); + Symbol (SynSymbol visp_result_todo)], (19,0--19,48)), + (19,0--19,48))], (8,0--19,48))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-0.structured output.verified.txt new file mode 100644 index 0000000..dba3b65 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-0.structured output.verified.txt @@ -0,0 +1,27 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (8,0--13,1)), + ForIn + (Named (SynSymbol x, (8,9--8,10)), + Computation + (SynSymbol seq, + [FsYield (Const (Int32 1, (9,11--9,12)), false, (9,5--9,12)); + FsYield + (Const (Int32 2, (10,11--10,12)), false, (10,5--10,12)); + FsYield + (Const (Int32 3, (11,11--11,12)), false, (11,5--11,12))], + (8,12--11,13)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("x is %i", Regular, (12,11--12,20)), + (12,11--12,20)); Symbol (SynSymbol x)], (12,3--12,22))], + (8,1--12,23)), None, (8,0--13,1)), (8,0--13,1)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (8,0--13,1)), (8,0--13,1)); + Symbol (SynSymbol visp_result_todo)], (8,0--13,1)), (8,0--13,1))], + (8,0--13,1))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-1.structured output.verified.txt new file mode 100644 index 0000000..d800f0d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-1.structured output.verified.txt @@ -0,0 +1,50 @@ +ParsedFile + [AnonModule + ([Open (SynSymbol System.Threading, (8,1--8,22)); + Expr + (FunctionDef + (SynSymbol SomeTaskCode, None, + Args + (List + [Typed + (Named (SynSymbol cancellationToken, (10,19--10,36)), + Ident CancellationToken, (10,18--10,56))], (10,17--10,57)), + [Computation + (SynSymbol task, + [DotMethod + (Symbol (SynSymbol cancellationToken), + SynSymbol ThrowIfCancellationRequested, [], Tuple, + (12,8--12,55)); + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("continuing...", Regular, (13,16--13,31)), + (13,16--13,31))], (13,8--13,31)); + FsReturn + (Const (Int32 1, (14,15--14,16)), false, (14,8--14,16))], + (11,3--14,17))], (10,1--15,3)), (10,0--15,4)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (17,0--19,27)), + ThreadLast + ([Expr + (FunctionCall + (Symbol (SynSymbol SomeTaskCode), + [DotProperty + (Symbol (SynSymbol CancellationToken), SynSymbol None, + (17,20--17,43))], (17,6--17,44)), (17,5--17,45)); + Expr + (FunctionCall + (Symbol (SynSymbol Async.AwaitTask), [], (18,3--18,18)), + (18,2--18,19)); + Expr + (FunctionCall + (Symbol (SynSymbol Async.RunSynchronously), [], + (19,3--19,25)), (19,2--19,26))], (17,1--19,26)), None, + (17,0--19,27)), (17,0--19,27)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,0--19,27)), (17,0--19,27)); + Symbol (SynSymbol visp_result_todo)], (17,0--19,27)), + (17,0--19,27))], (8,0--19,27))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-0.structured output.verified.txt new file mode 100644 index 0000000..79b58d6 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-0.structured output.verified.txt @@ -0,0 +1,45 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("Char is %O", Regular, (8,9--8,21)), (8,9--8,21)); + Const (Char 'h', (8,22--8,25))], (8,1--8,25)), (8,0--8,26)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("Char is %O", Regular, (9,9--9,21)), (9,9--9,21)); + Const (Char 'a', (9,22--9,29))], (9,1--9,29)), (9,0--9,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Char is %O", Regular, (10,9--10,21)), (10,9--10,21)); + Const (Char 'a', (10,22--10,29))], (10,1--10,29)), (10,0--10,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Char is %O", Regular, (12,9--12,21)), (12,9--12,21)); + Const (Char ':', (12,22--12,25))], (12,1--12,25)), (12,0--12,26)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Char is %O", Regular, (13,9--13,21)), (13,9--13,21)); + Const (Char '(', (13,22--13,25))], (13,1--13,25)), (13,0--13,27)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (14,0--14,27)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Char is %O", Regular, (14,9--14,21)), (14,9--14,21)); + Const (Char ')', (14,22--14,25))], (14,1--14,25)), None, + (14,0--14,27)), (14,0--14,27)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (14,0--14,27)), (14,0--14,27)); + Symbol (SynSymbol visp_result_todo)], (14,0--14,27)), + (14,0--14,27))], (8,0--14,27))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-1.structured output.verified.txt new file mode 100644 index 0000000..6c40014 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-1.structured output.verified.txt @@ -0,0 +1,36 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Char is '%03o'", Regular, (8,9--8,25)), (8,9--8,25)); + FunctionCall + (Symbol (SynSymbol int), [Const (Char '\010', (8,31--8,35))], + (8,27--8,35))], (8,1--8,36)), (8,0--8,37)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Char is '%03o'", Regular, (9,9--9,25)), (9,9--9,25)); + FunctionCall + (Symbol (SynSymbol int), [Const (Char '\013', (9,31--9,35))], + (9,27--9,35))], (9,1--9,36)), (9,0--9,37)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (10,0--10,38)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Char is '%03o'", Regular, (10,9--10,25)), + (10,9--10,25)); + FunctionCall + (Symbol (SynSymbol int), + [Const (Char '\009', (10,31--10,36))], (10,27--10,36))], + (10,1--10,37)), None, (10,0--10,38)), (10,0--10,38)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (10,0--10,38)), (10,0--10,38)); + Symbol (SynSymbol visp_result_todo)], (10,0--10,38)), + (10,0--10,38))], (8,0--10,38))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-2.structured output.verified.txt new file mode 100644 index 0000000..d110529 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-2.structured output.verified.txt @@ -0,0 +1,21 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (9,0--9,46)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Chars are %A", Regular, (9,9--9,23)), (9,9--9,23)); + Tuple + ([Const (Char '=', (9,25--9,28)); + Const (Char '|', (9,30--9,33)); + Const (Char '<', (9,35--9,38)); + Const (Char '>', (9,40--9,43))], (9,25--9,43))], + (9,1--9,44)), None, (9,0--9,46)), (9,0--9,46)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (9,0--9,46)), (9,0--9,46)); + Symbol (SynSymbol visp_result_todo)], (9,0--9,46)), (9,0--9,46))], + (9,0--9,46))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_collections_list-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_collections_list-0.structured output.verified.txt new file mode 100644 index 0000000..62f852d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_collections_list-0.structured output.verified.txt @@ -0,0 +1,37 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol lst, (8,5--8,8)), + Collection + (SynCollection + (FsList, + [Const (Int32 1, (8,12--8,13)); Const (Int32 2, (8,14--8,15)); + Const (Int32 3, (8,16--8,17))], (8,9--8,20))), None, + (8,1--8,20)), (8,0--8,21)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("List.head: %A", Regular, (10,9--10,24)), (10,9--10,24)); + FunctionCall + (Symbol (SynSymbol List.head), [Symbol (SynSymbol lst)], + (10,26--10,39))], (10,1--10,40)), (10,0--10,41)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("List.tail: %A", Regular, (11,9--11,24)), (11,9--11,24)); + FunctionCall + (Symbol (SynSymbol List.tail), [Symbol (SynSymbol lst)], + (11,26--11,39))], (11,1--11,40)), (11,0--11,41)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (13,0--13,3)), + Symbol (SynSymbol lst), None, (13,0--13,3)), (13,0--13,3)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (13,0--13,3)), (13,0--13,3)); + Symbol (SynSymbol visp_result_todo)], (13,0--13,3)), (13,0--13,3))], + (8,0--13,3))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_dot_dot-shorthands.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_dot_dot-shorthands.structured output.verified.txt new file mode 100644 index 0000000..402bceb --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_dot_dot-shorthands.structured output.verified.txt @@ -0,0 +1,63 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol vec, (8,5--8,8)), + Collection + (SynCollection + (Bracket, + [Const (Int32 1, (8,10--8,11)); Const (Int32 2, (8,12--8,13)); + Const (Int32 3, (8,14--8,15)); Const (Int32 4, (8,16--8,17)); + Const (Int32 5, (8,18--8,19)); Const (Int32 6, (8,20--8,21))], + (8,9--8,22))), Mutable, (8,1--8,22)), (8,0--8,23)); + Expr + (Set + (DotIndex + (Symbol (SynSymbol vec), [Const (Int32 1, (10,9--10,10))], + (10,7--10,15)), + FunctionCall + (Symbol (SynSymbol Value.int), [Const (Int32 -1, (10,28--10,30))], + (10,18--10,30)), (10,1--10,31)), (10,0--10,32)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%O", Regular, (12,9--12,13)), (12,9--12,13)); + DotIndex + (Symbol (SynSymbol vec), [Const (Int32 1, (12,17--12,18))], + (12,15--12,23))], (12,1--12,24)), (12,0--12,25)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%O", Regular, (13,9--13,13)), (13,9--13,13)); + DotProperty + (Symbol (SynSymbol System.Int64), SynSymbol MaxValue, + (13,15--13,38))], (13,1--13,39)), (13,0--13,40)); + Expr + (DotMethod + (Symbol (SynSymbol vec), SynSymbol Add, + [FunctionCall + (Symbol (SynSymbol Value.int), + [Const (Int32 64, (15,21--15,23))], (15,11--15,23))], Tuple, + (15,1--15,24)), (15,0--15,25)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (17,0--17,43)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%O", Regular, (17,9--17,13)), (17,9--17,13)); + DotIndex + (Symbol (SynSymbol vec), + [Op + (Infix + (SynSymbol -, + [DotProperty + (Symbol (SynSymbol vec), SynSymbol Count, + (17,21--17,32)); Const (Int32 1, (17,34--17,35))], + (17,18--17,35)))], (17,15--17,41))], (17,1--17,42)), + None, (17,0--17,43)), (17,0--17,43)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,0--17,43)), (17,0--17,43)); + Symbol (SynSymbol visp_result_todo)], (17,0--17,43)), + (17,0--17,43))], (8,0--17,43))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-0.structured output.verified.txt new file mode 100644 index 0000000..346bfb1 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-0.structured output.verified.txt @@ -0,0 +1,29 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol hello, None, + Args + (List + [Typed + (Named (SynSymbol name, (10,12--10,16)), Ident string, + (10,11--10,26))], (10,10--10,27)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("hello %s", Regular, (12,13--12,23)), + (12,13--12,23)); Symbol (SynSymbol name)], (12,5--12,28))], + (10,1--12,29)), (10,0--12,30)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (14,0--14,15)), + FunctionCall + (Symbol (SynSymbol hello), + [Const (String ("world", Regular, (14,7--14,14)), (14,7--14,14))], + (14,1--14,14)), None, (14,0--14,15)), (14,0--14,15)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (14,0--14,15)), (14,0--14,15)); + Symbol (SynSymbol visp_result_todo)], (14,0--14,15)), + (14,0--14,15))], (10,0--14,15))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-1.structured output.verified.txt new file mode 100644 index 0000000..3576cbb --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-1.structured output.verified.txt @@ -0,0 +1,101 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol hello, None, + Args + (List + [Typed + (Named (SynSymbol name, (10,12--10,16)), Ident string, + (10,11--10,26))], (10,10--10,27)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("hello %s", Regular, (12,13--12,23)), + (12,13--12,23)); Symbol (SynSymbol name)], (12,5--12,28))], + (10,1--12,29)), (10,0--12,30)); + Expr + (FunctionDef + (SynSymbol hello-no-types, None, + Args + (List [Named (SynSymbol name, (16,20--16,24))], (16,19--16,25)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("hello %s", Regular, (17,13--17,23)), + (17,13--17,23)); Symbol (SynSymbol name)], (17,5--17,28))], + (16,1--17,29)), (16,0--17,30)); + Expr + (FunctionDef + (SynSymbol hello-with-vector, None, + Args + (List + [Typed + (Named (SynSymbol name, (20,24--20,28)), Ident string, + (20,23--20,38))], (20,22--20,39)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("hello %s", Regular, (21,13--21,23)), + (21,13--21,23)); Symbol (SynSymbol name)], (21,5--21,28))], + (20,1--21,29)), (20,0--21,30)); + Expr + (LetOrUse + (Named (SynSymbol anon, (24,5--24,9)), + LambdaDef + (SynLambda + (Args + (List [Named (SynSymbol name, (24,15--24,19))], + (24,14--24,20)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("hello %s", Regular, (24,30--24,40)), + (24,30--24,40)); Symbol (SynSymbol name)], + (24,22--24,45))], (24,11--24,46))), None, (24,1--24,47)), + (24,0--24,48)); + Expr + (FunctionCall + (Symbol (SynSymbol hello), + [Const (String ("test", Regular, (26,7--26,13)), (26,7--26,13))], + (26,1--26,13)), (26,0--26,14)); + Expr + (FunctionCall + (Symbol (SynSymbol hello-no-types), + [Const + (String ("no types", Regular, (27,16--27,26)), (27,16--27,26))], + (27,1--27,26)), (27,0--27,27)); + Expr + (FunctionCall + (Symbol (SynSymbol hello-with-vector), + [Const (String ("vector", Regular, (28,19--28,27)), (28,19--28,27))], + (28,1--28,27)), (28,0--28,28)); + Expr + (FunctionCall + (Symbol (SynSymbol anon), + [Const (String ("anon", Regular, (29,6--29,12)), (29,6--29,12))], + (29,1--29,12)), (29,0--29,13)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (31,0--32,40)), + FunctionCall + (LambdaDef + (SynLambda + (Args + (List [Named (SynSymbol name, (31,6--31,10))], + (31,5--31,11)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("hello %s", Regular, (32,13--32,23)), + (32,13--32,23)); Symbol (SynSymbol name)], + (32,5--32,28))], (31,2--32,29))), + [Const + (String ("lambda", Regular, (32,31--32,39)), (32,31--32,39))], + (31,1--32,39)), None, (31,0--32,40)), (31,0--32,40)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (31,0--32,40)), (31,0--32,40)); + Symbol (SynSymbol visp_result_todo)], (31,0--32,40)), + (31,0--32,40))], (10,0--32,40))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-10.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-10.structured output.verified.txt new file mode 100644 index 0000000..5912fdd --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-10.structured output.verified.txt @@ -0,0 +1,39 @@ +ParsedFile + [AnonModule + ([HashDirective + (ParsedHashDirective + ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), + (9,0--9,12)); Open (SynSymbol System.Text, (11,1--11,17)); + Expr + (LetOrUse + (Named (SynSymbol sb, (13,5--13,7)), + New (Ident StringBuilder, [], (13,9--13,26)), None, (13,1--13,27)), + (13,0--13,28)); + Expr + (DotMethod + (Symbol (SynSymbol sb), SynSymbol Append, + [Const (String ("hello", Regular, (15,13--15,20)), (15,13--15,20))], + Tuple, (15,1--15,20)), (15,0--15,21)); + Expr + (DotMethod + (Symbol (SynSymbol sb), SynSymbol Append, + [Const (String ("world", Regular, (16,13--16,20)), (16,13--16,20))], + Tuple, (16,1--16,20)), (16,0--16,21)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (18,0--19,20)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("sb contains: %s", Regular, (18,9--18,26)), + (18,9--18,26)); + DotMethod + (Symbol (SynSymbol sb), SynSymbol ToString, [], Tuple, + (19,5--19,18))], (18,1--19,19)), None, (18,0--19,20)), + (18,0--19,20)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (18,0--19,20)), (18,0--19,20)); + Symbol (SynSymbol visp_result_todo)], (18,0--19,20)), + (18,0--19,20))], (9,0--19,20))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-11.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-11.structured output.verified.txt new file mode 100644 index 0000000..dac2dec --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-11.structured output.verified.txt @@ -0,0 +1,46 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String + ("this is in the default top-level module", Regular, + (8,9--8,50)), (8,9--8,50))], (8,1--8,50)), (8,0--8,51)); + NestedModule + (SynSymbol MyCustomModule, + [Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String + ("this is inside MyCustomModule", Regular, (11,13--11,44)), + (11,13--11,44))], (11,5--11,44)), (11,4--11,45)); + Expr + (FunctionDef + (SynSymbol hello, None, Args (List [], (12,14--12,16)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("hello world", Regular, (13,17--13,30)), + (13,17--13,30))], (13,9--13,30))], (12,5--13,31)), + (12,4--13,32)); + Expr + (FunctionCall (Symbol (SynSymbol hello), [], (15,5--15,10)), + (15,4--15,11))], (10,1--15,11)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (18,0--18,48)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String + ("this is back in the top-level-module", Regular, + (18,9--18,47)), (18,9--18,47))], (18,1--18,47)), None, + (18,0--18,48)), (18,0--18,48)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (18,0--18,48)), (18,0--18,48)); + Symbol (SynSymbol visp_result_todo)], (18,0--18,48)), + (18,0--18,48))], (8,0--18,48))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-12.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-12.structured output.verified.txt new file mode 100644 index 0000000..285fdd3 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-12.structured output.verified.txt @@ -0,0 +1,56 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol quoted, (9,5--9,11)), + Quote + (false, + Collection + (SynCollection + (Paren, + [Symbol (SynSymbol hello); Symbol (SynSymbol world); + Symbol (SynSymbol in); Symbol (SynSymbol quotes)], + (9,19--9,42))), (9,13--9,42)), None, (9,1--9,43)), + (9,0--9,44)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("quoted is: %O", Regular, (11,9--11,24)), (11,9--11,24)); + Symbol (SynSymbol quoted)], (11,1--11,31)), (11,0--11,32)); + Expr + (LetOrUse + (Named (SynSymbol next_quoted, (13,5--13,16)), + Quote + (false, + Collection + (SynCollection + (Paren, + [Const + (String ("constants", Regular, (14,5--14,16)), + (14,5--14,16)); Keyword (SynKeyword :keywords-work); + Const (Bool true, (14,32--14,36)); + Const (Int32 1, (14,37--14,38)); + Const (Double 1.5, (14,39--14,42)); + Const (Bool false, (14,43--14,48)); + Symbol (SynSymbol also); + Const + (String ("work", Regular, (14,54--14,60)), + (14,54--14,60)); Const (Nil, (14,61--14,64))], + (14,4--14,65))), (13,18--14,65)), None, (13,1--14,66)), + (13,0--14,67)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (16,0--16,42)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("next_quoted is: %O", Regular, (16,9--16,29)), + (16,9--16,29)); Symbol (SynSymbol next_quoted)], + (16,1--16,41)), None, (16,0--16,42)), (16,0--16,42)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (16,0--16,42)), (16,0--16,42)); + Symbol (SynSymbol visp_result_todo)], (16,0--16,42)), + (16,0--16,42))], (9,0--16,42))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-13.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-13.structured output.verified.txt new file mode 100644 index 0000000..765a14a --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-13.structured output.verified.txt @@ -0,0 +1,57 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol quasiquoted, (9,5--9,16)), + Quasiquote + (false, + Collection + (SynCollection + (Paren, + [Symbol (SynSymbol hello); Symbol (SynSymbol world); + Symbol (SynSymbol in); Symbol (SynSymbol quotes)], + (9,29--9,52))), (9,18--9,52)), None, (9,1--9,53)), + (9,0--9,54)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("quasiquoted is: %O", Regular, (11,9--11,29)), + (11,9--11,29)); Symbol (SynSymbol quasiquoted)], (11,1--11,41)), + (11,0--11,42)); + Expr + (LetOrUse + (Named (SynSymbol next_quasiquoted, (13,5--13,21)), + Quasiquote + (false, + Collection + (SynCollection + (Paren, + [Const + (String ("constants", Regular, (14,5--14,16)), + (14,5--14,16)); Keyword (SynKeyword :keywords-work); + Const (Bool true, (14,32--14,36)); + Const (Int32 1, (14,37--14,38)); + Const (Double 1.5, (14,39--14,42)); + Const (Bool false, (14,43--14,48)); + Symbol (SynSymbol also); + Const + (String ("work", Regular, (14,54--14,60)), + (14,54--14,60)); Const (Nil, (14,61--14,64))], + (14,4--14,65))), (13,23--14,65)), None, (13,1--14,66)), + (13,0--14,67)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (16,0--16,52)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("next_quasiquoted is: %O", Regular, (16,9--16,34)), + (16,9--16,34)); Symbol (SynSymbol next_quasiquoted)], + (16,1--16,51)), None, (16,0--16,52)), (16,0--16,52)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (16,0--16,52)), (16,0--16,52)); + Symbol (SynSymbol visp_result_todo)], (16,0--16,52)), + (16,0--16,52))], (9,0--16,52))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-14.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-14.structured output.verified.txt new file mode 100644 index 0000000..e1fc2f5 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-14.structured output.verified.txt @@ -0,0 +1,83 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol value, (8,5--8,10)), + Const (String ("hello", Regular, (8,11--8,18)), (8,11--8,18)), None, + (8,1--8,18)), (8,0--8,19)); + Expr + (LetOrUse + (Named (SynSymbol result, (10,5--10,11)), + Quasiquote + (false, Unquote (Symbol (SynSymbol value), (10,24--10,39)), + (10,13--10,39)), None, (10,1--10,40)), (10,0--10,41)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("value is %O", Regular, (12,9--12,22)), (12,9--12,22)); + Symbol (SynSymbol result)], (12,1--12,29)), (12,0--12,30)); + Expr + (LetOrUse + (Named (SynSymbol items, (15,5--15,10)), + Quote + (false, + Collection + (SynCollection + (Paren, + [Const (Int32 1, (15,19--15,20)); + Const (Int32 2, (15,21--15,22)); + Const (Int32 3, (15,23--15,24)); + Const (Int32 4, (15,25--15,26)); + Const (Int32 5, (15,27--15,28))], (15,18--15,29))), + (15,12--15,29)), None, (15,1--15,30)), (15,0--15,31)); + Expr + (LetOrUse + (Named (SynSymbol result2, (18,5--18,12)), + Quasiquote + (false, + Collection + (SynCollection + (Paren, + [Const (Int32 1, (18,26--18,27)); + Const (Int32 2, (18,28--18,29)); + Unquote + (FunctionCall + (Symbol (SynSymbol +), + [Const (Int32 3, (18,42--18,43)); + Const (Int32 4, (18,44--18,45))], (18,40--18,45)), + (18,30--18,47))], (18,25--18,48))), (18,14--18,48)), + None, (18,1--18,49)), (18,0--18,50)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("result2 is %O", Regular, (20,9--20,24)), (20,9--20,24)); + Symbol (SynSymbol result2)], (20,1--20,32)), (20,0--20,33)); + Expr + (LetOrUse + (Named (SynSymbol result3, (22,5--22,12)), + Quasiquote + (false, + Collection + (SynCollection + (Paren, + [Const (Int32 0, (22,26--22,27)); + SpliceUnquote (Symbol (SynSymbol items), (22,28--22,50)); + Const (Int32 6, (22,51--22,52))], (22,25--22,53))), + (22,14--22,53)), None, (22,1--22,54)), (22,0--22,55)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (24,0--24,33)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("result3 is %O", Regular, (24,9--24,24)), + (24,9--24,24)); Symbol (SynSymbol result3)], (24,1--24,32)), + None, (24,0--24,33)), (24,0--24,33)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (24,0--24,33)), (24,0--24,33)); + Symbol (SynSymbol visp_result_todo)], (24,0--24,33)), + (24,0--24,33))], (8,0--24,33))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-15.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-15.structured output.verified.txt new file mode 100644 index 0000000..db9605d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-15.structured output.verified.txt @@ -0,0 +1,39 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (8,0--11,5)), + FunctionCall + (LambdaDef + (SynLambda + (Args + (List [Named (SynSymbol captured_arg, (8,7--8,19))], + (8,6--8,20)), + [LetStar + ([SynBinding + (Named (SynSymbol second_capture, (9,9--9,23)), + Op + (Infix + (SynSymbol +, + [Symbol (SynSymbol captured_arg); + Const (Int32 1, (9,40--9,41))], + (9,25--9,41))), (9,9--9,42))], + [FunctionCall + (LambdaDef + (SynLambda + (Args (List [], (10,10--10,12)), + [Op + (Infix + (SynSymbol +, + [Symbol (SynSymbol captured_arg); + Symbol (SynSymbol second_capture)], + (10,14--10,43)))], (10,6--10,44))), + [], (10,5--10,45))], (9,3--10,46))], (8,2--10,47))), + [Const (Int32 99, (11,2--11,4))], (8,1--11,4)), None, + (8,0--11,5)), (8,0--11,5)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (8,0--11,5)), (8,0--11,5)); + Symbol (SynSymbol visp_result_todo)], (8,0--11,5)), (8,0--11,5))], + (8,0--11,5))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-16.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-16.structured output.verified.txt new file mode 100644 index 0000000..4ecbb49 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-16.structured output.verified.txt @@ -0,0 +1,61 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (8,0--21,22)), + LetStar + ([SynBinding + (Named (SynSymbol captured_variable, (9,4--9,21)), + Const (Int32 1, (9,22--9,23)), (9,4--9,23)); + SynBinding + (Named (SynSymbol first_fun, (10,4--10,13)), + LambdaDef + (SynLambda + (Args (List [], (11,11--11,13)), + [LetStar + ([SynBinding + (Named (SynSymbol second_fun, (12,17--12,27)), + LambdaDef + (SynLambda + (Args (List [], (13,23--13,25)), + [LetStar + ([SynBinding + (Named + (SynSymbol third_fun, + (14,27--14,36)), + LambdaDef + (SynLambda + (Args + (List [], (15,29--15,31)), + [Op + (Infix + (SynSymbol +, + [Symbol + (SynSymbol + captured_variable); + Const + (Int32 1, + (15,53--15,54))], + (15,33--15,54)))], + (15,25--15,55))), + (14,27--15,56))], + [FunctionCall + (Symbol (SynSymbol third_fun), [], + (16,23--16,32))], (14,21--16,33))], + (13,19--16,34))), (12,17--17,23))], + [FunctionCall + (Symbol (SynSymbol second_fun), [], + (18,13--18,23))], (12,11--18,24))], + (11,7--18,25))), (10,4--19,7))], + [FunctionCall + (Symbol (SynSymbol str), + [FunctionCall + (Symbol (SynSymbol first_fun), [], (21,10--21,19))], + (21,5--21,20))], (8,1--21,21)), None, (8,0--21,22)), + (8,0--21,22)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (8,0--21,22)), (8,0--21,22)); + Symbol (SynSymbol visp_result_todo)], (8,0--21,22)), (8,0--21,22))], + (8,0--21,22))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-17.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-17.structured output.verified.txt new file mode 100644 index 0000000..a65f50c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-17.structured output.verified.txt @@ -0,0 +1,35 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (8,0--12,45)), + LetStar + ([SynBinding + (Named (SynSymbol hello, (8,7--8,12)), + Const + (String ("hello", Regular, (8,13--8,20)), (8,13--8,20)), + (8,7--8,20)); + SynBinding + (Named (SynSymbol world, (9,7--9,12)), + Const + (String ("world", Regular, (9,13--9,20)), (9,13--9,20)), + (9,7--9,20)); + SynBinding + (Named (SynSymbol banaani, (10,7--10,14)), + Const + (String ("banaani", Regular, (10,15--10,24)), + (10,15--10,24)), (10,7--10,24))], + [FunctionCall + (Symbol (SynSymbol sprintf), + [Const + (String ("%s %s %s", Regular, (12,13--12,23)), + (12,13--12,23)); Symbol (SynSymbol hello); + Symbol (SynSymbol world); Symbol (SynSymbol banaani)], + (12,5--12,43))], (8,1--12,44)), None, (8,0--12,45)), + (8,0--12,45)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (8,0--12,45)), (8,0--12,45)); + Symbol (SynSymbol visp_result_todo)], (8,0--12,45)), (8,0--12,45))], + (8,0--12,45))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-2.structured output.verified.txt new file mode 100644 index 0000000..cf09b7f --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-2.structured output.verified.txt @@ -0,0 +1,29 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol hello, None, + Args + (List [Named (SynSymbol argname, (10,11--10,18))], (10,10--10,19)), + [LetOrUse + (Named (SynSymbol name, (12,9--12,13)), + Symbol (SynSymbol argname), None, (12,5--12,21)); + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("hello %s", Regular, (13,13--13,23)), + (13,13--13,23)); Symbol (SynSymbol name)], (13,5--13,28))], + (10,1--13,29)), (10,0--13,30)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (15,0--15,15)), + FunctionCall + (Symbol (SynSymbol hello), + [Const (String ("world", Regular, (15,7--15,14)), (15,7--15,14))], + (15,1--15,14)), None, (15,0--15,15)), (15,0--15,15)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (15,0--15,15)), (15,0--15,15)); + Symbol (SynSymbol visp_result_todo)], (15,0--15,15)), + (15,0--15,15))], (10,0--15,15))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-3.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-3.structured output.verified.txt new file mode 100644 index 0000000..8b2fe0c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-3.structured output.verified.txt @@ -0,0 +1,32 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol value, (8,5--8,10)), + Const (String ("initial", Regular, (8,11--8,20)), (8,11--8,20)), + Mutable, (8,1--8,20)), (8,0--8,21)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("value is %s", Regular, (9,9--9,22)), (9,9--9,22)); + Symbol (SynSymbol value)], (9,1--9,28)), (9,0--9,29)); + Expr + (Set + (Symbol (SynSymbol value), + Const (String ("updated", Regular, (10,12--10,21)), (10,12--10,21)), + (10,1--10,21)), (10,0--10,22)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (11,0--11,29)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("value is %s", Regular, (11,9--11,22)), + (11,9--11,22)); Symbol (SynSymbol value)], (11,1--11,28)), + None, (11,0--11,29)), (11,0--11,29)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (11,0--11,29)), (11,0--11,29)); + Symbol (SynSymbol visp_result_todo)], (11,0--11,29)), + (11,0--11,29))], (8,0--11,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-4.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-4.structured output.verified.txt new file mode 100644 index 0000000..930290d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-4.structured output.verified.txt @@ -0,0 +1,56 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol value, (9,5--9,10)), + Const (String ("initial", Regular, (9,11--9,20)), (9,11--9,20)), + Mutable, (9,1--9,20)), (9,0--9,21)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("value is %s", Regular, (10,9--10,22)), (10,9--10,22)); + Symbol (SynSymbol value)], (10,1--10,28)), (10,0--10,29)); + Expr + (LetOrUse + (Named (SynSymbol foo, (12,5--12,8)), + LambdaDef + (SynLambda + (Args + (List [Named (SynSymbol arg, (12,14--12,17))], + (12,13--12,18)), + [Set + (Symbol (SynSymbol value), Symbol (SynSymbol arg), + (12,20--12,34))], (12,10--12,35))), None, (12,1--12,36)), + (12,0--12,37)); + Expr + (FunctionCall + (Symbol (SynSymbol foo), + [Const (String ("hello", Regular, (14,5--14,12)), (14,5--14,12))], + (14,1--14,12)), (14,0--14,13)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("value is %s", Regular, (15,9--15,22)), (15,9--15,22)); + Symbol (SynSymbol value)], (15,1--15,28)), (15,0--15,29)); + Expr + (FunctionCall + (Symbol (SynSymbol foo), + [Const (String ("world", Regular, (17,5--17,12)), (17,5--17,12))], + (17,1--17,12)), (17,0--17,13)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (18,0--18,29)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("value is %s", Regular, (18,9--18,22)), + (18,9--18,22)); Symbol (SynSymbol value)], (18,1--18,28)), + None, (18,0--18,29)), (18,0--18,29)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (18,0--18,29)), (18,0--18,29)); + Symbol (SynSymbol visp_result_todo)], (18,0--18,29)), + (18,0--18,29))], (9,0--18,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-5.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-5.structured output.verified.txt new file mode 100644 index 0000000..2eb681e --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-5.structured output.verified.txt @@ -0,0 +1,153 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol a, (8,5--8,6)), Const (Int32 5, (8,7--8,8)), None, + (8,1--8,8)), (8,0--8,9)); + Expr + (LetOrUse + (Named (SynSymbol b, (9,5--9,6)), Const (Int32 4, (9,7--9,8)), None, + (9,1--9,8)), (9,0--9,9)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("+ is %i", Regular, (11,9--11,18)), (11,9--11,18)); + Op + (Infix + (SynSymbol +, + [Symbol (SynSymbol a); Symbol (SynSymbol b); + Const (Int32 52, (11,26--11,28))], (11,20--11,28)))], + (11,1--11,29)), (11,0--11,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("+ is %i", Regular, (12,9--12,18)), (12,9--12,18)); + Op (Infix (SynSymbol +, [], (12,20--12,21)))], (12,1--12,22)), + (12,0--12,23)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("+ is %i", Regular, (13,9--13,18)), (13,9--13,18)); + Op + (Infix + (SynSymbol +, [Const (Int32 2, (13,22--13,23))], + (13,20--13,23)))], (13,1--13,24)), (13,0--13,25)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("* is %i", Regular, (15,9--15,18)), (15,9--15,18)); + Op + (Infix + (SynSymbol *, + [Symbol (SynSymbol a); Symbol (SynSymbol b); + Const (Int32 52, (15,26--15,28))], (15,20--15,28)))], + (15,1--15,29)), (15,0--15,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("* is %i", Regular, (16,9--16,18)), (16,9--16,18)); + Op + (Infix + (SynSymbol *, [Const (Int32 2, (16,22--16,23))], + (16,20--16,23)))], (16,1--16,24)), (16,0--16,25)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("* is %i", Regular, (17,9--17,18)), (17,9--17,18)); + Op (Infix (SynSymbol *, [], (17,20--17,21)))], (17,1--17,22)), + (17,0--17,23)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("* is %A", Regular, (18,9--18,18)), (18,9--18,18)); + Op + (Infix + (SynSymbol *, + [Const (SByte 2y, (18,22--18,24)); + Const (SByte 1y, (18,25--18,27))], (18,20--18,27)))], + (18,1--18,28)), (18,0--18,29)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("- is %i", Regular, (20,9--20,18)), (20,9--20,18)); + Op + (Infix + (SynSymbol -, + [Symbol (SynSymbol a); Symbol (SynSymbol b); + Const (Int32 52, (20,26--20,28))], (20,20--20,28)))], + (20,1--20,29)), (20,0--20,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("- is %i", Regular, (21,9--21,18)), (21,9--21,18)); + Op + (Infix + (SynSymbol -, [Const (Int32 2, (21,22--21,23))], + (21,20--21,23)))], (21,1--21,24)), (21,0--21,25)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("/ is %A", Regular, (23,9--23,18)), (23,9--23,18)); + Op + (Infix + (SynSymbol /, + [Symbol (SynSymbol a); Symbol (SynSymbol b); + Const (Int32 52, (23,26--23,28))], (23,20--23,28)))], + (23,1--23,29)), (23,0--23,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("/ is %A", Regular, (24,9--24,18)), (24,9--24,18)); + Op + (Infix + (SynSymbol /, [Const (Int64 2L, (24,22--24,24))], + (24,20--24,24)))], (24,1--24,25)), (24,0--24,26)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("/ is %A", Regular, (26,9--26,18)), (26,9--26,18)); + Op + (Infix + (SynSymbol /, + [FunctionCall + (Symbol (SynSymbol decimal), [Symbol (SynSymbol a)], + (26,23--26,32)); + FunctionCall + (Symbol (SynSymbol decimal), [Symbol (SynSymbol b)], + (26,35--26,44)); + FunctionCall + (Symbol (SynSymbol decimal), + [Const (Double 52.0, (26,55--26,59))], (26,47--26,59))], + (26,20--26,60)))], (26,1--26,61)), (26,0--26,62)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("/ is %A", Regular, (27,9--27,18)), (27,9--27,18)); + Op + (Infix + (SynSymbol /, [Const (Int32 2, (27,22--27,23))], + (27,20--27,23)))], (27,1--27,24)), (27,0--27,25)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (28,0--28,53)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("/ is %A", Regular, (28,9--28,18)), (28,9--28,18)); + Op + (Infix + (SynSymbol /, + [FunctionCall + (Symbol (SynSymbol decimal), [Symbol (SynSymbol a)], + (28,23--28,32)); + FunctionCall + (Symbol (SynSymbol decimal), [Symbol (SynSymbol b)], + (28,35--28,44)); + Const (Decimal 52.0M, (28,46--28,51))], (28,20--28,51)))], + (28,1--28,52)), None, (28,0--28,53)), (28,0--28,53)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (28,0--28,53)), (28,0--28,53)); + Symbol (SynSymbol visp_result_todo)], (28,0--28,53)), + (28,0--28,53))], (8,0--28,53))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-6.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-6.structured output.verified.txt new file mode 100644 index 0000000..e00e0d5 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-6.structured output.verified.txt @@ -0,0 +1,27 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol values, (8,5--8,11)), + Collection + (SynCollection + (Bracket, + [Const (Int32 1, (9,5--9,6)); Const (Int32 2, (9,7--9,8)); + Const (String ("foo", Regular, (9,9--9,14)), (9,9--9,14)); + Const (String ("bar", Regular, (9,15--9,20)), (9,15--9,20))], + (9,4--9,21))), None, (8,1--9,21)), (8,0--9,22)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (10,0--10,32)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("values are %O", Regular, (10,9--10,24)), + (10,9--10,24)); Symbol (SynSymbol values)], (10,1--10,31)), + None, (10,0--10,32)), (10,0--10,32)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (10,0--10,32)), (10,0--10,32)); + Symbol (SynSymbol visp_result_todo)], (10,0--10,32)), + (10,0--10,32))], (8,0--10,32))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-7.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-7.structured output.verified.txt new file mode 100644 index 0000000..4d86ab3 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-7.structured output.verified.txt @@ -0,0 +1,46 @@ +ParsedFile + [AnonModule + ([HashDirective + (ParsedHashDirective + ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), + (9,0--9,12)); + Expr + (LetOrUse + (Named (SynSymbol values, (11,5--11,11)), + Collection + (SynCollection + (Bracket, + [Const (Int32 1, (12,5--12,6)); Const (Int32 2, (12,7--12,8)); + Const + (String ("foo", Regular, (12,9--12,14)), (12,9--12,14)); + Const + (String ("bar", Regular, (12,15--12,20)), (12,15--12,20))], + (12,4--12,21))), None, (11,1--12,21)), (11,0--12,22)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("values are %O", Regular, (14,9--14,24)), (14,9--14,24)); + Symbol (SynSymbol values)], (14,1--14,31)), (14,0--14,32)); + Expr + (FunctionCall + (Symbol (SynSymbol vector-push!), + [Symbol (SynSymbol values); Const (Int32 4, (15,21--15,22)); + Const (Int32 5, (15,23--15,24)); Const (Int32 6, (15,25--15,26)); + Const (Int32 7, (15,27--15,28))], (15,1--15,28)), (15,0--15,29)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (16,0--16,45)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String + ("values after update are %O", Regular, (16,9--16,37)), + (16,9--16,37)); Symbol (SynSymbol values)], (16,1--16,44)), + None, (16,0--16,45)), (16,0--16,45)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (16,0--16,45)), (16,0--16,45)); + Symbol (SynSymbol visp_result_todo)], (16,0--16,45)), + (16,0--16,45))], (9,0--16,45))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-8.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-8.structured output.verified.txt new file mode 100644 index 0000000..68a737c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-8.structured output.verified.txt @@ -0,0 +1,45 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Typed + (Named (SynSymbol ints, (9,6--9,10)), + Generic (Ident ResizeArray, [Ident int32], (9,13--9,31)), + (9,5--9,32)), New (Ident ResizeArray<_>, [], (10,5--10,23)), + None, (9,1--10,24)), (9,0--10,25)); + Expr + (DotMethod + (Symbol (SynSymbol ints), SynSymbol Add, + [Const (Int32 1, (12,12--12,13))], Tuple, (12,1--12,13)), + (12,0--12,14)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("number of ints: %i", Regular, (14,9--14,29)), + (14,9--14,29)); + DotProperty + (Symbol (SynSymbol ints), SynSymbol Count, (14,31--14,44))], + (14,1--14,45)), (14,0--14,46)); + Expr + (DotMethod + (Symbol (SynSymbol ints), SynSymbol Add, + [Const (Int32 2, (16,12--16,13))], Tuple, (16,1--16,13)), + (16,0--16,14)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (18,0--18,46)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("number of ints: %i", Regular, (18,9--18,29)), + (18,9--18,29)); + DotProperty + (Symbol (SynSymbol ints), SynSymbol Count, (18,31--18,44))], + (18,1--18,45)), None, (18,0--18,46)), (18,0--18,46)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (18,0--18,46)), (18,0--18,46)); + Symbol (SynSymbol visp_result_todo)], (18,0--18,46)), + (18,0--18,46))], (9,0--18,46))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-9.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-9.structured output.verified.txt new file mode 100644 index 0000000..61cde3e --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-9.structured output.verified.txt @@ -0,0 +1,69 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol decimals, (9,5--9,13)), + New (Ident ResizeArray<_>, [], (9,15--9,33)), None, (9,1--9,34)), + (9,0--9,35)); + Expr + (DotMethod + (Symbol (SynSymbol decimals), SynSymbol Add, + [FunctionCall + (Symbol (SynSymbol decimal), [Const (Int32 1, (11,25--11,26))], + (11,17--11,26))], Tuple, (11,1--11,27)), (11,0--11,28)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("number of decimals: %i", Regular, (13,9--13,33)), + (13,9--13,33)); + DotProperty + (Symbol (SynSymbol decimals), SynSymbol Count, (13,35--13,52))], + (13,1--13,53)), (13,0--13,54)); + Expr + (DotMethod + (Symbol (SynSymbol decimals), SynSymbol Add, + [FunctionCall + (Symbol (SynSymbol decimal), [Const (Int32 2, (15,25--15,26))], + (15,17--15,26))], Tuple, (15,1--15,27)), (15,0--15,28)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("number of decimals: %i", Regular, (17,9--17,33)), + (17,9--17,33)); + DotProperty + (Symbol (SynSymbol decimals), SynSymbol Count, (17,35--17,52))], + (17,1--17,53)), (17,0--17,54)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("decimals 0 is %f", Regular, (19,9--19,27)), + (19,9--19,27)); + DotIndex + (Symbol (SynSymbol decimals), [Const (Int32 0, (19,42--19,43))], + (19,29--19,44))], (19,1--19,45)), (19,0--19,46)); + Expr + (LetOrUse + (Named (SynSymbol index, (21,5--21,10)), + Const (Int32 1, (21,11--21,12)), None, (21,1--21,12)), + (21,0--21,13)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (23,0--23,50)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("decimals 1 is %f", Regular, (23,9--23,27)), + (23,9--23,27)); + DotIndex + (Symbol (SynSymbol decimals), [Symbol (SynSymbol index)], + (23,29--23,48))], (23,1--23,49)), None, (23,0--23,50)), + (23,0--23,50)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (23,0--23,50)), (23,0--23,50)); + Symbol (SynSymbol visp_result_todo)], (23,0--23,50)), + (23,0--23,50))], (9,0--23,50))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_variables-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_variables-0.structured output.verified.txt new file mode 100644 index 0000000..0a3fd81 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_variables-0.structured output.verified.txt @@ -0,0 +1,48 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol value, (10,5--10,10)), + Const (Int32 1, (10,11--10,12)), None, (10,1--10,12)), + (10,0--10,13)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("value is %i", Regular, (11,9--11,22)), (11,9--11,22)); + Symbol (SynSymbol value)], (11,1--11,28)), (11,0--11,29)); + Expr + (LetOrUse + (Named (SynSymbol valuemut, (14,5--14,13)), + Const (Int32 1, (14,14--14,15)), Mutable, (14,1--14,15)), + (14,0--14,16)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("valuemut is %i", Regular, (15,9--15,25)), + (15,9--15,25)); Symbol (SynSymbol valuemut)], (15,1--15,34)), + (15,0--15,35)); + Expr + (Set + (Symbol (SynSymbol valuemut), + Op + (Infix + (SynSymbol +, + [Symbol (SynSymbol valuemut); Const (Int32 1, (19,27--19,28))], + (19,16--19,28))), (19,1--19,29)), (19,0--19,30)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (21,0--21,35)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("valuemut is %i", Regular, (21,9--21,25)), + (21,9--21,25)); Symbol (SynSymbol valuemut)], (21,1--21,34)), + None, (21,0--21,35)), (21,0--21,35)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (21,0--21,35)), (21,0--21,35)); + Symbol (SynSymbol visp_result_todo)], (21,0--21,35)), + (21,0--21,35))], (10,0--21,35))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-0.structured output.verified.txt new file mode 100644 index 0000000..32b0d3b --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-0.structured output.verified.txt @@ -0,0 +1,23 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (8,0--9,29)), + ForIn + (Named (SynSymbol var, (8,9--8,12)), + RangeExpr + (Const (Int32 0, (8,17--8,18)), + Some (Const (Int32 1, (8,22--8,23))), + Const (Int32 10, (8,27--8,29)), (8,14--8,29)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("var is: %O", Regular, (9,11--9,23)), + (9,11--9,23)); Symbol (SynSymbol var)], (9,3--9,27))], + (8,1--9,28)), None, (8,0--9,29)), (8,0--9,29)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (8,0--9,29)), (8,0--9,29)); + Symbol (SynSymbol visp_result_todo)], (8,0--9,29)), (8,0--9,29))], + (8,0--9,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-1.structured output.verified.txt new file mode 100644 index 0000000..d286012 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-1.structured output.verified.txt @@ -0,0 +1,28 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (8,0--9,29)), + ForIn + (Named (SynSymbol var, (8,9--8,12)), + Collection + (SynCollection + (FsList, + [Const (Int32 1, (8,20--8,21)); + Const (Int32 2, (8,22--8,23)); + Const (Int32 3, (8,24--8,25)); + Const (Int32 4, (8,26--8,27)); + Const (Int32 5, (8,28--8,29)); + Const (Int32 6, (8,30--8,31))], (8,14--8,31))), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("var is: %O", Regular, (9,11--9,23)), + (9,11--9,23)); Symbol (SynSymbol var)], (9,3--9,27))], + (8,1--9,28)), None, (8,0--9,29)), (8,0--9,29)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (8,0--9,29)), (8,0--9,29)); + Symbol (SynSymbol visp_result_todo)], (8,0--9,29)), (8,0--9,29))], + (8,0--9,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-2.structured output.verified.txt new file mode 100644 index 0000000..1be9025 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-2.structured output.verified.txt @@ -0,0 +1,28 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (8,0--9,29)), + ForIn + (Named (SynSymbol var, (8,9--8,12)), + Collection + (SynCollection + (FsArray, + [Const (Int32 1, (8,21--8,22)); + Const (Int32 2, (8,23--8,24)); + Const (Int32 3, (8,25--8,26)); + Const (Int32 4, (8,27--8,28)); + Const (Int32 5, (8,29--8,30)); + Const (Int32 6, (8,31--8,32))], (8,14--8,32))), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("var is: %O", Regular, (9,11--9,23)), + (9,11--9,23)); Symbol (SynSymbol var)], (9,3--9,27))], + (8,1--9,28)), None, (8,0--9,29)), (8,0--9,29)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (8,0--9,29)), (8,0--9,29)); + Symbol (SynSymbol visp_result_todo)], (8,0--9,29)), (8,0--9,29))], + (8,0--9,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-3.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-3.structured output.verified.txt new file mode 100644 index 0000000..3a7f48a --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-3.structured output.verified.txt @@ -0,0 +1,28 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (9,0--10,29)), + ForIn + (Named (SynSymbol var, (9,9--9,12)), + Collection + (SynCollection + (FsSet, + [Const (Int32 1, (9,19--9,20)); + Const (Int32 2, (9,21--9,22)); + Const (Int32 3, (9,23--9,24)); + Const (Int32 4, (9,25--9,26)); + Const (Int32 5, (9,27--9,28)); + Const (Int32 6, (9,29--9,30))], (9,14--9,30))), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("var is: %O", Regular, (10,11--10,23)), + (10,11--10,23)); Symbol (SynSymbol var)], (10,3--10,27))], + (9,1--10,28)), None, (9,0--10,29)), (9,0--10,29)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (9,0--10,29)), (9,0--10,29)); + Symbol (SynSymbol visp_result_todo)], (9,0--10,29)), (9,0--10,29))], + (9,0--10,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-4.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-4.structured output.verified.txt new file mode 100644 index 0000000..efbd845 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-4.structured output.verified.txt @@ -0,0 +1,32 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (9,0--10,29)), + ForIn + (Named (SynSymbol var, (9,9--9,12)), + Collection + (SynCollection + (FsMap, + [Tuple + ([Const (Int32 1, (9,20--9,21)); + Const (Int32 2, (9,24--9,25))], (9,20--9,25)); + Tuple + ([Const (Int32 3, (9,28--9,29)); + Const (Int32 4, (9,32--9,33))], (9,28--9,33)); + Tuple + ([Const (Int32 5, (9,36--9,37)); + Const (Int32 6, (9,40--9,41))], (9,36--9,41))], + (9,14--9,42))), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("var is: %O", Regular, (10,11--10,23)), + (10,11--10,23)); Symbol (SynSymbol var)], (10,3--10,27))], + (9,1--10,28)), None, (9,0--10,29)), (9,0--10,29)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (9,0--10,29)), (9,0--10,29)); + Symbol (SynSymbol visp_result_todo)], (9,0--10,29)), (9,0--10,29))], + (9,0--10,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-to_for-to-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-to_for-to-0.structured output.verified.txt new file mode 100644 index 0000000..e7d114d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-to_for-to-0.structured output.verified.txt @@ -0,0 +1,112 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol func1, None, Args (List [], (8,10--8,12)), + [ForTo + (SynSymbol var, Const (Int32 1, (9,16--9,17)), + Const (Int32 10, (9,21--9,23)), + [FunctionCall + (Symbol (SynSymbol printf), + [Const + (String ("%d ", Regular, (10,12--10,17)), (10,12--10,17)); + Symbol (SynSymbol var)], (10,5--10,21))], false, + (9,3--10,22)); + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("", Regular, (11,11--11,13)), (11,11--11,13))], + (11,3--11,13))], (8,1--11,14)), (8,0--11,15)); + Expr + (FunctionDef + (SynSymbol func2, None, Args (List [], (13,10--13,12)), + [ForTo + (SynSymbol var, Const (Int32 10, (14,16--14,18)), + Const (Int32 1, (14,26--14,27)), + [FunctionCall + (Symbol (SynSymbol printf), + [Const + (String ("%d ", Regular, (15,12--15,17)), (15,12--15,17)); + Symbol (SynSymbol var)], (15,5--15,21))], true, + (14,3--15,22)); + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("", Regular, (16,11--16,13)), (16,11--16,13))], + (16,3--16,13))], (13,1--16,14)), (13,0--16,15)); + Expr + (FunctionCall (Symbol (SynSymbol func1), [], (18,1--18,6)), + (18,0--18,7)); + Expr + (FunctionCall (Symbol (SynSymbol func2), [], (19,1--19,6)), + (19,0--19,7)); + Expr + (FunctionDef + (SynSymbol start, None, + Args + (List + [Named (SynSymbol x, (21,11--21,12)); + Named (SynSymbol y, (21,13--21,14))], (21,10--21,15)), + [Op + (Infix + (SynSymbol -, + [Symbol (SynSymbol x); + Op + (Infix + (SynSymbol *, + [Const (Int32 2, (21,24--21,25)); + Symbol (SynSymbol y)], (21,22--21,27)))], + (21,17--21,28)))], (21,1--21,29)), (21,0--21,30)); + Expr + (FunctionDef + (SynSymbol end, None, + Args + (List + [Named (SynSymbol x, (22,9--22,10)); + Named (SynSymbol y, (22,11--22,12))], (22,8--22,13)), + [Op + (Infix + (SynSymbol +, + [Symbol (SynSymbol x); + Op + (Infix + (SynSymbol *, + [Const (Int32 2, (22,22--22,23)); + Symbol (SynSymbol y)], (22,20--22,25)))], + (22,15--22,26)))], (22,1--22,27)), (22,0--22,28)); + Expr + (FunctionDef + (SynSymbol func3, None, + Args + (List + [Named (SynSymbol x, (24,11--24,12)); + Named (SynSymbol y, (24,13--24,14))], (24,10--24,15)), + [ForTo + (SynSymbol var, + FunctionCall + (Symbol (SynSymbol start), + [Symbol (SynSymbol x); Symbol (SynSymbol y)], (25,17--25,26)), + FunctionCall + (Symbol (SynSymbol end), + [Symbol (SynSymbol x); Symbol (SynSymbol y)], (25,32--25,39)), + [FunctionCall + (Symbol (SynSymbol printf), + [Const + (String ("%d ", Regular, (26,12--26,17)), (26,12--26,17)); + Symbol (SynSymbol var)], (26,5--26,21))], false, + (25,3--26,22)); + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("", Regular, (27,11--27,13)), (27,11--27,13))], + (27,3--27,13))], (24,1--27,14)), (24,0--28,1)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (30,0--30,12)), + FunctionCall + (Symbol (SynSymbol func3), + [Const (Int32 10, (30,7--30,9)); Const (Int32 4, (30,10--30,11))], + (30,1--30,11)), None, (30,0--30,12)), (30,0--30,12)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (30,0--30,12)), (30,0--30,12)); + Symbol (SynSymbol visp_result_todo)], (30,0--30,12)), + (30,0--30,12))], (8,0--30,12))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_functions_apply-method-args-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_functions_apply-method-args-0.structured output.verified.txt new file mode 100644 index 0000000..7cb2bcb --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_functions_apply-method-args-0.structured output.verified.txt @@ -0,0 +1,379 @@ +ParsedFile + [AnonModule + ([Expr + (TypeAlias + (SynSymbol Grid, Array (2, Ident char, (9,14--9,21)), (9,1--9,21)), + (9,0--9,22)); + Expr + (SyntaxMacroCall + (SynMacroCall + (SynSymbol struct, + [Symbol (SynSymbol struct); Symbol (SynSymbol Pos); + List + (Paren, + [List + (Bracket, + [Symbol (SynSymbol x); Trivia (Colon, (11,15--11,17)); + Symbol (SynSymbol int32)], (11,13--11,23)); + List + (Bracket, + [Symbol (SynSymbol y); Trivia (Colon, (11,26--11,28)); + Symbol (SynSymbol int32)], (11,24--11,34))], + (11,12--11,35)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.X); + Symbol (SynSymbol x)], (12,2--12,16)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); + Symbol (SynSymbol y)], (13,2--13,16)); + List + (Paren, + [Symbol (SynSymbol override); Symbol (SynSymbol fn); + Symbol (SynSymbol _.ToString); Const (Unit, (15,26--15,28)); + List + (Paren, + [Symbol (SynSymbol sprintf); + Const + (String ("(y: %A, x: %A)", Regular, (16,13--16,29)), + (16,13--16,29)); Symbol (SynSymbol y); + Symbol (SynSymbol x)], (16,4--16,34))], (15,2--17,3))], + (11,1--17,3))), (11,0--17,4)); + Expr + (FunctionDef + (SynSymbol NorthOf, Inline, + Args + (List + [Typed + (Named (SynSymbol p, (19,21--19,22)), Ident Pos, + (19,20--19,28))], (19,19--19,29)), + [FunctionCall + (Symbol (SynSymbol mkPos), + [DotProperty + (Symbol (SynSymbol p), SynSymbol X, (20,10--20,14)); + FunctionCall + (Symbol (SynSymbol dec), + [DotProperty + (Symbol (SynSymbol p), SynSymbol Y, (20,22--20,26))], + (20,17--20,27))], (20,3--20,28))], (19,1--20,29)), + (19,0--20,30)); + Expr + (Type + (SynSymbol TileMap, + Args + (Tuple + [Typed + (Named (SynSymbol grid, (22,16--22,20)), Ident Grid, + (22,15--22,27)); Trivia (Comma, (22,14--22,15)); + Typed + (Named (SynSymbol rocks, (22,29--22,34)), + Generic (Ident array, [Ident Pos], (22,36--22,46)), + (22,28--22,47))], (22,14--22,48)), + [Let + (Named (SynSymbol grid, (23,7--23,11)), Symbol (SynSymbol grid), + (23,3--23,16)); + Let + (Named (SynSymbol height, (24,7--24,13)), + FunctionCall + (Symbol (SynSymbol Array2D.length1), + [Symbol (SynSymbol grid)], (24,15--24,35)), (24,3--24,36)); + Let + (Named (SynSymbol width, (25,7--25,12)), + FunctionCall + (Symbol (SynSymbol Array2D.length2), + [Symbol (SynSymbol grid)], (25,14--25,34)), (25,3--25,35)); + Member + (SynSymbol _.Rocks, Symbol (SynSymbol rocks), (27,3--27,23)); + OverrideFn + (SynSymbol _.ToString, Args (List [], (29,25--29,27)), + [FunctionCall + (Symbol (SynSymbol sprintf), + [Const + (String ("TileMap\n%A", Regular, (30,13--30,26)), + (30,13--30,26)); Symbol (SynSymbol grid)], + (30,5--30,31))], (29,3--30,32)); + MemberFn + (SynSymbol t.MoveRock, + Args + (List + [Typed + (Named (SynSymbol from, (32,26--32,30)), Ident Pos, + (32,25--32,36)); + Typed + (Named (SynSymbol to, (32,38--32,40)), Ident Pos, + (32,37--32,46))], (32,24--32,47)), + [Match + (DotIndex + (Symbol (SynSymbol t), [Symbol (SynSymbol from)], + (33,12--33,21)), + [SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol Some, (34,8--34,12)); + Const (Char 'O', (34,13--34,16))], (34,7--34,17))), + None, + [Match + (DotIndex + (Symbol (SynSymbol t), [Symbol (SynSymbol to)], + (35,16--35,23)), + [SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol Some, (36,12--36,16)); + Const (Char '.', (36,17--36,20))], + (36,11--36,21))), None, + [Set + (DotIndex + (Symbol (SynSymbol t), + [Symbol (SynSymbol from)], + (37,19--37,28)), + Const (Char '.', (37,30--37,33)), + (37,13--37,33)); + Set + (DotIndex + (Symbol (SynSymbol t), + [Symbol (SynSymbol to)], (38,19--38,26)), + Const (Char 'O', (38,28--38,31)), + (38,13--38,31)); + Const (Bool true, (39,12--39,16))], + (36,11--39,16)); + SynMatch + (Discard (41,11--41,12), None, + [Const (Bool false, (41,13--41,18))], + (41,11--41,18))], (35,9--41,19))], (34,7--42,9)); + SynMatch + (Discard (43,7--43,8), None, + [Const (Bool false, (43,9--43,14))], (43,7--43,14))], + (33,5--43,15))], (32,3--44,5)); + GetSet + (SynSymbol _.Item, + Some + (SynMemberGet + (Args + (Tuple + [Typed + (Named (SynSymbol pos, (47,11--47,14)), Ident Pos, + (47,10--47,20))], (47,9--47,21)), + [LetOrUse + (Named (SynSymbol y, (48,11--48,12)), + DotProperty + (Symbol (SynSymbol pos), SynSymbol Y, + (48,14--48,20)), None, (48,7--48,21)); + LetOrUse + (Named (SynSymbol x, (49,11--49,12)), + DotProperty + (Symbol (SynSymbol pos), SynSymbol X, + (49,14--49,20)), None, (49,7--49,21)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol cond_, + [Symbol (SynSymbol cond_); + List + (Bracket, + [List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol >=); + Symbol (SynSymbol y); + Const (Int32 0, (52,25--52,26))], + (52,19--52,27)); + List + (Paren, + [Symbol (SynSymbol <); + Symbol (SynSymbol y); + Symbol (SynSymbol height)], + (52,28--52,40))], (52,14--52,41)); + List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol >=); + Symbol (SynSymbol x); + Const (Int32 0, (53,25--53,26))], + (53,19--53,27)); + List + (Paren, + [Symbol (SynSymbol <); + Symbol (SynSymbol x); + Symbol (SynSymbol width)], + (53,28--53,39))], (53,14--53,40))], + (52,9--53,41)); + List + (Paren, + [Symbol (SynSymbol Some); + List + (Paren, + [List + (DotBracket, + [Symbol (SynSymbol y); + Trivia (Comma, (54,20--54,21)); + Symbol (SynSymbol x)], + (54,17--54,24)); + Symbol (SynSymbol grid)], + (54,16--54,30))], (54,10--54,31))], + (52,8--55,9)); + List + (Bracket, + [Discard (56,9--56,10); + Symbol (SynSymbol None)], (56,8--56,16))], + (51,7--56,16)))], (47,4--57,5))), + Some + (SynMemberSet + (Args + (Tuple + [Typed + (Named (SynSymbol pos, (58,11--58,14)), Ident Pos, + (58,10--58,20))], (58,9--58,21)), + Named (SynSymbol ch, (58,22--58,24)), + [LetOrUse + (Named (SynSymbol y, (59,11--59,12)), + DotProperty + (Symbol (SynSymbol pos), SynSymbol Y, + (59,14--59,20)), None, (59,7--59,21)); + LetOrUse + (Named (SynSymbol x, (60,11--60,12)), + DotProperty + (Symbol (SynSymbol pos), SynSymbol X, + (60,14--60,20)), None, (60,7--60,21)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol cond_, + [Symbol (SynSymbol cond_); + List + (Bracket, + [List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol >=); + Symbol (SynSymbol y); + Const (Int32 0, (62,25--62,26))], + (62,19--62,27)); + List + (Paren, + [Symbol (SynSymbol <); + Symbol (SynSymbol y); + Symbol (SynSymbol height)], + (62,28--62,40))], (62,14--62,41)); + List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol >=); + Symbol (SynSymbol x); + Const (Int32 0, (63,25--63,26))], + (63,19--63,27)); + List + (Paren, + [Symbol (SynSymbol <); + Symbol (SynSymbol x); + Symbol (SynSymbol width)], + (63,28--63,39))], (63,14--63,40))], + (62,9--63,41)); + List + (Paren, + [Symbol (SynSymbol set!); + List + (Paren, + [List + (DotBracket, + [Symbol (SynSymbol y); + Trivia (Comma, (65,20--65,21)); + Symbol (SynSymbol x)], + (65,17--65,24)); + Symbol (SynSymbol grid)], + (65,16--65,30)); Symbol (SynSymbol ch)], + (65,10--65,34))], (62,8--66,9)); + List + (Bracket, + [Discard (67,9--67,10); + Const (Unit, (67,11--67,13))], (67,8--67,14))], + (61,7--67,14)))], (58,4--68,5))), (46,3--68,5))], + [], (22,1--69,3)), (22,0--70,1)); + Expr + (FunctionDef + (SynSymbol TiltNorth, None, + Args + (List + [Typed + (Named (SynSymbol tm, (72,16--72,18)), Ident TileMap, + (72,15--72,28))], (72,14--72,29)), + [LetOrUse + (Named (SynSymbol rocks, (73,7--73,12)), + DotProperty + (Symbol (SynSymbol tm), SynSymbol Rocks, (73,14--73,23)), + None, (73,3--73,24)); + LetOrUse + (Named (SynSymbol rocksToMove, (74,7--74,18)), + ThreadLast + ([Expr (Symbol (SynSymbol rocks), (74,24--74,29)); + Expr + (FunctionCall + (Symbol (SynSymbol Array.filter), + [LambdaShort + (Op + (Infix + (SynSymbol >, + [DotProperty + (Symbol (SynSymbol %1), SynSymbol Y, + (74,49--74,54)); + Const (Int32 0, (74,56--74,57))], + (74,46--74,57))), (74,44--74,58))], + (74,31--74,58)), (74,30--74,59))], (74,20--74,59)), + None, (74,3--74,60)); + ForIn + (Named (SynSymbol rock, (77,11--77,15)), + Symbol (SynSymbol rocksToMove), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("%A", Regular, (78,13--78,17)), (78,13--78,17)); + Symbol (SynSymbol rock)], (78,5--78,22)); + LetOrUse + (Named (SynSymbol pos, (79,9--79,12)), + Symbol (SynSymbol rock), Mutable, (79,5--79,17)); + While + (DotMethod + (Symbol (SynSymbol tm), SynSymbol MoveRock, + [Symbol (SynSymbol pos); + FunctionCall + (Symbol (SynSymbol NorthOf), [Symbol (SynSymbol pos)], + (80,30--80,41))], Apply, (80,12--80,42)), + [Set + (Symbol (SynSymbol pos), + FunctionCall + (Symbol (SynSymbol NorthOf), [Symbol (SynSymbol pos)], + (81,17--81,28)), (81,7--81,29))], (80,5--81,30))], + (77,3--82,5)); + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (84,11--84,15)), (84,11--84,15)); + Symbol (SynSymbol tm)], (84,3--84,18)); + Const (Unit, (86,2--86,4))], (72,1--86,4)), (72,0--86,5)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (88,0--88,14)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("OK", Regular, (88,9--88,13)), (88,9--88,13))], + (88,1--88,13)), None, (88,0--88,14)), (88,0--88,14)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (88,0--88,14)), (88,0--88,14)); + Symbol (SynSymbol visp_result_todo)], (88,0--88,14)), + (88,0--88,14))], (9,0--88,14))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashmap_hashmap-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashmap_hashmap-0.structured output.verified.txt new file mode 100644 index 0000000..8e36143 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashmap_hashmap-0.structured output.verified.txt @@ -0,0 +1,55 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol map, (8,5--8,8)), + Collection + (SynCollection + (Brace, + [Keyword (SynKeyword :this-is-a-key); + Const + (String ("value", Regular, (8,25--8,32)), (8,25--8,32)); + Const + (String ("string as key", Regular, (9,10--9,25)), + (9,10--9,25)); + Const + (String ("string value", Regular, (9,26--9,40)), + (9,26--9,40)); Const (Int32 0, (10,10--10,11)); + Const + (String ("int as key", Regular, (10,12--10,24)), + (10,12--10,24))], (8,9--10,25))), None, (8,1--10,25)), + (8,0--10,26)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%O", Regular, (12,9--12,13)), (12,9--12,13)); + Symbol (SynSymbol map)], (12,1--12,17)), (12,0--12,18)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%O", Regular, (14,9--14,13)), (14,9--14,13)); + FunctionCall + (Symbol (SynSymbol HashMap.find), + [FunctionCall + (Symbol (SynSymbol Value.string), + [Const + (String ("string as key", Regular, (14,42--14,57)), + (14,42--14,57))], (14,29--14,57)); + Symbol (SynSymbol map)], (14,15--14,62))], (14,1--14,63)), + (14,0--14,64)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (16,0--16,35)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%O", Regular, (16,9--16,13)), (16,9--16,13)); + FunctionCall + (Keyword (SynKeyword :this-is-a-key), + [Symbol (SynSymbol map)], (16,15--16,33))], (16,1--16,34)), + None, (16,0--16,35)), (16,0--16,35)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (16,0--16,35)), (16,0--16,35)); + Symbol (SynSymbol visp_result_todo)], (16,0--16,35)), + (16,0--16,35))], (8,0--16,35))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashset_hashset-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashset_hashset-0.structured output.verified.txt new file mode 100644 index 0000000..d7a41b7 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashset_hashset-0.structured output.verified.txt @@ -0,0 +1,35 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol set, (9,5--9,8)), + Collection + (SynCollection + (HashBrace, + [Keyword (SynKeyword :this-is-a-key); + Const + (String ("value", Regular, (9,26--9,33)), (9,26--9,33)); + Const + (String ("string as key", Regular, (10,10--10,25)), + (10,10--10,25)); + Const + (String ("string value", Regular, (10,26--10,40)), + (10,26--10,40)); Const (Int32 0, (11,10--11,11)); + Const + (String ("int as key", Regular, (11,12--11,24)), + (11,12--11,24))], (9,9--11,25))), None, (9,1--11,25)), + (9,0--11,26)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (13,0--13,18)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%O", Regular, (13,9--13,13)), (13,9--13,13)); + Symbol (SynSymbol set)], (13,1--13,17)), None, (13,0--13,18)), + (13,0--13,18)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (13,0--13,18)), (13,0--13,18)); + Symbol (SynSymbol visp_result_todo)], (13,0--13,18)), + (13,0--13,18))], (9,0--13,18))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_if_if-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_if_if-0.structured output.verified.txt new file mode 100644 index 0000000..ea54330 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_if_if-0.structured output.verified.txt @@ -0,0 +1,30 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol condition, None, Args (List [], (8,14--8,16)), + [Const (Bool false, (8,17--8,22))], (8,1--8,22)), (8,0--8,23)); + Expr + (FunctionDef + (SynSymbol then, None, Args (List [], (9,9--9,11)), + [Const (String ("then", Regular, (9,12--9,18)), (9,12--9,18))], + (9,1--9,18)), (9,0--9,19)); + Expr + (FunctionDef + (SynSymbol alt, None, Args (List [], (10,8--10,10)), + [Const (String ("alt", Regular, (10,11--10,16)), (10,11--10,16))], + (10,1--10,16)), (10,0--10,17)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (12,0--14,10)), + If + (FunctionCall (Symbol (SynSymbol condition), [], (12,5--12,14)), + FunctionCall (Symbol (SynSymbol then), [], (13,5--13,9)), + Some (FunctionCall (Symbol (SynSymbol alt), [], (14,5--14,8))), + (12,1--14,9)), None, (12,0--14,10)), (12,0--14,10)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (12,0--14,10)), (12,0--14,10)); + Symbol (SynSymbol visp_result_todo)], (12,0--14,10)), + (12,0--14,10))], (8,0--14,10))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_and-example-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_and-example-0.structured output.verified.txt new file mode 100644 index 0000000..1a4f12f --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_and-example-0.structured output.verified.txt @@ -0,0 +1,115 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacro + (SynMacro + (SynSymbol my-and, + [SynMacroCase + ([Discard (9,4--9,5)], Const (Bool true, (9,7--9,11)), + (9,2--9,12)); + SynMacroCase + ([Discard (10,4--10,5); Symbol (SynSymbol one, (10,6--10,9))], + Symbol (SynSymbol one), (10,2--10,15)); + SynMacroCase + ([Discard (11,4--11,5); + Symbol (SynSymbol cond, (11,6--11,10)); + Symbol (SynSymbol exprs, (11,11--11,16)); + Ellipsis (11,17--11,20)], + List + (Paren, + [Symbol (SynSymbol if); Symbol (SynSymbol cond); + List + (Paren, + [Symbol (SynSymbol my-and); Symbol (SynSymbol exprs); + Ellipsis (13,20--13,23)], (13,6--13,24)); + Const (Bool false, (14,6--14,11))], (12,4--14,12)), + (11,2--15,3))], (8,1--15,3))), (8,0--15,4)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("my-and %A", Regular, (17,9--17,20)), (17,9--17,20)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-and, [Symbol (SynSymbol my-and)], + (17,22--17,28)))], (17,1--17,29)), (17,0--17,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("my-and %A", Regular, (18,9--18,20)), (18,9--18,20)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-and, + [Symbol (SynSymbol my-and); + Const (Bool false, (18,29--18,34))], (18,22--18,34)))], + (18,1--18,35)), (18,0--18,36)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("my-and %A", Regular, (19,9--19,20)), (19,9--19,20)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-and, + [Symbol (SynSymbol my-and); + Const (Bool true, (19,29--19,33))], (19,22--19,33)))], + (19,1--19,34)), (19,0--19,35)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("my-and %A", Regular, (20,9--20,20)), (20,9--20,20)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-and, + [Symbol (SynSymbol my-and); + Const (Bool true, (20,29--20,33)); + Const (Bool false, (20,34--20,39))], (20,22--20,39)))], + (20,1--20,40)), (20,0--20,41)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("my-and %A", Regular, (21,9--21,20)), (21,9--21,20)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-and, + [Symbol (SynSymbol my-and); + Const (Bool true, (21,29--21,33)); + Const (Bool true, (21,34--21,38))], (21,22--21,38)))], + (21,1--21,39)), (21,0--21,40)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("my-and %A", Regular, (22,9--22,20)), (22,9--22,20)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-and, + [Symbol (SynSymbol my-and); + Const (Bool true, (22,29--22,33)); + Const (Bool true, (22,34--22,38)); + Const (Bool false, (22,39--22,44))], (22,22--22,44)))], + (22,1--22,45)), (22,0--22,46)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (23,0--23,45)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("my-and %A", Regular, (23,9--23,20)), (23,9--23,20)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-and, + [Symbol (SynSymbol my-and); + Const (Bool true, (23,29--23,33)); + Const (Bool true, (23,34--23,38)); + Const (Bool true, (23,39--23,43))], (23,22--23,43)))], + (23,1--23,44)), None, (23,0--23,45)), (23,0--23,45)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (23,0--23,45)), (23,0--23,45)); + Symbol (SynSymbol visp_result_todo)], (23,0--23,45)), + (23,0--23,45))], (8,0--23,45))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_bar-parens-in-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_bar-parens-in-macro-0.structured output.verified.txt new file mode 100644 index 0000000..12e9d70 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_bar-parens-in-macro-0.structured output.verified.txt @@ -0,0 +1,33 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacro + (SynMacro + (SynSymbol MyBegin, + [SynMacroCase + ([Discard (9,4--9,5); Symbol (SynSymbol exprs, (9,6--9,11)); + Ellipsis (9,12--9,15)], + List + (Paren, + [Symbol (SynSymbol begin); Symbol (SynSymbol exprs); + Ellipsis (10,17--10,20)], (10,4--10,21)), (9,2--11,3))], + (8,1--11,3))), (8,0--11,4)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (13,0--13,21)), + SyntaxMacroCall + (SynMacroCall + (SynSymbol MyBegin, + [Symbol (SynSymbol MyBegin); + List + (ParenBar, + [Const (Int32 1, (13,12--13,13)); + Const (Int32 2, (13,14--13,15)); + Const (Int32 3, (13,16--13,17))], (13,9--13,20))], + (13,1--13,20))), None, (13,0--13,21)), (13,0--13,21)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (13,0--13,21)), (13,0--13,21)); + Symbol (SynSymbol visp_result_todo)], (13,0--13,21)), + (13,0--13,21))], (8,0--13,21))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_chars-in-macros-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_chars-in-macros-0.structured output.verified.txt new file mode 100644 index 0000000..d05444e --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_chars-in-macros-0.structured output.verified.txt @@ -0,0 +1,69 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacro + (SynMacro + (SynSymbol PrintChars, + [SynMacroCase + ([Discard (9,4--9,5); Symbol (SynSymbol body, (9,6--9,10)); + Ellipsis (9,11--9,14)], + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("Values: %A", Regular, (10,13--10,25)), + (10,13--10,25)); + List + (Paren, + [Symbol (SynSymbol !list); Symbol (SynSymbol body); + Ellipsis (10,38--10,41)], (10,26--10,42))], + (10,4--10,43)), (9,2--11,3))], (8,1--11,3))), (8,0--11,4)); + Expr + (SyntaxMacroCall + (SynMacroCall + (SynSymbol PrintChars, + [Symbol (SynSymbol PrintChars); + List + (Paren, + [Const (Char 'a', (13,13--13,16)); + Trivia (Dot, (13,17--13,19)); + Const (Char '=', (13,19--13,22)); + Trivia (Dot, (13,23--13,25)); + Const (Char 'B', (13,25--13,28)); + Trivia (Dot, (13,29--13,31)); + Const (Char '\010', (13,31--13,40)); + Trivia (Dot, (13,41--13,43)); + Const (Char ' ', (13,43--13,50)); + Trivia (Dot, (13,51--13,53)); + Const (Char '\009', (13,53--13,58))], (13,12--13,59))], + (13,1--13,59))), (13,0--13,60)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (15,9--15,13)), (15,9--15,13)); + Const (Char 'a', (15,14--15,17))], (15,1--15,17)), (15,0--15,18)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (16,9--16,13)), (16,9--16,13)); + Const (Char '\010', (16,14--16,23))], (16,1--16,23)), + (16,0--16,24)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,9--17,13)), (17,9--17,13)); + Const (Char ' ', (17,14--17,21))], (17,1--17,21)), (17,0--17,22)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (18,0--18,20)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (18,9--18,13)), (18,9--18,13)); + Const (Char '\009', (18,14--18,19))], (18,1--18,19)), None, + (18,0--18,20)), (18,0--18,20)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (18,0--18,20)), (18,0--18,20)); + Symbol (SynSymbol visp_result_todo)], (18,0--18,20)), + (18,0--18,20))], (8,0--18,20))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-0.structured output.verified.txt new file mode 100644 index 0000000..228eefb --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-0.structured output.verified.txt @@ -0,0 +1,57 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacro + (SynMacro + (SynSymbol my-cond, + [SynMacroCase + ([Discard (9,4--9,5)], + List + (Paren, + [Symbol (SynSymbol failwith); + Const + (String ("unreachable cond", Regular, (9,17--9,35)), + (9,17--9,35))], (9,7--9,36)), (9,2--9,37)); + SynMacroCase + ([Discard (10,4--10,5); Symbol (SynSymbol one, (10,6--10,9))], + Symbol (SynSymbol one), (10,2--10,15)); + SynMacroCase + ([Discard (11,4--11,5); Symbol (SynSymbol var, (11,6--11,9)); + Symbol (SynSymbol body, (11,10--11,14)); + Symbol (SynSymbol exprs, (11,15--11,20)); + Ellipsis (11,21--11,24)], + List + (Paren, + [Symbol (SynSymbol if); Symbol (SynSymbol var); + Symbol (SynSymbol body); + List + (Paren, + [Symbol (SynSymbol my-cond); Symbol (SynSymbol exprs); + Ellipsis (14,21--14,24)], (14,6--14,25))], + (12,4--14,26)), (11,2--15,3))], (8,1--15,3))), + (8,0--15,4)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (17,0--23,6)), + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-cond, + [Symbol (SynSymbol my-cond); + List + (Paren, + [Symbol (SynSymbol >); Const (Int32 0, (18,5--18,6)); + Const (Int32 0, (18,7--18,8))], (18,2--18,9)); + Const (Int32 1, (19,4--19,5)); + List + (Paren, + [Symbol (SynSymbol <); Const (Int32 0, (20,5--20,6)); + Const (Int32 0, (20,7--20,8))], (20,2--20,9)); + Const (Int32 2, (21,4--21,5)); Keyword (SynKeyword :else); + Const (Int32 3, (23,4--23,5))], (17,1--23,5))), None, + (17,0--23,6)), (17,0--23,6)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,0--23,6)), (17,0--23,6)); + Symbol (SynSymbol visp_result_todo)], (17,0--23,6)), (17,0--23,6))], + (8,0--23,6))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-1.structured output.verified.txt new file mode 100644 index 0000000..2bc0c13 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-1.structured output.verified.txt @@ -0,0 +1,123 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacro + (SynMacro + (SynSymbol my-cond_, + [SynMacroCase + ([Discard (9,4--9,5)], + List + (Paren, + [Symbol (SynSymbol failwith); + Const + (String ("unbalanced cond", Regular, (9,17--9,34)), + (9,17--9,34))], (9,7--9,35)), (9,2--9,36)); + SynMacroCase + ([Discard (10,4--10,5); + List + ([List + ([Symbol (SynSymbol ?discard, (10,8--10,16))], + (10,7--10,17)); + Symbol (SynSymbol body, (10,18--10,22)); + Ellipsis (10,23--10,26)], (10,6--10,27))], + List + (Paren, + [Symbol (SynSymbol if); Const (Bool true, (11,8--11,12)); + List + (Paren, + [Symbol (SynSymbol begin); Symbol (SynSymbol body); + Ellipsis (12,18--12,21)], (12,6--12,22)); + List + (Paren, + [Symbol (SynSymbol failwith); + Const + (String ("unreachable", Regular, (13,16--13,29)), + (13,16--13,29))], (13,6--13,30))], (11,4--13,31)), + (10,2--14,3)); + SynMacroCase + ([Discard (15,4--15,5); + List + ([Symbol (SynSymbol test, (15,7--15,11)); + Symbol (SynSymbol body, (15,12--15,16)); + Ellipsis (15,17--15,20)], (15,6--15,21)); + Symbol (SynSymbol rest, (15,22--15,26)); + Ellipsis (15,27--15,30)], + List + (Paren, + [Symbol (SynSymbol if); Symbol (SynSymbol test); + List + (Paren, + [Symbol (SynSymbol begin); Symbol (SynSymbol body); + Ellipsis (17,18--17,21)], (17,6--17,22)); + List + (Paren, + [Symbol (SynSymbol my-cond_); Symbol (SynSymbol rest); + Ellipsis (18,21--18,24)], (18,6--18,25))], + (16,4--18,26)), (15,2--19,3))], (8,1--19,3))), + (8,0--20,1)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (22,0--35,1)), + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-cond_, + [Symbol (SynSymbol my-cond_); + List + (Bracket, + [List + (Paren, + [Symbol (SynSymbol >); Const (Int32 0, (23,6--23,7)); + Const (Int32 1, (23,8--23,9))], (23,3--23,10)); + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("body here1", Regular, (24,13--24,25)), + (24,13--24,25))], (24,4--24,26)); + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("body here2", Regular, (25,13--25,25)), + (25,13--25,25))], (25,4--25,26)); + Const (Unit, (26,4--26,6))], (23,2--26,7)); + List + (Bracket, + [List + (Paren, + [Symbol (SynSymbol <); Const (Int32 1, (27,6--27,7)); + Const (Int32 0, (27,8--27,9))], (27,3--27,10)); + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("here1", Regular, (28,13--28,20)), + (28,13--28,20))], (28,4--28,21)); + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("here2", Regular, (29,13--29,20)), + (29,13--29,20))], (29,4--29,21))], (27,2--30,3)); + List + (Bracket, + [Discard (31,3--31,4); + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("default1", Regular, (32,13--32,23)), + (32,13--32,23))], (32,4--32,24)); + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("default2", Regular, (33,13--33,23)), + (33,13--33,23))], (33,4--33,24))], (31,2--34,5))], + (22,1--34,5))), None, (22,0--35,1)), (22,0--35,1)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (22,0--35,1)), (22,0--35,1)); + Symbol (SynSymbol visp_result_todo)], (22,0--35,1)), (22,0--35,1))], + (8,0--35,1))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_count-exprs-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_count-exprs-0.structured output.verified.txt new file mode 100644 index 0000000..fba5349 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_count-exprs-0.structured output.verified.txt @@ -0,0 +1,56 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacro + (SynMacro + (SynSymbol CountExprsExampleTest1, + [SynMacroCase + ([Discard (9,4--9,5)], Const (Int32 0, (9,7--9,8)), + (9,2--9,9)); + SynMacroCase + ([Discard (10,4--10,5); Discard (10,6--10,7)], + Const (Int32 1, (10,9--10,10)), (10,2--10,11)); + SynMacroCase + ([Discard (11,4--11,5); + Symbol (SynSymbol head, (11,6--11,10)); + Symbol (SynSymbol tail, (11,11--11,15)); + Ellipsis (11,16--11,19)], + List + (Paren, + [Symbol (SynSymbol +); Const (Int32 1, (12,7--12,8)); + List + (Paren, + [Symbol (SynSymbol CountExprsExampleTest1); + Symbol (SynSymbol tail); Ellipsis (12,38--12,41)], + (12,9--12,42))], (12,4--12,43)), (11,2--12,44))], + (8,1--12,44))), (8,0--13,1)); + Expr + (LetOrUse + (Named (SynSymbol exprCount, (15,5--15,14)), + SyntaxMacroCall + (SynMacroCall + (SynSymbol CountExprsExampleTest1, + [Symbol (SynSymbol CountExprsExampleTest1); + List (Bracket, [], (15,39--15,41)); + List (Bracket, [], (15,42--15,44)); + List (Bracket, [], (15,45--15,47)); + List (Bracket, [], (15,48--15,50)); + List (Bracket, [], (15,51--15,53)); + List (Bracket, [], (15,54--15,56)); + List (Bracket, [], (15,57--15,59))], (15,16--15,59))), None, + (15,1--15,60)), (15,0--15,61)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (17,0--17,31)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("exprs: %A", Regular, (17,9--17,20)), (17,9--17,20)); + Symbol (SynSymbol exprCount)], (17,1--17,30)), None, + (17,0--17,31)), (17,0--17,31)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,0--17,31)), (17,0--17,31)); + Symbol (SynSymbol visp_result_todo)], (17,0--17,31)), + (17,0--17,31))], (8,0--17,31))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_macro-lambda-shorthand-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_macro-lambda-shorthand-0.structured output.verified.txt new file mode 100644 index 0000000..8197be2 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_macro-lambda-shorthand-0.structured output.verified.txt @@ -0,0 +1,64 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (8,0--18,1)), + ThreadLast + ([Expr + (Collection + (SynCollection + (FsList, + [Const (Int32 1, (8,8--8,9)); + Const (Int32 2, (8,10--8,11)); + Const (Int32 3, (8,12--8,13)); + Const (Int32 4, (8,14--8,15)); + Const (Int32 5, (8,16--8,17)); + Const (Int32 6, (8,18--8,19)); + Const (Int32 7, (8,20--8,21)); + Const (Int32 8, (8,22--8,23)); + Const (Int32 9, (8,24--8,25)); + Const (Int32 10, (8,26--8,28))], (8,5--8,31))), + (8,5--8,31)); + Expr + (LambdaShort + (Begin + ([LetOrUse + (Named (SynSymbol lst, (10,9--10,12)), + Symbol (SynSymbol %1), None, (10,5--10,15)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol cond_, + [Symbol (SynSymbol cond_); + List + (Bracket, + [Discard (12,7--12,8); + List + (Paren, + [Symbol (SynSymbol List.filter); + List + (HashParen, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol >); + Symbol (SynSymbol %1); + Const + (Int32 1, (14,16--14,17))], + (14,10--14,18)); + List + (Paren, + [Symbol (SynSymbol <); + Symbol (SynSymbol %1); + Const + (Int32 10, (15,16--15,18))], + (15,10--15,19))], (13,21--16,9)); + Symbol (SynSymbol lst)], (13,8--16,14))], + (12,6--17,7))], (11,5--17,7)))], Begin, + (9,4--17,8)), (9,2--17,9)), (9,2--17,9))], (8,1--17,9)), + None, (8,0--18,1)), (8,0--18,1)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (8,0--18,1)), (8,0--18,1)); + Symbol (SynSymbol visp_result_todo)], (8,0--18,1)), (8,0--18,1))], + (8,0--18,1))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_my-rinit-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_my-rinit-0.structured output.verified.txt new file mode 100644 index 0000000..f50b99c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_my-rinit-0.structured output.verified.txt @@ -0,0 +1,81 @@ +ParsedFile + [AnonModule + ([Expr + (Record + (SynSymbol Mapping, + [RecordLabel (Default, SynSymbol src, Ident int64, (9,3--9,14)); + RecordLabel (Default, SynSymbol dest, Ident int64, (10,3--10,15)); + RecordLabel (Default, SynSymbol range, Ident int64, (11,3--11,16))], + [MemberFn + (SynSymbol this.Stuff, Args (List [], (13,23--13,25)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("doing stuff %A", Regular, (14,13--14,29)), + (14,13--14,29)); + DotProperty + (Symbol (SynSymbol this), SynSymbol src, (14,31--14,40))], + (14,5--14,41))], (13,3--14,42))], [], (8,1--14,43)), + (8,0--15,1)); + Expr + (SyntaxMacro + (SynMacro + (SynSymbol MyRinit, + [SynMacroCase + ([Discard (18,4--18,5); + List + ([Symbol (SynSymbol sym, (18,7--18,10)); + Symbol (SynSymbol val, (18,11--18,14))], (18,6--18,15)); + List + ([Symbol (SynSymbol s, (18,17--18,18)); + Symbol (SynSymbol v, (18,19--18,20))], (18,16--18,21)); + Ellipsis (18,22--18,25)], + List + (BraceBar, + [Symbol (SynSymbol sym); Symbol (SynSymbol val); + List + (Paren, + [Symbol (SynSymbol m-alternate); Symbol (SynSymbol s); + Symbol (SynSymbol v)], (19,15--19,32))], + (19,4--19,35)), (18,2--20,3))], (17,1--20,3))), + (17,0--20,4)); + Expr + (LetOrUse + (Named (SynSymbol temp, (22,5--22,9)), + SyntaxMacroCall + (SynMacroCall + (SynSymbol MyRinit, + [Symbol (SynSymbol MyRinit); + List + (Bracket, + [Symbol (SynSymbol src); Const (Int32 1, (22,24--22,25))], + (22,19--22,26)); + List + (Bracket, + [Symbol (SynSymbol Mapping.dest); + Const (Int32 2, (22,41--22,42))], (22,27--22,43)); + List + (Bracket, + [Symbol (SynSymbol range); + Const (Int32 3, (22,51--22,52))], (22,44--22,53))], + (22,11--22,53))), None, (22,1--22,54)), (22,0--22,55)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Record is %A", Regular, (23,9--23,23)), (23,9--23,23)); + Symbol (SynSymbol temp)], (23,1--23,28)), (23,0--23,29)); + Expr + (DotMethod + (Symbol (SynSymbol temp), SynSymbol Stuff, [], Tuple, (24,1--24,12)), + (24,0--24,13)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (26,0--26,2)), + Const (Unit, (26,0--26,2)), None, (26,0--26,2)), (26,0--26,2)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (26,0--26,2)), (26,0--26,2)); + Symbol (SynSymbol visp_result_todo)], (26,0--26,2)), (26,0--26,2))], + (8,0--26,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-0.structured output.verified.txt new file mode 100644 index 0000000..7b25b6c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-0.structured output.verified.txt @@ -0,0 +1,189 @@ +ParsedFile + [AnonModule + ([Expr + (TypeAlias + (SynSymbol Grid, + Generic + (Ident array, [Generic (Ident array, [Ident char], (8,20--8,31))], + (8,14--8,32)), (8,1--8,32)), (8,0--8,33)); + Expr + (SyntaxMacroCall + (SynMacroCall + (SynSymbol struct, + [Symbol (SynSymbol struct); Symbol (SynSymbol Pos); + List + (Paren, + [List + (Bracket, + [Symbol (SynSymbol x); Trivia (Colon, (10,15--10,17)); + Symbol (SynSymbol int32)], (10,13--10,23)); + List + (Bracket, + [Symbol (SynSymbol y); Trivia (Colon, (10,26--10,28)); + Symbol (SynSymbol int32)], (10,24--10,34))], + (10,12--10,35)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.X); + Symbol (SynSymbol x)], (11,2--11,16)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); + Symbol (SynSymbol y)], (12,2--12,16)); + List + (Paren, + [Symbol (SynSymbol override); Symbol (SynSymbol fn); + Symbol (SynSymbol _.ToString); Const (Unit, (14,26--14,28)); + List + (Paren, + [Symbol (SynSymbol sprintf); + Const + (String + ("Pos(x: %A, y: %A)", Regular, (15,13--15,32)), + (15,13--15,32)); Symbol (SynSymbol x); + Symbol (SynSymbol y)], (15,4--15,37))], (14,2--16,3))], + (10,1--16,3))), (10,0--17,1)); + Expr + (Type + (SynSymbol TileMap, + Args + (Tuple + [Typed + (Named (SynSymbol grid, (19,16--19,20)), Ident Grid, + (19,15--19,27)); Trivia (Comma, (19,14--19,15)); + Typed + (Named (SynSymbol start, (19,29--19,34)), Ident Pos, + (19,28--19,40))], (19,14--19,41)), + [Let + (Named (SynSymbol grid, (20,7--20,11)), Symbol (SynSymbol grid), + (20,3--20,16)); + Let + (Named (SynSymbol start, (21,7--21,12)), + Symbol (SynSymbol start), (21,3--21,18)); + OverrideFn + (SynSymbol _.ToString, Args (List [], (22,25--22,27)), + [FunctionCall + (Symbol (SynSymbol sprintf), + [Const + (String ("TileMap(%A)\n%A", Regular, (23,13--23,30)), + (23,13--23,30)); Symbol (SynSymbol start); + Symbol (SynSymbol grid)], (23,5--23,41))], (22,3--23,42)); + Member + (SynSymbol _.Start, Symbol (SynSymbol start), (26,3--26,23)); + GetSet + (SynSymbol _.Item, + Some + (SynMemberGet + (Args + (Tuple + [Typed + (Named (SynSymbol pos, (29,11--29,14)), Ident Pos, + (29,10--29,20))], (29,9--29,21)), + [LetOrUse + (Named (SynSymbol y, (30,11--30,12)), + DotProperty + (Symbol (SynSymbol pos), SynSymbol Y, + (30,14--30,20)), None, (30,7--30,21)); + LetOrUse + (Named (SynSymbol x, (31,11--31,12)), + DotProperty + (Symbol (SynSymbol pos), SynSymbol X, + (31,14--31,20)), None, (31,7--31,21)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol cond_, + [Symbol (SynSymbol cond_); + List + (Bracket, + [List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol >=); + Symbol (SynSymbol y); + Const (Int32 0, (34,25--34,26))], + (34,19--34,27)); + List + (Paren, + [Symbol (SynSymbol <); + Symbol (SynSymbol y); + List + (Paren, + [Symbol (SynSymbol +Length); + Symbol (SynSymbol grid)], + (34,33--34,47))], + (34,28--34,48))], (34,14--34,49)); + List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol >=); + Symbol (SynSymbol x); + Const (Int32 0, (35,25--35,26))], + (35,19--35,27)); + List + (Paren, + [Symbol (SynSymbol <); + Symbol (SynSymbol x); + List + (Paren, + [Symbol (SynSymbol +Length); + List + (Paren, + [List + (DotBracket, + [Const + (Int32 0, + (35,45--35,46))], + (35,43--35,47)); + Symbol (SynSymbol grid)], + (35,42--35,53))], + (35,33--35,54))], + (35,28--35,55))], (35,14--35,56))], + (34,9--35,57)); + List + (Paren, + [Symbol (SynSymbol let); + Symbol (SynSymbol row); + List + (Paren, + [List + (DotBracket, [Symbol (SynSymbol y)], + (37,20--37,24)); + Symbol (SynSymbol grid)], + (37,19--37,30))], (37,10--37,31)); + List + (Paren, + [Symbol (SynSymbol Some); + List + (Paren, + [List + (DotBracket, [Symbol (SynSymbol x)], + (38,17--38,21)); + Symbol (SynSymbol row)], + (38,16--38,26))], (38,10--38,27))], + (34,8--39,9)); + List + (Bracket, + [Discard (40,9--40,10); + Symbol (SynSymbol None)], (40,8--40,16))], + (33,7--40,16)))], (29,4--40,18))), None, + (28,3--40,18))], [], (19,1--41,3)), (19,0--41,4)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (43,0--43,14)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("OK", Regular, (43,9--43,13)), (43,9--43,13))], + (43,1--43,13)), None, (43,0--43,14)), (43,0--43,14)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (43,0--43,14)), (43,0--43,14)); + Symbol (SynSymbol visp_result_todo)], (43,0--43,14)), + (43,0--43,14))], (8,0--43,14))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-1.structured output.verified.txt new file mode 100644 index 0000000..19bc194 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-1.structured output.verified.txt @@ -0,0 +1,325 @@ +ParsedFile + [AnonModule + ([Open (SynSymbol System, (7,1--7,12)); + Expr + (FunctionDef + (SynSymbol Something, None, Args (List [], (9,14--9,16)), + [LetOrUse + (Named (SynSymbol work, (10,7--10,11)), + New (Ident ResizeArray, [], (10,13--10,43)), + None, (10,3--10,44)); + LetOrUse + (Named (SynSymbol conditions, (12,7--12,17)), + Collection (SynCollection (FsArray, [], (12,19--12,25))), None, + (12,3--12,26)); + LetOrUse + (Named (SynSymbol broken, (13,7--13,13)), + Collection (SynCollection (FsArray, [], (13,15--13,21))), None, + (13,3--13,22)); + LetOrUse + (Named (SynSymbol possibleOffsets, (14,7--14,22)), + Collection (SynCollection (FsArray, [], (14,24--14,30))), None, + (14,3--14,31)); + FunctionDef + (SynSymbol PopWork, None, Args (List [], (16,14--16,16)), + [LetOrUse + (Named (SynSymbol r, (17,9--17,10)), + DotIndex + (Symbol (SynSymbol work), + [Const (Int32 0, (17,14--17,15))], (17,12--17,21)), None, + (17,5--17,22)); + DotMethod + (Symbol (SynSymbol work), SynSymbol RemoveAt, + [Const (Int32 0, (18,20--18,21))], Tuple, (18,5--18,21)); + Symbol (SynSymbol r)], (16,3--19,5)); + FunctionDef + (SynSymbol EnqueueWork, None, + Args + (List + [Named (SynSymbol bi, (21,19--21,21)); + Named (SynSymbol offsetEnd, (21,22--21,31)); + Named (SynSymbol nextPos, (21,32--21,39)); + Named (SynSymbol count, (21,40--21,45))], (21,18--21,46)), + [Const (Unit, (22,4--22,6))], (21,3--22,6)); + LetOrUse + (Named (SynSymbol result, (24,7--24,13)), + Const (Int64 0L, (24,14--24,16)), Mutable, (24,3--24,16)); + While + (Op + (Infix + (SynSymbol >, + [DotProperty + (Symbol (SynSymbol work), SynSymbol Count, + (26,13--26,24)); Const (Int32 0, (26,26--26,27))], + (26,10--26,27))), + [Match + (FunctionCall + (Symbol (SynSymbol PopWork), [], (27,12--27,19)), + [SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol bi, (28,8--28,10)); + Trivia (Dot, (28,11--28,12)); + Named (SynSymbol off, (28,13--28,16)); + Trivia (Dot, (28,17--28,18)); + Named (SynSymbol count, (28,19--28,24))], + (28,7--28,25))), None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("(%A,%A,%A)", Regular, (29,17--29,29)), + (29,17--29,29)); Symbol (SynSymbol bi); + Symbol (SynSymbol off); Symbol (SynSymbol count)], + (29,9--29,42)); + LetOrUse + (Named (SynSymbol brokenLength, (30,13--30,25)), + DotIndex + (Symbol (SynSymbol broken), + [Symbol (SynSymbol bi)], (30,27--30,39)), None, + (30,9--30,40)); + LetOrUse + (Named (SynSymbol offsetEnd, (31,13--31,22)), + Op + (Infix + (SynSymbol +, + [Symbol (SynSymbol off); + Symbol (SynSymbol brokenLength)], + (31,24--31,42))), None, (31,9--31,43)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol cond_, + [Symbol (SynSymbol cond_); + List + (Bracket, + [List + (Paren, + [Symbol (SynSymbol not); + List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol or); + List + (Paren, + [Symbol (SynSymbol =); + Symbol (SynSymbol off); + Const + (Int32 0, (41,27--41,28))], + (41,20--41,29)); + List + (Paren, + [Symbol (SynSymbol !=); + List + (Paren, + [List + (DotBracket, + [List + (Paren, + [Symbol + (SynSymbol + dec); + Symbol + (SynSymbol + off)], + (41,37--41,46))], + (41,35--41,47)); + Symbol + (SynSymbol conditions)], + (41,34--41,59)); + Const + (Char '#', (41,60--41,63))], + (41,30--41,64))], + (41,16--41,65)); + List + (Paren, + [Symbol (SynSymbol or); + List + (Paren, + [Symbol (SynSymbol =); + Symbol + (SynSymbol offsetEnd); + List + (Paren, + [Symbol + (SynSymbol +Length); + Symbol + (SynSymbol conditions)], + (42,33--42,53))], + (42,20--42,54)); + List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol <); + Symbol + (SynSymbol offsetEnd); + List + (Paren, + [Symbol + (SynSymbol + +Length); + Symbol + (SynSymbol + conditions)], + (43,38--43,58))], + (43,25--43,59)); + List + (Paren, + [Symbol (SynSymbol !=); + List + (Paren, + [List + (DotBracket, + [Symbol + (SynSymbol + offsetEnd)], + (44,29--44,41)); + Symbol + (SynSymbol + conditions)], + (44,28--44,53)); + Const + (Char '#', + (44,54--44,57))], + (44,24--44,58))], + (43,20--44,59))], + (42,16--44,60)); + List + (Paren, + [Symbol (SynSymbol not); + List + (Paren, + [Symbol + (SynSymbol .Contains); + List + (Paren, + [Symbol + (SynSymbol .AsSpan); + Symbol + (SynSymbol conditions); + Symbol (SynSymbol off); + Symbol + (SynSymbol + brokenLength)], + (45,32--45,69)); + Const + (Char '.', (45,70--45,73))], + (45,21--45,74))], + (45,16--45,75))], (40,14--46,15))], + (39,11--46,16)); + Const (Unit, (47,12--47,14))], + (39,10--48,11)); + List + (Bracket, + [List + (Paren, + [Symbol (SynSymbol =); + Symbol (SynSymbol bi); + List + (Paren, + [Symbol (SynSymbol dec); + Symbol (SynSymbol brokenLength)], + (50,17--50,35))], (50,11--50,36)); + List + (Paren, + [Symbol (SynSymbol unless); + List + (Paren, + [Symbol (SynSymbol .Contains); + List + (Paren, + [Symbol (SynSymbol .AsSpan); + Symbol (SynSymbol conditions); + Symbol (SynSymbol offsetEnd)], + (51,31--51,61)); + Const (Char '#', (51,62--51,65))], + (51,20--51,66)); + List + (Paren, + [Symbol (SynSymbol set!); + Symbol (SynSymbol result); + List + (Paren, + [Symbol (SynSymbol +); + Symbol (SynSymbol result); + Symbol (SynSymbol count)], + (52,27--52,43))], (52,14--52,44))], + (51,12--52,45))], (50,10--53,11)); + List + (Bracket, + [Keyword (SynKeyword :else); + List + (Paren, + [Symbol (SynSymbol mut); + Symbol (SynSymbol nextPossibleIndex); + List + (Paren, + [Symbol + (SynSymbol + System.Array.BinarySearch); + List + (Paren, + [Symbol + (SynSymbol possibleOffsets); + Trivia (Dot, (55,79--55,81)); + List + (Paren, + [Symbol (SynSymbol inc); + Symbol + (SynSymbol offsetEnd)], + (55,81--55,96))], + (55,62--55,97))], (55,35--55,98))], + (55,12--55,99)); + List + (Paren, + [Symbol (SynSymbol when); + List + (Paren, + [Symbol (SynSymbol <); + Symbol + (SynSymbol nextPossibleIndex); + Const (Int32 0, (57,39--57,40))], + (57,18--57,41)); + List + (Paren, + [Symbol (SynSymbol set!); + Symbol + (SynSymbol nextPossibleIndex); + List + (Paren, + [Symbol (SynSymbol bcompl); + Symbol + (SynSymbol nextPossibleIndex)], + (58,38--58,64))], (58,14--58,65))], + (57,12--58,66)); + List + (Paren, + [Symbol (SynSymbol EnqueueWork); + List + (Paren, + [Symbol (SynSymbol inc); + Symbol (SynSymbol bi)], + (59,25--59,33)); + Symbol (SynSymbol offsetEnd); + Symbol (SynSymbol nextPossibleIndex); + Symbol (SynSymbol count)], + (59,12--59,68))], (54,10--60,11))], + (38,9--60,11))); Const (Unit, (62,8--62,10))], + (28,7--62,10))], (27,5--63,7))], (26,3--63,8))], + (9,1--64,5)), (9,0--65,1)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (67,0--67,14)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("OK", Regular, (67,9--67,13)), (67,9--67,13))], + (67,1--67,13)), None, (67,0--67,14)), (67,0--67,14)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (67,0--67,14)), (67,0--67,14)); + Symbol (SynSymbol visp_result_todo)], (67,0--67,14)), + (67,0--67,14))], (7,0--67,14))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_or-example-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_or-example-0.structured output.verified.txt new file mode 100644 index 0000000..1b17364 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_or-example-0.structured output.verified.txt @@ -0,0 +1,170 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacro + (SynMacro + (SynSymbol my-or, + [SynMacroCase + ([Discard (9,4--9,5)], Const (Bool false, (9,7--9,12)), + (9,2--9,13)); + SynMacroCase + ([Discard (10,4--10,5); Symbol (SynSymbol one, (10,6--10,9))], + Symbol (SynSymbol one), (10,2--10,15)); + SynMacroCase + ([Discard (11,4--11,5); + Symbol (SynSymbol test, (11,6--11,10)); + Symbol (SynSymbol exprs, (11,11--11,16)); + Ellipsis (11,17--11,20)], + List + (Paren, + [Symbol (SynSymbol do); + List + (Paren, + [Symbol (SynSymbol let); Symbol (SynSymbol orTemp); + Symbol (SynSymbol test)], (13,6--13,23)); + List + (Paren, + [Symbol (SynSymbol if); Symbol (SynSymbol orTemp); + Symbol (SynSymbol orTemp); + List + (Paren, + [Symbol (SynSymbol my-or); + Symbol (SynSymbol exprs); + Ellipsis (16,21--16,24)], (16,8--16,25))], + (14,6--17,7))], (12,4--17,8)), (11,2--18,3))], + (8,1--18,3))), (8,0--18,4)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("my-or %A", Regular, (20,9--20,19)), (20,9--20,19)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-or, [Symbol (SynSymbol my-or)], (20,21--20,26)))], + (20,1--20,27)), (20,0--20,28)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("my-or %A", Regular, (21,9--21,19)), (21,9--21,19)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-or, + [Symbol (SynSymbol my-or); + Const (Bool false, (21,27--21,32))], (21,21--21,32)))], + (21,1--21,33)), (21,0--21,34)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("my-or %A", Regular, (22,9--22,19)), (22,9--22,19)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-or, + [Symbol (SynSymbol my-or); Const (Bool true, (22,27--22,31))], + (22,21--22,31)))], (22,1--22,32)), (22,0--22,33)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("my-or %A", Regular, (23,9--23,19)), (23,9--23,19)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-or, + [Symbol (SynSymbol my-or); Const (Bool true, (23,27--23,31)); + Const (Bool false, (23,32--23,37))], (23,21--23,37)))], + (23,1--23,38)), (23,0--23,39)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("my-or %A", Regular, (24,9--24,19)), (24,9--24,19)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-or, + [Symbol (SynSymbol my-or); Const (Bool true, (24,27--24,31)); + Const (Bool true, (24,32--24,36))], (24,21--24,36)))], + (24,1--24,37)), (24,0--24,38)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("my-or %A", Regular, (25,9--25,19)), (25,9--25,19)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-or, + [Symbol (SynSymbol my-or); Const (Bool true, (25,27--25,31)); + Const (Bool true, (25,32--25,36)); + Const (Bool false, (25,37--25,42))], (25,21--25,42)))], + (25,1--25,43)), (25,0--25,44)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("my-or %A", Regular, (26,9--26,19)), (26,9--26,19)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-or, + [Symbol (SynSymbol my-or); Const (Bool true, (26,27--26,31)); + Const (Bool true, (26,32--26,36)); + Const (Bool true, (26,37--26,41))], (26,21--26,41)))], + (26,1--26,42)), (26,0--26,43)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("my-or %A", Regular, (28,9--28,19)), (28,9--28,19)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-or, + [Symbol (SynSymbol my-or); + List + (Paren, + [Symbol (SynSymbol Value.bool); + Const (Bool false, (28,39--28,44))], (28,27--28,45))], + (28,21--28,45)))], (28,1--28,46)), (28,0--28,47)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("my-or %A", Regular, (29,9--29,19)), (29,9--29,19)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-or, + [Symbol (SynSymbol my-or); + List + (Paren, + [Symbol (SynSymbol Value.bool); + Const (Bool false, (29,39--29,44))], (29,27--29,45)); + List + (Paren, + [Symbol (SynSymbol Value.string); + Const + (String ("this works, yay", Regular, (29,60--29,77)), + (29,60--29,77))], (29,46--29,78))], (29,21--29,78)))], + (29,1--29,79)), (29,0--29,80)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (30,0--30,99)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("my-or %A", Regular, (30,9--30,19)), (30,9--30,19)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol my-or, + [Symbol (SynSymbol my-or); + List + (Paren, + [Symbol (SynSymbol Value.bool); + Const (Bool false, (30,39--30,44))], (30,27--30,45)); + List + (Paren, + [Symbol (SynSymbol Value.bool); + Const (Bool false, (30,58--30,63))], (30,46--30,64)); + List + (Paren, + [Symbol (SynSymbol Value.string); + Const + (String + ("this works, yay", Regular, (30,79--30,96)), + (30,79--30,96))], (30,65--30,97))], + (30,21--30,97)))], (30,1--30,98)), None, (30,0--30,99)), + (30,0--30,99)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (30,0--30,99)), (30,0--30,99)); + Symbol (SynSymbol visp_result_todo)], (30,0--30,99)), + (30,0--30,99))], (8,0--30,99))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-example-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-example-1.structured output.verified.txt new file mode 100644 index 0000000..33dc217 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-example-1.structured output.verified.txt @@ -0,0 +1,232 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacroCall + (SynMacroCall + (SynSymbol struct, + [Symbol (SynSymbol struct); Symbol (SynSymbol Range); + List + (Paren, + [List + (Bracket, + [Symbol (SynSymbol start); Trivia (Colon, (8,21--8,23)); + Symbol (SynSymbol int64)], (8,15--8,29)); + List + (Bracket, + [Symbol (SynSymbol len); Trivia (Colon, (8,34--8,36)); + Symbol (SynSymbol int64)], (8,30--8,42))], (8,14--8,43)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Start); + Symbol (SynSymbol start)], (9,2--9,24)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Len); + Symbol (SynSymbol len)], (10,2--10,20)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.End); + List + (Paren, + [Symbol (SynSymbol +); Symbol (SynSymbol start); + Symbol (SynSymbol len)], (11,16--11,29))], + (11,2--11,30)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol fn); + Symbol (SynSymbol d.Offset); + List (Paren, [Symbol (SynSymbol v)], (13,22--13,25)); + List + (Paren, + [Symbol (SynSymbol -); Symbol (SynSymbol v); + List + (Paren, + [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], + (14,9--14,19))], (14,4--14,20))], (13,2--14,21)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol fn); + Symbol (SynSymbol d.Contains); + List (Paren, [Symbol (SynSymbol v)], (16,24--16,27)); + List + (Paren, + [Symbol (SynSymbol and); + List + (Paren, + [Symbol (SynSymbol >=); Symbol (SynSymbol v); + List + (Paren, + [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], + (18,12--18,22))], (18,6--18,23)); + List + (Paren, + [Symbol (SynSymbol <); Symbol (SynSymbol v); + List + (Paren, + [Symbol (SynSymbol +End); Symbol (SynSymbol d)], + (19,11--19,19))], (19,6--19,20))], (17,4--19,21))], + (16,2--20,3)); + List + (Paren, + [Symbol (SynSymbol override); Symbol (SynSymbol fn); + Symbol (SynSymbol t.ToString); Const (Unit, (22,26--22,28)); + List + (Paren, + [Symbol (SynSymbol sprintf); + Const + (String ("Range(%i, %i)", Regular, (23,13--23,28)), + (23,13--23,28)); + List + (Paren, + [Symbol (SynSymbol +Start); Symbol (SynSymbol t)], + (23,29--23,39)); + List + (Paren, + [Symbol (SynSymbol +Len); Symbol (SynSymbol t)], + (23,40--23,48))], (23,4--23,49))], (22,2--23,50))], + (8,1--23,50))), (8,0--24,1)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Range is: %A", Regular, (26,9--26,23)), (26,9--26,23)); + New + (Ident Range, + [Const (Int32 0, (26,35--26,36)); + Const (Int32 5, (26,37--26,38))], (26,25--26,38))], + (26,1--26,39)), (26,0--26,40)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Range end is: %A", Regular, (27,9--27,27)), + (27,9--27,27)); + ThreadLast + ([Expr + (New + (Ident Range, + [Const (Int32 0, (27,44--27,45)); + Const (Int32 5, (27,46--27,47))], (27,34--27,47)), + (27,33--27,48)); Property (SynSymbol End, (27,49--27,53))], + (27,29--27,53))], (27,1--27,54)), (27,0--27,55)); + Expr + (SyntaxMacroCall + (SynMacroCall + (SynSymbol struct, + [Symbol (SynSymbol struct); Symbol (SynSymbol SourceDestMap); + List + (Paren, + [List + (Bracket, + [Symbol (SynSymbol dest); Trivia (Colon, (29,28--29,30)); + Symbol (SynSymbol int64)], (29,23--29,36)); + List + (Bracket, + [Symbol (SynSymbol src); Trivia (Colon, (29,41--29,43)); + Symbol (SynSymbol int64)], (29,37--29,49)); + List + (Bracket, + [Symbol (SynSymbol len); Trivia (Colon, (29,54--29,56)); + Symbol (SynSymbol int64)], (29,50--29,62))], + (29,22--29,63)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Dest); + List + (Paren, + [Symbol (SynSymbol new); Symbol (SynSymbol Range); + Symbol (SynSymbol dest); Symbol (SynSymbol len)], + (30,17--30,37))], (30,2--30,38)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Src); + List + (Paren, + [Symbol (SynSymbol new); Symbol (SynSymbol Range); + Symbol (SynSymbol src); Symbol (SynSymbol len)], + (31,16--31,35))], (31,2--31,36)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Len); + Symbol (SynSymbol len)], (32,2--32,20)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol fn); + Symbol (SynSymbol d.Contains); + List (Paren, [Symbol (SynSymbol v)], (34,24--34,27)); + List + (Paren, + [Symbol (SynSymbol ->>); Symbol (SynSymbol d); + Symbol (SynSymbol +Src); + List + (HashParen, + [Symbol (SynSymbol -Contains); Symbol (SynSymbol %1); + Symbol (SynSymbol v)], (36,6--36,23))], + (35,4--37,5))], (34,2--37,6)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol fn); + Symbol (SynSymbol d.Get); + List (Paren, [Symbol (SynSymbol src)], (39,19--39,24)); + List + (Paren, + [Symbol (SynSymbol cond); + List + (Paren, + [Symbol (SynSymbol -Contains); + List + (Paren, + [Symbol (SynSymbol +Src); Symbol (SynSymbol d)], + (41,17--41,25)); Symbol (SynSymbol src)], + (41,6--41,30)); + List + (Paren, + [Symbol (SynSymbol +); + List + (Paren, + [Symbol (SynSymbol ->>); Symbol (SynSymbol d); + Symbol (SynSymbol +Dest); + Symbol (SynSymbol +Start)], (42,11--42,31)); + List + (Paren, + [Symbol (SynSymbol -Offset); + List + (Paren, + [Symbol (SynSymbol +Src); + Symbol (SynSymbol d)], (42,41--42,49)); + Symbol (SynSymbol src)], (42,32--42,54))], + (42,8--42,55)); Keyword (SynKeyword :else); + Symbol (SynSymbol src)], (40,4--45,5))], (39,2--45,6)); + List + (Paren, + [Symbol (SynSymbol override); Symbol (SynSymbol fn); + Symbol (SynSymbol t.ToString); Const (Unit, (47,26--47,28)); + List + (Paren, + [Symbol (SynSymbol sprintf); + Const + (String ("(%A, %A, %i)", Regular, (48,13--48,27)), + (48,13--48,27)); + List + (Paren, + [Symbol (SynSymbol +Dest); Symbol (SynSymbol t)], + (48,28--48,37)); + List + (Paren, + [Symbol (SynSymbol +Src); Symbol (SynSymbol t)], + (48,38--48,46)); + List + (Paren, + [Symbol (SynSymbol +Len); Symbol (SynSymbol t)], + (48,47--48,55))], (48,4--48,56))], (47,2--48,57))], + (29,1--48,57))), (29,0--49,1)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (51,0--51,2)), + Const (Unit, (51,0--51,2)), None, (51,0--51,2)), (51,0--51,2)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (51,0--51,2)), (51,0--51,2)); + Symbol (SynSymbol visp_result_todo)], (51,0--51,2)), (51,0--51,2))], + (8,0--51,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-0.structured output.verified.txt new file mode 100644 index 0000000..05feae8 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-0.structured output.verified.txt @@ -0,0 +1,108 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacro + (SynMacro + (SynSymbol MyStruct, + [SynMacroCase + ([Discard (9,4--9,5); Symbol (SynSymbol typ, (9,6--9,9)); + List + ([Symbol (SynSymbol arg, (9,11--9,14)); + Symbol (SynSymbol ctor, (9,15--9,19)); + Ellipsis (9,20--9,23)], (9,10--9,24)); + Symbol (SynSymbol body, (9,25--9,29)); + Ellipsis (9,30--9,33)], + List + (Paren, + [List + (HashBracket, [Symbol (SynSymbol Struct)], + (10,5--10,14)); Symbol (SynSymbol type); + Symbol (SynSymbol typ); + List + (Paren, + [Symbol (SynSymbol arg); Symbol (SynSymbol ctor); + Ellipsis (11,25--11,28)], (11,15--11,29)); + Symbol (SynSymbol body); Ellipsis (12,11--12,14)], + (10,4--13,5)), (9,2--14,3))], (8,1--14,3))), (8,0--14,4)); + Expr + (SyntaxMacroCall + (SynMacroCall + (SynSymbol MyStruct, + [Symbol (SynSymbol MyStruct); Symbol (SynSymbol Example); + List + (Paren, + [List + (Bracket, + [Symbol (SynSymbol x); Trivia (Colon, (16,21--16,23)); + Symbol (SynSymbol int)], (16,19--16,27)); + List + (Bracket, + [Symbol (SynSymbol y); Trivia (Colon, (16,30--16,32)); + Symbol (SynSymbol int)], (16,28--16,36))], + (16,18--16,37)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.X); + Symbol (SynSymbol x)], (17,2--17,16)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); + Symbol (SynSymbol y)], (18,2--18,16)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol fn); + Symbol (SynSymbol d.Sum); Const (Unit, (20,19--20,21)); + List + (Paren, + [Symbol (SynSymbol +); + List + (Paren, [Symbol (SynSymbol +X); Symbol (SynSymbol d)], + (20,25--20,31)); + List + (Paren, [Symbol (SynSymbol +Y); Symbol (SynSymbol d)], + (20,32--20,38))], (20,22--20,39))], (20,2--20,40))], + (16,1--20,40))), (16,0--20,41)); + Expr + (LetOrUse + (Named (SynSymbol instance, (22,5--22,13)), + New + (Ident Example, + [Const (Int32 1, (22,27--22,28)); + Const (Int32 2, (22,29--22,30))], (22,15--22,30)), None, + (22,1--22,31)), (22,0--22,32)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Example Struct is %A", Regular, (24,9--24,31)), + (24,9--24,31)); Symbol (SynSymbol instance)], (24,1--24,40)), + (24,0--24,41)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Example IsValueType %A", Regular, (25,9--25,33)), + (25,9--25,33)); + ThreadLast + ([Expr (Symbol (SynSymbol instance), (25,39--25,47)); + Method (SynSymbol GetType, Tuple, (25,48--25,56)); + Property (SynSymbol IsValueType, (25,57--25,69))], + (25,35--25,69))], (25,1--25,70)), (25,0--25,71)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (26,0--26,48)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Example Result is %i", Regular, (26,9--26,31)), + (26,9--26,31)); + DotMethod + (Symbol (SynSymbol instance), SynSymbol Sum, [], Tuple, + (26,33--26,46))], (26,1--26,47)), None, (26,0--26,48)), + (26,0--26,48)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (26,0--26,48)), (26,0--26,48)); + Symbol (SynSymbol visp_result_todo)], (26,0--26,48)), + (26,0--26,48))], (8,0--26,48))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-2.structured output.verified.txt new file mode 100644 index 0000000..eb2feab --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-2.structured output.verified.txt @@ -0,0 +1,172 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacro + (SynMacro + (SynSymbol MyStruct2, + [SynMacroCase + ([Discard (9,4--9,5); Symbol (SynSymbol typ, (9,6--9,9)); + List + ([List + ([Symbol (SynSymbol arg1, (9,12--9,16)); + Trivia (Colon, (9,17--9,19)); + Symbol (SynSymbol argtyp1, (9,19--9,26))], + (9,11--9,27)); + List + ([Symbol (SynSymbol argrest, (9,29--9,36)); + Trivia (Colon, (9,37--9,39)); + Symbol (SynSymbol argresttyp, (9,39--9,49))], + (9,28--9,50)); Ellipsis (9,51--9,54)], (9,10--9,55)); + Symbol (SynSymbol body, (9,56--9,60)); + Ellipsis (9,61--9,64)], + List + (Paren, + [Symbol (SynSymbol begin); + List + (Paren, + [List + (HashBracket, [Symbol (SynSymbol Struct)], + (11,7--11,16)); Symbol (SynSymbol type); + Symbol (SynSymbol typ); + List + (Paren, + [List + (Paren, + [Symbol (SynSymbol arg1); + Trivia (Colon, (12,24--12,26)); + Symbol (SynSymbol argtyp1)], (12,18--12,34)); + List + (Paren, + [Symbol (SynSymbol argrest); + Trivia (Colon, (12,44--12,46)); + Symbol (SynSymbol argresttyp)], + (12,35--12,57)); Ellipsis (12,58--12,61)], + (12,17--12,62)); Symbol (SynSymbol body); + Ellipsis (13,13--13,16)], (11,6--14,7)); + List + (Paren, + [Symbol (SynSymbol fn); + List + (Paren, + [Symbol (SynSymbol m-concat-id); + Symbol (SynSymbol mk); Symbol (SynSymbol typ)], + (16,10--16,30)); + List + (Paren, + [Symbol (SynSymbol arg1); + Symbol (SynSymbol argrest); + Ellipsis (17,22--17,25)], (17,8--17,26)); + List + (Paren, + [Symbol (SynSymbol new); Symbol (SynSymbol typ); + Symbol (SynSymbol arg1); + Symbol (SynSymbol argrest); + Ellipsis (18,30--18,33)], (18,8--18,34))], + (16,6--19,7))], (10,4--20,5)), (9,2--21,3))], + (8,1--21,3))), (8,0--21,4)); + Expr + (SyntaxMacroCall + (SynMacroCall + (SynSymbol MyStruct2, + [Symbol (SynSymbol MyStruct2); Symbol (SynSymbol Example); + List + (Paren, + [List + (Bracket, + [Symbol (SynSymbol x); Trivia (Colon, (23,22--23,24)); + Symbol (SynSymbol int)], (23,20--23,28)); + List + (Bracket, + [Symbol (SynSymbol y); Trivia (Colon, (23,31--23,33)); + Symbol (SynSymbol int)], (23,29--23,37)); + List + (Bracket, + [Symbol (SynSymbol z); Trivia (Colon, (23,40--23,42)); + Symbol (SynSymbol int)], (23,38--23,46)); + List + (Bracket, + [Symbol (SynSymbol w); Trivia (Colon, (23,49--23,51)); + Symbol (SynSymbol int)], (23,47--23,55))], + (23,19--23,56)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.X); + Symbol (SynSymbol x)], (24,2--24,16)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); + Symbol (SynSymbol y)], (25,2--25,16)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Z); + Symbol (SynSymbol z)], (26,2--26,16)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.W); + Symbol (SynSymbol w)], (27,2--27,16)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol fn); + Symbol (SynSymbol d.Sum); Const (Unit, (29,19--29,21)); + List + (Paren, + [Symbol (SynSymbol +); + List + (Paren, [Symbol (SynSymbol +X); Symbol (SynSymbol d)], + (29,25--29,31)); + List + (Paren, [Symbol (SynSymbol +Y); Symbol (SynSymbol d)], + (29,32--29,38)); + List + (Paren, [Symbol (SynSymbol +Z); Symbol (SynSymbol d)], + (29,39--29,45)); + List + (Paren, [Symbol (SynSymbol +W); Symbol (SynSymbol d)], + (29,46--29,52))], (29,22--29,53))], (29,2--29,54))], + (23,1--29,54))), (23,0--29,55)); + Expr + (LetOrUse + (Named (SynSymbol instance, (31,5--31,13)), + FunctionCall + (Symbol (SynSymbol mkExample), + [Const (Int32 1, (31,25--31,26)); + Const (Int32 2, (31,27--31,28)); + Const (Int32 3, (31,29--31,30)); + Const (Int32 4, (31,31--31,32))], (31,15--31,32)), None, + (31,1--31,33)), (31,0--31,34)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Example Struct is %A", Regular, (33,9--33,31)), + (33,9--33,31)); Symbol (SynSymbol instance)], (33,1--33,40)), + (33,0--33,41)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Example IsValueType %A", Regular, (34,9--34,33)), + (34,9--34,33)); + ThreadLast + ([Expr (Symbol (SynSymbol instance), (34,39--34,47)); + Method (SynSymbol GetType, Tuple, (34,48--34,56)); + Property (SynSymbol IsValueType, (34,57--34,69))], + (34,35--34,69))], (34,1--34,70)), (34,0--34,71)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (35,0--35,48)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Example Result is %i", Regular, (35,9--35,31)), + (35,9--35,31)); + DotMethod + (Symbol (SynSymbol instance), SynSymbol Sum, [], Tuple, + (35,33--35,46))], (35,1--35,47)), None, (35,0--35,48)), + (35,0--35,48)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (35,0--35,48)), (35,0--35,48)); + Symbol (SynSymbol visp_result_todo)], (35,0--35,48)), + (35,0--35,48))], (8,0--35,48))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-3.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-3.structured output.verified.txt new file mode 100644 index 0000000..0f1588e --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-3.structured output.verified.txt @@ -0,0 +1,182 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacro + (SynMacro + (SynSymbol MyStruct3, + [SynMacroCase + ([Discard (9,4--9,5); Symbol (SynSymbol typ, (9,6--9,9)); + List + ([Symbol (SynSymbol arg, (9,11--9,14)); + Symbol (SynSymbol ctor, (9,15--9,19)); + Ellipsis (9,20--9,23)], (9,10--9,24)); + Symbol (SynSymbol body, (9,25--9,29)); + Ellipsis (9,30--9,33)], + List + (Paren, + [List + (HashBracket, [Symbol (SynSymbol Struct)], + (10,5--10,14)); Symbol (SynSymbol type); + Symbol (SynSymbol typ); + List + (Paren, + [Symbol (SynSymbol arg); Symbol (SynSymbol ctor); + Ellipsis (11,25--11,28)], (11,15--11,29)); + Symbol (SynSymbol body); Ellipsis (12,11--12,14)], + (10,4--13,5)), (9,2--14,3))], (8,1--14,3))), (8,0--14,4)); + Expr + (SyntaxMacro + (SynMacro + (SynSymbol my-and-3, + [SynMacroCase + ([Discard (17,4--17,5)], Const (Bool true, (17,7--17,11)), + (17,2--17,12)); + SynMacroCase + ([Discard (18,4--18,5); Symbol (SynSymbol one, (18,6--18,9))], + Symbol (SynSymbol one), (18,2--18,15)); + SynMacroCase + ([Discard (19,4--19,5); + Symbol (SynSymbol cond, (19,6--19,10)); + Symbol (SynSymbol exprs, (19,11--19,16)); + Ellipsis (19,17--19,20)], + List + (Paren, + [Symbol (SynSymbol if); Symbol (SynSymbol cond); + List + (Paren, + [Symbol (SynSymbol my-and-3); + Symbol (SynSymbol exprs); Ellipsis (21,22--21,25)], + (21,6--21,26)); Const (Bool false, (22,6--22,11))], + (20,4--22,12)), (19,2--23,3))], (16,1--23,3))), + (16,0--23,4)); + Expr + (SyntaxMacroCall + (SynMacroCall + (SynSymbol MyStruct3, + [Symbol (SynSymbol MyStruct3); Symbol (SynSymbol Range); + List + (Paren, + [List + (Bracket, + [Symbol (SynSymbol start); + Trivia (Colon, (25,24--25,26)); + Symbol (SynSymbol int64)], (25,18--25,32)); + List + (Bracket, + [Symbol (SynSymbol len); Trivia (Colon, (25,37--25,39)); + Symbol (SynSymbol int64)], (25,33--25,45))], + (25,17--25,46)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Start); + Symbol (SynSymbol start)], (26,2--26,24)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.Len); + Symbol (SynSymbol len)], (27,2--27,20)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol _.End); + List + (Paren, + [Symbol (SynSymbol +); Symbol (SynSymbol start); + Symbol (SynSymbol len)], (28,16--28,29))], + (28,2--28,30)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol fn); + Symbol (SynSymbol d.Offset); + List (Paren, [Symbol (SynSymbol v)], (30,22--30,25)); + List + (Paren, + [Symbol (SynSymbol -); Symbol (SynSymbol v); + List + (Paren, + [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], + (31,9--31,19))], (31,4--31,20))], (30,2--31,21)); + List + (Paren, + [Symbol (SynSymbol member); Symbol (SynSymbol fn); + Symbol (SynSymbol d.Contains); + List (Paren, [Symbol (SynSymbol v)], (33,24--33,27)); + List + (Paren, + [Symbol (SynSymbol my-and-3); + List + (Paren, + [Symbol (SynSymbol >=); Symbol (SynSymbol v); + List + (Paren, + [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], + (35,12--35,22))], (35,6--35,23)); + List + (Paren, + [Symbol (SynSymbol <); Symbol (SynSymbol v); + List + (Paren, + [Symbol (SynSymbol +End); Symbol (SynSymbol d)], + (36,11--36,19))], (36,6--36,20))], (34,4--36,21))], + (33,2--37,3)); + List + (Paren, + [Symbol (SynSymbol override); Symbol (SynSymbol fn); + Symbol (SynSymbol t.ToString); Const (Unit, (39,26--39,28)); + List + (Paren, + [Symbol (SynSymbol sprintf); + Const + (String ("Range(%i, %i)", Regular, (40,13--40,28)), + (40,13--40,28)); + List + (Paren, + [Symbol (SynSymbol +Start); Symbol (SynSymbol t)], + (40,29--40,39)); + List + (Paren, + [Symbol (SynSymbol +Len); Symbol (SynSymbol t)], + (40,40--40,48))], (40,4--40,49))], (39,2--40,50))], + (25,1--40,50))), (25,0--41,1)); + Expr + (LetOrUse + (Named (SynSymbol instance, (43,5--43,13)), + New + (Ident Range, + [Const (Int32 1, (43,25--43,26)); + Const (Int32 2, (43,27--43,28))], (43,15--43,28)), None, + (43,1--43,29)), (43,0--43,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Example Struct is %A", Regular, (45,9--45,31)), + (45,9--45,31)); Symbol (SynSymbol instance)], (45,1--45,40)), + (45,0--45,41)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Example IsValueType %A", Regular, (46,9--46,33)), + (46,9--46,33)); + ThreadLast + ([Expr (Symbol (SynSymbol instance), (46,39--46,47)); + Method (SynSymbol GetType, Tuple, (46,48--46,56)); + Property (SynSymbol IsValueType, (46,57--46,69))], + (46,35--46,69))], (46,1--46,70)), (46,0--46,71)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (47,0--47,53)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Example Result is %A", Regular, (47,9--47,31)), + (47,9--47,31)); + DotMethod + (Symbol (SynSymbol instance), SynSymbol ToString, [], Tuple, + (47,33--47,51))], (47,1--47,52)), None, (47,0--47,53)), + (47,0--47,53)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (47,0--47,53)), (47,0--47,53)); + Symbol (SynSymbol visp_result_todo)], (47,0--47,53)), + (47,0--47,53))], (8,0--47,53))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-0.structured output.verified.txt new file mode 100644 index 0000000..fd2edf0 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-0.structured output.verified.txt @@ -0,0 +1,94 @@ +ParsedFile + [AnonModule + ([HashDirective + (ParsedHashDirective + ("nowarn", [String ("0026", Regular, (10,8--10,14))], (10,0--10,14)), + (10,0--10,14)); + Expr + (SyntaxMacro + (SynMacro + (SynSymbol matchfnexample, + [SynMacroCase + ([Discard (13,4--13,5); Symbol (SynSymbol sym, (13,6--13,9)); + Symbol (SynSymbol m, (13,10--13,11)); + Symbol (SynSymbol rest, (13,12--13,16)); + Ellipsis (13,17--13,20)], + List + (Paren, + [Symbol (SynSymbol fn); Symbol (SynSymbol sym); + List (Paren, [Symbol (SynSymbol arg)], (14,12--14,17)); + List + (Paren, + [Symbol (SynSymbol match); Symbol (SynSymbol arg); + Symbol (SynSymbol m); Symbol (SynSymbol rest); + Ellipsis (17,13--17,16)], (15,6--18,7))], + (14,4--18,8)), (13,2--19,3))], (12,1--19,3))), + (12,0--19,4)); + Expr + (SyntaxMacroCall + (SynMacroCall + (SynSymbol matchfnexample, + [Symbol (SynSymbol matchfnexample); Symbol (SynSymbol name); + List + (Bracket, + [List + (Paren, + [Symbol (SynSymbol !tuple); Symbol (SynSymbol a); + Symbol (SynSymbol b)], (22,3--22,15)); + List + (Paren, + [Symbol (SynSymbol +); Symbol (SynSymbol a); + Symbol (SynSymbol b)], (23,4--23,11))], (22,2--23,12)); + List + (Bracket, + [Discard (24,3--24,4); Const (Int32 0, (24,5--24,6))], + (24,2--24,7))], (21,1--24,7))), (21,0--24,8)); + Expr + (FunctionDef + (SynSymbol name2, None, + Args (List [Named (SynSymbol tup, (26,11--26,14))], (26,10--26,15)), + [Match + (Symbol (SynSymbol tup), + [SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol a, (28,13--28,14)); + Trivia (Comma, (28,5--28,6)); + Named (SynSymbol b, (28,15--28,16))], (28,5--28,17))), + None, + [Op + (Infix + (SynSymbol +, + [Symbol (SynSymbol a); Symbol (SynSymbol b)], + (28,19--28,24)))], (28,5--28,25)); + SynMatch + (Discard (29,5--29,6), None, [Const (Int32 0, (29,7--29,8))], + (29,5--29,8))], (27,3--29,9))], (26,1--29,10)), + (26,0--29,11)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (31,0--33,23)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("%A & %A", Regular, (31,9--31,18)), (31,9--31,18)); + FunctionCall + (Symbol (SynSymbol name), + [Tuple + ([Const (Int32 1, (32,16--32,17)); + Const (Int32 2, (32,18--32,19))], (32,9--32,19))], + (32,3--32,20)); + FunctionCall + (Symbol (SynSymbol name2), + [Tuple + ([Const (Int32 1, (33,17--33,18)); + Const (Int32 2, (33,19--33,20))], (33,10--33,20))], + (33,3--33,21))], (31,1--33,22)), None, (31,0--33,23)), + (31,0--33,23)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (31,0--33,23)), (31,0--33,23)); + Symbol (SynSymbol visp_result_todo)], (31,0--33,23)), + (31,0--33,23))], (10,0--33,23))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-2.structured output.verified.txt new file mode 100644 index 0000000..db52823 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-2.structured output.verified.txt @@ -0,0 +1,112 @@ +ParsedFile + [AnonModule + ([HashDirective + (ParsedHashDirective + ("nowarn", [String ("0026", Regular, (9,8--9,14))], (9,0--9,14)), + (9,0--9,14)); + Expr + (SyntaxMacro + (SynMacro + (SynSymbol custom-match-fn, + [SynMacroCase + ([Discard (12,4--12,5); + List + ([Symbol (SynSymbol c, (12,7--12,8)); + Ellipsis (12,9--12,12)], (12,6--12,13)); + Symbol (SynSymbol rest, (12,14--12,18)); + Ellipsis (12,19--12,22)], + List + (Paren, + [Symbol (SynSymbol fn); + List (Paren, [Symbol (SynSymbol arg)], (13,8--13,13)); + List + (Paren, + [Symbol (SynSymbol match); Symbol (SynSymbol arg); + List + (Bracket, + [Symbol (SynSymbol c); Ellipsis (15,11--15,14)], + (15,8--15,15)); Symbol (SynSymbol rest); + Ellipsis (16,13--16,16)], (14,6--17,7))], + (13,4--17,8)), (12,2--18,3)); + SynMacroCase + ([Discard (19,4--19,5); Symbol (SynSymbol sym, (19,6--19,9)); + Symbol (SynSymbol m, (19,10--19,11)); + Symbol (SynSymbol rest, (19,12--19,16)); + Ellipsis (19,17--19,20)], + List + (Paren, + [Symbol (SynSymbol fn); Symbol (SynSymbol sym); + List (Paren, [Symbol (SynSymbol arg)], (20,12--20,17)); + List + (Paren, + [Symbol (SynSymbol match); Symbol (SynSymbol arg); + Symbol (SynSymbol m); Symbol (SynSymbol rest); + Ellipsis (23,13--23,16)], (21,6--24,7))], + (20,4--24,8)), (19,2--25,3))], (11,1--25,3))), + (11,0--26,1)); + Expr + (LetOrUse + (Named (SynSymbol lambda, (28,5--28,11)), + SyntaxMacroCall + (SynMacroCall + (SynSymbol custom-match-fn, + [Symbol (SynSymbol custom-match-fn); + List + (Bracket, + [List + (Paren, + [Symbol (SynSymbol a); Trivia (Dot, (28,33--28,35)); + Symbol (SynSymbol b)], (28,30--28,37)); + List + (Paren, + [Symbol (SynSymbol +); Symbol (SynSymbol a); + Symbol (SynSymbol b)], (28,38--28,45))], + (28,29--28,46))], (28,13--28,46))), None, (28,1--28,47)), + (28,0--28,48)); + Expr + (SyntaxMacroCall + (SynMacroCall + (SynSymbol custom-match-fn, + [Symbol (SynSymbol custom-match-fn); Symbol (SynSymbol named); + List + (Bracket, + [List + (Paren, + [Symbol (SynSymbol a); Trivia (Dot, (30,6--30,8)); + Symbol (SynSymbol b)], (30,3--30,10)); + List + (Paren, + [Symbol (SynSymbol +); Symbol (SynSymbol a); + Symbol (SynSymbol b)], (30,11--30,18))], (30,2--30,19))], + (29,1--30,19))), (29,0--30,20)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("lambda: %i", Regular, (32,9--32,21)), (32,9--32,21)); + FunctionCall + (Symbol (SynSymbol lambda), + [Tuple + ([Const (Int32 1, (32,31--32,32)); + Const (Int32 2, (32,35--32,36))], (32,31--32,36))], + (32,23--32,37))], (32,1--32,38)), (32,0--32,39)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (33,0--33,37)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("named: %i", Regular, (33,9--33,20)), (33,9--33,20)); + FunctionCall + (Symbol (SynSymbol named), + [Tuple + ([Const (Int32 1, (33,29--33,30)); + Const (Int32 2, (33,33--33,34))], (33,29--33,34))], + (33,22--33,35))], (33,1--33,36)), None, (33,0--33,37)), + (33,0--33,37)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (33,0--33,37)), (33,0--33,37)); + Symbol (SynSymbol visp_result_todo)], (33,0--33,37)), + (33,0--33,37))], (9,0--33,37))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_up-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_up-macro-0.structured output.verified.txt new file mode 100644 index 0000000..08a2fb4 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_up-macro-0.structured output.verified.txt @@ -0,0 +1,37 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol DoingThings, None, Args (List [], (8,16--8,18)), + [LetOrUse + (Named (SynSymbol items, (9,7--9,12)), + Collection (SynCollection (FsSet, [], (9,14--9,18))), Mutable, + (9,3--9,19)); + ForTo + (SynSymbol i, Const (Int32 0, (11,14--11,15)), + Const (Int32 5, (11,19--11,20)), + [SyntaxMacroCall + (SynMacroCall + (SynSymbol up!, + [Symbol (SynSymbol up!); Symbol (SynSymbol items); + List + (Paren, + [Symbol (SynSymbol Set.add); Symbol (SynSymbol i)], + (12,15--12,26))], (12,5--12,26)))], false, + (11,3--12,27)); Symbol (SynSymbol items)], (8,1--14,7)), + (8,0--14,8)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (17,0--17,28)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,9--17,13)), (17,9--17,13)); + FunctionCall + (Symbol (SynSymbol DoingThings), [], (17,15--17,26))], + (17,1--17,27)), None, (17,0--17,28)), (17,0--17,28)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,0--17,28)), (17,0--17,28)); + Symbol (SynSymbol visp_result_todo)], (17,0--17,28)), + (17,0--17,28))], (8,0--17,28))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_when-unless-example-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_when-unless-example-0.structured output.verified.txt new file mode 100644 index 0000000..4225ad4 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_when-unless-example-0.structured output.verified.txt @@ -0,0 +1,85 @@ +ParsedFile + [AnonModule + ([Expr + (SyntaxMacro + (SynMacro + (SynSymbol MyWhen1, + [SynMacroCase + ([Discard (9,4--9,5); Symbol (SynSymbol test, (9,6--9,10)); + Symbol (SynSymbol body, (9,11--9,15)); + Ellipsis (9,16--9,19)], + List + (Paren, + [Symbol (SynSymbol if); Symbol (SynSymbol test); + List + (Paren, + [Symbol (SynSymbol begin); Symbol (SynSymbol body); + Ellipsis (11,18--11,21)], (11,6--11,22))], + (10,4--11,23)), (9,2--12,3))], (8,1--12,3))), (8,0--12,4)); + Expr + (SyntaxMacro + (SynMacro + (SynSymbol MyUnless1, + [SynMacroCase + ([Discard (15,4--15,5); + Symbol (SynSymbol test, (15,6--15,10)); + Symbol (SynSymbol body, (15,11--15,15)); + Ellipsis (15,16--15,19)], + List + (Paren, + [Symbol (SynSymbol if); + List + (Paren, + [Symbol (SynSymbol not); Symbol (SynSymbol test)], + (16,8--16,18)); + List + (Paren, + [Symbol (SynSymbol begin); Symbol (SynSymbol body); + Ellipsis (17,18--17,21)], (17,6--17,22))], + (16,4--17,23)), (15,2--18,3))], (14,1--18,3))), + (14,0--18,4)); + Expr + (SyntaxMacroCall + (SynMacroCall + (SynSymbol MyWhen1, + [Symbol (SynSymbol MyWhen1); Const (Bool true, (20,9--20,13)); + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("inside when 1", Regular, (21,11--21,26)), + (21,11--21,26))], (21,2--21,27)); + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("inside when 2", Regular, (22,11--22,26)), + (22,11--22,26))], (22,2--22,27))], (20,1--22,27))), + (20,0--23,1)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (25,0--27,30)), + SyntaxMacroCall + (SynMacroCall + (SynSymbol MyUnless1, + [Symbol (SynSymbol MyUnless1); + Const (Bool false, (25,11--25,16)); + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("inside unless 3", Regular, (26,11--26,28)), + (26,11--26,28))], (26,2--26,29)); + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("inside unless 4", Regular, (27,11--27,28)), + (27,11--27,28))], (27,2--27,29))], (25,1--27,29))), + None, (25,0--27,30)), (25,0--27,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (25,0--27,30)), (25,0--27,30)); + Symbol (SynSymbol visp_result_todo)], (25,0--27,30)), + (25,0--27,30))], (8,0--27,30))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_while-match-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_while-match-0.structured output.verified.txt new file mode 100644 index 0000000..48d434b --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_while-match-0.structured output.verified.txt @@ -0,0 +1,79 @@ +ParsedFile + [AnonModule + ([Expr + (Type + (SynSymbol Counter, Args (Tuple [], (8,14--8,16)), + [Mut + (Named (SynSymbol count, (9,7--9,12)), + Const (Int32 0, (9,13--9,14)), (9,3--9,14)); + MemberFn + (SynSymbol _.DoStuff, Args (List [], (10,23--10,25)), + [If + (Op + (Infix + (SynSymbol >, + [Symbol (SynSymbol count); + Const (Int32 6, (11,17--11,18))], (11,9--11,18))), + Symbol (SynSymbol None), + Some + (Begin + ([Set + (Symbol (SynSymbol count), + FunctionCall + (Symbol (SynSymbol inc), + [Symbol (SynSymbol count)], (14,21--14,30)), + (14,9--14,31)); + FunctionCall + (Symbol (SynSymbol Some), + [Symbol (SynSymbol count)], (15,9--15,19))], Do, + (13,7--15,20))), (11,5--16,7))], (10,3--17,5))], [], + (8,1--17,6)), (8,0--17,7)); + Expr + (LetOrUse + (Named (SynSymbol counter, (19,5--19,12)), + New (Ident Counter, [], (19,14--19,25)), None, (19,1--19,26)), + (19,0--19,27)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (21,0--26,10)), + SyntaxMacroCall + (SynMacroCall + (SynSymbol while-match, + [Symbol (SynSymbol while-match); + List + (Paren, + [Symbol (SynSymbol .DoStuff); Symbol (SynSymbol counter)], + (21,13--21,31)); + List + (Bracket, + [Symbol (SynSymbol None); + Const (Bool false, (22,8--22,13))], (22,2--22,14)); + List + (Bracket, + [List + (Paren, + [Symbol (SynSymbol Some); Symbol (SynSymbol c)], + (23,3--23,11)); + List + (Paren, + [Symbol (SynSymbol printfn); + Const + (String ("Count is: %i", Regular, (24,13--24,27)), + (24,13--24,27)); Symbol (SynSymbol c)], + (24,4--24,30)); + List + (Paren, + [Symbol (SynSymbol let); Discard (25,9--25,10); + List + (Paren, + [Symbol (SynSymbol .DoStuff); + Symbol (SynSymbol counter)], (25,11--25,29))], + (25,4--25,30)); Const (Bool true, (26,4--26,8))], + (23,2--26,9))], (21,1--26,9))), None, (21,0--26,10)), + (21,0--26,10)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (21,0--26,10)), (21,0--26,10)); + Symbol (SynSymbol visp_result_todo)], (21,0--26,10)), + (21,0--26,10))], (8,0--26,10))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_numbers_int-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_numbers_int-0.structured output.verified.txt new file mode 100644 index 0000000..33fedc0 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_numbers_int-0.structured output.verified.txt @@ -0,0 +1,28 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("int32 is %A", Regular, (9,9--9,22)), (9,9--9,22)); + Const (Int32 99, (9,23--9,25))], (9,1--9,25)), (9,0--9,26)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("int32 is %A", Regular, (10,9--10,22)), (10,9--10,22)); + Const (Int32 99, (10,23--10,26))], (10,1--10,26)), (10,0--10,27)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (11,0--11,27)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("int64 is %A", Regular, (11,9--11,22)), + (11,9--11,22)); Const (Int64 99L, (11,23--11,26))], + (11,1--11,26)), None, (11,0--11,27)), (11,0--11,27)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (11,0--11,27)), (11,0--11,27)); + Symbol (SynSymbol visp_result_todo)], (11,0--11,27)), + (11,0--11,27))], (9,0--11,27))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_call-tuple-args-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_call-tuple-args-0.structured output.verified.txt new file mode 100644 index 0000000..21c81a5 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_call-tuple-args-0.structured output.verified.txt @@ -0,0 +1,45 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("result is is %A", Regular, (8,9--8,26)), (8,9--8,26)); + DotMethod + (Symbol (SynSymbol System.String), SynSymbol Concat, + [Tuple + ([Const + (String ("first", Regular, (8,51--8,58)), (8,51--8,58)); + Const + (String ("second", Regular, (8,60--8,68)), (8,60--8,68)); + Const + (String ("third", Regular, (8,70--8,77)), (8,70--8,77))], + (8,51--8,77))], Apply, (8,28--8,78))], (8,1--8,79)), + (8,0--8,80)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (9,0--9,79)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("result is is %A", Regular, (9,9--9,26)), + (9,9--9,26)); + FunctionCall + (Symbol (SynSymbol System.String.Concat), + [Tuple + ([Const + (String ("first", Regular, (9,50--9,57)), + (9,50--9,57)); + Const + (String ("second", Regular, (9,59--9,67)), + (9,59--9,67)); + Const + (String ("third", Regular, (9,69--9,76)), + (9,69--9,76))], (9,50--9,76))], (9,28--9,77))], + (9,1--9,78)), None, (9,0--9,79)), (9,0--9,79)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (9,0--9,79)), (9,0--9,79)); + Symbol (SynSymbol visp_result_todo)], (9,0--9,79)), (9,0--9,79))], + (8,0--9,79))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_lambda-shorthand-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_lambda-shorthand-0.structured output.verified.txt new file mode 100644 index 0000000..b75cb37 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_lambda-shorthand-0.structured output.verified.txt @@ -0,0 +1,25 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol temp, (8,5--8,9)), + LambdaShort + (Op + (Infix + (SynSymbol +, + [Symbol (SynSymbol %1); Symbol (SynSymbol %2)], + (8,12--8,19))), (8,10--8,20)), None, (8,1--8,20)), + (8,0--8,21)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (9,0--9,10)), + FunctionCall + (Symbol (SynSymbol temp), + [Const (Int32 1, (9,6--9,7)); Const (Int32 2, (9,8--9,9))], + (9,1--9,9)), None, (9,0--9,10)), (9,0--9,10)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (9,0--9,10)), (9,0--9,10)); + Symbol (SynSymbol visp_result_todo)], (9,0--9,10)), (9,0--9,10))], + (8,0--9,10))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_let-values.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_let-values.structured output.verified.txt new file mode 100644 index 0000000..389df01 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_let-values.structured output.verified.txt @@ -0,0 +1,39 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%i", Regular, (13,9--13,13)), (13,9--13,13)); + FunctionCall + (Symbol (SynSymbol add), + [Const (Int32 1, (13,19--13,20)); + Const (Int32 2, (13,21--13,22))], (13,15--13,22))], + (13,1--13,23)), (13,0--13,24)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%i", Regular, (14,9--14,13)), (14,9--14,13)); + FunctionCall + (Symbol (SynSymbol List.reduce), + [Symbol (SynSymbol add); + Collection + (SynCollection + (FsList, + [Const (Int32 1, (14,38--14,39)); + Const (Int32 2, (14,40--14,41)); + Const (Int32 3, (14,42--14,43)); + Const (Int32 4, (14,44--14,45)); + Const (Int32 5, (14,46--14,47))], (14,32--14,47)))], + (14,15--14,48))], (14,1--14,49)), (14,0--14,50)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (16,0--16,20)), + Const + (String ("let-value support?", Regular, (16,0--16,20)), + (16,0--16,20)), None, (16,0--16,20)), (16,0--16,20)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (16,0--16,20)), (16,0--16,20)); + Symbol (SynSymbol visp_result_todo)], (16,0--16,20)), + (16,0--16,20))], (13,0--16,20))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-0.structured output.verified.txt new file mode 100644 index 0000000..c6b41e3 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-0.structured output.verified.txt @@ -0,0 +1,217 @@ +ParsedFile + [AnonModule + ([HashDirective + (ParsedHashDirective + ("nowarn", [String ("26", Regular, (9,8--9,12))], (9,0--9,12)), + (9,0--9,12)); + Expr + (Match + (Const (String ("hello", Regular, (11,7--11,14)), (11,7--11,14)), + [SynMatch + (Const (String ("hello", Regular, (12,3--12,10)), (12,3--12,10)), + None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("was hello", Regular, (13,13--13,24)), + (13,13--13,24))], (13,5--13,24))], (12,3--13,25)); + SynMatch + (Discard (15,3--15,4), None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("default", Regular, (16,13--16,22)), + (16,13--16,22))], (16,5--16,22))], (15,3--16,23))], + (11,1--17,3)), (11,0--17,4)); + Expr + (Match + (Tuple + ([Const (Int32 1, (19,15--19,16)); + Const (Int32 2, (19,17--19,18))], (19,8--19,18)), + [SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol a, (20,12--20,13)); + Trivia (Comma, (20,4--20,5)); + Const (Int32 2, (20,14--20,15))], (20,4--20,16))), + Some + (Op + (Infix + (SynSymbol >=, + [Symbol (SynSymbol a); Const (Int32 0, (21,16--21,17))], + (21,11--21,17)))), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("a is %A", Regular, (22,13--22,22)), + (22,13--22,22)); Symbol (SynSymbol a)], (22,5--22,24))], + (20,4--22,25)); + SynMatch + (Discard (24,3--24,4), None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("default", Regular, (25,13--25,22)), + (25,13--25,22))], (25,5--25,22))], (24,3--25,23))], + (19,1--26,3)), (19,0--26,4)); + Expr + (Match + (Tuple + ([Const (Int32 1, (28,15--28,16)); + Const (Int32 2, (28,17--28,18))], (28,8--28,18)), + [SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol a, (29,5--29,6)); + Trivia (Comma, (29,6--29,7)); + Const (Int32 2, (29,8--29,9))], (29,4--29,10))), + Some + (Op + (Infix + (SynSymbol >=, + [Symbol (SynSymbol a); Const (Int32 0, (30,16--30,17))], + (30,11--30,17)))), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("a is %A", Regular, (31,13--31,22)), + (31,13--31,22)); Symbol (SynSymbol a)], (31,5--31,24))], + (29,4--31,25)); + SynMatch + (Discard (33,3--33,4), None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("default", Regular, (34,13--34,22)), + (34,13--34,22))], (34,5--34,22))], (33,3--34,23))], + (28,1--35,3)), (28,0--35,4)); + Expr + (Match + (FunctionCall + (Symbol (SynSymbol Some), [Const (Int32 1, (37,13--37,14))], + (37,8--37,14)), + [SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol Some, (38,5--38,9)); + Named (SynSymbol a, (38,10--38,11))], (38,4--38,12))), + Some + (Op + (Infix + (SynSymbol >=, + [Symbol (SynSymbol a); Const (Int32 0, (39,16--39,17))], + (39,11--39,17)))), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("a is %A", Regular, (40,13--40,22)), + (40,13--40,22)); Symbol (SynSymbol a)], (40,5--40,24))], + (38,4--40,25)); + SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol Some, (42,5--42,9)); + Discard (42,10--42,11)], (42,4--42,12))), None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("some other", Regular, (43,13--43,25)), + (43,13--43,25))], (43,5--43,25))], (42,4--43,26)); + SynMatch + (Discard (45,3--45,4), None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("default", Regular, (46,13--46,22)), + (46,13--46,22))], (46,5--46,22))], (45,3--46,23))], + (37,1--47,3)), (37,0--48,1)); + Expr + (Match + (Collection + (SynCollection + (FsList, + [Const (Int32 1, (50,8--50,9)); + Const (Int32 2, (50,13--50,14)); + Const (Int32 3, (50,18--50,19)); + Const (Int32 4, (50,23--50,24)); + Const (Unit, (50,28--50,30))], (50,8--50,30))), + [SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x, (51,4--51,5)); + Trivia (ColonColon, (51,6--51,8)); + Named (SynSymbol y, (51,9--51,10)); + Trivia (ColonColon, (51,11--51,13)); + Named (SynSymbol rest, (51,14--51,18))], (51,3--51,19))), + None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String + ("x is %A y is %A rest is %A", Regular, + (52,13--52,41)), (52,13--52,41)); + Symbol (SynSymbol x); Symbol (SynSymbol y); + Symbol (SynSymbol rest)], (52,5--52,50))], (51,3--52,51)); + SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x, (54,4--54,5)); + Trivia (ColonColon, (54,6--54,8)); + Named (SynSymbol rest, (54,9--54,13))], (54,3--54,14))), + None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("x is %A rest is %A", Regular, (55,13--55,33)), + (55,13--55,33)); Symbol (SynSymbol x); + Symbol (SynSymbol rest)], (55,5--55,40))], (54,3--55,41)); + SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x, (57,4--57,5)); + Trivia (ColonColon, (57,6--57,8)); + Collection (SynCollection (Bracket, [], (57,9--57,11)))], + (57,3--57,12))), None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String + ("x is %A rest is empty", Regular, (58,13--58,36)), + (58,13--58,36)); Symbol (SynSymbol x)], (58,5--58,38))], + (57,3--58,39)); + SynMatch + (Collection + (SynCollection + (Paren, + [Collection (SynCollection (Bracket, [], (60,4--60,6)))], + (60,3--60,7))), None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("empty", Regular, (60,17--60,24)), + (60,17--60,24))], (60,9--60,24))], (60,3--60,25)); + SynMatch + (Collection (SynCollection (Bracket, [], (61,3--61,5))), None, + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("empty", Regular, (61,15--61,22)), + (61,15--61,22))], (61,7--61,22))], (61,3--61,23))], + (50,1--61,24)), (50,0--62,1)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (64,0--64,2)), + Const (Unit, (64,0--64,2)), None, (64,0--64,2)), (64,0--64,2)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (64,0--64,2)), (64,0--64,2)); + Symbol (SynSymbol visp_result_todo)], (64,0--64,2)), (64,0--64,2))], + (9,0--64,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-1.structured output.verified.txt new file mode 100644 index 0000000..67f7362 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-1.structured output.verified.txt @@ -0,0 +1,139 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol IsString, None, + Args + (List + [Typed + (Named (SynSymbol lhs, (8,15--8,18)), Ident obj, + (8,14--8,24))], (8,13--8,25)), + [Match + (Symbol (SynSymbol lhs), + [SynMatch + (IsInst (Ident string, (10,5--10,16)), None, + [Const (Bool true, (10,17--10,21))], (10,5--10,21)); + SynMatch + (Discard (11,5--11,6), None, + [Const (Bool false, (11,7--11,12))], (11,5--11,12))], + (9,3--11,13))], (8,1--12,3)), (8,0--12,4)); + Expr + (FunctionDef + (SynSymbol AreEqualStrings, None, + Args + (List + [Typed + (Named (SynSymbol lhs, (14,22--14,25)), Ident obj, + (14,21--14,31)); + Typed + (Named (SynSymbol rhs, (14,33--14,36)), Ident obj, + (14,32--14,42))], (14,20--14,43)), + [Match + (Tuple + ([Symbol (SynSymbol lhs); Symbol (SynSymbol rhs)], + (15,10--15,18)), + [SynMatch + (Collection + (SynCollection + (Paren, + [Collection + (SynCollection + (Paren, + [As + (IsInst (Ident string, (16,7--16,16)), + Named (SynSymbol lhss, (16,17--16,21)), + (16,6--16,22))], (16,6--16,22))); + Trivia (Dot, (16,23--16,24)); + Collection + (SynCollection + (Paren, + [As + (IsInst (Ident string, (16,26--16,35)), + Named (SynSymbol rhss, (16,36--16,40)), + (16,25--16,41))], (16,25--16,41)))], + (16,5--16,42))), None, + [Op + (Infix + (SynSymbol =, + [Symbol (SynSymbol lhss); Symbol (SynSymbol rhss)], + (17,7--17,18)))], (16,5--17,19)); + SynMatch + (Discard (19,5--19,6), None, + [Const (Bool false, (19,7--19,12))], (19,5--19,12))], + (15,3--19,13))], (14,1--20,3)), (14,0--21,1)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("IsString: %A", Regular, (23,9--23,23)), (23,9--23,23)); + FunctionCall + (Symbol (SynSymbol IsString), [Const (Int32 1, (23,34--23,35))], + (23,25--23,35))], (23,1--23,36)), (23,0--23,37)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("IsString: %A", Regular, (24,9--24,23)), (24,9--24,23)); + FunctionCall + (Symbol (SynSymbol IsString), + [Const + (String ("foo", Regular, (24,34--24,39)), (24,34--24,39))], + (24,25--24,39))], (24,1--24,40)), (24,0--24,41)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("AreEqualStrings: %A", Regular, (26,9--26,30)), + (26,9--26,30)); + FunctionCall + (Symbol (SynSymbol AreEqualStrings), + [Const (Int32 1, (26,48--26,49)); + Const (Int32 2, (26,50--26,51))], (26,32--26,51))], + (26,1--26,52)), (26,0--26,53)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("AreEqualStrings: %A", Regular, (27,9--27,30)), + (27,9--27,30)); + FunctionCall + (Symbol (SynSymbol AreEqualStrings), + [Const + (String ("foo", Regular, (27,48--27,53)), (27,48--27,53)); + Const (Int32 2, (27,54--27,55))], (27,32--27,55))], + (27,1--27,56)), (27,0--27,57)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("AreEqualStrings: %A", Regular, (28,9--28,30)), + (28,9--28,30)); + FunctionCall + (Symbol (SynSymbol AreEqualStrings), + [Const + (String ("foo", Regular, (28,48--28,53)), (28,48--28,53)); + Const + (String ("foo", Regular, (28,54--28,59)), (28,54--28,59))], + (28,32--28,59))], (28,1--28,60)), (28,0--28,61)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (29,0--29,61)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("AreEqualStrings: %A", Regular, (29,9--29,30)), + (29,9--29,30)); + FunctionCall + (Symbol (SynSymbol AreEqualStrings), + [Const + (String ("foo", Regular, (29,48--29,53)), (29,48--29,53)); + Const + (String ("bar", Regular, (29,54--29,59)), (29,54--29,59))], + (29,32--29,59))], (29,1--29,60)), None, (29,0--29,61)), + (29,0--29,61)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (29,0--29,61)), (29,0--29,61)); + Symbol (SynSymbol visp_result_todo)], (29,0--29,61)), + (29,0--29,61))], (8,0--29,61))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_operators-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_operators-0.structured output.verified.txt new file mode 100644 index 0000000..19d118d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_operators-0.structured output.verified.txt @@ -0,0 +1,112 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol OrTest, None, + Args + (List + [Named (SynSymbol a, (8,12--8,13)); + Named (SynSymbol b, (8,14--8,15))], (8,11--8,16)), + [Op + (Infix + (SynSymbol ||, [Symbol (SynSymbol a); Symbol (SynSymbol b)], + (8,18--8,25)))], (8,1--8,26)), (8,0--8,27)); + Expr + (FunctionDef + (SynSymbol AndTest, None, + Args + (List + [Named (SynSymbol a, (9,13--9,14)); + Named (SynSymbol b, (9,15--9,16))], (9,12--9,17)), + [Op + (Infix + (SynSymbol &&, [Symbol (SynSymbol a); Symbol (SynSymbol b)], + (9,19--9,25)))], (9,1--9,26)), (9,0--9,27)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("OrTest %A", Regular, (11,9--11,20)), (11,9--11,20)); + FunctionCall + (Symbol (SynSymbol OrTest), + [Const (Bool false, (11,29--11,34)); + Const (Bool false, (11,35--11,40))], (11,22--11,40))], + (11,1--11,41)), (11,0--11,42)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("OrTest %A", Regular, (12,9--12,20)), (12,9--12,20)); + FunctionCall + (Symbol (SynSymbol OrTest), + [Const (Bool false, (12,29--12,34)); + Const (Bool true, (12,35--12,39))], (12,22--12,39))], + (12,1--12,40)), (12,0--12,41)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("OrTest %A", Regular, (13,9--13,20)), (13,9--13,20)); + FunctionCall + (Symbol (SynSymbol OrTest), + [Const (Bool true, (13,29--13,33)); + Const (Bool false, (13,34--13,39))], (13,22--13,39))], + (13,1--13,40)), (13,0--13,41)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("OrTest %A", Regular, (14,9--14,20)), (14,9--14,20)); + FunctionCall + (Symbol (SynSymbol OrTest), + [Const (Bool true, (14,29--14,33)); + Const (Bool true, (14,34--14,38))], (14,22--14,38))], + (14,1--14,39)), (14,0--14,40)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("AndTest %A", Regular, (16,9--16,21)), (16,9--16,21)); + FunctionCall + (Symbol (SynSymbol AndTest), + [Const (Bool false, (16,31--16,36)); + Const (Bool false, (16,37--16,42))], (16,23--16,42))], + (16,1--16,43)), (16,0--16,44)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("AndTest %A", Regular, (17,9--17,21)), (17,9--17,21)); + FunctionCall + (Symbol (SynSymbol AndTest), + [Const (Bool false, (17,31--17,36)); + Const (Bool true, (17,37--17,41))], (17,23--17,41))], + (17,1--17,42)), (17,0--17,43)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("AndTest %A", Regular, (18,9--18,21)), (18,9--18,21)); + FunctionCall + (Symbol (SynSymbol AndTest), + [Const (Bool true, (18,31--18,35)); + Const (Bool false, (18,36--18,41))], (18,23--18,41))], + (18,1--18,42)), (18,0--18,43)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (19,0--19,42)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("AndTest %A", Regular, (19,9--19,21)), (19,9--19,21)); + FunctionCall + (Symbol (SynSymbol AndTest), + [Const (Bool true, (19,31--19,35)); + Const (Bool true, (19,36--19,40))], (19,23--19,40))], + (19,1--19,41)), None, (19,0--19,42)), (19,0--19,42)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (19,0--19,42)), (19,0--19,42)); + Symbol (SynSymbol visp_result_todo)], (19,0--19,42)), + (19,0--19,42))], (8,0--19,42))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_props.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_props.structured output.verified.txt new file mode 100644 index 0000000..f605bb6 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_props.structured output.verified.txt @@ -0,0 +1,19 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol hello, (8,5--8,10)), + Const (String ("world", Regular, (8,11--8,18)), (8,11--8,18)), None, + (8,1--8,18)), (8,0--8,19)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (9,0--9,15)), + DotProperty + (Symbol (SynSymbol hello), SynSymbol Length, (9,1--9,14)), None, + (9,0--9,15)), (9,0--9,15)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (9,0--9,15)), (9,0--9,15)); + Symbol (SynSymbol visp_result_todo)], (9,0--9,15)), (9,0--9,15))], + (8,0--9,15))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_seq-as-generic-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_seq-as-generic-0.structured output.verified.txt new file mode 100644 index 0000000..3409ced --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_seq-as-generic-0.structured output.verified.txt @@ -0,0 +1,109 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol SeqAsArg, None, + Args + (List + [Typed + (Named (SynSymbol items, (8,15--8,20)), + Generic (Ident seq, [Ident ^T], (8,22--8,29)), + (8,14--8,30))], (8,13--8,31)), + [FunctionCall + (Symbol (SynSymbol Seq.length), [Symbol (SynSymbol items)], + (8,33--8,49))], (8,1--8,50)), (8,0--8,51)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (10,9--10,13)), (10,9--10,13)); + FunctionCall + (Symbol (SynSymbol SeqAsArg), + [Collection (SynCollection (FsList, [], (10,24--10,28)))], + (10,15--10,28))], (10,1--10,29)), (10,0--10,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (11,9--11,13)), (11,9--11,13)); + FunctionCall + (Symbol (SynSymbol SeqAsArg), + [Collection + (SynCollection + (FsList, [Const (Int32 1, (11,26--11,27))], + (11,24--11,29)))], (11,15--11,29))], (11,1--11,30)), + (11,0--11,31)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (12,9--12,13)), (12,9--12,13)); + FunctionCall + (Symbol (SynSymbol SeqAsArg), + [Collection + (SynCollection + (FsList, + [Const (Int32 1, (12,26--12,27)); + Const (Int32 2, (12,28--12,29))], (12,24--12,31)))], + (12,15--12,31))], (12,1--12,32)), (12,0--12,33)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (13,9--13,13)), (13,9--13,13)); + FunctionCall + (Symbol (SynSymbol SeqAsArg), + [Collection (SynCollection (FsArray, [], (13,24--13,28)))], + (13,15--13,28))], (13,1--13,29)), (13,0--13,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (14,9--14,13)), (14,9--14,13)); + FunctionCall + (Symbol (SynSymbol SeqAsArg), + [Collection + (SynCollection + (FsArray, [Const (Int32 1, (14,26--14,27))], + (14,24--14,29)))], (14,15--14,29))], (14,1--14,30)), + (14,0--14,31)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (15,9--15,13)), (15,9--15,13)); + FunctionCall + (Symbol (SynSymbol SeqAsArg), + [Collection + (SynCollection + (FsArray, + [Const (Int32 1, (15,26--15,27)); + Const (Int32 2, (15,28--15,29))], (15,24--15,31)))], + (15,15--15,31))], (15,1--15,32)), (15,0--15,33)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (16,9--16,13)), (16,9--16,13)); + FunctionCall + (Symbol (SynSymbol SeqAsArg), + [Computation + (SynSymbol seq, [Const (Unit, (16,31--16,33))], + (16,25--16,33))], (16,15--16,34))], (16,1--16,35)), + (16,0--16,36)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (17,0--17,53)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,9--17,13)), (17,9--17,13)); + FunctionCall + (Symbol (SynSymbol SeqAsArg), + [Computation + (SynSymbol seq, + [FsYield + (Const (Int32 1, (17,38--17,39)), false, + (17,32--17,39)); + FsYield + (Const (Int32 2, (17,48--17,49)), false, + (17,42--17,49))], (17,25--17,50))], (17,15--17,51))], + (17,1--17,52)), None, (17,0--17,53)), (17,0--17,53)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,0--17,53)), (17,0--17,53)); + Symbol (SynSymbol visp_result_todo)], (17,0--17,53)), + (17,0--17,53))], (8,0--17,53))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_span-to-int32-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_span-to-int32-0.structured output.verified.txt new file mode 100644 index 0000000..8dc2b6e --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_span-to-int32-0.structured output.verified.txt @@ -0,0 +1,53 @@ +ParsedFile + [AnonModule + ([Open (SynSymbol System, (8,1--8,12)); + Expr + (FunctionDef + (SynSymbol Test, None, + Args + (List + [Typed + (Named (SynSymbol text, (10,11--10,15)), Ident string, + (10,10--10,24))], (10,9--10,25)), + [LetOrUse + (Named (SynSymbol span1, (11,7--11,12)), + DotMethod + (Symbol (SynSymbol text), SynSymbol AsSpan, [], Tuple, + (11,14--11,26)), None, (11,3--11,27)); + FunctionCall + (Symbol (SynSymbol span->int32), [Symbol (SynSymbol span1)], + (12,3--12,20))], (10,1--12,21)), (10,0--13,1)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (15,9--15,13)), (15,9--15,13)); + FunctionCall + (Symbol (SynSymbol Test), + [Const (String ("99", Regular, (15,20--15,24)), (15,20--15,24))], + (15,15--15,24))], (15,1--15,25)), (15,0--15,26)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (16,9--16,13)), (16,9--16,13)); + FunctionCall + (Symbol (SynSymbol Test), + [Const (String ("0", Regular, (16,20--16,23)), (16,20--16,23))], + (16,15--16,23))], (16,1--16,24)), (16,0--16,25)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (17,0--17,25)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,9--17,13)), (17,9--17,13)); + FunctionCall + (Symbol (SynSymbol Test), + [Const + (String ("1", Regular, (17,20--17,23)), (17,20--17,23))], + (17,15--17,23))], (17,1--17,24)), None, (17,0--17,25)), + (17,0--17,25)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,0--17,25)), (17,0--17,25)); + Symbol (SynSymbol visp_result_todo)], (17,0--17,25)), + (17,0--17,25))], (8,0--17,25))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt new file mode 100644 index 0000000..2c2899c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt @@ -0,0 +1,69 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is: '%s'", Regular, (9,9--9,26)), (9,9--9,26)); + Const + (String + (" + this is + a multiline + string +", Regular, (9,27--13,1)), + (9,27--13,1))], (9,1--13,1)), (9,0--13,2)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is: '%s'", Regular, (15,9--15,26)), + (15,9--15,26)); + Const + (String + (" + this is + a multiline + string +", TripleQuote, + (15,27--19,3)), (15,27--19,3))], (15,1--19,3)), (15,0--19,4)); + Expr + (FunctionDef + (SynSymbol generate-test, None, + Args + (List [Named (SynSymbol path, (21,19--21,23))], (21,18--21,24)), + [LetOrUse + (Named (SynSymbol template, (22,7--22,15)), + FunctionCall + (Symbol (SynSymbol sprintf), + [Const + (String + (" +let ``can parse %s`` = + TestUtils.runTest %s + |> Async.AwaitTask + ", + TripleQuote, (22,25--26,5)), (22,25--26,5)); + Symbol (SynSymbol path); Symbol (SynSymbol path)], + (22,17--26,15)), None, (22,3--26,16)); + Symbol (SynSymbol template)], (21,1--28,10)), (21,0--28,11)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (30,0--30,49)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("test is: '%s'", Regular, (30,9--30,24)), + (30,9--30,24)); + FunctionCall + (Symbol (SynSymbol generate-test), + [Const + (String ("hello", Regular, (30,40--30,47)), + (30,40--30,47))], (30,26--30,47))], (30,1--30,48)), None, + (30,0--30,49)), (30,0--30,49)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (30,0--30,49)), (30,0--30,49)); + Symbol (SynSymbol visp_result_todo)], (30,0--30,49)), + (30,0--30,49))], (9,0--30,49))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt new file mode 100644 index 0000000..3fca28d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt @@ -0,0 +1,213 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol value, (8,5--8,10)), + Const + (String ("r:\rt:\tn:\na:\a\"", Regular, (8,11--8,31)), + (8,11--8,31)), None, (8,1--8,31)), (8,0--8,32)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is '%s'", Regular, (10,9--10,25)), + (10,9--10,25)); Symbol (SynSymbol value)], (10,1--10,31)), + (10,0--10,32)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is '%s'", Regular, (11,9--11,25)), + (11,9--11,25)); + Const + (String ("r:\rt:\tn:\na:\a", TripleQuote, (11,26--11,48)), + (11,26--11,48))], (11,1--11,48)), (11,0--11,49)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is '%s'", Regular, (12,9--12,25)), + (12,9--12,25)); + Const + (String ("r:\rt:\tn:\na:\a", TripleQuote, (12,26--12,50)), + (12,26--12,50))], (12,1--12,50)), (12,0--12,51)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is '%s'", Regular, (13,9--13,25)), + (13,9--13,25)); + Const + (String + (" + multiple lines are okay? +", TripleQuote, (13,26--15,3)), + (13,26--15,3))], (13,1--15,3)), (13,0--15,4)); + Expr + (Begin + ([Begin + ([Begin + ([FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is '%s'", Regular, (19,15--19,31)), + (19,15--19,31)); + Const + (String + (" + multiple lines are okay? + ", + TripleQuote, (19,32--21,9)), (19,32--21,9))], + (19,7--21,9))], Do, (18,5--21,10))], Do, (17,3--22,5))], + Do, (16,1--22,6)), (16,0--22,7)); + Expr + (FunctionDef + (SynSymbol genTestHeader, None, + Args + (List [Named (SynSymbol moduleName, (24,19--24,29))], + (24,18--24,30)), + [ThreadLast + ([Expr + (FunctionCall + (Symbol (SynSymbol sprintf), + [Const + (String + (" + // AUTO GENERATED + // DO NOT MODIFY BY HAND + + namespace %s + + open Xunit + + module %s + ", + TripleQuote, (25,16--34,5)), (25,16--34,5)); + Symbol (SynSymbol moduleName); + Symbol (SynSymbol moduleName)], (25,8--34,27)), + (25,7--34,28))], (25,3--34,28))], (24,1--35,5)), + (24,0--35,6)); + Expr + (LetOrUse + (Named (SynSymbol lf, (37,5--37,7)), + Symbol (SynSymbol System.Environment.NewLine), None, (37,1--37,34)), + (37,0--37,35)); + Expr + (FunctionDef + (SynSymbol genTestTemplate, None, + Args + (List + [Typed + (Named (SynSymbol prefix, (39,22--39,28)), Ident string, + (39,21--39,37)); + Typed + (Named (SynSymbol path, (39,39--39,43)), Ident string, + (39,38--39,52))], (39,20--39,53)), + [LetOrUse + (Named (SynSymbol path, (40,7--40,11)), + DotMethod + (Symbol (SynSymbol path), SynSymbol Replace, + [Const + (String ("\\", Regular, (40,27--40,31)), (40,27--40,31)); + Const + (String ("/", Regular, (40,32--40,35)), (40,32--40,35))], + Tuple, (40,13--40,35)), None, (40,3--40,36)); + LetOrUse + (Named (SynSymbol testname, (41,7--41,15)), + ThreadLast + ([Expr (Symbol (SynSymbol path), (41,21--41,25)); + Expr + (LambdaShort + (DotMethod + (Symbol (SynSymbol %1), SynSymbol Replace, + [Const + (String ("/", Regular, (41,40--41,43)), + (41,40--41,43)); + Const + (String ("_", Regular, (41,44--41,47)), + (41,44--41,47))], Tuple, (41,28--41,47)), + (41,26--41,48)), (41,26--41,48))], (41,17--41,48)), + None, (41,3--41,49)); + Begin + ([Begin + ([LetOrUse + (Named (SynSymbol template, (45,11--45,19)), + FunctionCall + (Symbol (SynSymbol sprintf), + [Const + (String + (" + [] + let ``%s %s`` () = TestUtils.runTest "%s" + ", + TripleQuote, (45,29--48,9)), (45,29--48,9)); + Symbol (SynSymbol prefix); + Symbol (SynSymbol testname); + Symbol (SynSymbol path)], (45,21--48,30)), None, + (45,7--48,31)); + LetOrUse + (Named (SynSymbol template2, (49,11--49,20)), + Const + (String + (" + [] + let ``interpolated {prefix} {testname}`` () = TestUtils.runTest "{path}" + ", + InterpolatedTripleQuote 1, (49,21--52,9)), + (49,21--52,9)), None, (49,7--52,9)); + LetOrUse + (Named (SynSymbol template3, (53,11--53,20)), + Const + (String + (" + [] + let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{path}} {path}" + ", + InterpolatedTripleQuote 2, (53,21--56,9)), + (53,21--56,9)), None, (53,7--56,9)); + LetOrUse + (Named (SynSymbol template4, (57,11--57,20)), + Const + (String + (" + [] + let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{(+ 1 2 3)}} {{(+ 1 2 3)}} {(+ 1 2 3)}" + ", + InterpolatedTripleQuote 2, (57,21--60,9)), + (57,21--60,9)), None, (57,7--60,9)); + Op + (Infix + (SynSymbol +, + [Symbol (SynSymbol template); Symbol (SynSymbol lf); + Symbol (SynSymbol template2); Symbol (SynSymbol lf); + Symbol (SynSymbol template3); Symbol (SynSymbol lf); + Symbol (SynSymbol template4); Symbol (SynSymbol lf)], + (61,7--61,59)))], Do, (44,5--61,60))], Do, + (43,3--62,5))], (39,1--62,6)), (39,0--63,1)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (65,0--65,91)), + Op + (Infix + (SynSymbol +, + [FunctionCall + (Symbol (SynSymbol genTestHeader), + [Const + (String ("Temp", Regular, (65,18--65,24)), + (65,18--65,24))], (65,4--65,24)); + Symbol (SynSymbol System.Environment.NewLine); + FunctionCall + (Symbol (SynSymbol genTestTemplate), + [Const + (String ("example", Regular, (65,70--65,79)), + (65,70--65,79)); + Const + (String ("example", Regular, (65,80--65,89)), + (65,80--65,89))], (65,54--65,89))], (65,1--65,90))), + None, (65,0--65,91)), (65,0--65,91)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (65,0--65,91)), (65,0--65,91)); + Symbol (SynSymbol visp_result_todo)], (65,0--65,91)), + (65,0--65,91))], (8,0--65,91))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt new file mode 100644 index 0000000..16c6dca --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt @@ -0,0 +1,60 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol value, (8,5--8,10)), + Const (String ("hello world", Regular, (8,11--8,24)), (8,11--8,24)), + None, (8,1--8,24)), (8,0--8,25)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is '%s'", Regular, (10,9--10,25)), + (10,9--10,25)); + Const + (String + ("interpolated: {value} {value.Length}", Interpolated 1, + (10,26--10,65)), (10,26--10,65))], (10,1--10,65)), + (10,0--10,66)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is '%s'", Regular, (11,9--11,25)), + (11,9--11,25)); + Const + (String + ("interpolated: {value} {value.Length}", + InterpolatedTripleQuote 1, (11,26--11,69)), (11,26--11,69))], + (11,1--11,69)), (11,0--11,70)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is '%s'", Regular, (12,9--12,25)), + (12,9--12,25)); + Const + (String + ("interpolated: {value} {{ value }} {{ value.Length }}", + InterpolatedTripleQuote 2, (12,26--12,86)), (12,26--12,86))], + (12,1--12,86)), (12,0--12,87)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (13,0--13,104)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is '%s'", Regular, (13,9--13,25)), + (13,9--13,25)); + Const + (String + ("interpolated: {value} {{ value }} {{{ value }}} {{{ value.Length }}}", + InterpolatedTripleQuote 3, (13,26--13,103)), + (13,26--13,103))], (13,1--13,103)), None, (13,0--13,104)), + (13,0--13,104)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (13,0--13,104)), (13,0--13,104)); + Symbol (SynSymbol visp_result_todo)], (13,0--13,104)), + (13,0--13,104))], (8,0--13,104))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-1.structured output.verified.txt new file mode 100644 index 0000000..fe8e61a --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-1.structured output.verified.txt @@ -0,0 +1,26 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol value, (8,5--8,10)), + Const (String ("hello world", Regular, (8,11--8,24)), (8,11--8,24)), + None, (8,1--8,24)), (8,0--8,25)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (10,0--10,67)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("string is '%s'", Regular, (10,9--10,25)), + (10,9--10,25)); + Const + (String + ("interpolated: {value} {value} {value}", Interpolated 1, + (10,26--10,66)), (10,26--10,66))], (10,1--10,66)), None, + (10,0--10,67)), (10,0--10,67)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (10,0--10,67)), (10,0--10,67)); + Symbol (SynSymbol visp_result_todo)], (10,0--10,67)), + (10,0--10,67))], (8,0--10,67))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_sym-with-arrow-in-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_sym-with-arrow-in-macro-0.structured output.verified.txt new file mode 100644 index 0000000..7c1e9ce --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_sym-with-arrow-in-macro-0.structured output.verified.txt @@ -0,0 +1,58 @@ +ParsedFile + [AnonModule + ([Open (SynSymbol System, (8,1--8,12)); + Expr + (SyntaxMacro + (SynMacro + (SynSymbol noop-macro-1, + [SynMacroCase + ([Discard (11,4--11,5); Symbol (SynSymbol ids, (11,6--11,9)); + Ellipsis (11,10--11,13)], + List + (Paren, + [Symbol (SynSymbol begin); Symbol (SynSymbol ids); + Ellipsis (11,26--11,29)], (11,15--11,30)), (11,2--11,31))], + (10,1--11,31))), (10,0--11,32)); + Expr + (FunctionDef + (SynSymbol something->nothing, Inline, + Args (List [Named (SynSymbol i, (13,31--13,32))], (13,30--13,33)), + [Symbol (SynSymbol i)], (13,1--13,35)), (13,0--13,36)); + Expr + (FunctionDef + (SynSymbol Test, Inline, + Args (List [Named (SynSymbol i, (15,17--15,18))], (15,16--15,19)), + [SyntaxMacroCall + (SynMacroCall + (SynSymbol noop-macro-1, + [Symbol (SynSymbol noop-macro-1); + List + (Paren, + [Symbol (SynSymbol something->nothing); + Symbol (SynSymbol i)], (16,16--16,38))], (16,3--16,38)))], + (15,1--16,39)), (15,0--16,40)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (18,9--18,13)), (18,9--18,13)); + FunctionCall + (Symbol (SynSymbol Test), [Const (Int32 1, (18,20--18,21))], + (18,15--18,21))], (18,1--18,22)), (18,0--18,23)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (19,0--19,29)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (19,9--19,13)), (19,9--19,13)); + FunctionCall + (Symbol (SynSymbol Test), + [Const + (String ("hello", Regular, (19,20--19,27)), + (19,20--19,27))], (19,15--19,27))], (19,1--19,28)), None, + (19,0--19,29)), (19,0--19,29)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (19,0--19,29)), (19,0--19,29)); + Symbol (SynSymbol visp_result_todo)], (19,0--19,29)), + (19,0--19,29))], (8,0--19,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_tuple-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_tuple-0.structured output.verified.txt new file mode 100644 index 0000000..831a779 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_tuple-0.structured output.verified.txt @@ -0,0 +1,35 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (8,9--8,13)), (8,9--8,13)); + Tuple + ([Const (Int32 1, (8,22--8,23)); Const (Int32 2, (8,24--8,25))], + (8,15--8,25))], (8,1--8,26)), (8,0--8,27)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (9,9--9,13)), (9,9--9,13)); + Tuple + ([Const (Int32 1, (9,22--9,23)); Const (Int32 2, (9,24--9,25)); + Const (Int32 3, (9,26--9,27))], (9,15--9,27))], (9,1--9,28)), + (9,0--9,29)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (10,0--10,31)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (10,9--10,13)), (10,9--10,13)); + Tuple + ([Const (Int32 1, (10,22--10,23)); + Const (Int32 2, (10,24--10,25)); + Const (Int32 3, (10,26--10,27)); + Const (Int32 4, (10,28--10,29))], (10,15--10,29))], + (10,1--10,30)), None, (10,0--10,31)), (10,0--10,31)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (10,0--10,31)), (10,0--10,31)); + Symbol (SynSymbol visp_result_todo)], (10,0--10,31)), + (10,0--10,31))], (8,0--10,31))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-0.structured output.verified.txt new file mode 100644 index 0000000..d4f9c63 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-0.structured output.verified.txt @@ -0,0 +1,192 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol no-type, None, + Args (List [Named (SynSymbol s, (8,13--8,14))], (8,12--8,15)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("no-type %A", Regular, (8,25--8,37)), (8,25--8,37)); + Symbol (SynSymbol s)], (8,17--8,39))], (8,1--8,40)), + (8,0--8,41)); + Expr + (FunctionCall + (Symbol (SynSymbol no-type), + [Const (String ("hello", Regular, (9,9--9,16)), (9,9--9,16))], + (9,1--9,16)), (9,0--9,17)); + Expr + (FunctionDef + (SynSymbol with-type, None, + Args + (List + [Typed + (Named (SynSymbol s, (11,16--11,17)), Ident string, + (11,15--11,26))], (11,14--11,27)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("with-type %A", Regular, (11,37--11,51)), + (11,37--11,51)); Symbol (SynSymbol s)], (11,29--11,53))], + (11,1--11,54)), (11,0--11,55)); + Expr + (FunctionCall + (Symbol (SynSymbol with-type), + [Const (String ("hello", Regular, (12,11--12,18)), (12,11--12,18))], + (12,1--12,18)), (12,0--12,19)); + Expr + (FunctionDef + (SynSymbol with-type-multiple, None, + Args + (List + [Typed + (Named (SynSymbol s, (14,25--14,26)), Ident string, + (14,24--14,35)); + Typed + (Named (SynSymbol b, (14,37--14,38)), Ident int, + (14,36--14,44))], (14,23--14,45)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("with-type-multiple %A", Regular, (15,11--15,34)), + (15,11--15,34)); Symbol (SynSymbol s)], (15,3--15,36)); + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("with-type-multiple %A", Regular, (16,11--16,34)), + (16,11--16,34)); Symbol (SynSymbol b)], (16,3--16,36))], + (14,1--16,37)), (14,0--17,3)); + Expr + (FunctionCall + (Symbol (SynSymbol with-type-multiple), + [Const (String ("hello", Regular, (18,20--18,27)), (18,20--18,27)); + Const (Int32 99, (18,28--18,30))], (18,1--18,30)), (18,0--18,31)); + Expr + (FunctionDef + (SynSymbol with-tuple, None, + Args + (List + [Collection + (SynCollection + (Paren, + [Named (SynSymbol x, (20,17--20,18)); + Trivia (Comma, (20,18--20,19)); + Named (SynSymbol y, (20,20--20,21))], (20,16--20,22)))], + (20,15--20,23)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("with-tuple %A", Regular, (20,33--20,48)), + (20,33--20,48)); + Tuple + ([Symbol (SynSymbol x); Symbol (SynSymbol y)], + (20,50--20,55))], (20,25--20,56))], (20,1--20,57)), + (20,0--20,58)); + Expr + (FunctionCall + (Symbol (SynSymbol with-tuple), + [Tuple + ([Const (Int32 1, (21,13--21,14)); + Const (Int32 2, (21,17--21,18))], (21,13--21,18))], + (21,1--21,19)), (21,0--21,20)); + Expr + (FunctionDef + (SynSymbol with-tuple-type, None, + Args + (List + [Typed + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x, (23,23--23,24)); + Trivia (Comma, (23,24--23,25)); + Named (SynSymbol y, (23,26--23,27))], + (23,22--23,28))), + Tuple + (false, + [Type (Ident int); Star (23,34--23,35); + Type (Ident int)], (23,30--23,39)), (23,21--23,40))], + (23,20--23,41)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("with-tuple-type %A", Regular, (23,51--23,71)), + (23,51--23,71)); + Tuple + ([Symbol (SynSymbol x); Symbol (SynSymbol y)], + (23,73--23,78))], (23,43--23,79))], (23,1--23,80)), + (23,0--23,81)); + Expr + (FunctionCall + (Symbol (SynSymbol with-tuple-type), + [Tuple + ([Const (Int32 1, (24,18--24,19)); + Const (Int32 2, (24,22--24,23))], (24,18--24,23))], + (24,1--24,24)), (24,0--24,25)); + Expr + (FunctionDef + (SynSymbol with-tuple-multiple, None, + Args + (List + [Typed + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x, (26,27--26,28)); + Trivia (Comma, (26,28--26,29)); + Named (SynSymbol y, (26,30--26,31))], + (26,26--26,32))), + Tuple + (false, + [Type (Ident int); Star (26,38--26,39); + Type (Ident int)], (26,34--26,43)), (26,25--26,44)); + Typed + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x2, (26,47--26,49)); + Trivia (Comma, (26,49--26,50)); + Named (SynSymbol y2, (26,51--26,53))], + (26,46--26,54))), + Tuple + (false, + [Type (Ident int); Star (26,60--26,61); + Type (Ident int)], (26,56--26,65)), (26,45--26,66))], + (26,24--26,67)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("with-tuple-multiple %A", Regular, (27,11--27,35)), + (27,11--27,35)); + Tuple + ([Symbol (SynSymbol x); Symbol (SynSymbol y)], + (27,37--27,42))], (27,3--27,43)); + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("with-tuple-multiple %A", Regular, (28,11--28,35)), + (28,11--28,35)); + Tuple + ([Symbol (SynSymbol x2); Symbol (SynSymbol y2)], + (28,37--28,44))], (28,3--28,45))], (26,1--28,46)), + (26,0--29,3)); + Expr + (FunctionCall + (Symbol (SynSymbol with-tuple-multiple), + [Tuple + ([Const (Int32 1, (30,22--30,23)); + Const (Int32 2, (30,26--30,27))], (30,22--30,27)); + Tuple + ([Const (Int32 3, (30,30--30,31)); + Const (Int32 4, (30,34--30,35))], (30,30--30,35))], + (30,1--30,36)), (30,0--30,37)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (32,0--32,2)), + Const (Unit, (32,0--32,2)), None, (32,0--32,2)), (32,0--32,2)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (32,0--32,2)), (32,0--32,2)); + Symbol (SynSymbol visp_result_todo)], (32,0--32,2)), (32,0--32,2))], + (8,0--32,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-1.structured output.verified.txt new file mode 100644 index 0000000..19bbf18 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-1.structured output.verified.txt @@ -0,0 +1,56 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol WithPred, None, + Args + (List + [Typed + (Named (SynSymbol pred, (8,15--8,19)), + Paren + (Fun (Ident ^T, Ident bool, (8,22--8,32)), (8,21--8,33)), + (8,14--8,34)); Named (SynSymbol t, (8,35--8,36))], + (8,13--8,37)), + [FunctionCall + (Symbol (SynSymbol pred), [Symbol (SynSymbol t)], (9,3--9,9))], + (8,1--9,10)), (8,0--9,11)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("WithPred: %A", Regular, (11,9--11,23)), (11,9--11,23)); + FunctionCall + (Symbol (SynSymbol WithPred), + [LambdaShort + (Op + (Infix + (SynSymbol =, + [Symbol (SynSymbol %1); + Const (Int32 1, (11,41--11,42))], (11,36--11,42))), + (11,34--11,43)); Const (Int32 1, (11,44--11,45))], + (11,25--11,45))], (11,1--11,46)), (11,0--11,47)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("WithPred: %A", Regular, (12,9--12,23)), (12,9--12,23)); + FunctionCall + (Symbol (SynSymbol WithPred), + [LambdaShort + (Op + (Infix + (SynSymbol =, + [Symbol (SynSymbol %1); + Const (Int32 1, (12,41--12,42))], (12,36--12,42))), + (12,34--12,43)); Const (Int32 0, (12,44--12,45))], + (12,25--12,45))], (12,1--12,46)), (12,0--12,47)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (14,0--14,2)), + Const (Unit, (14,0--14,2)), None, (14,0--14,2)), (14,0--14,2)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (14,0--14,2)), (14,0--14,2)); + Symbol (SynSymbol visp_result_todo)], (14,0--14,2)), (14,0--14,2))], + (8,0--14,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_let-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_let-0.structured output.verified.txt new file mode 100644 index 0000000..7a04de4 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_let-0.structured output.verified.txt @@ -0,0 +1,109 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Typed (Named (SynSymbol n, (8,6--8,7)), Ident string, (8,5--8,16)), + Const (String ("hello", Regular, (8,17--8,24)), (8,17--8,24)), None, + (8,1--8,24)), (8,0--8,25)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("n is: %s", Regular, (10,9--10,19)), (10,9--10,19)); + Symbol (SynSymbol n)], (10,1--10,21)), (10,0--10,22)); + Expr + (LetOrUse + (Typed + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x, (12,7--12,8)); + Trivia (Comma, (12,8--12,9)); + Named (SynSymbol y, (12,10--12,11))], (12,6--12,12))), + Tuple + (false, + [Type (Ident int); Star (12,19--12,20); Type (Ident int)], + (12,15--12,24)), (12,5--12,25)), + Tuple + ([Const (Int32 1, (12,27--12,28)); + Const (Int32 2, (12,30--12,31))], (12,27--12,31)), None, + (12,1--12,32)), (12,0--12,33)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("x is: %i", Regular, (13,9--13,19)), (13,9--13,19)); + Symbol (SynSymbol x)], (13,1--13,21)), (13,0--13,22)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("y is: %i", Regular, (14,9--14,19)), (14,9--14,19)); + Symbol (SynSymbol y)], (14,1--14,21)), (14,0--14,22)); + Expr + (LetOrUse + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x2, (16,6--16,8)); + Trivia (Comma, (16,8--16,9)); + Named (SynSymbol y2, (16,10--16,12))], (16,5--16,13))), + Tuple + ([Const (Int32 3, (16,15--16,16)); + Const (Int32 4, (16,18--16,19))], (16,15--16,19)), None, + (16,1--16,20)), (16,0--16,21)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("x2 is: %i", Regular, (17,9--17,20)), (17,9--17,20)); + Symbol (SynSymbol x2)], (17,1--17,23)), (17,0--17,24)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("y2 is: %i", Regular, (18,9--18,20)), (18,9--18,20)); + Symbol (SynSymbol y2)], (18,1--18,23)), (18,0--18,24)); + Expr + (LetOrUse + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x3, (20,6--20,8)); + Trivia (Comma, (20,8--20,9)); Discard (20,10--20,11)], + (20,5--20,12))), + Tuple + ([Const (Int32 5, (20,14--20,15)); + Const (Int32 6, (20,17--20,18))], (20,14--20,18)), None, + (20,1--20,19)), (20,0--20,20)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("x3 is: %i", Regular, (21,9--21,20)), (21,9--21,20)); + Symbol (SynSymbol x3)], (21,1--21,23)), (21,0--21,24)); + Expr + (LetOrUse + (Collection + (SynCollection + (Paren, + [Typed + (Named (SynSymbol x4, (23,7--23,9)), Ident int, + (23,6--23,15)); Trivia (Comma, (23,15--23,16)); + Discard (23,17--23,18)], (23,5--23,19))), + Tuple + ([Const (Int32 7, (23,21--23,22)); + Const (Int32 8, (23,24--23,25))], (23,21--23,25)), None, + (23,1--23,26)), (23,0--23,27)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (24,0--24,24)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("x4 is: %i", Regular, (24,9--24,20)), (24,9--24,20)); + Symbol (SynSymbol x4)], (24,1--24,23)), None, (24,0--24,24)), + (24,0--24,24)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (24,0--24,24)), (24,0--24,24)); + Symbol (SynSymbol visp_result_todo)], (24,0--24,24)), + (24,0--24,24))], (8,0--24,24))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_quotation_quote-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_quotation_quote-0.structured output.verified.txt new file mode 100644 index 0000000..16abec9 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_quotation_quote-0.structured output.verified.txt @@ -0,0 +1,138 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol items, (9,5--9,10)), + Quote + (true, + Collection + (SynCollection + (Paren, + [Const (Int32 1, (9,13--9,14)); + Const (Int32 2, (9,15--9,16)); + Const (Int32 3, (9,17--9,18)); + Const (Int32 4, (9,19--9,20)); + Const (Int32 5, (9,21--9,22))], (9,12--9,23))), + (9,11--9,23)), None, (9,1--9,23)), (9,0--9,24)); + Expr + (LetOrUse + (Named (SynSymbol sym, (10,5--10,8)), + Quote (true, Symbol (SynSymbol symbol), (10,9--10,16)), None, + (10,1--10,16)), (10,0--10,17)); + Expr + (LetOrUse + (Named (SynSymbol something, (11,5--11,14)), + Quote + (true, + Collection + (SynCollection + (Paren, + [Symbol (SynSymbol fn); + Collection + (SynCollection + (Bracket, [Symbol (SynSymbol a)], (11,20--11,23))); + Collection + (SynCollection + (Paren, + [Symbol (SynSymbol +); Symbol (SynSymbol a); + Symbol (SynSymbol b); + Const (Int32 1, (11,31--11,32)); + Collection + (SynCollection + (Paren, + [Symbol (SynSymbol call); + Symbol (SynSymbol +); + Const (Int32 1, (11,41--11,42)); + Const (Int32 2, (11,43--11,44))], + (11,33--11,45)))], (11,24--11,46)))], + (11,16--11,47))), (11,15--11,47)), None, (11,1--11,47)), + (11,0--11,48)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("items: %O", Regular, (13,9--13,20)), (13,9--13,20)); + Symbol (SynSymbol items)], (13,1--13,26)), (13,0--13,27)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("sym: %O", Regular, (14,9--14,18)), (14,9--14,18)); + Symbol (SynSymbol sym)], (14,1--14,22)), (14,0--14,23)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("something: %O", Regular, (15,9--15,24)), (15,9--15,24)); + Symbol (SynSymbol something)], (15,1--15,34)), (15,0--15,35)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("nested: %O", Regular, (16,9--16,21)), (16,9--16,21)); + Quote + (true, + Collection + (SynCollection + (Paren, + [Symbol (SynSymbol nested1); + Collection + (SynCollection + (Paren, + [Symbol (SynSymbol nested2); + Collection + (SynCollection + (Paren, + [Symbol (SynSymbol nested3); + Collection + (SynCollection + (Paren, + [Symbol (SynSymbol nested4); + Symbol (SynSymbol and); + Symbol (SynSymbol on); + Symbol (SynSymbol and); + Symbol (SynSymbol on); + Keyword (SynKeyword :keyword)], + (16,50--16,82)))], (16,41--16,83)))], + (16,32--16,84)))], (16,23--16,85))), + (16,22--16,85))], (16,1--16,85)), (16,0--16,86)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (17,0--17,90)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("nested vec: %O", Regular, (17,9--17,25)), + (17,9--17,25)); + Quote + (true, + Collection + (SynCollection + (Bracket, + [Symbol (SynSymbol nested1); + Collection + (SynCollection + (Paren, + [Symbol (SynSymbol nested2); + Collection + (SynCollection + (Bracket, + [Symbol (SynSymbol nested3); + Collection + (SynCollection + (Paren, + [Symbol (SynSymbol nested4); + Symbol (SynSymbol and); + Symbol (SynSymbol on); + Symbol (SynSymbol and); + Symbol (SynSymbol on); + Keyword (SynKeyword :keyword)], + (17,54--17,86)))], (17,45--17,87)))], + (17,36--17,88)))], (17,27--17,89))), + (17,26--17,89))], (17,1--17,89)), None, (17,0--17,90)), + (17,0--17,90)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,0--17,90)), (17,0--17,90)); + Symbol (SynSymbol visp_result_todo)], (17,0--17,90)), + (17,0--17,90))], (9,0--17,90))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_custom-comparison-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_custom-comparison-0.structured output.verified.txt new file mode 100644 index 0000000..64f78fa --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_custom-comparison-0.structured output.verified.txt @@ -0,0 +1,298 @@ +ParsedFile + [AnonModule + ([Open (SynSymbol System, (8,1--8,12)); + Expr + (Union + (SynSymbol MyCustomValue, + [UnionCase (SynSymbol Nil, [], (12,2--12,5)); + UnionCase + (SynSymbol String, [Type (Ident string, (13,10--13,16))], + (13,3--13,16))], + [OverrideFn + (SynSymbol t.GetHashCode, Args (List [], (15,29--15,31)), + [Match + (Symbol (SynSymbol t), + [SynMatch + (Named (SynSymbol Nil, (17,7--17,10)), None, + [Const (Int32 919321, (17,11--17,17))], (17,7--17,17)); + SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol String, (18,8--18,14)); + Named (SynSymbol s, (18,15--18,16))], + (18,7--18,17))), None, + [FunctionCall + (Symbol (SynSymbol System.HashCode.Combine), + [Tuple + ([Const + (String ("string", Regular, (18,44--18,52)), + (18,44--18,52)); Symbol (SynSymbol s)], + (18,44--18,55))], (18,19--18,56))], + (18,7--18,57))], (16,5--18,58))], (15,3--19,5)); + OverrideFn + (SynSymbol t.Equals, + Args + (List [Named (SynSymbol other, (21,25--21,30))], + (21,24--21,31)), + [Match + (Symbol (SynSymbol other), + [SynMatch + (Collection + (SynCollection + (Paren, + [As + (IsInst (Ident MyCustomValue, (23,8--23,24)), + Named (SynSymbol v, (23,25--23,26)), + (23,7--23,27))], (23,7--23,27))), None, + [DotMethod + (Op + (Infix + (SynSymbol :>, + [Symbol (SynSymbol t); + Symbol (SynSymbol IEquatable<_>)], + (24,18--24,36))), SynSymbol Equals, + [Symbol (SynSymbol v)], Tuple, (24,9--24,39))], + (23,7--24,40)); + SynMatch + (Discard (26,7--26,8), None, + [Const (Bool false, (26,9--26,14))], (26,7--26,14))], + (22,5--26,15))], (21,3--27,5)); + Interface + (SynSymbol IEquatable, + [MemberFn + (SynSymbol t.Equals, + Args + (List [Named (SynSymbol other, (30,25--30,30))], + (30,24--30,31)), + [Match + (Tuple + ([Symbol (SynSymbol t); Symbol (SynSymbol other)], + (31,14--31,22)), + [SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol Nil, (32,10--32,13)); + Trivia (Dot, (32,14--32,15)); + Named (SynSymbol Nil, (32,16--32,19))], + (32,9--32,20))), None, + [Const (Bool true, (32,21--32,25))], (32,9--32,25)); + SynMatch + (Collection + (SynCollection + (Paren, + [Collection + (SynCollection + (Paren, + [Named + (SynSymbol String, (33,11--33,17)); + Named (SynSymbol lhs, (33,18--33,21))], + (33,10--33,22))); + Trivia (Dot, (33,23--33,24)); + Collection + (SynCollection + (Paren, + [Named + (SynSymbol String, (33,26--33,32)); + Named (SynSymbol rhs, (33,33--33,36))], + (33,25--33,37)))], (33,9--33,38))), + None, + [Op + (Infix + (SynSymbol =, + [Symbol (SynSymbol lhs); + Symbol (SynSymbol rhs)], (33,40--33,49)))], + (33,9--33,50)); + SynMatch + (Collection + (SynCollection + (Paren, + [Discard (34,10--34,11); + Trivia (Dot, (34,12--34,13)); + Discard (34,14--34,15)], (34,9--34,16))), + None, [Const (Bool false, (34,17--34,22))], + (34,9--34,22))], (31,7--34,23))], (30,5--35,7))], + (29,3--36,5)); + Interface + (SynSymbol IComparable, + [MemberFn + (SynSymbol t.CompareTo, + Args + (List [Named (SynSymbol other, (39,28--39,33))], + (39,27--39,34)), + [Match + (Symbol (SynSymbol other), + [SynMatch + (Collection + (SynCollection + (Paren, + [As + (IsInst + (Ident MyCustomValue, (41,10--41,26)), + Named (SynSymbol v, (41,27--41,28)), + (41,9--41,29))], (41,9--41,29))), None, + [DotMethod + (Op + (Infix + (SynSymbol :>, + [Symbol (SynSymbol t); + Symbol (SynSymbol IComparable<_>)], + (42,23--42,42))), SynSymbol CompareTo, + [Symbol (SynSymbol v)], Tuple, (42,11--42,45))], + (41,9--42,46)); + SynMatch + (Named (SynSymbol null, (44,9--44,13)), None, + [Const (Int32 1, (44,14--44,15))], (44,9--44,15)); + SynMatch + (Discard (45,9--45,10), None, + [Const (Int32 -1, (45,11--45,13))], (45,9--45,13))], + (40,7--45,14))], (39,5--46,7))], (38,3--46,8)); + Interface + (SynSymbol IComparable, + [MemberFn + (SynSymbol t.CompareTo, + Args + (List [Named (SynSymbol other, (49,28--49,33))], + (49,27--49,34)), + [Match + (Tuple + ([Symbol (SynSymbol t); Symbol (SynSymbol other)], + (50,14--50,22)), + [SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol Nil, (51,10--51,13)); + Trivia (Comma, (51,13--51,14)); + Named (SynSymbol Nil, (51,15--51,18))], + (51,9--51,19))), None, + [Const (Int32 0, (51,20--51,21))], (51,9--51,21)); + SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol Nil, (52,10--52,13)); + Trivia (Comma, (52,13--52,14)); + Collection + (SynCollection + (Paren, + [Named + (SynSymbol String, (52,16--52,22)); + Discard (52,23--52,24)], + (52,15--52,25)))], (52,9--52,26))), + None, [Const (Int32 -1, (52,27--52,29))], + (52,9--52,29)); + SynMatch + (Collection + (SynCollection + (Paren, + [Collection + (SynCollection + (Paren, + [Named + (SynSymbol String, (53,11--53,17)); + Discard (53,18--53,19)], + (53,10--53,20))); + Trivia (Comma, (53,20--53,21)); + Named (SynSymbol Nil, (53,22--53,25))], + (53,9--53,26))), None, + [Const (Int32 1, (53,27--53,28))], (53,9--53,28)); + SynMatch + (Collection + (SynCollection + (Paren, + [Collection + (SynCollection + (Paren, + [Named + (SynSymbol String, (54,11--54,17)); + Named (SynSymbol lhs, (54,18--54,21))], + (54,10--54,22))); + Trivia (Comma, (54,22--54,23)); + Collection + (SynCollection + (Paren, + [Named + (SynSymbol String, (54,25--54,31)); + Named (SynSymbol rhs, (54,32--54,35))], + (54,24--54,36)))], (54,9--54,37))), + None, + [DotMethod + (Symbol (SynSymbol lhs), SynSymbol CompareTo, + [Symbol (SynSymbol rhs)], Tuple, (54,39--54,57))], + (54,9--54,58))], (50,7--54,59))], (49,5--55,7))], + (48,3--55,8))], + [{ Attributes = + [{ TypeName = Ident CustomEquality + ArgExpr = Const (Unit, (10,3--10,17)) + Range = (10,3--10,17) }; + { TypeName = Ident CustomComparison + ArgExpr = Const (Unit, (10,20--10,36)) + Range = (10,20--10,36) }; + { TypeName = Ident RequireQualifiedAccess + ArgExpr = Const (Unit, (10,39--10,61)) + Range = (10,39--10,61) }] + Range = (10,1--10,62) }], (10,1--55,9)), (10,0--56,1)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Nil < String %A", Regular, (58,9--58,26)), + (58,9--58,26)); + Op + (Infix + (SynSymbol <, + [Symbol (SynSymbol MyCustomValue.Nil); + FunctionCall + (Symbol (SynSymbol MyCustomValue.String), + [Const + (String ("hello", Regular, (58,70--58,77)), + (58,70--58,77))], (58,49--58,77))], (58,28--58,78)))], + (58,1--58,79)), (58,0--58,80)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Nil > String %A", Regular, (59,9--59,26)), + (59,9--59,26)); + Op + (Infix + (SynSymbol >, + [Symbol (SynSymbol MyCustomValue.Nil); + FunctionCall + (Symbol (SynSymbol MyCustomValue.String), + [Const + (String ("hello", Regular, (59,70--59,77)), + (59,70--59,77))], (59,49--59,77))], (59,28--59,78)))], + (59,1--59,79)), (59,0--59,80)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("String = String %A", Regular, (60,9--60,29)), + (60,9--60,29)); + Op + (Infix + (SynSymbol =, + [FunctionCall + (Symbol (SynSymbol MyCustomValue.String), + [Const + (String ("hello", Regular, (60,55--60,62)), + (60,55--60,62))], (60,34--60,62)); + FunctionCall + (Symbol (SynSymbol MyCustomValue.String), + [Const + (String ("hello", Regular, (60,86--60,93)), + (60,86--60,93))], (60,65--60,93))], (60,31--60,94)))], + (60,1--60,95)), (60,0--60,96)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (62,0--62,2)), + Const (Unit, (62,0--62,2)), None, (62,0--62,2)), (62,0--62,2)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (62,0--62,2)), (62,0--62,2)); + Symbol (SynSymbol visp_result_todo)], (62,0--62,2)), (62,0--62,2))], + (8,0--62,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-fn-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-fn-0.structured output.verified.txt new file mode 100644 index 0000000..2b5e235 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-fn-0.structured output.verified.txt @@ -0,0 +1,58 @@ +ParsedFile + [AnonModule + ([Open (SynSymbol System.Collections.Generic, (8,1--8,32)); + Expr + (Type + (SynSymbol Mapping, Args (Tuple [], (10,14--10,16)), + [Let + (Named (SynSymbol src_to_dest, (11,7--11,18)), + New (Ident Dictionary, [], (11,20--11,43)), + (11,3--11,44)); + MemberFn + (SynSymbol _.AddRange, + Args + (List + [Named (SynSymbol dest, (13,25--13,29)); + Named (SynSymbol src, (13,30--13,33)); + Named (SynSymbol len, (13,34--13,37))], (13,24--13,38)), + [ForIn + (Named (SynSymbol src_range, (14,13--14,22)), + RangeExpr + (Symbol (SynSymbol src), None, + Op + (Infix + (SynSymbol +, + [Symbol (SynSymbol src); + FunctionCall + (Symbol (SynSymbol dec), + [Symbol (SynSymbol len)], (14,46--14,53))], + (14,39--14,54))), (14,24--14,55)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("src %i", Regular, (15,15--15,23)), + (15,15--15,23)); Symbol (SynSymbol src_range)], + (15,7--15,33))], (14,5--15,34)); + Const (Unit, (17,4--17,6))], (13,3--17,6))], [], (10,1--18,5)), + (10,0--18,6)); + Expr + (LetOrUse + (Named (SynSymbol mapping, (20,5--20,12)), + New (Ident Mapping, [], (20,14--20,25)), None, (20,1--20,26)), + (20,0--20,27)); + Expr + (DotMethod + (Symbol (SynSymbol mapping), SynSymbol AddRange, + [Const (Int32 0, (21,19--21,20)); Const (Int32 1, (21,21--21,22)); + Const (Int32 5, (21,23--21,24))], Apply, (21,1--21,24)), + (21,0--21,25)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (23,0--23,2)), + Const (Unit, (23,0--23,2)), None, (23,0--23,2)), (23,0--23,2)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (23,0--23,2)), (23,0--23,2)); + Symbol (SynSymbol visp_result_todo)], (23,0--23,2)), (23,0--23,2))], + (8,0--23,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-get-set-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-get-set-0.structured output.verified.txt new file mode 100644 index 0000000..627d4dc --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-get-set-0.structured output.verified.txt @@ -0,0 +1,166 @@ +ParsedFile + [AnonModule + ([Expr + (Type + (SynSymbol GetOnly<^T>, + Args + (Tuple + [Typed + (Named (SynSymbol items, (8,20--8,25)), + Generic (Ident array, [Ident ^T], (8,27--8,36)), + (8,19--8,37))], (8,18--8,38)), + [Let + (Named (SynSymbol items, (9,7--9,12)), Symbol (SynSymbol items), + (9,3--9,18)); + GetSet + (SynSymbol _.Item, + Some + (SynMemberGet + (Args + (Tuple + [Typed + (Named (SynSymbol i, (11,11--11,12)), Ident int, + (11,10--11,18))], (11,9--11,19)), + [DotIndex + (Symbol (SynSymbol items), [Symbol (SynSymbol i)], + (12,7--12,17))], (11,4--12,19))), None, (10,3--12,19))], + [], (8,1--12,20)), (8,0--12,21)); + Expr + (Type + (SynSymbol SetOnly<^T>, + Args + (Tuple + [Typed + (Named (SynSymbol items, (14,20--14,25)), + Generic (Ident array, [Ident ^T], (14,27--14,36)), + (14,19--14,37))], (14,18--14,38)), + [Let + (Named (SynSymbol items, (15,7--15,12)), + Symbol (SynSymbol items), (15,3--15,18)); + GetSet + (SynSymbol _.Item, None, + Some + (SynMemberSet + (Args + (Tuple + [Typed + (Named (SynSymbol i, (17,11--17,12)), Ident int, + (17,10--17,18))], (17,9--17,19)), + Named (SynSymbol v, (17,20--17,21)), + [Set + (DotIndex + (Symbol (SynSymbol items), [Symbol (SynSymbol i)], + (18,13--18,23)), Symbol (SynSymbol v), + (18,7--18,26))], (17,4--18,28))), (16,3--18,28))], [], + (14,1--18,29)), (14,0--18,30)); + Expr + (Type + (SynSymbol GetAndSet<^T>, + Args + (Tuple + [Typed + (Named (SynSymbol items, (20,22--20,27)), + Generic (Ident array, [Ident ^T], (20,29--20,38)), + (20,21--20,39))], (20,20--20,40)), + [Let + (Named (SynSymbol items, (21,7--21,12)), + Symbol (SynSymbol items), (21,3--21,18)); + GetSet + (SynSymbol _.Item, + Some + (SynMemberGet + (Args + (Tuple + [Typed + (Named (SynSymbol i, (23,11--23,12)), Ident int, + (23,10--23,18))], (23,9--23,19)), + [DotIndex + (Symbol (SynSymbol items), [Symbol (SynSymbol i)], + (24,7--24,17))], (23,4--24,19))), + Some + (SynMemberSet + (Args + (Tuple + [Typed + (Named (SynSymbol i, (25,11--25,12)), Ident int, + (25,10--25,18))], (25,9--25,19)), + Named (SynSymbol v, (25,20--25,21)), + [Set + (DotIndex + (Symbol (SynSymbol items), [Symbol (SynSymbol i)], + (26,13--26,23)), Symbol (SynSymbol v), + (26,7--26,26))], (25,4--26,28))), (22,3--26,28))], [], + (20,1--26,29)), (20,0--27,3)); + Expr + (LetOrUse + (Named (SynSymbol array, (29,5--29,10)), + Collection + (SynCollection + (FsArray, + [Const (Int32 1, (29,19--29,20)); + Const (Int32 2, (29,21--29,22)); + Const (Int32 3, (29,23--29,24)); + Const (Int32 4, (29,25--29,26)); + Const (Int32 5, (29,27--29,28))], (29,12--29,28))), None, + (29,1--29,29)), (29,0--29,30)); + Expr + (LetOrUse + (Named (SynSymbol getOnly, (31,5--31,12)), + New (Ident GetOnly<_>, [Symbol (SynSymbol array)], (31,14--31,34)), + None, (31,1--31,35)), (31,0--31,36)); + Expr + (LetOrUse + (Named (SynSymbol setOnly, (32,5--32,12)), + New (Ident SetOnly<_>, [Symbol (SynSymbol array)], (32,14--32,34)), + None, (32,1--32,35)), (32,0--32,36)); + Expr + (LetOrUse + (Named (SynSymbol getAndSet, (33,5--33,14)), + New + (Ident GetAndSet<_>, [Symbol (SynSymbol array)], (33,16--33,38)), + None, (33,1--33,39)), (33,0--33,40)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (35,9--35,13)), (35,9--35,13)); + DotIndex + (Symbol (SynSymbol getOnly), [Const (Int32 0, (35,17--35,18))], + (35,15--35,27))], (35,1--35,28)), (35,0--35,29)); + Expr + (Set + (DotIndex + (Symbol (SynSymbol setOnly), [Const (Int32 0, (37,9--37,10))], + (37,7--37,19)), Const (Int32 99, (37,21--37,23)), (37,1--37,23)), + (37,0--37,24)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (39,9--39,13)), (39,9--39,13)); + Symbol (SynSymbol array)], (39,1--39,19)), (39,0--39,20)); + Expr + (Set + (DotIndex + (Symbol (SynSymbol getAndSet), [Const (Int32 1, (41,9--41,10))], + (41,7--41,21)), Const (Int32 99, (41,23--41,25)), (41,1--41,25)), + (41,0--41,26)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (43,9--43,13)), (43,9--43,13)); + DotIndex + (Symbol (SynSymbol getAndSet), [Const (Int32 1, (43,17--43,18))], + (43,15--43,29))], (43,1--43,30)), (43,0--43,31)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (45,0--45,20)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (45,9--45,13)), (45,9--45,13)); + Symbol (SynSymbol array)], (45,1--45,19)), None, (45,0--45,20)), + (45,0--45,20)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (45,0--45,20)), (45,0--45,20)); + Symbol (SynSymbol visp_result_todo)], (45,0--45,20)), + (45,0--45,20))], (8,0--45,20))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-0.structured output.verified.txt new file mode 100644 index 0000000..f697616 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-0.structured output.verified.txt @@ -0,0 +1,77 @@ +ParsedFile + [AnonModule + ([Expr + (Record + (SynSymbol Mapping, + [RecordLabel (Default, SynSymbol src, Ident int64, (9,3--9,14)); + RecordLabel (Default, SynSymbol dest, Ident int64, (10,3--10,15)); + RecordLabel (Default, SynSymbol range, Ident int64, (11,3--11,16))], + [MemberFn + (SynSymbol this.Stuff, Args (List [], (13,23--13,25)), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("doing stuff %A", Regular, (14,13--14,29)), + (14,13--14,29)); + DotProperty + (Symbol (SynSymbol this), SynSymbol src, (14,31--14,40))], + (14,5--14,41))], (13,3--14,42))], [], (8,1--14,43)), + (8,0--15,1)); + Expr + (LetOrUse + (Named (SynSymbol temp, (17,5--17,9)), + RecordInit + ([SynInit + (SynSymbol src, Const (Int32 1, (17,22--17,23)), + (17,17--17,24)); + SynInit + (SynSymbol Mapping.dest, Const (Int32 2, (17,39--17,40)), + (17,25--17,41)); + SynInit + (SynSymbol range, Const (Int32 3, (17,49--17,50)), + (17,42--17,51))], (17,11--17,51)), None, (17,1--17,52)), + (17,0--17,53)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Record is %A", Regular, (18,9--18,23)), (18,9--18,23)); + Symbol (SynSymbol temp)], (18,1--18,28)), (18,0--18,29)); + Expr + (DotMethod + (Symbol (SynSymbol temp), SynSymbol Stuff, [], Tuple, (19,1--19,12)), + (19,0--19,13)); + Expr + (LetOrUse + (Named (SynSymbol temp2, (21,5--21,10)), + RecordInit + ([SynInit + (SynSymbol src, Const (Int32 3, (21,18--21,19)), + (21,14--21,19)); + SynInit + (SynSymbol Mapping.dest, Const (Int32 5, (21,33--21,34)), + (21,20--21,34)); + SynInit + (SynSymbol range, Const (Int32 8, (21,41--21,42)), + (21,35--21,42))], (21,11--21,45)), None, (21,1--21,45)), + (21,0--21,46)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Record is %A", Regular, (23,9--23,23)), (23,9--23,23)); + Symbol (SynSymbol temp2)], (23,1--23,29)), (23,0--23,30)); + Expr + (DotMethod + (Symbol (SynSymbol temp2), SynSymbol Stuff, [], Tuple, (24,1--24,13)), + (24,0--24,14)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (27,0--27,2)), + Const (Unit, (27,0--27,2)), None, (27,0--27,2)), (27,0--27,2)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (27,0--27,2)), (27,0--27,2)); + Symbol (SynSymbol visp_result_todo)], (27,0--27,2)), (27,0--27,2))], + (8,0--27,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-1.structured output.verified.txt new file mode 100644 index 0000000..bcbe46f --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-1.structured output.verified.txt @@ -0,0 +1,176 @@ +ParsedFile + [AnonModule + ([Expr + (Union + (SynSymbol Dir, + [UnionCase (SynSymbol Up, [], (9,2--9,4)); + UnionCase (SynSymbol Left, [], (10,2--10,6)); + UnionCase (SynSymbol Down, [], (11,2--11,6)); + UnionCase (SynSymbol Right, [], (12,2--12,7))], [], [], + (8,1--12,7)), (8,0--12,8)); + Expr + (TypeAlias + (SynSymbol Pos, + Tuple + (false, [Type (Ident int); Star (14,17--14,18); Type (Ident int)], + (14,13--14,22)), (14,1--14,22)), (14,0--14,23)); + Expr + (Record + (SynSymbol Node, + [RecordLabel (Default, SynSymbol pos, Ident Pos, (17,3--17,11)); + RecordLabel (Default, SynSymbol dir, Ident Dir, (18,3--18,11)); + RecordLabel (Default, SynSymbol steps, Ident int, (19,3--19,13))], + [], [], (16,1--19,14)), (16,0--19,15)); + Expr + (FunctionDef + (SynSymbol LeftOf, Inline, + Args + (List + [Typed + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x, (21,21--21,22)); + Trivia (Comma, (21,22--21,23)); + Named (SynSymbol y, (21,24--21,25))], + (21,20--21,26))), Ident Pos, (21,19--21,32))], + (21,18--21,33)), + [Tuple + ([FunctionCall + (Symbol (SynSymbol dec), [Symbol (SynSymbol x)], + (21,36--21,41)); Symbol (SynSymbol y)], (21,35--21,45))], + (21,1--21,46)), (21,0--21,47)); + Expr + (FunctionDef + (SynSymbol RightOf, Inline, + Args + (List + [Typed + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x, (22,22--22,23)); + Trivia (Comma, (22,23--22,24)); + Named (SynSymbol y, (22,25--22,26))], + (22,21--22,27))), Ident Pos, (22,20--22,33))], + (22,19--22,34)), + [Tuple + ([FunctionCall + (Symbol (SynSymbol inc), [Symbol (SynSymbol x)], + (22,37--22,42)); Symbol (SynSymbol y)], (22,36--22,46))], + (22,1--22,47)), (22,0--22,48)); + Expr + (FunctionDef + (SynSymbol UpOf, Inline, + Args + (List + [Typed + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x, (23,19--23,20)); + Trivia (Comma, (23,20--23,21)); + Named (SynSymbol y, (23,22--23,23))], + (23,18--23,24))), Ident Pos, (23,17--23,30))], + (23,16--23,31)), + [Tuple + ([Symbol (SynSymbol x); + FunctionCall + (Symbol (SynSymbol dec), [Symbol (SynSymbol y)], + (23,37--23,42))], (23,33--23,43))], (23,1--23,44)), + (23,0--23,45)); + Expr + (FunctionDef + (SynSymbol DownOf, Inline, + Args + (List + [Typed + (Collection + (SynCollection + (Paren, + [Named (SynSymbol x, (24,21--24,22)); + Trivia (Comma, (24,22--24,23)); + Named (SynSymbol y, (24,24--24,25))], + (24,20--24,26))), Ident Pos, (24,19--24,32))], + (24,18--24,33)), + [Tuple + ([Symbol (SynSymbol x); + FunctionCall + (Symbol (SynSymbol inc), [Symbol (SynSymbol y)], + (24,39--24,44))], (24,35--24,45))], (24,1--24,46)), + (24,0--24,47)); + Expr + (FunctionDef + (SynSymbol GetDirFun, Inline, + Args + (List + [Typed + (Named (SynSymbol d, (26,23--26,24)), Ident Dir, + (26,22--26,30))], (26,21--26,31)), + [Match + (Symbol (SynSymbol d), + [SynMatch + (Named (SynSymbol Up, (28,5--28,7)), None, + [Symbol (SynSymbol UpOf)], (28,5--28,12)); + SynMatch + (Named (SynSymbol Down, (29,5--29,9)), None, + [Symbol (SynSymbol DownOf)], (29,5--29,16)); + SynMatch + (Named (SynSymbol Left, (30,5--30,9)), None, + [Symbol (SynSymbol LeftOf)], (30,5--30,16)); + SynMatch + (Named (SynSymbol Right, (31,5--31,10)), None, + [Symbol (SynSymbol RightOf)], (31,5--31,18))], + (27,3--31,19))], (26,1--32,3)), (26,0--32,4)); + Expr + (FunctionDef + (SynSymbol MoveNode, None, + Args + (List + [Named (SynSymbol v, (34,14--34,15)); + Named (SynSymbol dir, (34,16--34,19))], (34,13--34,20)), + [RecordInit + ([SynInit (SynSymbol dir, Symbol (SynSymbol dir), (36,4--36,11)); + SynInit + (SynSymbol pos, + ThreadLast + ([Expr + (DotProperty + (Symbol (SynSymbol v), SynSymbol pos, + (37,14--37,20)), (37,13--37,21)); + Expr + (FunctionCall + (Symbol (SynSymbol GetDirFun), + [Symbol (SynSymbol dir)], (37,23--37,36)), + (37,22--37,37))], (37,9--37,37)), (37,4--37,38)); + SynInit + (SynSymbol steps, + If + (Op + (Infix + (SynSymbol =, + [Symbol (SynSymbol dir); + DotProperty + (Symbol (SynSymbol v), SynSymbol dir, + (38,22--38,28))], (38,15--38,29))), + FunctionCall + (Symbol (SynSymbol inc), + [DotProperty + (Symbol (SynSymbol v), SynSymbol steps, + (38,37--38,45))], (38,32--38,46)), + Some (Const (Int32 1, (38,48--38,49))), (38,11--38,49)), + (38,4--38,50))], (35,2--39,4))], (34,1--39,4)), + (34,0--40,1)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (42,0--42,14)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("OK", Regular, (42,9--42,13)), (42,9--42,13))], + (42,1--42,13)), None, (42,0--42,14)), (42,0--42,14)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (42,0--42,14)), (42,0--42,14)); + Symbol (SynSymbol visp_result_todo)], (42,0--42,14)), + (42,0--42,14))], (8,0--42,14))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-2.structured output.verified.txt new file mode 100644 index 0000000..e8cdefb --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-2.structured output.verified.txt @@ -0,0 +1,78 @@ +ParsedFile + [AnonModule + ([Expr + (Record + (SynSymbol Mapping, + [RecordLabel (Default, SynSymbol src, Ident int64, (9,3--9,14)); + RecordLabel (Default, SynSymbol dest, Ident int64, (10,3--10,15)); + RecordLabel (Default, SynSymbol range, Ident int64, (11,3--11,16))], + [], [], (8,1--11,17)), (8,0--12,1)); + Expr + (LetOrUse + (Named (SynSymbol initial, (14,5--14,12)), + RecordInit + ([SynInit + (SynSymbol src, Const (Int32 3, (14,22--14,23)), + (14,16--14,25)); + SynInit + (SynSymbol Mapping.dest, Const (Int32 5, (14,40--14,41)), + (14,26--14,42)); + SynInit + (SynSymbol range, Const (Int32 8, (14,51--14,52)), + (14,43--14,54))], (14,13--14,57)), None, (14,1--14,57)), + (14,0--14,58)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("initial is %A", Regular, (16,9--16,24)), (16,9--16,24)); + Symbol (SynSymbol initial)], (16,1--16,32)), (16,0--16,33)); + Expr + (LetOrUse + (Named (SynSymbol updated1, (18,5--18,13)), + FunctionCall + (Symbol (SynSymbol with), + [Symbol (SynSymbol initial); + RecordInit + ([SynInit + (SynSymbol src, Const (Int32 5, (18,36--18,37)), + (18,31--18,38))], (18,28--18,41))], (18,15--18,41)), + None, (18,1--18,42)), (18,0--18,43)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("updated1 is %A", Regular, (20,9--20,25)), + (20,9--20,25)); Symbol (SynSymbol updated1)], (20,1--20,34)), + (20,0--20,35)); + Expr + (LetOrUse + (Named (SynSymbol updated2, (22,5--22,13)), + FunctionCall + (Symbol (SynSymbol with), + [Symbol (SynSymbol initial); + RecordInit + ([SynInit + (SynSymbol src, Const (Int32 99, (22,36--22,38)), + (22,31--22,39)); + SynInit + (SynSymbol Mapping.dest, Const (Int32 12, (22,54--22,56)), + (22,40--22,57))], (22,28--22,60))], (22,15--22,60)), + None, (22,1--22,61)), (22,0--22,62)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("updated2 is %A", Regular, (24,9--24,25)), + (24,9--24,25)); Symbol (SynSymbol updated2)], (24,1--24,34)), + (24,0--24,35)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (26,0--26,2)), + Const (Unit, (26,0--26,2)), None, (26,0--26,2)), (26,0--26,2)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (26,0--26,2)), (26,0--26,2)); + Symbol (SynSymbol visp_result_todo)], (26,0--26,2)), (26,0--26,2))], + (8,0--26,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-3.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-3.structured output.verified.txt new file mode 100644 index 0000000..2dfc30b --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-3.structured output.verified.txt @@ -0,0 +1,68 @@ +ParsedFile + [AnonModule + ([Expr + (Record + (SynSymbol TestRec, + [RecordLabel (Default, SynSymbol value, Ident int, (9,3--9,13))], + [], [], (8,1--9,14)), (8,0--9,15)); + Expr + (FunctionDef + (SynSymbol SomeFun, None, + Args + (List + [Typed + (Named (SynSymbol r, (11,14--11,15)), Ident TestRec, + (11,13--11,25))], (11,12--11,26)), + [LetOrUse + (Named (SynSymbol counter, (12,7--12,14)), + Const (Int32 0, (12,15--12,16)), Mutable, (12,3--12,16)); + LetOrUse + (Named (SynSymbol value, (14,7--14,12)), Symbol (SynSymbol r), + Mutable, (14,3--14,14)); + While + (Op + (Infix + (SynSymbol <, + [Symbol (SynSymbol counter); + Const (Int32 10, (16,20--16,22))], (16,10--16,22))), + [Set + (Symbol (SynSymbol value), + FunctionCall + (Symbol (SynSymbol with), + [Symbol (SynSymbol value); + RecordInit + ([SynInit + (SynSymbol value, + FunctionCall + (Symbol (SynSymbol inc), + [DotProperty + (Symbol (SynSymbol value), SynSymbol value, + (17,44--17,56))], (17,39--17,57)), + (17,31--17,59))], (17,28--17,62))], + (17,17--17,62)), (17,5--17,63)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol up!, + [Symbol (SynSymbol up!); Symbol (SynSymbol counter); + Symbol (SynSymbol inc)], (18,5--18,20)))], + (16,3--18,21)); Symbol (SynSymbol value)], (11,1--21,7)), + (11,0--22,1)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (24,0--24,40)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (24,9--24,13)), (24,9--24,13)); + FunctionCall + (Symbol (SynSymbol SomeFun), + [RecordInit + ([SynInit + (SynSymbol value, Const (Int32 0, (24,33--24,34)), + (24,26--24,35))], (24,23--24,38))], (24,15--24,38))], + (24,1--24,39)), None, (24,0--24,40)), (24,0--24,40)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (24,0--24,40)), (24,0--24,40)); + Symbol (SynSymbol visp_result_todo)], (24,0--24,40)), + (24,0--24,40))], (8,0--24,40))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-4.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-4.structured output.verified.txt new file mode 100644 index 0000000..c4c3908 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-4.structured output.verified.txt @@ -0,0 +1,55 @@ +ParsedFile + [AnonModule + ([Expr + (Record + (SynSymbol TestRec, + [RecordLabel (Default, SynSymbol value, Ident int, (10,3--10,13))], + [Member + (SynSymbol t.Structuredtext, + DotMethod + (Symbol (SynSymbol t), SynSymbol ToString, [], Tuple, + (12,28--12,39)), (12,3--12,40)); + OverrideFn + (SynSymbol t.ToString, Args (List [], (14,25--14,27)), + [FunctionCall + (Symbol (SynSymbol sprintf), + [Const + (String ("TestRec(%i)", Regular, (14,37--14,50)), + (14,37--14,50)); + DotProperty + (Symbol (SynSymbol t), SynSymbol value, (14,52--14,60))], + (14,29--14,61))], (14,3--14,62))], + [{ Attributes = + [{ TypeName = Ident StructuredFormatDisplay + ArgExpr = + Const + (String ("{Structuredtext}", Regular, (8,27--8,45)), + (8,27--8,45)) + Range = (8,3--8,46) }] + Range = (8,1--8,47) }], (8,1--14,63)), (8,0--15,1)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (19,9--19,13)), (19,9--19,13)); + RecordInit + ([SynInit + (SynSymbol value, Const (Int32 99, (19,24--19,26)), + (19,17--19,27))], (19,14--19,30))], (19,1--19,30)), + (19,0--19,31)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (20,0--20,30)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (20,9--20,13)), (20,9--20,13)); + RecordInit + ([SynInit + (SynSymbol value, Const (Int32 1, (20,24--20,25)), + (20,17--20,26))], (20,14--20,29))], (20,1--20,29)), None, + (20,0--20,30)), (20,0--20,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (20,0--20,30)), (20,0--20,30)); + Symbol (SynSymbol visp_result_todo)], (20,0--20,30)), + (20,0--20,30))], (8,0--20,30))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-0.structured output.verified.txt new file mode 100644 index 0000000..1b62d64 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-0.structured output.verified.txt @@ -0,0 +1,46 @@ +ParsedFile + [AnonModule + ([Expr + (Type + (SynSymbol MyType, + Args + (Tuple + [Typed + (Named (SynSymbol value, (8,15--8,20)), Ident int32, + (8,14--8,28))], (8,13--8,29)), + [Let + (Named (SynSymbol field, (9,7--9,12)), Symbol (SynSymbol value), + (9,3--9,18)); + Member + (SynSymbol this.Foo, Symbol (SynSymbol value), (10,3--10,24)); + MemberFn + (SynSymbol this.Thing, Args (List [], (11,23--11,25)), + [Const + (String ("hello", Regular, (11,26--11,33)), (11,26--11,33))], + (11,3--11,33))], [], (8,1--11,34)), (8,0--12,1)); + Expr + (LetOrUse + (Named (SynSymbol myObject, (14,5--14,13)), + New + (Ident MyType, [Const (Int32 99, (14,26--14,28))], (14,15--14,28)), + None, (14,1--14,29)), (14,0--14,30)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%O", Regular, (16,9--16,13)), (16,9--16,13)); + Symbol (SynSymbol myObject)], (16,1--16,22)), (16,0--16,23)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (17,0--17,31)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%O", Regular, (17,9--17,13)), (17,9--17,13)); + DotProperty + (Symbol (SynSymbol myObject), SynSymbol Foo, (17,15--17,29))], + (17,1--17,30)), None, (17,0--17,31)), (17,0--17,31)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,0--17,31)), (17,0--17,31)); + Symbol (SynSymbol visp_result_todo)], (17,0--17,31)), + (17,0--17,31))], (8,0--17,31))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-alias-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-alias-0.structured output.verified.txt new file mode 100644 index 0000000..31b0b53 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-alias-0.structured output.verified.txt @@ -0,0 +1,49 @@ +ParsedFile + [AnonModule + ([Expr + (TypeAlias + (SynSymbol range, + Paren + (Tuple + (false, + [Type (Ident int64); Star (8,22--8,23); Type (Ident int64)], + (8,16--8,29)), (8,15--8,30)), (8,1--8,30)), (8,0--8,31)); + Expr + (FunctionDef + (SynSymbol things, None, + Args + (List + [Typed + (Named (SynSymbol r, (10,13--10,14)), Ident range, + (10,12--10,23))], (10,11--10,24)), + [Op + (Infix + (SynSymbol +, + [FunctionCall + (Symbol (SynSymbol fst), [Symbol (SynSymbol r)], + (11,6--11,11)); + FunctionCall + (Symbol (SynSymbol snd), [Symbol (SynSymbol r)], + (11,14--11,19))], (11,3--11,20)))], (10,1--11,21)), + (10,0--11,22)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (13,0--13,41)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("Result is %A", Regular, (13,9--13,23)), + (13,9--13,23)); + FunctionCall + (Symbol (SynSymbol things), + [Tuple + ([Const (Int32 1, (13,33--13,34)); + Const (Int32 2, (13,37--13,38))], (13,33--13,38))], + (13,25--13,39))], (13,1--13,40)), None, (13,0--13,41)), + (13,0--13,41)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (13,0--13,41)), (13,0--13,41)); + Symbol (SynSymbol visp_result_todo)], (13,0--13,41)), + (13,0--13,41))], (8,0--13,41))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_union-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_union-0.structured output.verified.txt new file mode 100644 index 0000000..67d80ad --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_union-0.structured output.verified.txt @@ -0,0 +1,134 @@ +ParsedFile + [AnonModule + ([Expr + (Union + (SynSymbol MyList<^a>, + [UnionCase (SynSymbol Empty, [], (9,2--9,7)); + UnionCase + (SynSymbol Cons, + [Type (Ident ^a, (10,8--10,10)); + Named (SynSymbol tail, Ident MyList<^a>, (10,11--10,29))], + (10,3--10,29))], + [Member + (SynSymbol t.TIsEmpty, + Match + (Symbol (SynSymbol t), + [SynMatch + (Named (SynSymbol Empty, (14,7--14,12)), None, + [Const (Bool true, (14,13--14,17))], (14,7--14,17)); + SynMatch + (Discard (15,7--15,8), None, + [Const (Bool false, (15,9--15,14))], (15,7--15,14))], + (13,5--15,15)), (12,3--15,16)); + MemberFn + (SynSymbol t.Length, Args (List [], (17,22--17,24)), + [Match + (Symbol (SynSymbol t), + [SynMatch + (Named (SynSymbol Empty, (19,7--19,12)), None, + [Const (Int32 0, (19,13--19,14))], (19,7--19,14)); + SynMatch + (Collection + (SynCollection + (Paren, + [Named (SynSymbol Cons, (20,8--20,12)); + Collection + (SynCollection + (Paren, + [Discard (20,14--20,15); + Trivia (Comma, (20,15--20,16)); + Named (SynSymbol rest, (20,17--20,21))], + (20,13--20,22)))], (20,7--20,23))), None, + [Op + (Infix + (SynSymbol +, + [Const (Int32 1, (21,11--21,12)); + FunctionCall + (Symbol (SynSymbol rest.Length), [], + (21,14--21,25))], (21,9--21,26)))], + (20,7--21,27))], (18,5--22,7))], (17,3--23,5))], [], + (8,1--23,6)), (8,0--24,1)); + Expr + (LetOrUse + (Named (SynSymbol linkedList, (26,5--26,15)), + FunctionCall + (Symbol (SynSymbol Cons), + [Tuple + ([Const (Int32 1, (26,23--26,24)); + FunctionCall + (Symbol (SynSymbol Cons), + [Tuple + ([Const (Int32 2, (26,33--26,34)); + FunctionCall + (Symbol (SynSymbol Cons), + [Tuple + ([Const (Int32 3, (26,43--26,44)); + Symbol (SynSymbol Empty)], (26,43--26,51))], + (26,37--26,52))], (26,33--26,53))], + (26,27--26,54))], (26,23--26,55))], (26,17--26,56)), + None, (26,1--26,57)), (26,0--26,58)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("List is %A", Regular, (28,9--28,21)), (28,9--28,21)); + Symbol (SynSymbol linkedList)], (28,1--28,32)), (28,0--28,33)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("List length %A", Regular, (29,9--29,25)), + (29,9--29,25)); + FunctionCall + (Symbol (SynSymbol linkedList.Length), [], (29,27--29,44))], + (29,1--29,45)), (29,0--29,46)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("List isEmpty %A", Regular, (30,9--30,26)), + (30,9--30,26)); Symbol (SynSymbol linkedList.TIsEmpty)], + (30,1--30,46)), (30,0--30,47)); + Expr + (Union + (SynSymbol MyOption<^T>, + [UnionCase (SynSymbol None, [], (35,2--35,6)); + UnionCase + (SynSymbol Some, [Type (Ident ^T, (36,8--36,10))], (36,3--36,10))], + [], [{ Attributes = [{ TypeName = Ident RequireQualifiedAccess + ArgExpr = Const (Unit, (33,3--33,25)) + Range = (33,3--33,25) }] + Range = (33,1--33,26) }], (33,1--36,11)), (33,0--36,12)); + Expr + (LetOrUse + (Named (SynSymbol myOptNone, (38,5--38,14)), + Symbol (SynSymbol MyOption.None), None, (38,1--38,28)), + (38,0--38,29)); + Expr + (LetOrUse + (Named (SynSymbol myOptSome, (39,5--39,14)), + FunctionCall + (Symbol (SynSymbol MyOption.Some), + [Const (Int32 1, (39,30--39,31))], (39,16--39,31)), None, + (39,1--39,32)), (39,0--39,33)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("myOptNone %A", Regular, (41,9--41,23)), (41,9--41,23)); + Symbol (SynSymbol myOptNone)], (41,1--41,33)), (41,0--41,34)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (42,0--42,34)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("myOptSome %A", Regular, (42,9--42,23)), + (42,9--42,23)); Symbol (SynSymbol myOptSome)], (42,1--42,33)), + None, (42,0--42,34)), (42,0--42,34)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (42,0--42,34)), (42,0--42,34)); + Symbol (SynSymbol visp_result_todo)], (42,0--42,34)), + (42,0--42,34))], (8,0--42,34))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_vector_vector-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_vector_vector-0.structured output.verified.txt new file mode 100644 index 0000000..75b10e7 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_vector_vector-0.structured output.verified.txt @@ -0,0 +1,47 @@ +ParsedFile + [AnonModule + ([Expr + (LetOrUse + (Named (SynSymbol vec, (8,5--8,8)), + Collection + (SynCollection + (Bracket, + [Const (Int32 1, (8,10--8,11)); Const (Int32 2, (8,12--8,13)); + Const (Int32 3, (8,14--8,15)); Const (Int32 4, (8,16--8,17)); + Const (Int32 5, (8,18--8,19)); Const (Int32 6, (8,20--8,21))], + (8,9--8,22))), Mutable, (8,1--8,22)), (8,0--8,23)); + Expr + (LetOrUse + (Named (SynSymbol empty, (9,5--9,10)), + Collection (SynCollection (Bracket, [], (9,11--9,13))), None, + (9,1--9,13)), (9,0--9,14)); + Expr + (Set + (DotIndex + (Symbol (SynSymbol vec), [Const (Int32 1, (11,9--11,10))], + (11,7--11,15)), + FunctionCall + (Symbol (SynSymbol Value.int), [Const (Int32 -1, (11,28--11,30))], + (11,18--11,30)), (11,1--11,31)), (11,0--11,32)); + Expr + (DotMethod + (Symbol (SynSymbol empty), SynSymbol Add, + [FunctionCall + (Symbol (SynSymbol Value.int), + [Const (Int32 99, (13,23--13,25))], (13,13--13,25))], Tuple, + (13,1--13,26)), (13,0--13,27)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%O", Regular, (15,9--15,13)), (15,9--15,13)); + Symbol (SynSymbol empty)], (15,1--15,19)), (15,0--15,20)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (17,0--17,3)), + Symbol (SynSymbol vec), None, (17,0--17,3)), (17,0--17,3)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (17,0--17,3)), (17,0--17,3)); + Symbol (SynSymbol visp_result_todo)], (17,0--17,3)), (17,0--17,3))], + (8,0--17,3))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-0.structured output.verified.txt new file mode 100644 index 0000000..a144b45 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-0.structured output.verified.txt @@ -0,0 +1,60 @@ +ParsedFile + [AnonModule + ([HashDirective + (ParsedHashDirective + ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), + (9,0--9,12)); + Expr + (FunctionDef + (SynSymbol inc, None, + Args + (List + [Typed + (Named (SynSymbol v, (11,10--11,11)), Ident Value, + (11,9--11,19))], (11,8--11,20)), + [FunctionCall + (Symbol (SynSymbol Value.from), + [Op + (Infix + (SynSymbol +, + [Const (Int64 1L, (12,19--12,21)); + FunctionCall + (Symbol (SynSymbol unwrapInt), [Symbol (SynSymbol v)], + (12,23--12,34))], (12,17--12,35)))], (12,5--12,36))], + (11,1--12,37)), (11,0--12,38)); + Expr + (LetOrUse + (Named (SynSymbol count, (14,5--14,10)), + Atom (Const (Int64 0L, (14,17--14,19)), (14,12--14,19)), None, + (14,1--14,20)), (14,0--14,21)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (15,0--17,22)), + While + (Op + (Infix + (SynSymbol <, + [FunctionCall + (Symbol (SynSymbol unwrapInt), + [Deref + (true, Symbol (SynSymbol count), (15,21--15,27))], + (15,11--15,27)); Const (Int64 5L, (15,29--15,31))], + (15,8--15,31))), + [FunctionCall + (Symbol (SynSymbol printfn), + [Const + (String ("in loop %O", Regular, (16,13--16,25)), + (16,13--16,25)); + Deref (true, Symbol (SynSymbol count), (16,26--16,32))], + (16,5--16,32)); + FunctionCall + (Symbol (SynSymbol swap!), + [Symbol (SynSymbol count); Symbol (SynSymbol inc)], + (17,5--17,20))], (15,1--17,21)), None, (15,0--17,22)), + (15,0--17,22)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (15,0--17,22)), (15,0--17,22)); + Symbol (SynSymbol visp_result_todo)], (15,0--17,22)), + (15,0--17,22))], (9,0--17,22))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-1.structured output.verified.txt new file mode 100644 index 0000000..375d2c7 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-1.structured output.verified.txt @@ -0,0 +1,98 @@ +ParsedFile + [AnonModule + ([Expr + (FunctionDef + (SynSymbol DiffByOne, Inline, + Args + (List + [Typed + (Named (SynSymbol lhs, (8,23--8,26)), + Generic (Ident array, [Ident ^T], (8,28--8,37)), + (8,22--8,38)); + Typed + (Named (SynSymbol rhs, (8,40--8,43)), + Generic (Ident array, [Ident ^T], (8,45--8,54)), + (8,39--8,55))], (8,21--8,56)), + [LetOrUse + (Named (SynSymbol index, (9,7--9,12)), + Const (Int32 0, (9,13--9,14)), Mutable, (9,3--9,14)); + LetOrUse + (Named (SynSymbol loop, (10,7--10,11)), + Const (Bool true, (10,12--10,16)), Mutable, (10,3--10,16)); + LetOrUse + (Named (SynSymbol diff, (11,7--11,11)), + Const (Int32 0, (11,12--11,13)), Mutable, (11,3--11,13)); + While + (SyntaxMacroCall + (SynMacroCall + (SynSymbol and, + [Symbol (SynSymbol and); Symbol (SynSymbol loop); + List + (Paren, + [Symbol (SynSymbol <); Symbol (SynSymbol index); + List + (Paren, + [Symbol (SynSymbol +Length); + Symbol (SynSymbol lhs)], (13,28--13,41))], + (13,19--13,42))], (13,10--13,42))), + [LetOrUse + (Named (SynSymbol lhs, (14,9--14,12)), + DotIndex + (Symbol (SynSymbol lhs), [Symbol (SynSymbol index)], + (14,14--14,26)), None, (14,5--14,27)); + LetOrUse + (Named (SynSymbol rhs, (15,9--15,12)), + DotIndex + (Symbol (SynSymbol rhs), [Symbol (SynSymbol index)], + (15,14--15,26)), None, (15,5--15,27)); + SyntaxMacroCall + (SynMacroCall + (SynSymbol unless, + [Symbol (SynSymbol unless); + List + (Paren, + [Symbol (SynSymbol =); Symbol (SynSymbol lhs); + Symbol (SynSymbol rhs)], (17,12--17,23)); + List + (Paren, + [Symbol (SynSymbol set!); Symbol (SynSymbol diff); + List + (Paren, + [Symbol (SynSymbol inc); Symbol (SynSymbol diff)], + (18,17--18,27))], (18,6--18,28))], (17,5--18,28))); + SyntaxMacroCall + (SynMacroCall + (SynSymbol when, + [Symbol (SynSymbol when); + List + (Paren, + [Symbol (SynSymbol >); Symbol (SynSymbol diff); + Const (Int32 1, (20,18--20,19))], (20,10--20,20)); + List + (Paren, + [Symbol (SynSymbol set!); Symbol (SynSymbol loop); + Const (Bool false, (21,17--21,22))], (21,6--21,23))], + (20,5--21,23))); + Set + (Symbol (SynSymbol index), + FunctionCall + (Symbol (SynSymbol inc), [Symbol (SynSymbol index)], + (23,17--23,26)), (23,5--23,27))], (13,3--23,28)); + Op + (Infix + (SynSymbol =, + [Symbol (SynSymbol diff); Const (Int32 1, (26,10--26,11))], + (26,3--26,11)))], (8,1--26,12)), (8,0--26,13)); + Expr + (LetOrUse + (Named (SynSymbol visp_result_todo, (29,0--29,14)), + FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("OK", Regular, (29,9--29,13)), (29,9--29,13))], + (29,1--29,13)), None, (29,0--29,14)), (29,0--29,14)); + Expr + (FunctionCall + (Symbol (SynSymbol printfn), + [Const (String ("%A", Regular, (29,0--29,14)), (29,0--29,14)); + Symbol (SynSymbol visp_result_todo)], (29,0--29,14)), + (29,0--29,14))], (8,0--29,14))] \ No newline at end of file diff --git a/visp/utils/test-generator.visp b/visp/utils/test-generator.visp index 86c048c..f3adf20 100644 --- a/visp/utils/test-generator.visp +++ b/visp/utils/test-generator.visp @@ -89,7 +89,7 @@ let ``%s %s`` () = TestUtils.runTest "%s" ] )) -(fn GenerateTestModulePerFile (parent prefix file) +(fn GenerateTestModulePerFile (parent method prefix file) (let writer (new System.IO.StringWriter)) (let write (write writer)) @@ -105,7 +105,7 @@ let ``%s %s`` () = TestUtils.runTest "%s" (write " ") (writeln "[]") (write " ") - (writeln (->> (sprintf #r"""let ``%s`` () = TestUtils.runTest "%s" """ prefix file) .Trim)) + (writeln (->> (sprintf #r"""let ``%s`` () = %s "%s" """ prefix method file) .Trim)) () (.ToString writer) @@ -159,48 +159,69 @@ let ``%s %s`` () = TestUtils.runTest "%s" cur) -(fn WriteParserTests (projectRoot vispRoot files) - (let parserTargetDir (.Combine Path projectRoot "tests" "Visp.Compiler.UnitTests")) - (let parserTargetFile (.Combine Path parserTargetDir "ParsingTests.generated.fs")) +(record TestGen + [project: string] + [header: string] + [prefix: string] + [method: string] +) + +(fn WriteTests (gen projectRoot vispRoot files) + (let targetDir (.Combine Path projectRoot "tests" (+project gen))) + (let targetFile (.Combine Path targetDir $"{(+header gen)}.generated.fs")) - (let header (genTestHeader "ParsingTests")) + (let header (genTestHeader (+header gen))) (let sep (+ (+NewLine System.Environment) (+NewLine System.Environment))) (let output (+ header sep (String.concat (+NewLine System.Environment) - (List.map #(GenerateTestModulePerFile vispRoot "can parse" %1) files) - ;(List.map #(GenerateTestGroup "can parse" %1) files) + (List.map #(GenerateTestModulePerFile vispRoot (+method gen) (+prefix gen) %1) files) ) (+NewLine System.Environment))) - (printfn "target %s" parserTargetDir) - ;; (let output (genParserTests vispRoot files)) - (.WriteAllText System.IO.File parserTargetFile output) + (printfn "generating %s" targetFile) + (.WriteAllText System.IO.File targetFile output) ) -(fn WriteExecutionTests (projectRoot vispRoot files) - (let targetDir (.Combine Path projectRoot "tests" "Visp.ExecutionTests")) - (let targetfile (.Combine Path targetDir "ExecutionTests.generated.fs")) - - (let header (genTestHeader "ExecutionTests")) - (let sep (+ (+NewLine System.Environment) (+NewLine System.Environment))) +(fn WriteParserTests (projectRoot vispRoot files) + (WriteTests + {| + [project "Visp.Compiler.UnitTests"] + [header "ParsingTests"] + [prefix "can parse"] + [method "TestUtils.runTest"] + |} + projectRoot + vispRoot + files + ) - (let output (+ header - sep - (String.concat (+NewLine System.Environment) - (List.map #(GenerateTestModulePerFile vispRoot "can execute" %1) files) - ;(List.map #(GenerateTestGroup "can parse" %1) files) - ) - ;; (String.concat (+NewLine System.Environment) (List.map #(GenerateTestGroup "can execute" %1) files)) - (+NewLine System.Environment))) + (WriteTests + {| + [project "Visp.Compiler.UnitTests"] + [header "StructuredOutputTests"] + [prefix "structured output"] + [method "TestUtils.runStructuredOutputTest"] + |} + projectRoot + vispRoot + files + ) +) - (printfn "target %s" targetDir) - ;; (let output (genParserTests vispRoot files)) - (.WriteAllText System.IO.File targetfile output) - ;; (printfn "target %s" targetDir) - ;; (let output (genExecutionTests vispRoot files)) - ;; (.WriteAllText System.IO.File targetfile output) +(fn WriteExecutionTests (projectRoot vispRoot files) + (WriteTests + {| + [project "Visp.ExecutionTests"] + [header "ExecutionTests"] + [prefix "can execute"] + [method "TestUtils.runTest"] + |} + projectRoot + vispRoot + files + ) ) (fn run () @@ -213,22 +234,11 @@ let ``%s %s`` () = TestUtils.runTest "%s" (let groups (->> files (List.filter #(not (IsIgnoredFile %1))) - ;; (List.groupBy #(GetTestCategory vispRoot %1)) - ;; (List.map (fn [grp] - ;; (match grp - ;; [(cat, items) - ;; (cat, (List.map #(GetTestFilePath vispRoot %1) items)) - ;; ]))) )) - ;; (printfn "groups %A" groups) - - ;; (let result ) (WriteParserTests projectRoot vispRoot groups) (WriteExecutionTests projectRoot vispRoot groups) - ;; (printfn "results %A" result) - ()) From 43ec53453f3cbe97609f9ec97a1c7f0c71bf353f Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Sat, 23 Dec 2023 11:12:38 +0100 Subject: [PATCH 2/6] Normalize line endings in structured output test --- tests/Visp.Compiler.UnitTests/TestUtils.fs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Visp.Compiler.UnitTests/TestUtils.fs b/tests/Visp.Compiler.UnitTests/TestUtils.fs index 14eedd1..985c65b 100644 --- a/tests/Visp.Compiler.UnitTests/TestUtils.fs +++ b/tests/Visp.Compiler.UnitTests/TestUtils.fs @@ -54,7 +54,9 @@ let runStructuredOutputTest (name: string) = let nameParam = name.Replace('/', '_').Replace('\\', '_') - return! verify (sprintf "%A" parsed) "parsing-snapshots" nameParam + let output = (sprintf "%A" parsed).Replace("\r\n", "\n") + + return! verify output "parsing-snapshots" nameParam with :? ParseHelpers.SyntaxError as syn -> return raise <| (LexHelpers.syntaxErrorToParseError syn) } From b1f00b6c2ffb90a6dc5149260146c1cef38efa3e Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Sat, 23 Dec 2023 11:27:13 +0100 Subject: [PATCH 3/6] Try using windows-2019 in CI --- .github/workflows/pull-request.yml | 6 +++--- build/Build.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8fad4e5..8da783a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -27,9 +27,9 @@ on: - develop jobs: - windows-latest: - name: windows-latest - runs-on: windows-latest + windows-2019: + name: windows-2019 + runs-on: windows-2019 steps: - uses: actions/checkout@v3 - name: Setup dotnet diff --git a/build/Build.cs b/build/Build.cs index 8e270a2..f7f6bb5 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -19,7 +19,7 @@ [ExtendedGitHubActions( "pull-request", - GitHubActionsImage.WindowsLatest, + GitHubActionsImage.WindowsServer2019, GitHubActionsImage.UbuntuLatest, GitHubActionsImage.MacOsLatest, OnPullRequestBranches = [ MainBranch, DevelopBranch ], From 14abfc5ca08606786c1842568fc9e4092090a8e9 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Sat, 23 Dec 2023 11:30:46 +0100 Subject: [PATCH 4/6] Increase structured output width to 120 --- tests/Visp.Compiler.UnitTests/TestUtils.fs | 2 +- ...ays_array-0.structured output.verified.txt | 33 +- ...s_array2d-0.structured output.verified.txt | 99 ++---- ...s_array2d-1.structured output.verified.txt | 39 +-- ...atom_atom-0.structured output.verified.txt | 43 +-- ...ttributes-0.structured output.verified.txt | 47 +-- ...cros_cond-0.structured output.verified.txt | 20 +- ...ead-first-0.structured output.verified.txt | 11 +- ...ead-first-1.structured output.verified.txt | 25 +- ...read-last-0.structured output.verified.txt | 50 +-- ...xpr_cexpr-0.structured output.verified.txt | 18 +- ...xpr_cexpr-1.structured output.verified.txt | 39 +-- ...hars_char-0.structured output.verified.txt | 34 +- ...hars_char-1.structured output.verified.txt | 29 +- ...hars_char-2.structured output.verified.txt | 15 +- ...ions_list-0.structured output.verified.txt | 32 +- ...-shorthands.structured output.verified.txt | 41 +-- ...s_example-0.structured output.verified.txt | 20 +- ...s_example-1.structured output.verified.txt | 80 ++--- ..._example-10.structured output.verified.txt | 30 +- ..._example-11.structured output.verified.txt | 34 +- ..._example-12.structured output.verified.txt | 41 +-- ..._example-13.structured output.verified.txt | 42 +-- ..._example-14.structured output.verified.txt | 54 ++-- ..._example-15.structured output.verified.txt | 22 +- ..._example-16.structured output.verified.txt | 44 +-- ..._example-17.structured output.verified.txt | 26 +- ...s_example-2.structured output.verified.txt | 22 +- ...s_example-3.structured output.verified.txt | 21 +- ...s_example-4.structured output.verified.txt | 44 +-- ...s_example-5.structured output.verified.txt | 106 ++----- ...s_example-6.structured output.verified.txt | 15 +- ...s_example-7.structured output.verified.txt | 35 +-- ...s_example-8.structured output.verified.txt | 36 +-- ...s_example-9.structured output.verified.txt | 57 ++-- ...variables-0.structured output.verified.txt | 37 +-- ...in_for-in-0.structured output.verified.txt | 16 +- ...in_for-in-1.structured output.verified.txt | 20 +- ...in_for-in-2.structured output.verified.txt | 20 +- ...in_for-in-3.structured output.verified.txt | 20 +- ...in_for-in-4.structured output.verified.txt | 23 +- ...to_for-to-0.structured output.verified.txt | 84 ++--- ...thod-args-0.structured output.verified.txt | 297 ++++++------------ ...p_hashmap-0.structured output.verified.txt | 41 +-- ...t_hashset-0.structured output.verified.txt | 29 +- ...sts_if_if-0.structured output.verified.txt | 19 +- ...d-example-0.structured output.verified.txt | 88 ++---- ...-in-macro-0.structured output.verified.txt | 21 +- ...in-macros-0.structured output.verified.txt | 53 ++-- ...ond-macro-0.structured output.verified.txt | 44 +-- ...ond-macro-1.structured output.verified.txt | 83 ++--- ...unt-exprs-0.structured output.verified.txt | 42 +-- ...shorthand-0.structured output.verified.txt | 45 +-- ..._my-rinit-0.structured output.verified.txt | 59 +--- ...expansion-0.structured output.verified.txt | 152 +++------ ...expansion-1.structured output.verified.txt | 254 +++++---------- ...r-example-0.structured output.verified.txt | 105 ++----- ...t-example-1.structured output.verified.txt | 186 ++++------- ...uct-macro-0.structured output.verified.txt | 91 ++---- ...uct-macro-2.structured output.verified.txt | 153 +++------ ...uct-macro-3.structured output.verified.txt | 146 +++------ ...tax-macro-0.structured output.verified.txt | 74 ++--- ...tax-macro-2.structured output.verified.txt | 84 ++--- ..._up-macro-0.structured output.verified.txt | 24 +- ...s-example-0.structured output.verified.txt | 55 +--- ...ile-match-0.structured output.verified.txt | 59 +--- ...mbers_int-0.structured output.verified.txt | 20 +- ...uple-args-0.structured output.verified.txt | 36 +-- ...shorthand-0.structured output.verified.txt | 18 +- ..._let-values.structured output.verified.txt | 26 +- ...ing_match-0.structured output.verified.txt | 191 ++++------- ...ing_match-1.structured output.verified.txt | 113 ++----- ...operators-0.structured output.verified.txt | 99 ++---- ...rsing_props.structured output.verified.txt | 12 +- ...s-generic-0.structured output.verified.txt | 62 ++-- ...-to-int32-0.structured output.verified.txt | 33 +- ...g_strings-0.structured output.verified.txt | 50 +-- ...g_strings-1.structured output.verified.txt | 140 +++------ ...rpolation-0.structured output.verified.txt | 48 +-- ...rpolation-1.structured output.verified.txt | 18 +- ...-in-macro-0.structured output.verified.txt | 39 +-- ...ing_tuple-0.structured output.verified.txt | 23 +- ...s_pats_fn-0.structured output.verified.txt | 162 +++------- ...s_pats_fn-1.structured output.verified.txt | 44 +-- ..._pats_let-0.structured output.verified.txt | 76 ++--- ...ion_quote-0.structured output.verified.txt | 83 ++--- ...omparison-0.structured output.verified.txt | 219 ++++--------- ...member-fn-0.structured output.verified.txt | 37 +-- ...r-get-set-0.structured output.verified.txt | 120 +++---- ...pe_record-0.structured output.verified.txt | 68 ++-- ...pe_record-1.structured output.verified.txt | 125 +++----- ...pe_record-2.structured output.verified.txt | 61 ++-- ...pe_record-3.structured output.verified.txt | 48 +-- ...pe_record-4.structured output.verified.txt | 44 +-- ...type_type-0.structured output.verified.txt | 36 +-- ...ype-alias-0.structured output.verified.txt | 38 +-- ...ype_union-0.structured output.verified.txt | 87 ++--- ...or_vector-0.structured output.verified.txt | 35 +-- ...ile_while-0.structured output.verified.txt | 45 +-- ...ile_while-1.structured output.verified.txt | 74 ++--- 100 files changed, 1935 insertions(+), 4125 deletions(-) diff --git a/tests/Visp.Compiler.UnitTests/TestUtils.fs b/tests/Visp.Compiler.UnitTests/TestUtils.fs index 985c65b..e33748d 100644 --- a/tests/Visp.Compiler.UnitTests/TestUtils.fs +++ b/tests/Visp.Compiler.UnitTests/TestUtils.fs @@ -54,7 +54,7 @@ let runStructuredOutputTest (name: string) = let nameParam = name.Replace('/', '_').Replace('\\', '_') - let output = (sprintf "%A" parsed).Replace("\r\n", "\n") + let output = (sprintf "%120A" parsed).Replace("\r\n", "\n") return! verify output "parsing-snapshots" nameParam with :? ParseHelpers.SyntaxError as syn -> diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array-0.structured output.verified.txt index 7b8e66c..e093f23 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array-0.structured output.verified.txt @@ -6,33 +6,26 @@ Collection (SynCollection (FsArray, - [Const (Int32 1, (8,12--8,13)); Const (Int32 2, (8,14--8,15)); - Const (Int32 3, (8,16--8,17)); Const (Int32 4, (8,18--8,19)); - Const (Int32 5, (8,20--8,21))], (8,9--8,24))), None, - (8,1--8,24)), (8,0--8,25)); + [Const (Int32 1, (8,12--8,13)); Const (Int32 2, (8,14--8,15)); Const (Int32 3, (8,16--8,17)); + Const (Int32 4, (8,18--8,19)); Const (Int32 5, (8,20--8,21))], (8,9--8,24))), None, (8,1--8,24)), + (8,0--8,25)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("arr[0] %A", Regular, (10,9--10,20)), (10,9--10,20)); - DotIndex - (Symbol (SynSymbol arr), [Const (Int32 0, (10,24--10,25))], - (10,22--10,30))], (10,1--10,31)), (10,0--10,32)); + [Const (String ("arr[0] %A", Regular, (10,9--10,20)), (10,9--10,20)); + DotIndex (Symbol (SynSymbol arr), [Const (Int32 0, (10,24--10,25))], (10,22--10,30))], (10,1--10,31)), + (10,0--10,32)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("arr[1] %A", Regular, (11,9--11,20)), (11,9--11,20)); - DotIndex - (Symbol (SynSymbol arr), [Const (Int32 1, (11,24--11,25))], - (11,22--11,30))], (11,1--11,31)), (11,0--11,32)); + [Const (String ("arr[1] %A", Regular, (11,9--11,20)), (11,9--11,20)); + DotIndex (Symbol (SynSymbol arr), [Const (Int32 1, (11,24--11,25))], (11,22--11,30))], (11,1--11,31)), + (11,0--11,32)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (13,0--13,3)), - Symbol (SynSymbol arr), None, (13,0--13,3)), (13,0--13,3)); + (LetOrUse (Named (SynSymbol visp_result_todo, (13,0--13,3)), Symbol (SynSymbol arr), None, (13,0--13,3)), + (13,0--13,3)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (13,0--13,3)), (13,0--13,3)); - Symbol (SynSymbol visp_result_todo)], (13,0--13,3)), (13,0--13,3))], - (8,0--13,3))] \ No newline at end of file + [Const (String ("%A", Regular, (13,0--13,3)), (13,0--13,3)); Symbol (SynSymbol visp_result_todo)], + (13,0--13,3)), (13,0--13,3))], (8,0--13,3))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-0.structured output.verified.txt index 803fa95..bddd0de 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-0.structured output.verified.txt @@ -1,100 +1,70 @@ ParsedFile [AnonModule - ([Expr - (TypeAlias - (SynSymbol Grid, Array (2, Ident char, (8,14--8,21)), (8,1--8,21)), - (8,0--8,22)); + ([Expr (TypeAlias (SynSymbol Grid, Array (2, Ident char, (8,14--8,21)), (8,1--8,21)), (8,0--8,22)); Expr (LetOrUse (Named (SynSymbol arr, (10,5--10,8)), FunctionCall (Symbol (SynSymbol Array2D.create), - [Const (Int32 5, (10,25--10,26)); - Const (Int32 5, (10,27--10,28)); - Const (Char '.', (10,29--10,32))], (10,10--10,32)), None, - (10,1--10,33)), (10,0--10,34)); + [Const (Int32 5, (10,25--10,26)); Const (Int32 5, (10,27--10,28)); Const (Char '.', (10,29--10,32))], + (10,10--10,32)), None, (10,1--10,33)), (10,0--10,34)); Expr - (LetOrUse - (Named (SynSymbol y, (12,5--12,6)), Const (Int32 4, (12,7--12,8)), - None, (12,1--12,8)), (12,0--12,9)); + (LetOrUse (Named (SynSymbol y, (12,5--12,6)), Const (Int32 4, (12,7--12,8)), None, (12,1--12,8)), (12,0--12,9)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("arr[0,0]=%A", Regular, (14,9--14,22)), (14,9--14,22)); + [Const (String ("arr[0,0]=%A", Regular, (14,9--14,22)), (14,9--14,22)); DotIndex - (Symbol (SynSymbol arr), - [Const (Int32 0, (14,26--14,27)); - Const (Int32 0, (14,28--14,29))], (14,24--14,34))], - (14,1--14,35)), (14,0--14,36)); + (Symbol (SynSymbol arr), [Const (Int32 0, (14,26--14,27)); Const (Int32 0, (14,28--14,29))], + (14,24--14,34))], (14,1--14,35)), (14,0--14,36)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("arr[1,2]=%A", Regular, (15,9--15,22)), (15,9--15,22)); + [Const (String ("arr[1,2]=%A", Regular, (15,9--15,22)), (15,9--15,22)); DotIndex - (Symbol (SynSymbol arr), - [Const (Int32 1, (15,26--15,27)); - Const (Int32 1, (15,29--15,30))], (15,24--15,35))], - (15,1--15,36)), (15,0--15,37)); + (Symbol (SynSymbol arr), [Const (Int32 1, (15,26--15,27)); Const (Int32 1, (15,29--15,30))], + (15,24--15,35))], (15,1--15,36)), (15,0--15,37)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("arr[3,3]=%A", Regular, (16,9--16,22)), (16,9--16,22)); + [Const (String ("arr[3,3]=%A", Regular, (16,9--16,22)), (16,9--16,22)); FunctionCall (Symbol (SynSymbol Array2D.get), - [Symbol (SynSymbol arr); Const (Int32 3, (16,40--16,41)); - Const (Int32 3, (16,42--16,43))], (16,24--16,43))], - (16,1--16,44)), (16,0--16,45)); + [Symbol (SynSymbol arr); Const (Int32 3, (16,40--16,41)); Const (Int32 3, (16,42--16,43))], + (16,24--16,43))], (16,1--16,44)), (16,0--16,45)); Expr (Set (DotIndex - (Symbol (SynSymbol arr), - [Const (Int32 2, (18,9--18,10)); Const (Int32 2, (18,12--18,13))], - (18,7--18,18)), Const (Char '#', (18,20--18,23)), (18,1--18,23)), - (18,0--18,24)); + (Symbol (SynSymbol arr), [Const (Int32 2, (18,9--18,10)); Const (Int32 2, (18,12--18,13))], (18,7--18,18)), + Const (Char '#', (18,20--18,23)), (18,1--18,23)), (18,0--18,24)); Expr (Set (DotIndex - (Symbol (SynSymbol arr), - [Const (Int32 3, (19,9--19,10)); Const (Int32 4, (19,12--19,13))], - (19,7--19,18)), Const (Char '#', (19,20--19,23)), (19,1--19,23)), - (19,0--19,24)); + (Symbol (SynSymbol arr), [Const (Int32 3, (19,9--19,10)); Const (Int32 4, (19,12--19,13))], (19,7--19,18)), + Const (Char '#', (19,20--19,23)), (19,1--19,23)), (19,0--19,24)); Expr (Set (DotIndex - (Symbol (SynSymbol arr), - [Const (Int32 4, (20,9--20,10)); Const (Int32 4, (20,12--20,13))], - (20,7--20,18)), Const (Char '#', (20,20--20,23)), (20,1--20,23)), - (20,0--20,24)); + (Symbol (SynSymbol arr), [Const (Int32 4, (20,9--20,10)); Const (Int32 4, (20,12--20,13))], (20,7--20,18)), + Const (Char '#', (20,20--20,23)), (20,1--20,23)), (20,0--20,24)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("arr[3,4]=%A", Regular, (21,9--21,22)), (21,9--21,22)); + [Const (String ("arr[3,4]=%A", Regular, (21,9--21,22)), (21,9--21,22)); ThreadLast ([Expr (Symbol (SynSymbol arr), (21,28--21,31)); Index - ([Op - (Infix - (SynSymbol -, - [Symbol (SynSymbol y); - Const (Int32 1, (21,39--21,40))], (21,35--21,40))); + ([Op (Infix (SynSymbol -, [Symbol (SynSymbol y); Const (Int32 1, (21,39--21,40))], (21,35--21,40))); Op (Infix (SynSymbol +, - [Const (Int32 1, (21,46--21,47)); - Const (Int32 1, (21,48--21,49)); - Const (Int32 1, (21,50--21,51)); - Const (Int32 1, (21,52--21,53))], (21,44--21,53)))], - (21,32--21,55))], (21,24--21,55))], (21,1--21,56)), - (21,0--21,57)); + [Const (Int32 1, (21,46--21,47)); Const (Int32 1, (21,48--21,49)); + Const (Int32 1, (21,50--21,51)); Const (Int32 1, (21,52--21,53))], (21,44--21,53)))], + (21,32--21,55))], (21,24--21,55))], (21,1--21,56)), (21,0--21,57)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("arr[4,4]=%A", Regular, (22,9--22,22)), (22,9--22,22)); + [Const (String ("arr[4,4]=%A", Regular, (22,9--22,22)), (22,9--22,22)); ThreadLast ([Expr (Symbol (SynSymbol arr), (22,28--22,31)); Index @@ -102,19 +72,14 @@ Op (Infix (SynSymbol +, - [Const (Int32 1, (22,40--22,41)); - Const (Int32 1, (22,42--22,43)); - Const (Int32 1, (22,44--22,45)); - Const (Int32 1, (22,46--22,47))], (22,38--22,47)))], - (22,32--22,49))], (22,24--22,49))], (22,1--22,50)), - (22,0--22,51)); + [Const (Int32 1, (22,40--22,41)); Const (Int32 1, (22,42--22,43)); + Const (Int32 1, (22,44--22,45)); Const (Int32 1, (22,46--22,47))], (22,38--22,47)))], + (22,32--22,49))], (22,24--22,49))], (22,1--22,50)), (22,0--22,51)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (25,0--25,3)), - Symbol (SynSymbol arr), None, (25,0--25,3)), (25,0--25,3)); + (LetOrUse (Named (SynSymbol visp_result_todo, (25,0--25,3)), Symbol (SynSymbol arr), None, (25,0--25,3)), + (25,0--25,3)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (25,0--25,3)), (25,0--25,3)); - Symbol (SynSymbol visp_result_todo)], (25,0--25,3)), (25,0--25,3))], - (8,0--25,3))] \ No newline at end of file + [Const (String ("%A", Regular, (25,0--25,3)), (25,0--25,3)); Symbol (SynSymbol visp_result_todo)], + (25,0--25,3)), (25,0--25,3))], (8,0--25,3))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-1.structured output.verified.txt index e1e030b..1481fe1 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_arrays_array2d-1.structured output.verified.txt @@ -1,43 +1,30 @@ ParsedFile [AnonModule - ([Expr - (TypeAlias - (SynSymbol Grid, Array (2, Ident char, (8,14--8,21)), (8,1--8,21)), - (8,0--8,22)); + ([Expr (TypeAlias (SynSymbol Grid, Array (2, Ident char, (8,14--8,21)), (8,1--8,21)), (8,0--8,22)); Expr (LetOrUse (Named (SynSymbol arr, (10,5--10,8)), FunctionCall (Symbol (SynSymbol Array2D.create), - [Const (Int32 5, (10,25--10,26)); - Const (Int32 5, (10,27--10,28)); - Const (Char '.', (10,29--10,32))], (10,10--10,32)), None, - (10,1--10,33)), (10,0--10,34)); + [Const (Int32 5, (10,25--10,26)); Const (Int32 5, (10,27--10,28)); Const (Char '.', (10,29--10,32))], + (10,10--10,32)), None, (10,1--10,33)), (10,0--10,34)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("arr[*,0]=%A", Regular, (12,9--12,22)), (12,9--12,22)); - DotIndex - (Symbol (SynSymbol arr), - [Symbol (SynSymbol *); Const (Int32 0, (12,28--12,29))], - (12,24--12,34))], (12,1--12,35)), (12,0--12,36)); + [Const (String ("arr[*,0]=%A", Regular, (12,9--12,22)), (12,9--12,22)); + DotIndex (Symbol (SynSymbol arr), [Symbol (SynSymbol *); Const (Int32 0, (12,28--12,29))], (12,24--12,34))], + (12,1--12,35)), (12,0--12,36)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("arr[0,*]=%A", Regular, (13,9--13,22)), (13,9--13,22)); - DotIndex - (Symbol (SynSymbol arr), - [Const (Int32 0, (13,26--13,27)); Symbol (SynSymbol *)], - (13,24--13,34))], (13,1--13,35)), (13,0--13,36)); + [Const (String ("arr[0,*]=%A", Regular, (13,9--13,22)), (13,9--13,22)); + DotIndex (Symbol (SynSymbol arr), [Const (Int32 0, (13,26--13,27)); Symbol (SynSymbol *)], (13,24--13,34))], + (13,1--13,35)), (13,0--13,36)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (15,0--15,3)), - Symbol (SynSymbol arr), None, (15,0--15,3)), (15,0--15,3)); + (LetOrUse (Named (SynSymbol visp_result_todo, (15,0--15,3)), Symbol (SynSymbol arr), None, (15,0--15,3)), + (15,0--15,3)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (15,0--15,3)), (15,0--15,3)); - Symbol (SynSymbol visp_result_todo)], (15,0--15,3)), (15,0--15,3))], - (8,0--15,3))] \ No newline at end of file + [Const (String ("%A", Regular, (15,0--15,3)), (15,0--15,3)); Symbol (SynSymbol visp_result_todo)], + (15,0--15,3)), (15,0--15,3))], (8,0--15,3))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_atom_atom-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_atom_atom-0.structured output.verified.txt index 41538e0..3c9d0f0 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_atom_atom-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_atom_atom-0.structured output.verified.txt @@ -1,57 +1,40 @@ ParsedFile [AnonModule - ([HashDirective - (ParsedHashDirective - ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), - (9,0--9,12)); + ([HashDirective (ParsedHashDirective ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), (9,0--9,12)); Expr (FunctionDef (SynSymbol inc, None, - Args - (List - [Typed - (Named (SynSymbol v, (11,10--11,11)), Ident Value, - (11,9--11,19))], (11,8--11,20)), + Args (List [Typed (Named (SynSymbol v, (11,10--11,11)), Ident Value, (11,9--11,19))], (11,8--11,20)), [FunctionCall (Symbol (SynSymbol Value.from), [Op (Infix (SynSymbol +, [Const (Int64 1L, (12,19--12,21)); - FunctionCall - (Symbol (SynSymbol unwrapInt), [Symbol (SynSymbol v)], - (12,23--12,34))], (12,17--12,35)))], (12,5--12,36))], - (11,1--12,37)), (11,0--12,38)); + FunctionCall (Symbol (SynSymbol unwrapInt), [Symbol (SynSymbol v)], (12,23--12,34))], + (12,17--12,35)))], (12,5--12,36))], (11,1--12,37)), (11,0--12,38)); Expr (LetOrUse - (Named (SynSymbol count, (13,5--13,10)), - Atom (Const (Int64 0L, (13,17--13,19)), (13,12--13,19)), None, + (Named (SynSymbol count, (13,5--13,10)), Atom (Const (Int64 0L, (13,17--13,19)), (13,12--13,19)), None, (13,1--13,20)), (13,0--13,21)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("count is %O", Regular, (15,9--15,22)), (15,9--15,22)); - Deref (true, Symbol (SynSymbol count), (15,23--15,29))], - (15,1--15,29)), (15,0--15,30)); + [Const (String ("count is %O", Regular, (15,9--15,22)), (15,9--15,22)); + Deref (true, Symbol (SynSymbol count), (15,23--15,29))], (15,1--15,29)), (15,0--15,30)); Expr - (FunctionCall - (Symbol (SynSymbol swap!), - [Symbol (SynSymbol count); Symbol (SynSymbol inc)], (17,1--17,16)), + (FunctionCall (Symbol (SynSymbol swap!), [Symbol (SynSymbol count); Symbol (SynSymbol inc)], (17,1--17,16)), (17,0--17,17)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (19,0--19,30)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("count is %O", Regular, (19,9--19,22)), - (19,9--19,22)); - Deref (true, Symbol (SynSymbol count), (19,23--19,29))], - (19,1--19,29)), None, (19,0--19,30)), (19,0--19,30)); + [Const (String ("count is %O", Regular, (19,9--19,22)), (19,9--19,22)); + Deref (true, Symbol (SynSymbol count), (19,23--19,29))], (19,1--19,29)), None, (19,0--19,30)), + (19,0--19,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (19,0--19,30)), (19,0--19,30)); - Symbol (SynSymbol visp_result_todo)], (19,0--19,30)), - (19,0--19,30))], (9,0--19,30))] \ No newline at end of file + [Const (String ("%A", Regular, (19,0--19,30)), (19,0--19,30)); Symbol (SynSymbol visp_result_todo)], + (19,0--19,30)), (19,0--19,30))], (9,0--19,30))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_attributes_attributes-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_attributes_attributes-0.structured output.verified.txt index b9507ba..4987aba 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_attributes_attributes-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_attributes_attributes-0.structured output.verified.txt @@ -3,44 +3,31 @@ ([Expr (Type (SynSymbol TestStruct, - Args - (Tuple - [Typed - (Named (SynSymbol value, (9,20--9,25)), Ident int, - (9,19--9,31))], (9,18--9,32)), - [Member - (SynSymbol _.Value, Symbol (SynSymbol value), (10,5--10,25))], - [{ Attributes = - [{ TypeName = Ident Struct - ArgExpr = Const (Unit, (8,3--8,9)) - Range = (8,3--8,9) }; { TypeName = Ident NoEquality - ArgExpr = Const (Unit, (8,12--8,22)) - Range = (8,12--8,22) }; - { TypeName = Ident NoComparison - ArgExpr = Const (Unit, (8,25--8,37)) - Range = (8,25--8,37) }] + Args (Tuple [Typed (Named (SynSymbol value, (9,20--9,25)), Ident int, (9,19--9,31))], (9,18--9,32)), + [Member (SynSymbol _.Value, Symbol (SynSymbol value), (10,5--10,25))], + [{ Attributes = [{ TypeName = Ident Struct + ArgExpr = Const (Unit, (8,3--8,9)) + Range = (8,3--8,9) }; { TypeName = Ident NoEquality + ArgExpr = Const (Unit, (8,12--8,22)) + Range = (8,12--8,22) }; { TypeName = Ident NoComparison + ArgExpr = Const (Unit, (8,25--8,37)) + Range = (8,25--8,37) }] Range = (8,1--8,38) }], (8,1--10,26)), (8,0--11,3)); Expr (LetOrUse (Named (SynSymbol xx, (13,5--13,7)), - New - (Ident TestStruct, [Const (Int32 99, (13,24--13,26))], - (13,9--13,26)), None, (13,1--13,27)), (13,0--13,28)); + New (Ident TestStruct, [Const (Int32 99, (13,24--13,26))], (13,9--13,26)), None, (13,1--13,27)), + (13,0--13,28)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Value is %i", Regular, (15,9--15,22)), (15,9--15,22)); - DotProperty - (Symbol (SynSymbol xx), SynSymbol Value, (15,24--15,33))], - (15,1--15,34)), (15,0--15,35)); + [Const (String ("Value is %i", Regular, (15,9--15,22)), (15,9--15,22)); + DotProperty (Symbol (SynSymbol xx), SynSymbol Value, (15,24--15,33))], (15,1--15,34)), (15,0--15,35)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (17,0--17,2)), - Const (Unit, (17,0--17,2)), None, (17,0--17,2)), (17,0--17,2)); + (LetOrUse (Named (SynSymbol visp_result_todo, (17,0--17,2)), Const (Unit, (17,0--17,2)), None, (17,0--17,2)), + (17,0--17,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,0--17,2)), (17,0--17,2)); - Symbol (SynSymbol visp_result_todo)], (17,0--17,2)), (17,0--17,2))], - (8,0--17,2))] \ No newline at end of file + [Const (String ("%A", Regular, (17,0--17,2)), (17,0--17,2)); Symbol (SynSymbol visp_result_todo)], + (17,0--17,2)), (17,0--17,2))], (8,0--17,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_cond-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_cond-0.structured output.verified.txt index 6c86855..d1c4ad1 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_cond-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_cond-0.structured output.verified.txt @@ -8,20 +8,14 @@ (SynSymbol cond, [Symbol (SynSymbol cond); List - (Paren, - [Symbol (SynSymbol >); Const (Int32 0, (9,5--9,6)); - Const (Int32 0, (9,7--9,8))], (9,2--9,9)); - Const (Int32 1, (10,4--10,5)); + (Paren, [Symbol (SynSymbol >); Const (Int32 0, (9,5--9,6)); Const (Int32 0, (9,7--9,8))], + (9,2--9,9)); Const (Int32 1, (10,4--10,5)); List - (Paren, - [Symbol (SynSymbol <); Const (Int32 0, (11,5--11,6)); - Const (Int32 0, (11,7--11,8))], (11,2--11,9)); - Const (Int32 2, (12,4--12,5)); Keyword (SynKeyword :else); - Const (Int32 3, (14,4--14,5))], (8,1--14,5))), None, - (8,0--14,6)), (8,0--14,6)); + (Paren, [Symbol (SynSymbol <); Const (Int32 0, (11,5--11,6)); Const (Int32 0, (11,7--11,8))], + (11,2--11,9)); Const (Int32 2, (12,4--12,5)); Keyword (SynKeyword :else); + Const (Int32 3, (14,4--14,5))], (8,1--14,5))), None, (8,0--14,6)), (8,0--14,6)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (8,0--14,6)), (8,0--14,6)); - Symbol (SynSymbol visp_result_todo)], (8,0--14,6)), (8,0--14,6))], - (8,0--14,6))] \ No newline at end of file + [Const (String ("%A", Regular, (8,0--14,6)), (8,0--14,6)); Symbol (SynSymbol visp_result_todo)], + (8,0--14,6)), (8,0--14,6))], (8,0--14,6))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-0.structured output.verified.txt index 9a41030..1b72cf2 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-0.structured output.verified.txt @@ -7,13 +7,10 @@ ([Const (String ("return me", Regular, (7,4--7,15)), (7,4--7,15)); LambdaDef (SynLambda - (Args - (List [Named (SynSymbol arg, (7,21--7,24))], - (7,20--7,25)), [Symbol (SynSymbol arg)], (7,17--7,29)))], - (7,1--7,30)), None, (7,0--7,31)), (7,0--7,31)); + (Args (List [Named (SynSymbol arg, (7,21--7,24))], (7,20--7,25)), [Symbol (SynSymbol arg)], + (7,17--7,29)))], (7,1--7,30)), None, (7,0--7,31)), (7,0--7,31)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (7,0--7,31)), (7,0--7,31)); - Symbol (SynSymbol visp_result_todo)], (7,0--7,31)), (7,0--7,31))], - (7,0--7,31))] \ No newline at end of file + [Const (String ("%A", Regular, (7,0--7,31)), (7,0--7,31)); Symbol (SynSymbol visp_result_todo)], + (7,0--7,31)), (7,0--7,31))], (7,0--7,31))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-1.structured output.verified.txt index a5c1d8c..39aecff 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-first-1.structured output.verified.txt @@ -2,37 +2,28 @@ [AnonModule ([Expr (FunctionDef - (SynSymbol identity, None, - Args (List [Named (SynSymbol arg, (9,14--9,17))], (9,13--9,18)), + (SynSymbol identity, None, Args (List [Named (SynSymbol arg, (9,14--9,17))], (9,13--9,18)), [Symbol (SynSymbol arg)], (9,1--9,22)), (9,0--9,23)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (11,0--17,6)), ThreadFirst - ([Const - (String ("return me", Regular, (11,4--11,15)), (11,4--11,15)); + ([Const (String ("return me", Regular, (11,4--11,15)), (11,4--11,15)); FunctionCall (Symbol (SynSymbol identity), [], (12,5--12,13)); LambdaDef (SynLambda - (Args - (List [Named (SynSymbol arg, (13,9--13,12))], - (13,8--13,13)), [Symbol (SynSymbol arg)], + (Args (List [Named (SynSymbol arg, (13,9--13,12))], (13,8--13,13)), [Symbol (SynSymbol arg)], (13,5--13,17))); LambdaDef (SynLambda - (Args - (List [Named (SynSymbol arg, (14,9--14,12))], - (14,8--14,13)), + (Args (List [Named (SynSymbol arg, (14,9--14,12))], (14,8--14,13)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("arg is %O", Regular, (15,15--15,26)), - (15,15--15,26)); Symbol (SynSymbol arg)], - (15,7--15,30)); Symbol (SynSymbol arg)], (14,5--16,9)))], + [Const (String ("arg is %O", Regular, (15,15--15,26)), (15,15--15,26)); + Symbol (SynSymbol arg)], (15,7--15,30)); Symbol (SynSymbol arg)], (14,5--16,9)))], (11,1--17,5)), None, (11,0--17,6)), (11,0--17,6)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (11,0--17,6)), (11,0--17,6)); - Symbol (SynSymbol visp_result_todo)], (11,0--17,6)), (11,0--17,6))], - (9,0--17,6))] \ No newline at end of file + [Const (String ("%A", Regular, (11,0--17,6)), (11,0--17,6)); Symbol (SynSymbol visp_result_todo)], + (11,0--17,6)), (11,0--17,6))], (9,0--17,6))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-last-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-last-0.structured output.verified.txt index a72621f..f12967e 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-last-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_builtin-macros_thread-last-0.structured output.verified.txt @@ -6,60 +6,44 @@ (Named (SynSymbol rx, (9,5--9,7)), New (Ident Regex, - [Const - (String ("Game (\d+):", Regular, (9,19--9,32)), (9,19--9,32)); - DotProperty - (Symbol (SynSymbol RegexOptions), SynSymbol Compiled, - (9,34--9,57))], (9,9--9,58)), None, (9,1--9,59)), - (9,0--9,60)); + [Const (String ("Game (\d+):", Regular, (9,19--9,32)), (9,19--9,32)); + DotProperty (Symbol (SynSymbol RegexOptions), SynSymbol Compiled, (9,34--9,57))], (9,9--9,58)), None, + (9,1--9,59)), (9,0--9,60)); Expr (LetOrUse (Named (SynSymbol ms, (11,5--11,7)), DotMethod (Symbol (SynSymbol rx), SynSymbol Match, - [Const - (String ("Game 1:", Regular, (11,19--11,28)), (11,19--11,28))], - Tuple, (11,9--11,28)), None, (11,1--11,29)), (11,0--11,30)); + [Const (String ("Game 1:", Regular, (11,19--11,28)), (11,19--11,28))], Tuple, (11,9--11,28)), None, + (11,1--11,29)), (11,0--11,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Groups %A", Regular, (13,9--13,20)), (13,9--13,20)); - DotProperty - (Symbol (SynSymbol ms), SynSymbol Groups, (13,22--13,32))], - (13,1--13,33)), (13,0--13,34)); + [Const (String ("Groups %A", Regular, (13,9--13,20)), (13,9--13,20)); + DotProperty (Symbol (SynSymbol ms), SynSymbol Groups, (13,22--13,32))], (13,1--13,33)), (13,0--13,34)); Expr (LetOrUse (Named (SynSymbol gamePrefix, (15,5--15,15)), DotIndex - (DotProperty - (Symbol (SynSymbol ms), SynSymbol Groups, (15,23--15,34)), - [Const (Int32 0, (15,19--15,20))], (15,17--15,35)), None, - (15,1--15,36)), (15,0--15,37)); + (DotProperty (Symbol (SynSymbol ms), SynSymbol Groups, (15,23--15,34)), [Const (Int32 0, (15,19--15,20))], + (15,17--15,35)), None, (15,1--15,36)), (15,0--15,37)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Game Prefix %A", Regular, (17,9--17,25)), - (17,9--17,25)); Symbol (SynSymbol gamePrefix)], (17,1--17,36)), - (17,0--17,37)); + [Const (String ("Game Prefix %A", Regular, (17,9--17,25)), (17,9--17,25)); Symbol (SynSymbol gamePrefix)], + (17,1--17,36)), (17,0--17,37)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (19,0--19,48)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Game Prefix %A", Regular, (19,9--19,25)), - (19,9--19,25)); + [Const (String ("Game Prefix %A", Regular, (19,9--19,25)), (19,9--19,25)); ThreadLast - ([Expr (Symbol (SynSymbol ms), (19,31--19,33)); - Property (SynSymbol Groups, (19,34--19,41)); - Index ([Const (Int32 0, (19,44--19,45))], (19,42--19,46))], - (19,27--19,46))], (19,1--19,47)), None, (19,0--19,48)), - (19,0--19,48)); + ([Expr (Symbol (SynSymbol ms), (19,31--19,33)); Property (SynSymbol Groups, (19,34--19,41)); + Index ([Const (Int32 0, (19,44--19,45))], (19,42--19,46))], (19,27--19,46))], (19,1--19,47)), None, + (19,0--19,48)), (19,0--19,48)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (19,0--19,48)), (19,0--19,48)); - Symbol (SynSymbol visp_result_todo)], (19,0--19,48)), - (19,0--19,48))], (8,0--19,48))] \ No newline at end of file + [Const (String ("%A", Regular, (19,0--19,48)), (19,0--19,48)); Symbol (SynSymbol visp_result_todo)], + (19,0--19,48)), (19,0--19,48))], (8,0--19,48))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-0.structured output.verified.txt index dba3b65..0912b09 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-0.structured output.verified.txt @@ -8,20 +8,14 @@ Computation (SynSymbol seq, [FsYield (Const (Int32 1, (9,11--9,12)), false, (9,5--9,12)); - FsYield - (Const (Int32 2, (10,11--10,12)), false, (10,5--10,12)); - FsYield - (Const (Int32 3, (11,11--11,12)), false, (11,5--11,12))], - (8,12--11,13)), + FsYield (Const (Int32 2, (10,11--10,12)), false, (10,5--10,12)); + FsYield (Const (Int32 3, (11,11--11,12)), false, (11,5--11,12))], (8,12--11,13)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("x is %i", Regular, (12,11--12,20)), - (12,11--12,20)); Symbol (SynSymbol x)], (12,3--12,22))], - (8,1--12,23)), None, (8,0--13,1)), (8,0--13,1)); + [Const (String ("x is %i", Regular, (12,11--12,20)), (12,11--12,20)); Symbol (SynSymbol x)], + (12,3--12,22))], (8,1--12,23)), None, (8,0--13,1)), (8,0--13,1)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (8,0--13,1)), (8,0--13,1)); - Symbol (SynSymbol visp_result_todo)], (8,0--13,1)), (8,0--13,1))], - (8,0--13,1))] \ No newline at end of file + [Const (String ("%A", Regular, (8,0--13,1)), (8,0--13,1)); Symbol (SynSymbol visp_result_todo)], + (8,0--13,1)), (8,0--13,1))], (8,0--13,1))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-1.structured output.verified.txt index d800f0d..4e05510 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_cexpr_cexpr-1.structured output.verified.txt @@ -6,23 +6,18 @@ (SynSymbol SomeTaskCode, None, Args (List - [Typed - (Named (SynSymbol cancellationToken, (10,19--10,36)), - Ident CancellationToken, (10,18--10,56))], (10,17--10,57)), + [Typed (Named (SynSymbol cancellationToken, (10,19--10,36)), Ident CancellationToken, (10,18--10,56))], + (10,17--10,57)), [Computation (SynSymbol task, [DotMethod - (Symbol (SynSymbol cancellationToken), - SynSymbol ThrowIfCancellationRequested, [], Tuple, + (Symbol (SynSymbol cancellationToken), SynSymbol ThrowIfCancellationRequested, [], Tuple, (12,8--12,55)); FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("continuing...", Regular, (13,16--13,31)), - (13,16--13,31))], (13,8--13,31)); - FsReturn - (Const (Int32 1, (14,15--14,16)), false, (14,8--14,16))], - (11,3--14,17))], (10,1--15,3)), (10,0--15,4)); + [Const (String ("continuing...", Regular, (13,16--13,31)), (13,16--13,31))], (13,8--13,31)); + FsReturn (Const (Int32 1, (14,15--14,16)), false, (14,8--14,16))], (11,3--14,17))], (10,1--15,3)), + (10,0--15,4)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (17,0--19,27)), @@ -30,21 +25,13 @@ ([Expr (FunctionCall (Symbol (SynSymbol SomeTaskCode), - [DotProperty - (Symbol (SynSymbol CancellationToken), SynSymbol None, - (17,20--17,43))], (17,6--17,44)), (17,5--17,45)); - Expr - (FunctionCall - (Symbol (SynSymbol Async.AwaitTask), [], (18,3--18,18)), - (18,2--18,19)); - Expr - (FunctionCall - (Symbol (SynSymbol Async.RunSynchronously), [], - (19,3--19,25)), (19,2--19,26))], (17,1--19,26)), None, - (17,0--19,27)), (17,0--19,27)); + [DotProperty (Symbol (SynSymbol CancellationToken), SynSymbol None, (17,20--17,43))], + (17,6--17,44)), (17,5--17,45)); + Expr (FunctionCall (Symbol (SynSymbol Async.AwaitTask), [], (18,3--18,18)), (18,2--18,19)); + Expr (FunctionCall (Symbol (SynSymbol Async.RunSynchronously), [], (19,3--19,25)), (19,2--19,26))], + (17,1--19,26)), None, (17,0--19,27)), (17,0--19,27)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,0--19,27)), (17,0--19,27)); - Symbol (SynSymbol visp_result_todo)], (17,0--19,27)), - (17,0--19,27))], (8,0--19,27))] \ No newline at end of file + [Const (String ("%A", Regular, (17,0--19,27)), (17,0--19,27)); Symbol (SynSymbol visp_result_todo)], + (17,0--19,27)), (17,0--19,27))], (8,0--19,27))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-0.structured output.verified.txt index 79b58d6..a36b9af 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-0.structured output.verified.txt @@ -3,43 +3,37 @@ ([Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("Char is %O", Regular, (8,9--8,21)), (8,9--8,21)); - Const (Char 'h', (8,22--8,25))], (8,1--8,25)), (8,0--8,26)); + [Const (String ("Char is %O", Regular, (8,9--8,21)), (8,9--8,21)); Const (Char 'h', (8,22--8,25))], + (8,1--8,25)), (8,0--8,26)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("Char is %O", Regular, (9,9--9,21)), (9,9--9,21)); - Const (Char 'a', (9,22--9,29))], (9,1--9,29)), (9,0--9,30)); + [Const (String ("Char is %O", Regular, (9,9--9,21)), (9,9--9,21)); Const (Char 'a', (9,22--9,29))], + (9,1--9,29)), (9,0--9,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Char is %O", Regular, (10,9--10,21)), (10,9--10,21)); - Const (Char 'a', (10,22--10,29))], (10,1--10,29)), (10,0--10,30)); + [Const (String ("Char is %O", Regular, (10,9--10,21)), (10,9--10,21)); Const (Char 'a', (10,22--10,29))], + (10,1--10,29)), (10,0--10,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Char is %O", Regular, (12,9--12,21)), (12,9--12,21)); - Const (Char ':', (12,22--12,25))], (12,1--12,25)), (12,0--12,26)); + [Const (String ("Char is %O", Regular, (12,9--12,21)), (12,9--12,21)); Const (Char ':', (12,22--12,25))], + (12,1--12,25)), (12,0--12,26)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Char is %O", Regular, (13,9--13,21)), (13,9--13,21)); - Const (Char '(', (13,22--13,25))], (13,1--13,25)), (13,0--13,27)); + [Const (String ("Char is %O", Regular, (13,9--13,21)), (13,9--13,21)); Const (Char '(', (13,22--13,25))], + (13,1--13,25)), (13,0--13,27)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (14,0--14,27)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Char is %O", Regular, (14,9--14,21)), (14,9--14,21)); - Const (Char ')', (14,22--14,25))], (14,1--14,25)), None, - (14,0--14,27)), (14,0--14,27)); + [Const (String ("Char is %O", Regular, (14,9--14,21)), (14,9--14,21)); Const (Char ')', (14,22--14,25))], + (14,1--14,25)), None, (14,0--14,27)), (14,0--14,27)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (14,0--14,27)), (14,0--14,27)); - Symbol (SynSymbol visp_result_todo)], (14,0--14,27)), - (14,0--14,27))], (8,0--14,27))] \ No newline at end of file + [Const (String ("%A", Regular, (14,0--14,27)), (14,0--14,27)); Symbol (SynSymbol visp_result_todo)], + (14,0--14,27)), (14,0--14,27))], (8,0--14,27))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-1.structured output.verified.txt index 6c40014..7c39282 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-1.structured output.verified.txt @@ -3,34 +3,25 @@ ([Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Char is '%03o'", Regular, (8,9--8,25)), (8,9--8,25)); - FunctionCall - (Symbol (SynSymbol int), [Const (Char '\010', (8,31--8,35))], - (8,27--8,35))], (8,1--8,36)), (8,0--8,37)); + [Const (String ("Char is '%03o'", Regular, (8,9--8,25)), (8,9--8,25)); + FunctionCall (Symbol (SynSymbol int), [Const (Char '\010', (8,31--8,35))], (8,27--8,35))], (8,1--8,36)), + (8,0--8,37)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Char is '%03o'", Regular, (9,9--9,25)), (9,9--9,25)); - FunctionCall - (Symbol (SynSymbol int), [Const (Char '\013', (9,31--9,35))], - (9,27--9,35))], (9,1--9,36)), (9,0--9,37)); + [Const (String ("Char is '%03o'", Regular, (9,9--9,25)), (9,9--9,25)); + FunctionCall (Symbol (SynSymbol int), [Const (Char '\013', (9,31--9,35))], (9,27--9,35))], (9,1--9,36)), + (9,0--9,37)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (10,0--10,38)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Char is '%03o'", Regular, (10,9--10,25)), - (10,9--10,25)); - FunctionCall - (Symbol (SynSymbol int), - [Const (Char '\009', (10,31--10,36))], (10,27--10,36))], + [Const (String ("Char is '%03o'", Regular, (10,9--10,25)), (10,9--10,25)); + FunctionCall (Symbol (SynSymbol int), [Const (Char '\009', (10,31--10,36))], (10,27--10,36))], (10,1--10,37)), None, (10,0--10,38)), (10,0--10,38)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (10,0--10,38)), (10,0--10,38)); - Symbol (SynSymbol visp_result_todo)], (10,0--10,38)), - (10,0--10,38))], (8,0--10,38))] \ No newline at end of file + [Const (String ("%A", Regular, (10,0--10,38)), (10,0--10,38)); Symbol (SynSymbol visp_result_todo)], + (10,0--10,38)), (10,0--10,38))], (8,0--10,38))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-2.structured output.verified.txt index d110529..9b195f5 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-2.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_chars_char-2.structured output.verified.txt @@ -5,17 +5,12 @@ (Named (SynSymbol visp_result_todo, (9,0--9,46)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Chars are %A", Regular, (9,9--9,23)), (9,9--9,23)); + [Const (String ("Chars are %A", Regular, (9,9--9,23)), (9,9--9,23)); Tuple - ([Const (Char '=', (9,25--9,28)); - Const (Char '|', (9,30--9,33)); - Const (Char '<', (9,35--9,38)); - Const (Char '>', (9,40--9,43))], (9,25--9,43))], - (9,1--9,44)), None, (9,0--9,46)), (9,0--9,46)); + ([Const (Char '=', (9,25--9,28)); Const (Char '|', (9,30--9,33)); Const (Char '<', (9,35--9,38)); + Const (Char '>', (9,40--9,43))], (9,25--9,43))], (9,1--9,44)), None, (9,0--9,46)), (9,0--9,46)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (9,0--9,46)), (9,0--9,46)); - Symbol (SynSymbol visp_result_todo)], (9,0--9,46)), (9,0--9,46))], - (9,0--9,46))] \ No newline at end of file + [Const (String ("%A", Regular, (9,0--9,46)), (9,0--9,46)); Symbol (SynSymbol visp_result_todo)], + (9,0--9,46)), (9,0--9,46))], (9,0--9,46))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_collections_list-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_collections_list-0.structured output.verified.txt index 62f852d..4b5e0e2 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_collections_list-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_collections_list-0.structured output.verified.txt @@ -5,33 +5,25 @@ (Named (SynSymbol lst, (8,5--8,8)), Collection (SynCollection - (FsList, - [Const (Int32 1, (8,12--8,13)); Const (Int32 2, (8,14--8,15)); - Const (Int32 3, (8,16--8,17))], (8,9--8,20))), None, - (8,1--8,20)), (8,0--8,21)); + (FsList, [Const (Int32 1, (8,12--8,13)); Const (Int32 2, (8,14--8,15)); Const (Int32 3, (8,16--8,17))], + (8,9--8,20))), None, (8,1--8,20)), (8,0--8,21)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("List.head: %A", Regular, (10,9--10,24)), (10,9--10,24)); - FunctionCall - (Symbol (SynSymbol List.head), [Symbol (SynSymbol lst)], - (10,26--10,39))], (10,1--10,40)), (10,0--10,41)); + [Const (String ("List.head: %A", Regular, (10,9--10,24)), (10,9--10,24)); + FunctionCall (Symbol (SynSymbol List.head), [Symbol (SynSymbol lst)], (10,26--10,39))], (10,1--10,40)), + (10,0--10,41)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("List.tail: %A", Regular, (11,9--11,24)), (11,9--11,24)); - FunctionCall - (Symbol (SynSymbol List.tail), [Symbol (SynSymbol lst)], - (11,26--11,39))], (11,1--11,40)), (11,0--11,41)); + [Const (String ("List.tail: %A", Regular, (11,9--11,24)), (11,9--11,24)); + FunctionCall (Symbol (SynSymbol List.tail), [Symbol (SynSymbol lst)], (11,26--11,39))], (11,1--11,40)), + (11,0--11,41)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (13,0--13,3)), - Symbol (SynSymbol lst), None, (13,0--13,3)), (13,0--13,3)); + (LetOrUse (Named (SynSymbol visp_result_todo, (13,0--13,3)), Symbol (SynSymbol lst), None, (13,0--13,3)), + (13,0--13,3)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (13,0--13,3)), (13,0--13,3)); - Symbol (SynSymbol visp_result_todo)], (13,0--13,3)), (13,0--13,3))], - (8,0--13,3))] \ No newline at end of file + [Const (String ("%A", Regular, (13,0--13,3)), (13,0--13,3)); Symbol (SynSymbol visp_result_todo)], + (13,0--13,3)), (13,0--13,3))], (8,0--13,3))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_dot_dot-shorthands.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_dot_dot-shorthands.structured output.verified.txt index 402bceb..32a2246 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_dot_dot-shorthands.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_dot_dot-shorthands.structured output.verified.txt @@ -6,38 +6,30 @@ Collection (SynCollection (Bracket, - [Const (Int32 1, (8,10--8,11)); Const (Int32 2, (8,12--8,13)); - Const (Int32 3, (8,14--8,15)); Const (Int32 4, (8,16--8,17)); - Const (Int32 5, (8,18--8,19)); Const (Int32 6, (8,20--8,21))], + [Const (Int32 1, (8,10--8,11)); Const (Int32 2, (8,12--8,13)); Const (Int32 3, (8,14--8,15)); + Const (Int32 4, (8,16--8,17)); Const (Int32 5, (8,18--8,19)); Const (Int32 6, (8,20--8,21))], (8,9--8,22))), Mutable, (8,1--8,22)), (8,0--8,23)); Expr (Set - (DotIndex - (Symbol (SynSymbol vec), [Const (Int32 1, (10,9--10,10))], - (10,7--10,15)), - FunctionCall - (Symbol (SynSymbol Value.int), [Const (Int32 -1, (10,28--10,30))], - (10,18--10,30)), (10,1--10,31)), (10,0--10,32)); + (DotIndex (Symbol (SynSymbol vec), [Const (Int32 1, (10,9--10,10))], (10,7--10,15)), + FunctionCall (Symbol (SynSymbol Value.int), [Const (Int32 -1, (10,28--10,30))], (10,18--10,30)), + (10,1--10,31)), (10,0--10,32)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%O", Regular, (12,9--12,13)), (12,9--12,13)); - DotIndex - (Symbol (SynSymbol vec), [Const (Int32 1, (12,17--12,18))], - (12,15--12,23))], (12,1--12,24)), (12,0--12,25)); + DotIndex (Symbol (SynSymbol vec), [Const (Int32 1, (12,17--12,18))], (12,15--12,23))], (12,1--12,24)), + (12,0--12,25)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%O", Regular, (13,9--13,13)), (13,9--13,13)); - DotProperty - (Symbol (SynSymbol System.Int64), SynSymbol MaxValue, - (13,15--13,38))], (13,1--13,39)), (13,0--13,40)); + DotProperty (Symbol (SynSymbol System.Int64), SynSymbol MaxValue, (13,15--13,38))], (13,1--13,39)), + (13,0--13,40)); Expr (DotMethod (Symbol (SynSymbol vec), SynSymbol Add, - [FunctionCall - (Symbol (SynSymbol Value.int), - [Const (Int32 64, (15,21--15,23))], (15,11--15,23))], Tuple, + [FunctionCall (Symbol (SynSymbol Value.int), [Const (Int32 64, (15,21--15,23))], (15,11--15,23))], Tuple, (15,1--15,24)), (15,0--15,25)); Expr (LetOrUse @@ -50,14 +42,11 @@ [Op (Infix (SynSymbol -, - [DotProperty - (Symbol (SynSymbol vec), SynSymbol Count, - (17,21--17,32)); Const (Int32 1, (17,34--17,35))], - (17,18--17,35)))], (17,15--17,41))], (17,1--17,42)), - None, (17,0--17,43)), (17,0--17,43)); + [DotProperty (Symbol (SynSymbol vec), SynSymbol Count, (17,21--17,32)); + Const (Int32 1, (17,34--17,35))], (17,18--17,35)))], (17,15--17,41))], (17,1--17,42)), None, + (17,0--17,43)), (17,0--17,43)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,0--17,43)), (17,0--17,43)); - Symbol (SynSymbol visp_result_todo)], (17,0--17,43)), - (17,0--17,43))], (8,0--17,43))] \ No newline at end of file + [Const (String ("%A", Regular, (17,0--17,43)), (17,0--17,43)); Symbol (SynSymbol visp_result_todo)], + (17,0--17,43)), (17,0--17,43))], (8,0--17,43))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-0.structured output.verified.txt index 346bfb1..7adc0e4 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-0.structured output.verified.txt @@ -3,27 +3,19 @@ ([Expr (FunctionDef (SynSymbol hello, None, - Args - (List - [Typed - (Named (SynSymbol name, (10,12--10,16)), Ident string, - (10,11--10,26))], (10,10--10,27)), + Args (List [Typed (Named (SynSymbol name, (10,12--10,16)), Ident string, (10,11--10,26))], (10,10--10,27)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("hello %s", Regular, (12,13--12,23)), - (12,13--12,23)); Symbol (SynSymbol name)], (12,5--12,28))], - (10,1--12,29)), (10,0--12,30)); + [Const (String ("hello %s", Regular, (12,13--12,23)), (12,13--12,23)); Symbol (SynSymbol name)], + (12,5--12,28))], (10,1--12,29)), (10,0--12,30)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (14,0--14,15)), FunctionCall - (Symbol (SynSymbol hello), - [Const (String ("world", Regular, (14,7--14,14)), (14,7--14,14))], + (Symbol (SynSymbol hello), [Const (String ("world", Regular, (14,7--14,14)), (14,7--14,14))], (14,1--14,14)), None, (14,0--14,15)), (14,0--14,15)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (14,0--14,15)), (14,0--14,15)); - Symbol (SynSymbol visp_result_todo)], (14,0--14,15)), - (14,0--14,15))], (10,0--14,15))] \ No newline at end of file + [Const (String ("%A", Regular, (14,0--14,15)), (14,0--14,15)); Symbol (SynSymbol visp_result_todo)], + (14,0--14,15)), (14,0--14,15))], (10,0--14,15))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-1.structured output.verified.txt index 3576cbb..c169f1b 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-1.structured output.verified.txt @@ -3,99 +3,67 @@ ([Expr (FunctionDef (SynSymbol hello, None, - Args - (List - [Typed - (Named (SynSymbol name, (10,12--10,16)), Ident string, - (10,11--10,26))], (10,10--10,27)), + Args (List [Typed (Named (SynSymbol name, (10,12--10,16)), Ident string, (10,11--10,26))], (10,10--10,27)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("hello %s", Regular, (12,13--12,23)), - (12,13--12,23)); Symbol (SynSymbol name)], (12,5--12,28))], - (10,1--12,29)), (10,0--12,30)); + [Const (String ("hello %s", Regular, (12,13--12,23)), (12,13--12,23)); Symbol (SynSymbol name)], + (12,5--12,28))], (10,1--12,29)), (10,0--12,30)); Expr (FunctionDef - (SynSymbol hello-no-types, None, - Args - (List [Named (SynSymbol name, (16,20--16,24))], (16,19--16,25)), + (SynSymbol hello-no-types, None, Args (List [Named (SynSymbol name, (16,20--16,24))], (16,19--16,25)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("hello %s", Regular, (17,13--17,23)), - (17,13--17,23)); Symbol (SynSymbol name)], (17,5--17,28))], - (16,1--17,29)), (16,0--17,30)); + [Const (String ("hello %s", Regular, (17,13--17,23)), (17,13--17,23)); Symbol (SynSymbol name)], + (17,5--17,28))], (16,1--17,29)), (16,0--17,30)); Expr (FunctionDef (SynSymbol hello-with-vector, None, - Args - (List - [Typed - (Named (SynSymbol name, (20,24--20,28)), Ident string, - (20,23--20,38))], (20,22--20,39)), + Args (List [Typed (Named (SynSymbol name, (20,24--20,28)), Ident string, (20,23--20,38))], (20,22--20,39)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("hello %s", Regular, (21,13--21,23)), - (21,13--21,23)); Symbol (SynSymbol name)], (21,5--21,28))], - (20,1--21,29)), (20,0--21,30)); + [Const (String ("hello %s", Regular, (21,13--21,23)), (21,13--21,23)); Symbol (SynSymbol name)], + (21,5--21,28))], (20,1--21,29)), (20,0--21,30)); Expr (LetOrUse (Named (SynSymbol anon, (24,5--24,9)), LambdaDef (SynLambda - (Args - (List [Named (SynSymbol name, (24,15--24,19))], - (24,14--24,20)), + (Args (List [Named (SynSymbol name, (24,15--24,19))], (24,14--24,20)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("hello %s", Regular, (24,30--24,40)), - (24,30--24,40)); Symbol (SynSymbol name)], - (24,22--24,45))], (24,11--24,46))), None, (24,1--24,47)), - (24,0--24,48)); + [Const (String ("hello %s", Regular, (24,30--24,40)), (24,30--24,40)); Symbol (SynSymbol name)], + (24,22--24,45))], (24,11--24,46))), None, (24,1--24,47)), (24,0--24,48)); Expr (FunctionCall - (Symbol (SynSymbol hello), - [Const (String ("test", Regular, (26,7--26,13)), (26,7--26,13))], - (26,1--26,13)), (26,0--26,14)); + (Symbol (SynSymbol hello), [Const (String ("test", Regular, (26,7--26,13)), (26,7--26,13))], (26,1--26,13)), + (26,0--26,14)); Expr (FunctionCall - (Symbol (SynSymbol hello-no-types), - [Const - (String ("no types", Regular, (27,16--27,26)), (27,16--27,26))], + (Symbol (SynSymbol hello-no-types), [Const (String ("no types", Regular, (27,16--27,26)), (27,16--27,26))], (27,1--27,26)), (27,0--27,27)); Expr (FunctionCall - (Symbol (SynSymbol hello-with-vector), - [Const (String ("vector", Regular, (28,19--28,27)), (28,19--28,27))], + (Symbol (SynSymbol hello-with-vector), [Const (String ("vector", Regular, (28,19--28,27)), (28,19--28,27))], (28,1--28,27)), (28,0--28,28)); Expr (FunctionCall - (Symbol (SynSymbol anon), - [Const (String ("anon", Regular, (29,6--29,12)), (29,6--29,12))], - (29,1--29,12)), (29,0--29,13)); + (Symbol (SynSymbol anon), [Const (String ("anon", Regular, (29,6--29,12)), (29,6--29,12))], (29,1--29,12)), + (29,0--29,13)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (31,0--32,40)), FunctionCall (LambdaDef (SynLambda - (Args - (List [Named (SynSymbol name, (31,6--31,10))], - (31,5--31,11)), + (Args (List [Named (SynSymbol name, (31,6--31,10))], (31,5--31,11)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("hello %s", Regular, (32,13--32,23)), - (32,13--32,23)); Symbol (SynSymbol name)], + [Const (String ("hello %s", Regular, (32,13--32,23)), (32,13--32,23)); Symbol (SynSymbol name)], (32,5--32,28))], (31,2--32,29))), - [Const - (String ("lambda", Regular, (32,31--32,39)), (32,31--32,39))], - (31,1--32,39)), None, (31,0--32,40)), (31,0--32,40)); + [Const (String ("lambda", Regular, (32,31--32,39)), (32,31--32,39))], (31,1--32,39)), None, + (31,0--32,40)), (31,0--32,40)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (31,0--32,40)), (31,0--32,40)); - Symbol (SynSymbol visp_result_todo)], (31,0--32,40)), - (31,0--32,40))], (10,0--32,40))] \ No newline at end of file + [Const (String ("%A", Regular, (31,0--32,40)), (31,0--32,40)); Symbol (SynSymbol visp_result_todo)], + (31,0--32,40)), (31,0--32,40))], (10,0--32,40))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-10.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-10.structured output.verified.txt index 5912fdd..1c2be15 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-10.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-10.structured output.verified.txt @@ -1,39 +1,29 @@ ParsedFile [AnonModule - ([HashDirective - (ParsedHashDirective - ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), - (9,0--9,12)); Open (SynSymbol System.Text, (11,1--11,17)); + ([HashDirective (ParsedHashDirective ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), (9,0--9,12)); + Open (SynSymbol System.Text, (11,1--11,17)); Expr (LetOrUse - (Named (SynSymbol sb, (13,5--13,7)), - New (Ident StringBuilder, [], (13,9--13,26)), None, (13,1--13,27)), + (Named (SynSymbol sb, (13,5--13,7)), New (Ident StringBuilder, [], (13,9--13,26)), None, (13,1--13,27)), (13,0--13,28)); Expr (DotMethod (Symbol (SynSymbol sb), SynSymbol Append, - [Const (String ("hello", Regular, (15,13--15,20)), (15,13--15,20))], - Tuple, (15,1--15,20)), (15,0--15,21)); + [Const (String ("hello", Regular, (15,13--15,20)), (15,13--15,20))], Tuple, (15,1--15,20)), (15,0--15,21)); Expr (DotMethod (Symbol (SynSymbol sb), SynSymbol Append, - [Const (String ("world", Regular, (16,13--16,20)), (16,13--16,20))], - Tuple, (16,1--16,20)), (16,0--16,21)); + [Const (String ("world", Regular, (16,13--16,20)), (16,13--16,20))], Tuple, (16,1--16,20)), (16,0--16,21)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (18,0--19,20)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("sb contains: %s", Regular, (18,9--18,26)), - (18,9--18,26)); - DotMethod - (Symbol (SynSymbol sb), SynSymbol ToString, [], Tuple, - (19,5--19,18))], (18,1--19,19)), None, (18,0--19,20)), - (18,0--19,20)); + [Const (String ("sb contains: %s", Regular, (18,9--18,26)), (18,9--18,26)); + DotMethod (Symbol (SynSymbol sb), SynSymbol ToString, [], Tuple, (19,5--19,18))], (18,1--19,19)), None, + (18,0--19,20)), (18,0--19,20)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (18,0--19,20)), (18,0--19,20)); - Symbol (SynSymbol visp_result_todo)], (18,0--19,20)), - (18,0--19,20))], (9,0--19,20))] \ No newline at end of file + [Const (String ("%A", Regular, (18,0--19,20)), (18,0--19,20)); Symbol (SynSymbol visp_result_todo)], + (18,0--19,20)), (18,0--19,20))], (9,0--19,20))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-11.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-11.structured output.verified.txt index dac2dec..a1dd004 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-11.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-11.structured output.verified.txt @@ -3,44 +3,32 @@ ([Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String - ("this is in the default top-level module", Regular, - (8,9--8,50)), (8,9--8,50))], (8,1--8,50)), (8,0--8,51)); + [Const (String ("this is in the default top-level module", Regular, (8,9--8,50)), (8,9--8,50))], + (8,1--8,50)), (8,0--8,51)); NestedModule (SynSymbol MyCustomModule, [Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String - ("this is inside MyCustomModule", Regular, (11,13--11,44)), - (11,13--11,44))], (11,5--11,44)), (11,4--11,45)); + [Const (String ("this is inside MyCustomModule", Regular, (11,13--11,44)), (11,13--11,44))], + (11,5--11,44)), (11,4--11,45)); Expr (FunctionDef (SynSymbol hello, None, Args (List [], (12,14--12,16)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("hello world", Regular, (13,17--13,30)), - (13,17--13,30))], (13,9--13,30))], (12,5--13,31)), - (12,4--13,32)); - Expr - (FunctionCall (Symbol (SynSymbol hello), [], (15,5--15,10)), - (15,4--15,11))], (10,1--15,11)); + [Const (String ("hello world", Regular, (13,17--13,30)), (13,17--13,30))], (13,9--13,30))], + (12,5--13,31)), (12,4--13,32)); + Expr (FunctionCall (Symbol (SynSymbol hello), [], (15,5--15,10)), (15,4--15,11))], (10,1--15,11)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (18,0--18,48)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String - ("this is back in the top-level-module", Regular, - (18,9--18,47)), (18,9--18,47))], (18,1--18,47)), None, - (18,0--18,48)), (18,0--18,48)); + [Const (String ("this is back in the top-level-module", Regular, (18,9--18,47)), (18,9--18,47))], + (18,1--18,47)), None, (18,0--18,48)), (18,0--18,48)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (18,0--18,48)), (18,0--18,48)); - Symbol (SynSymbol visp_result_todo)], (18,0--18,48)), - (18,0--18,48))], (8,0--18,48))] \ No newline at end of file + [Const (String ("%A", Regular, (18,0--18,48)), (18,0--18,48)); Symbol (SynSymbol visp_result_todo)], + (18,0--18,48)), (18,0--18,48))], (8,0--18,48))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-12.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-12.structured output.verified.txt index 285fdd3..c46c8c8 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-12.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-12.structured output.verified.txt @@ -8,16 +8,13 @@ Collection (SynCollection (Paren, - [Symbol (SynSymbol hello); Symbol (SynSymbol world); - Symbol (SynSymbol in); Symbol (SynSymbol quotes)], - (9,19--9,42))), (9,13--9,42)), None, (9,1--9,43)), - (9,0--9,44)); + [Symbol (SynSymbol hello); Symbol (SynSymbol world); Symbol (SynSymbol in); + Symbol (SynSymbol quotes)], (9,19--9,42))), (9,13--9,42)), None, (9,1--9,43)), (9,0--9,44)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("quoted is: %O", Regular, (11,9--11,24)), (11,9--11,24)); - Symbol (SynSymbol quoted)], (11,1--11,31)), (11,0--11,32)); + [Const (String ("quoted is: %O", Regular, (11,9--11,24)), (11,9--11,24)); Symbol (SynSymbol quoted)], + (11,1--11,31)), (11,0--11,32)); Expr (LetOrUse (Named (SynSymbol next_quoted, (13,5--13,16)), @@ -26,31 +23,21 @@ Collection (SynCollection (Paren, - [Const - (String ("constants", Regular, (14,5--14,16)), - (14,5--14,16)); Keyword (SynKeyword :keywords-work); - Const (Bool true, (14,32--14,36)); - Const (Int32 1, (14,37--14,38)); - Const (Double 1.5, (14,39--14,42)); - Const (Bool false, (14,43--14,48)); - Symbol (SynSymbol also); - Const - (String ("work", Regular, (14,54--14,60)), - (14,54--14,60)); Const (Nil, (14,61--14,64))], - (14,4--14,65))), (13,18--14,65)), None, (13,1--14,66)), - (13,0--14,67)); + [Const (String ("constants", Regular, (14,5--14,16)), (14,5--14,16)); + Keyword (SynKeyword :keywords-work); Const (Bool true, (14,32--14,36)); + Const (Int32 1, (14,37--14,38)); Const (Double 1.5, (14,39--14,42)); + Const (Bool false, (14,43--14,48)); Symbol (SynSymbol also); + Const (String ("work", Regular, (14,54--14,60)), (14,54--14,60)); Const (Nil, (14,61--14,64))], + (14,4--14,65))), (13,18--14,65)), None, (13,1--14,66)), (13,0--14,67)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (16,0--16,42)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("next_quoted is: %O", Regular, (16,9--16,29)), - (16,9--16,29)); Symbol (SynSymbol next_quoted)], - (16,1--16,41)), None, (16,0--16,42)), (16,0--16,42)); + [Const (String ("next_quoted is: %O", Regular, (16,9--16,29)), (16,9--16,29)); + Symbol (SynSymbol next_quoted)], (16,1--16,41)), None, (16,0--16,42)), (16,0--16,42)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (16,0--16,42)), (16,0--16,42)); - Symbol (SynSymbol visp_result_todo)], (16,0--16,42)), - (16,0--16,42))], (9,0--16,42))] \ No newline at end of file + [Const (String ("%A", Regular, (16,0--16,42)), (16,0--16,42)); Symbol (SynSymbol visp_result_todo)], + (16,0--16,42)), (16,0--16,42))], (9,0--16,42))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-13.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-13.structured output.verified.txt index 765a14a..e73db10 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-13.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-13.structured output.verified.txt @@ -8,17 +8,13 @@ Collection (SynCollection (Paren, - [Symbol (SynSymbol hello); Symbol (SynSymbol world); - Symbol (SynSymbol in); Symbol (SynSymbol quotes)], - (9,29--9,52))), (9,18--9,52)), None, (9,1--9,53)), - (9,0--9,54)); + [Symbol (SynSymbol hello); Symbol (SynSymbol world); Symbol (SynSymbol in); + Symbol (SynSymbol quotes)], (9,29--9,52))), (9,18--9,52)), None, (9,1--9,53)), (9,0--9,54)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("quasiquoted is: %O", Regular, (11,9--11,29)), - (11,9--11,29)); Symbol (SynSymbol quasiquoted)], (11,1--11,41)), - (11,0--11,42)); + [Const (String ("quasiquoted is: %O", Regular, (11,9--11,29)), (11,9--11,29)); + Symbol (SynSymbol quasiquoted)], (11,1--11,41)), (11,0--11,42)); Expr (LetOrUse (Named (SynSymbol next_quasiquoted, (13,5--13,21)), @@ -27,31 +23,21 @@ Collection (SynCollection (Paren, - [Const - (String ("constants", Regular, (14,5--14,16)), - (14,5--14,16)); Keyword (SynKeyword :keywords-work); - Const (Bool true, (14,32--14,36)); - Const (Int32 1, (14,37--14,38)); - Const (Double 1.5, (14,39--14,42)); - Const (Bool false, (14,43--14,48)); - Symbol (SynSymbol also); - Const - (String ("work", Regular, (14,54--14,60)), - (14,54--14,60)); Const (Nil, (14,61--14,64))], - (14,4--14,65))), (13,23--14,65)), None, (13,1--14,66)), - (13,0--14,67)); + [Const (String ("constants", Regular, (14,5--14,16)), (14,5--14,16)); + Keyword (SynKeyword :keywords-work); Const (Bool true, (14,32--14,36)); + Const (Int32 1, (14,37--14,38)); Const (Double 1.5, (14,39--14,42)); + Const (Bool false, (14,43--14,48)); Symbol (SynSymbol also); + Const (String ("work", Regular, (14,54--14,60)), (14,54--14,60)); Const (Nil, (14,61--14,64))], + (14,4--14,65))), (13,23--14,65)), None, (13,1--14,66)), (13,0--14,67)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (16,0--16,52)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("next_quasiquoted is: %O", Regular, (16,9--16,34)), - (16,9--16,34)); Symbol (SynSymbol next_quasiquoted)], - (16,1--16,51)), None, (16,0--16,52)), (16,0--16,52)); + [Const (String ("next_quasiquoted is: %O", Regular, (16,9--16,34)), (16,9--16,34)); + Symbol (SynSymbol next_quasiquoted)], (16,1--16,51)), None, (16,0--16,52)), (16,0--16,52)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (16,0--16,52)), (16,0--16,52)); - Symbol (SynSymbol visp_result_todo)], (16,0--16,52)), - (16,0--16,52))], (9,0--16,52))] \ No newline at end of file + [Const (String ("%A", Regular, (16,0--16,52)), (16,0--16,52)); Symbol (SynSymbol visp_result_todo)], + (16,0--16,52)), (16,0--16,52))], (9,0--16,52))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-14.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-14.structured output.verified.txt index e1fc2f5..326b341 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-14.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-14.structured output.verified.txt @@ -2,21 +2,18 @@ [AnonModule ([Expr (LetOrUse - (Named (SynSymbol value, (8,5--8,10)), - Const (String ("hello", Regular, (8,11--8,18)), (8,11--8,18)), None, + (Named (SynSymbol value, (8,5--8,10)), Const (String ("hello", Regular, (8,11--8,18)), (8,11--8,18)), None, (8,1--8,18)), (8,0--8,19)); Expr (LetOrUse (Named (SynSymbol result, (10,5--10,11)), - Quasiquote - (false, Unquote (Symbol (SynSymbol value), (10,24--10,39)), - (10,13--10,39)), None, (10,1--10,40)), (10,0--10,41)); + Quasiquote (false, Unquote (Symbol (SynSymbol value), (10,24--10,39)), (10,13--10,39)), None, (10,1--10,40)), + (10,0--10,41)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("value is %O", Regular, (12,9--12,22)), (12,9--12,22)); - Symbol (SynSymbol result)], (12,1--12,29)), (12,0--12,30)); + [Const (String ("value is %O", Regular, (12,9--12,22)), (12,9--12,22)); Symbol (SynSymbol result)], + (12,1--12,29)), (12,0--12,30)); Expr (LetOrUse (Named (SynSymbol items, (15,5--15,10)), @@ -25,11 +22,8 @@ Collection (SynCollection (Paren, - [Const (Int32 1, (15,19--15,20)); - Const (Int32 2, (15,21--15,22)); - Const (Int32 3, (15,23--15,24)); - Const (Int32 4, (15,25--15,26)); - Const (Int32 5, (15,27--15,28))], (15,18--15,29))), + [Const (Int32 1, (15,19--15,20)); Const (Int32 2, (15,21--15,22)); Const (Int32 3, (15,23--15,24)); + Const (Int32 4, (15,25--15,26)); Const (Int32 5, (15,27--15,28))], (15,18--15,29))), (15,12--15,29)), None, (15,1--15,30)), (15,0--15,31)); Expr (LetOrUse @@ -39,21 +33,17 @@ Collection (SynCollection (Paren, - [Const (Int32 1, (18,26--18,27)); - Const (Int32 2, (18,28--18,29)); + [Const (Int32 1, (18,26--18,27)); Const (Int32 2, (18,28--18,29)); Unquote (FunctionCall - (Symbol (SynSymbol +), - [Const (Int32 3, (18,42--18,43)); - Const (Int32 4, (18,44--18,45))], (18,40--18,45)), - (18,30--18,47))], (18,25--18,48))), (18,14--18,48)), - None, (18,1--18,49)), (18,0--18,50)); + (Symbol (SynSymbol +), [Const (Int32 3, (18,42--18,43)); Const (Int32 4, (18,44--18,45))], + (18,40--18,45)), (18,30--18,47))], (18,25--18,48))), (18,14--18,48)), None, (18,1--18,49)), + (18,0--18,50)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("result2 is %O", Regular, (20,9--20,24)), (20,9--20,24)); - Symbol (SynSymbol result2)], (20,1--20,32)), (20,0--20,33)); + [Const (String ("result2 is %O", Regular, (20,9--20,24)), (20,9--20,24)); Symbol (SynSymbol result2)], + (20,1--20,32)), (20,0--20,33)); Expr (LetOrUse (Named (SynSymbol result3, (22,5--22,12)), @@ -62,22 +52,18 @@ Collection (SynCollection (Paren, - [Const (Int32 0, (22,26--22,27)); - SpliceUnquote (Symbol (SynSymbol items), (22,28--22,50)); - Const (Int32 6, (22,51--22,52))], (22,25--22,53))), - (22,14--22,53)), None, (22,1--22,54)), (22,0--22,55)); + [Const (Int32 0, (22,26--22,27)); SpliceUnquote (Symbol (SynSymbol items), (22,28--22,50)); + Const (Int32 6, (22,51--22,52))], (22,25--22,53))), (22,14--22,53)), None, (22,1--22,54)), + (22,0--22,55)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (24,0--24,33)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("result3 is %O", Regular, (24,9--24,24)), - (24,9--24,24)); Symbol (SynSymbol result3)], (24,1--24,32)), - None, (24,0--24,33)), (24,0--24,33)); + [Const (String ("result3 is %O", Regular, (24,9--24,24)), (24,9--24,24)); Symbol (SynSymbol result3)], + (24,1--24,32)), None, (24,0--24,33)), (24,0--24,33)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (24,0--24,33)), (24,0--24,33)); - Symbol (SynSymbol visp_result_todo)], (24,0--24,33)), - (24,0--24,33))], (8,0--24,33))] \ No newline at end of file + [Const (String ("%A", Regular, (24,0--24,33)), (24,0--24,33)); Symbol (SynSymbol visp_result_todo)], + (24,0--24,33)), (24,0--24,33))], (8,0--24,33))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-15.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-15.structured output.verified.txt index db9605d..002fade 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-15.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-15.structured output.verified.txt @@ -6,17 +6,13 @@ FunctionCall (LambdaDef (SynLambda - (Args - (List [Named (SynSymbol captured_arg, (8,7--8,19))], - (8,6--8,20)), + (Args (List [Named (SynSymbol captured_arg, (8,7--8,19))], (8,6--8,20)), [LetStar ([SynBinding (Named (SynSymbol second_capture, (9,9--9,23)), Op (Infix - (SynSymbol +, - [Symbol (SynSymbol captured_arg); - Const (Int32 1, (9,40--9,41))], + (SynSymbol +, [Symbol (SynSymbol captured_arg); Const (Int32 1, (9,40--9,41))], (9,25--9,41))), (9,9--9,42))], [FunctionCall (LambdaDef @@ -25,15 +21,11 @@ [Op (Infix (SynSymbol +, - [Symbol (SynSymbol captured_arg); - Symbol (SynSymbol second_capture)], - (10,14--10,43)))], (10,6--10,44))), - [], (10,5--10,45))], (9,3--10,46))], (8,2--10,47))), - [Const (Int32 99, (11,2--11,4))], (8,1--11,4)), None, - (8,0--11,5)), (8,0--11,5)); + [Symbol (SynSymbol captured_arg); Symbol (SynSymbol second_capture)], + (10,14--10,43)))], (10,6--10,44))), [], (10,5--10,45))], (9,3--10,46))], + (8,2--10,47))), [Const (Int32 99, (11,2--11,4))], (8,1--11,4)), None, (8,0--11,5)), (8,0--11,5)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (8,0--11,5)), (8,0--11,5)); - Symbol (SynSymbol visp_result_todo)], (8,0--11,5)), (8,0--11,5))], - (8,0--11,5))] \ No newline at end of file + [Const (String ("%A", Regular, (8,0--11,5)), (8,0--11,5)); Symbol (SynSymbol visp_result_todo)], + (8,0--11,5)), (8,0--11,5))], (8,0--11,5))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-16.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-16.structured output.verified.txt index 4ecbb49..84ca420 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-16.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-16.structured output.verified.txt @@ -5,8 +5,7 @@ (Named (SynSymbol visp_result_todo, (8,0--21,22)), LetStar ([SynBinding - (Named (SynSymbol captured_variable, (9,4--9,21)), - Const (Int32 1, (9,22--9,23)), (9,4--9,23)); + (Named (SynSymbol captured_variable, (9,4--9,21)), Const (Int32 1, (9,22--9,23)), (9,4--9,23)); SynBinding (Named (SynSymbol first_fun, (10,4--10,13)), LambdaDef @@ -20,42 +19,25 @@ (Args (List [], (13,23--13,25)), [LetStar ([SynBinding - (Named - (SynSymbol third_fun, - (14,27--14,36)), + (Named (SynSymbol third_fun, (14,27--14,36)), LambdaDef (SynLambda - (Args - (List [], (15,29--15,31)), + (Args (List [], (15,29--15,31)), [Op (Infix (SynSymbol +, - [Symbol - (SynSymbol - captured_variable); - Const - (Int32 1, - (15,53--15,54))], - (15,33--15,54)))], - (15,25--15,55))), - (14,27--15,56))], - [FunctionCall - (Symbol (SynSymbol third_fun), [], - (16,23--16,32))], (14,21--16,33))], - (13,19--16,34))), (12,17--17,23))], - [FunctionCall - (Symbol (SynSymbol second_fun), [], - (18,13--18,23))], (12,11--18,24))], + [Symbol (SynSymbol captured_variable); + Const (Int32 1, (15,53--15,54))], (15,33--15,54)))], + (15,25--15,55))), (14,27--15,56))], + [FunctionCall (Symbol (SynSymbol third_fun), [], (16,23--16,32))], + (14,21--16,33))], (13,19--16,34))), (12,17--17,23))], + [FunctionCall (Symbol (SynSymbol second_fun), [], (18,13--18,23))], (12,11--18,24))], (11,7--18,25))), (10,4--19,7))], [FunctionCall - (Symbol (SynSymbol str), - [FunctionCall - (Symbol (SynSymbol first_fun), [], (21,10--21,19))], - (21,5--21,20))], (8,1--21,21)), None, (8,0--21,22)), - (8,0--21,22)); + (Symbol (SynSymbol str), [FunctionCall (Symbol (SynSymbol first_fun), [], (21,10--21,19))], + (21,5--21,20))], (8,1--21,21)), None, (8,0--21,22)), (8,0--21,22)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (8,0--21,22)), (8,0--21,22)); - Symbol (SynSymbol visp_result_todo)], (8,0--21,22)), (8,0--21,22))], - (8,0--21,22))] \ No newline at end of file + [Const (String ("%A", Regular, (8,0--21,22)), (8,0--21,22)); Symbol (SynSymbol visp_result_todo)], + (8,0--21,22)), (8,0--21,22))], (8,0--21,22))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-17.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-17.structured output.verified.txt index a65f50c..c5fb5c1 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-17.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-17.structured output.verified.txt @@ -5,31 +5,21 @@ (Named (SynSymbol visp_result_todo, (8,0--12,45)), LetStar ([SynBinding - (Named (SynSymbol hello, (8,7--8,12)), - Const - (String ("hello", Regular, (8,13--8,20)), (8,13--8,20)), + (Named (SynSymbol hello, (8,7--8,12)), Const (String ("hello", Regular, (8,13--8,20)), (8,13--8,20)), (8,7--8,20)); SynBinding - (Named (SynSymbol world, (9,7--9,12)), - Const - (String ("world", Regular, (9,13--9,20)), (9,13--9,20)), + (Named (SynSymbol world, (9,7--9,12)), Const (String ("world", Regular, (9,13--9,20)), (9,13--9,20)), (9,7--9,20)); SynBinding (Named (SynSymbol banaani, (10,7--10,14)), - Const - (String ("banaani", Regular, (10,15--10,24)), - (10,15--10,24)), (10,7--10,24))], + Const (String ("banaani", Regular, (10,15--10,24)), (10,15--10,24)), (10,7--10,24))], [FunctionCall (Symbol (SynSymbol sprintf), - [Const - (String ("%s %s %s", Regular, (12,13--12,23)), - (12,13--12,23)); Symbol (SynSymbol hello); - Symbol (SynSymbol world); Symbol (SynSymbol banaani)], - (12,5--12,43))], (8,1--12,44)), None, (8,0--12,45)), - (8,0--12,45)); + [Const (String ("%s %s %s", Regular, (12,13--12,23)), (12,13--12,23)); Symbol (SynSymbol hello); + Symbol (SynSymbol world); Symbol (SynSymbol banaani)], (12,5--12,43))], (8,1--12,44)), None, + (8,0--12,45)), (8,0--12,45)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (8,0--12,45)), (8,0--12,45)); - Symbol (SynSymbol visp_result_todo)], (8,0--12,45)), (8,0--12,45))], - (8,0--12,45))] \ No newline at end of file + [Const (String ("%A", Regular, (8,0--12,45)), (8,0--12,45)); Symbol (SynSymbol visp_result_todo)], + (8,0--12,45)), (8,0--12,45))], (8,0--12,45))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-2.structured output.verified.txt index cf09b7f..480dc2a 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-2.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-2.structured output.verified.txt @@ -2,28 +2,20 @@ [AnonModule ([Expr (FunctionDef - (SynSymbol hello, None, - Args - (List [Named (SynSymbol argname, (10,11--10,18))], (10,10--10,19)), - [LetOrUse - (Named (SynSymbol name, (12,9--12,13)), - Symbol (SynSymbol argname), None, (12,5--12,21)); + (SynSymbol hello, None, Args (List [Named (SynSymbol argname, (10,11--10,18))], (10,10--10,19)), + [LetOrUse (Named (SynSymbol name, (12,9--12,13)), Symbol (SynSymbol argname), None, (12,5--12,21)); FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("hello %s", Regular, (13,13--13,23)), - (13,13--13,23)); Symbol (SynSymbol name)], (13,5--13,28))], - (10,1--13,29)), (10,0--13,30)); + [Const (String ("hello %s", Regular, (13,13--13,23)), (13,13--13,23)); Symbol (SynSymbol name)], + (13,5--13,28))], (10,1--13,29)), (10,0--13,30)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (15,0--15,15)), FunctionCall - (Symbol (SynSymbol hello), - [Const (String ("world", Regular, (15,7--15,14)), (15,7--15,14))], + (Symbol (SynSymbol hello), [Const (String ("world", Regular, (15,7--15,14)), (15,7--15,14))], (15,1--15,14)), None, (15,0--15,15)), (15,0--15,15)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (15,0--15,15)), (15,0--15,15)); - Symbol (SynSymbol visp_result_todo)], (15,0--15,15)), - (15,0--15,15))], (10,0--15,15))] \ No newline at end of file + [Const (String ("%A", Regular, (15,0--15,15)), (15,0--15,15)); Symbol (SynSymbol visp_result_todo)], + (15,0--15,15)), (15,0--15,15))], (10,0--15,15))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-3.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-3.structured output.verified.txt index 8b2fe0c..f03b37d 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-3.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-3.structured output.verified.txt @@ -2,31 +2,26 @@ [AnonModule ([Expr (LetOrUse - (Named (SynSymbol value, (8,5--8,10)), - Const (String ("initial", Regular, (8,11--8,20)), (8,11--8,20)), + (Named (SynSymbol value, (8,5--8,10)), Const (String ("initial", Regular, (8,11--8,20)), (8,11--8,20)), Mutable, (8,1--8,20)), (8,0--8,21)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("value is %s", Regular, (9,9--9,22)), (9,9--9,22)); - Symbol (SynSymbol value)], (9,1--9,28)), (9,0--9,29)); + [Const (String ("value is %s", Regular, (9,9--9,22)), (9,9--9,22)); Symbol (SynSymbol value)], (9,1--9,28)), + (9,0--9,29)); Expr (Set - (Symbol (SynSymbol value), - Const (String ("updated", Regular, (10,12--10,21)), (10,12--10,21)), + (Symbol (SynSymbol value), Const (String ("updated", Regular, (10,12--10,21)), (10,12--10,21)), (10,1--10,21)), (10,0--10,22)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (11,0--11,29)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("value is %s", Regular, (11,9--11,22)), - (11,9--11,22)); Symbol (SynSymbol value)], (11,1--11,28)), - None, (11,0--11,29)), (11,0--11,29)); + [Const (String ("value is %s", Regular, (11,9--11,22)), (11,9--11,22)); Symbol (SynSymbol value)], + (11,1--11,28)), None, (11,0--11,29)), (11,0--11,29)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (11,0--11,29)), (11,0--11,29)); - Symbol (SynSymbol visp_result_todo)], (11,0--11,29)), - (11,0--11,29))], (8,0--11,29))] \ No newline at end of file + [Const (String ("%A", Regular, (11,0--11,29)), (11,0--11,29)); Symbol (SynSymbol visp_result_todo)], + (11,0--11,29)), (11,0--11,29))], (8,0--11,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-4.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-4.structured output.verified.txt index 930290d..2c01f69 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-4.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-4.structured output.verified.txt @@ -2,55 +2,43 @@ [AnonModule ([Expr (LetOrUse - (Named (SynSymbol value, (9,5--9,10)), - Const (String ("initial", Regular, (9,11--9,20)), (9,11--9,20)), + (Named (SynSymbol value, (9,5--9,10)), Const (String ("initial", Regular, (9,11--9,20)), (9,11--9,20)), Mutable, (9,1--9,20)), (9,0--9,21)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("value is %s", Regular, (10,9--10,22)), (10,9--10,22)); - Symbol (SynSymbol value)], (10,1--10,28)), (10,0--10,29)); + [Const (String ("value is %s", Regular, (10,9--10,22)), (10,9--10,22)); Symbol (SynSymbol value)], + (10,1--10,28)), (10,0--10,29)); Expr (LetOrUse (Named (SynSymbol foo, (12,5--12,8)), LambdaDef (SynLambda - (Args - (List [Named (SynSymbol arg, (12,14--12,17))], - (12,13--12,18)), - [Set - (Symbol (SynSymbol value), Symbol (SynSymbol arg), - (12,20--12,34))], (12,10--12,35))), None, (12,1--12,36)), - (12,0--12,37)); + (Args (List [Named (SynSymbol arg, (12,14--12,17))], (12,13--12,18)), + [Set (Symbol (SynSymbol value), Symbol (SynSymbol arg), (12,20--12,34))], (12,10--12,35))), None, + (12,1--12,36)), (12,0--12,37)); Expr (FunctionCall - (Symbol (SynSymbol foo), - [Const (String ("hello", Regular, (14,5--14,12)), (14,5--14,12))], - (14,1--14,12)), (14,0--14,13)); + (Symbol (SynSymbol foo), [Const (String ("hello", Regular, (14,5--14,12)), (14,5--14,12))], (14,1--14,12)), + (14,0--14,13)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("value is %s", Regular, (15,9--15,22)), (15,9--15,22)); - Symbol (SynSymbol value)], (15,1--15,28)), (15,0--15,29)); + [Const (String ("value is %s", Regular, (15,9--15,22)), (15,9--15,22)); Symbol (SynSymbol value)], + (15,1--15,28)), (15,0--15,29)); Expr (FunctionCall - (Symbol (SynSymbol foo), - [Const (String ("world", Regular, (17,5--17,12)), (17,5--17,12))], - (17,1--17,12)), (17,0--17,13)); + (Symbol (SynSymbol foo), [Const (String ("world", Regular, (17,5--17,12)), (17,5--17,12))], (17,1--17,12)), + (17,0--17,13)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (18,0--18,29)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("value is %s", Regular, (18,9--18,22)), - (18,9--18,22)); Symbol (SynSymbol value)], (18,1--18,28)), - None, (18,0--18,29)), (18,0--18,29)); + [Const (String ("value is %s", Regular, (18,9--18,22)), (18,9--18,22)); Symbol (SynSymbol value)], + (18,1--18,28)), None, (18,0--18,29)), (18,0--18,29)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (18,0--18,29)), (18,0--18,29)); - Symbol (SynSymbol visp_result_todo)], (18,0--18,29)), - (18,0--18,29))], (9,0--18,29))] \ No newline at end of file + [Const (String ("%A", Regular, (18,0--18,29)), (18,0--18,29)); Symbol (SynSymbol visp_result_todo)], + (18,0--18,29)), (18,0--18,29))], (9,0--18,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-5.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-5.structured output.verified.txt index 2eb681e..13bbbb7 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-5.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-5.structured output.verified.txt @@ -1,70 +1,52 @@ ParsedFile [AnonModule - ([Expr - (LetOrUse - (Named (SynSymbol a, (8,5--8,6)), Const (Int32 5, (8,7--8,8)), None, - (8,1--8,8)), (8,0--8,9)); - Expr - (LetOrUse - (Named (SynSymbol b, (9,5--9,6)), Const (Int32 4, (9,7--9,8)), None, - (9,1--9,8)), (9,0--9,9)); + ([Expr (LetOrUse (Named (SynSymbol a, (8,5--8,6)), Const (Int32 5, (8,7--8,8)), None, (8,1--8,8)), (8,0--8,9)); + Expr (LetOrUse (Named (SynSymbol b, (9,5--9,6)), Const (Int32 4, (9,7--9,8)), None, (9,1--9,8)), (9,0--9,9)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("+ is %i", Regular, (11,9--11,18)), (11,9--11,18)); Op (Infix - (SynSymbol +, - [Symbol (SynSymbol a); Symbol (SynSymbol b); - Const (Int32 52, (11,26--11,28))], (11,20--11,28)))], - (11,1--11,29)), (11,0--11,30)); + (SynSymbol +, [Symbol (SynSymbol a); Symbol (SynSymbol b); Const (Int32 52, (11,26--11,28))], + (11,20--11,28)))], (11,1--11,29)), (11,0--11,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("+ is %i", Regular, (12,9--12,18)), (12,9--12,18)); - Op (Infix (SynSymbol +, [], (12,20--12,21)))], (12,1--12,22)), - (12,0--12,23)); + Op (Infix (SynSymbol +, [], (12,20--12,21)))], (12,1--12,22)), (12,0--12,23)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("+ is %i", Regular, (13,9--13,18)), (13,9--13,18)); - Op - (Infix - (SynSymbol +, [Const (Int32 2, (13,22--13,23))], - (13,20--13,23)))], (13,1--13,24)), (13,0--13,25)); + Op (Infix (SynSymbol +, [Const (Int32 2, (13,22--13,23))], (13,20--13,23)))], (13,1--13,24)), + (13,0--13,25)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("* is %i", Regular, (15,9--15,18)), (15,9--15,18)); Op (Infix - (SynSymbol *, - [Symbol (SynSymbol a); Symbol (SynSymbol b); - Const (Int32 52, (15,26--15,28))], (15,20--15,28)))], - (15,1--15,29)), (15,0--15,30)); + (SynSymbol *, [Symbol (SynSymbol a); Symbol (SynSymbol b); Const (Int32 52, (15,26--15,28))], + (15,20--15,28)))], (15,1--15,29)), (15,0--15,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("* is %i", Regular, (16,9--16,18)), (16,9--16,18)); - Op - (Infix - (SynSymbol *, [Const (Int32 2, (16,22--16,23))], - (16,20--16,23)))], (16,1--16,24)), (16,0--16,25)); + Op (Infix (SynSymbol *, [Const (Int32 2, (16,22--16,23))], (16,20--16,23)))], (16,1--16,24)), + (16,0--16,25)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("* is %i", Regular, (17,9--17,18)), (17,9--17,18)); - Op (Infix (SynSymbol *, [], (17,20--17,21)))], (17,1--17,22)), - (17,0--17,23)); + Op (Infix (SynSymbol *, [], (17,20--17,21)))], (17,1--17,22)), (17,0--17,23)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("* is %A", Regular, (18,9--18,18)), (18,9--18,18)); Op (Infix - (SynSymbol *, - [Const (SByte 2y, (18,22--18,24)); - Const (SByte 1y, (18,25--18,27))], (18,20--18,27)))], + (SynSymbol *, [Const (SByte 2y, (18,22--18,24)); Const (SByte 1y, (18,25--18,27))], (18,20--18,27)))], (18,1--18,28)), (18,0--18,29)); Expr (FunctionCall @@ -72,36 +54,28 @@ [Const (String ("- is %i", Regular, (20,9--20,18)), (20,9--20,18)); Op (Infix - (SynSymbol -, - [Symbol (SynSymbol a); Symbol (SynSymbol b); - Const (Int32 52, (20,26--20,28))], (20,20--20,28)))], - (20,1--20,29)), (20,0--20,30)); + (SynSymbol -, [Symbol (SynSymbol a); Symbol (SynSymbol b); Const (Int32 52, (20,26--20,28))], + (20,20--20,28)))], (20,1--20,29)), (20,0--20,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("- is %i", Regular, (21,9--21,18)), (21,9--21,18)); - Op - (Infix - (SynSymbol -, [Const (Int32 2, (21,22--21,23))], - (21,20--21,23)))], (21,1--21,24)), (21,0--21,25)); + Op (Infix (SynSymbol -, [Const (Int32 2, (21,22--21,23))], (21,20--21,23)))], (21,1--21,24)), + (21,0--21,25)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("/ is %A", Regular, (23,9--23,18)), (23,9--23,18)); Op (Infix - (SynSymbol /, - [Symbol (SynSymbol a); Symbol (SynSymbol b); - Const (Int32 52, (23,26--23,28))], (23,20--23,28)))], - (23,1--23,29)), (23,0--23,30)); + (SynSymbol /, [Symbol (SynSymbol a); Symbol (SynSymbol b); Const (Int32 52, (23,26--23,28))], + (23,20--23,28)))], (23,1--23,29)), (23,0--23,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("/ is %A", Regular, (24,9--24,18)), (24,9--24,18)); - Op - (Infix - (SynSymbol /, [Const (Int64 2L, (24,22--24,24))], - (24,20--24,24)))], (24,1--24,25)), (24,0--24,26)); + Op (Infix (SynSymbol /, [Const (Int64 2L, (24,22--24,24))], (24,20--24,24)))], (24,1--24,25)), + (24,0--24,26)); Expr (FunctionCall (Symbol (SynSymbol printfn), @@ -109,45 +83,31 @@ Op (Infix (SynSymbol /, - [FunctionCall - (Symbol (SynSymbol decimal), [Symbol (SynSymbol a)], - (26,23--26,32)); - FunctionCall - (Symbol (SynSymbol decimal), [Symbol (SynSymbol b)], - (26,35--26,44)); - FunctionCall - (Symbol (SynSymbol decimal), - [Const (Double 52.0, (26,55--26,59))], (26,47--26,59))], + [FunctionCall (Symbol (SynSymbol decimal), [Symbol (SynSymbol a)], (26,23--26,32)); + FunctionCall (Symbol (SynSymbol decimal), [Symbol (SynSymbol b)], (26,35--26,44)); + FunctionCall (Symbol (SynSymbol decimal), [Const (Double 52.0, (26,55--26,59))], (26,47--26,59))], (26,20--26,60)))], (26,1--26,61)), (26,0--26,62)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("/ is %A", Regular, (27,9--27,18)), (27,9--27,18)); - Op - (Infix - (SynSymbol /, [Const (Int32 2, (27,22--27,23))], - (27,20--27,23)))], (27,1--27,24)), (27,0--27,25)); + Op (Infix (SynSymbol /, [Const (Int32 2, (27,22--27,23))], (27,20--27,23)))], (27,1--27,24)), + (27,0--27,25)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (28,0--28,53)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("/ is %A", Regular, (28,9--28,18)), (28,9--28,18)); + [Const (String ("/ is %A", Regular, (28,9--28,18)), (28,9--28,18)); Op (Infix (SynSymbol /, - [FunctionCall - (Symbol (SynSymbol decimal), [Symbol (SynSymbol a)], - (28,23--28,32)); - FunctionCall - (Symbol (SynSymbol decimal), [Symbol (SynSymbol b)], - (28,35--28,44)); - Const (Decimal 52.0M, (28,46--28,51))], (28,20--28,51)))], - (28,1--28,52)), None, (28,0--28,53)), (28,0--28,53)); + [FunctionCall (Symbol (SynSymbol decimal), [Symbol (SynSymbol a)], (28,23--28,32)); + FunctionCall (Symbol (SynSymbol decimal), [Symbol (SynSymbol b)], (28,35--28,44)); + Const (Decimal 52.0M, (28,46--28,51))], (28,20--28,51)))], (28,1--28,52)), None, (28,0--28,53)), + (28,0--28,53)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (28,0--28,53)), (28,0--28,53)); - Symbol (SynSymbol visp_result_todo)], (28,0--28,53)), - (28,0--28,53))], (8,0--28,53))] \ No newline at end of file + [Const (String ("%A", Regular, (28,0--28,53)), (28,0--28,53)); Symbol (SynSymbol visp_result_todo)], + (28,0--28,53)), (28,0--28,53))], (8,0--28,53))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-6.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-6.structured output.verified.txt index e00e0d5..cf70ad6 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-6.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-6.structured output.verified.txt @@ -8,20 +8,17 @@ (Bracket, [Const (Int32 1, (9,5--9,6)); Const (Int32 2, (9,7--9,8)); Const (String ("foo", Regular, (9,9--9,14)), (9,9--9,14)); - Const (String ("bar", Regular, (9,15--9,20)), (9,15--9,20))], - (9,4--9,21))), None, (8,1--9,21)), (8,0--9,22)); + Const (String ("bar", Regular, (9,15--9,20)), (9,15--9,20))], (9,4--9,21))), None, (8,1--9,21)), + (8,0--9,22)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (10,0--10,32)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("values are %O", Regular, (10,9--10,24)), - (10,9--10,24)); Symbol (SynSymbol values)], (10,1--10,31)), - None, (10,0--10,32)), (10,0--10,32)); + [Const (String ("values are %O", Regular, (10,9--10,24)), (10,9--10,24)); Symbol (SynSymbol values)], + (10,1--10,31)), None, (10,0--10,32)), (10,0--10,32)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (10,0--10,32)), (10,0--10,32)); - Symbol (SynSymbol visp_result_todo)], (10,0--10,32)), - (10,0--10,32))], (8,0--10,32))] \ No newline at end of file + [Const (String ("%A", Regular, (10,0--10,32)), (10,0--10,32)); Symbol (SynSymbol visp_result_todo)], + (10,0--10,32)), (10,0--10,32))], (8,0--10,32))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-7.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-7.structured output.verified.txt index 4d86ab3..f27eb56 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-7.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-7.structured output.verified.txt @@ -1,9 +1,6 @@ ParsedFile [AnonModule - ([HashDirective - (ParsedHashDirective - ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), - (9,0--9,12)); + ([HashDirective (ParsedHashDirective ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), (9,0--9,12)); Expr (LetOrUse (Named (SynSymbol values, (11,5--11,11)), @@ -11,36 +8,28 @@ (SynCollection (Bracket, [Const (Int32 1, (12,5--12,6)); Const (Int32 2, (12,7--12,8)); - Const - (String ("foo", Regular, (12,9--12,14)), (12,9--12,14)); - Const - (String ("bar", Regular, (12,15--12,20)), (12,15--12,20))], - (12,4--12,21))), None, (11,1--12,21)), (11,0--12,22)); + Const (String ("foo", Regular, (12,9--12,14)), (12,9--12,14)); + Const (String ("bar", Regular, (12,15--12,20)), (12,15--12,20))], (12,4--12,21))), None, + (11,1--12,21)), (11,0--12,22)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("values are %O", Regular, (14,9--14,24)), (14,9--14,24)); - Symbol (SynSymbol values)], (14,1--14,31)), (14,0--14,32)); + [Const (String ("values are %O", Regular, (14,9--14,24)), (14,9--14,24)); Symbol (SynSymbol values)], + (14,1--14,31)), (14,0--14,32)); Expr (FunctionCall (Symbol (SynSymbol vector-push!), - [Symbol (SynSymbol values); Const (Int32 4, (15,21--15,22)); - Const (Int32 5, (15,23--15,24)); Const (Int32 6, (15,25--15,26)); - Const (Int32 7, (15,27--15,28))], (15,1--15,28)), (15,0--15,29)); + [Symbol (SynSymbol values); Const (Int32 4, (15,21--15,22)); Const (Int32 5, (15,23--15,24)); + Const (Int32 6, (15,25--15,26)); Const (Int32 7, (15,27--15,28))], (15,1--15,28)), (15,0--15,29)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (16,0--16,45)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String - ("values after update are %O", Regular, (16,9--16,37)), - (16,9--16,37)); Symbol (SynSymbol values)], (16,1--16,44)), - None, (16,0--16,45)), (16,0--16,45)); + [Const (String ("values after update are %O", Regular, (16,9--16,37)), (16,9--16,37)); + Symbol (SynSymbol values)], (16,1--16,44)), None, (16,0--16,45)), (16,0--16,45)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (16,0--16,45)), (16,0--16,45)); - Symbol (SynSymbol visp_result_todo)], (16,0--16,45)), - (16,0--16,45))], (9,0--16,45))] \ No newline at end of file + [Const (String ("%A", Regular, (16,0--16,45)), (16,0--16,45)); Symbol (SynSymbol visp_result_todo)], + (16,0--16,45)), (16,0--16,45))], (9,0--16,45))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-8.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-8.structured output.verified.txt index 68a737c..4b53482 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-8.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-8.structured output.verified.txt @@ -3,43 +3,29 @@ ([Expr (LetOrUse (Typed - (Named (SynSymbol ints, (9,6--9,10)), - Generic (Ident ResizeArray, [Ident int32], (9,13--9,31)), - (9,5--9,32)), New (Ident ResizeArray<_>, [], (10,5--10,23)), - None, (9,1--10,24)), (9,0--10,25)); + (Named (SynSymbol ints, (9,6--9,10)), Generic (Ident ResizeArray, [Ident int32], (9,13--9,31)), + (9,5--9,32)), New (Ident ResizeArray<_>, [], (10,5--10,23)), None, (9,1--10,24)), (9,0--10,25)); Expr - (DotMethod - (Symbol (SynSymbol ints), SynSymbol Add, - [Const (Int32 1, (12,12--12,13))], Tuple, (12,1--12,13)), + (DotMethod (Symbol (SynSymbol ints), SynSymbol Add, [Const (Int32 1, (12,12--12,13))], Tuple, (12,1--12,13)), (12,0--12,14)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("number of ints: %i", Regular, (14,9--14,29)), - (14,9--14,29)); - DotProperty - (Symbol (SynSymbol ints), SynSymbol Count, (14,31--14,44))], - (14,1--14,45)), (14,0--14,46)); + [Const (String ("number of ints: %i", Regular, (14,9--14,29)), (14,9--14,29)); + DotProperty (Symbol (SynSymbol ints), SynSymbol Count, (14,31--14,44))], (14,1--14,45)), (14,0--14,46)); Expr - (DotMethod - (Symbol (SynSymbol ints), SynSymbol Add, - [Const (Int32 2, (16,12--16,13))], Tuple, (16,1--16,13)), + (DotMethod (Symbol (SynSymbol ints), SynSymbol Add, [Const (Int32 2, (16,12--16,13))], Tuple, (16,1--16,13)), (16,0--16,14)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (18,0--18,46)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("number of ints: %i", Regular, (18,9--18,29)), - (18,9--18,29)); - DotProperty - (Symbol (SynSymbol ints), SynSymbol Count, (18,31--18,44))], - (18,1--18,45)), None, (18,0--18,46)), (18,0--18,46)); + [Const (String ("number of ints: %i", Regular, (18,9--18,29)), (18,9--18,29)); + DotProperty (Symbol (SynSymbol ints), SynSymbol Count, (18,31--18,44))], (18,1--18,45)), None, + (18,0--18,46)), (18,0--18,46)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (18,0--18,46)), (18,0--18,46)); - Symbol (SynSymbol visp_result_todo)], (18,0--18,46)), - (18,0--18,46))], (9,0--18,46))] \ No newline at end of file + [Const (String ("%A", Regular, (18,0--18,46)), (18,0--18,46)); Symbol (SynSymbol visp_result_todo)], + (18,0--18,46)), (18,0--18,46))], (9,0--18,46))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-9.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-9.structured output.verified.txt index 61cde3e..041f338 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-9.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_example-9.structured output.verified.txt @@ -2,68 +2,47 @@ [AnonModule ([Expr (LetOrUse - (Named (SynSymbol decimals, (9,5--9,13)), - New (Ident ResizeArray<_>, [], (9,15--9,33)), None, (9,1--9,34)), + (Named (SynSymbol decimals, (9,5--9,13)), New (Ident ResizeArray<_>, [], (9,15--9,33)), None, (9,1--9,34)), (9,0--9,35)); Expr (DotMethod (Symbol (SynSymbol decimals), SynSymbol Add, - [FunctionCall - (Symbol (SynSymbol decimal), [Const (Int32 1, (11,25--11,26))], - (11,17--11,26))], Tuple, (11,1--11,27)), (11,0--11,28)); + [FunctionCall (Symbol (SynSymbol decimal), [Const (Int32 1, (11,25--11,26))], (11,17--11,26))], Tuple, + (11,1--11,27)), (11,0--11,28)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("number of decimals: %i", Regular, (13,9--13,33)), - (13,9--13,33)); - DotProperty - (Symbol (SynSymbol decimals), SynSymbol Count, (13,35--13,52))], - (13,1--13,53)), (13,0--13,54)); + [Const (String ("number of decimals: %i", Regular, (13,9--13,33)), (13,9--13,33)); + DotProperty (Symbol (SynSymbol decimals), SynSymbol Count, (13,35--13,52))], (13,1--13,53)), (13,0--13,54)); Expr (DotMethod (Symbol (SynSymbol decimals), SynSymbol Add, - [FunctionCall - (Symbol (SynSymbol decimal), [Const (Int32 2, (15,25--15,26))], - (15,17--15,26))], Tuple, (15,1--15,27)), (15,0--15,28)); + [FunctionCall (Symbol (SynSymbol decimal), [Const (Int32 2, (15,25--15,26))], (15,17--15,26))], Tuple, + (15,1--15,27)), (15,0--15,28)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("number of decimals: %i", Regular, (17,9--17,33)), - (17,9--17,33)); - DotProperty - (Symbol (SynSymbol decimals), SynSymbol Count, (17,35--17,52))], - (17,1--17,53)), (17,0--17,54)); + [Const (String ("number of decimals: %i", Regular, (17,9--17,33)), (17,9--17,33)); + DotProperty (Symbol (SynSymbol decimals), SynSymbol Count, (17,35--17,52))], (17,1--17,53)), (17,0--17,54)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("decimals 0 is %f", Regular, (19,9--19,27)), - (19,9--19,27)); - DotIndex - (Symbol (SynSymbol decimals), [Const (Int32 0, (19,42--19,43))], - (19,29--19,44))], (19,1--19,45)), (19,0--19,46)); + [Const (String ("decimals 0 is %f", Regular, (19,9--19,27)), (19,9--19,27)); + DotIndex (Symbol (SynSymbol decimals), [Const (Int32 0, (19,42--19,43))], (19,29--19,44))], (19,1--19,45)), + (19,0--19,46)); Expr - (LetOrUse - (Named (SynSymbol index, (21,5--21,10)), - Const (Int32 1, (21,11--21,12)), None, (21,1--21,12)), + (LetOrUse (Named (SynSymbol index, (21,5--21,10)), Const (Int32 1, (21,11--21,12)), None, (21,1--21,12)), (21,0--21,13)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (23,0--23,50)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("decimals 1 is %f", Regular, (23,9--23,27)), - (23,9--23,27)); - DotIndex - (Symbol (SynSymbol decimals), [Symbol (SynSymbol index)], - (23,29--23,48))], (23,1--23,49)), None, (23,0--23,50)), - (23,0--23,50)); + [Const (String ("decimals 1 is %f", Regular, (23,9--23,27)), (23,9--23,27)); + DotIndex (Symbol (SynSymbol decimals), [Symbol (SynSymbol index)], (23,29--23,48))], (23,1--23,49)), + None, (23,0--23,50)), (23,0--23,50)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (23,0--23,50)), (23,0--23,50)); - Symbol (SynSymbol visp_result_todo)], (23,0--23,50)), - (23,0--23,50))], (9,0--23,50))] \ No newline at end of file + [Const (String ("%A", Regular, (23,0--23,50)), (23,0--23,50)); Symbol (SynSymbol visp_result_todo)], + (23,0--23,50)), (23,0--23,50))], (9,0--23,50))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_variables-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_variables-0.structured output.verified.txt index 0a3fd81..0258899 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_variables-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_examples_variables-0.structured output.verified.txt @@ -1,48 +1,35 @@ ParsedFile [AnonModule ([Expr - (LetOrUse - (Named (SynSymbol value, (10,5--10,10)), - Const (Int32 1, (10,11--10,12)), None, (10,1--10,12)), + (LetOrUse (Named (SynSymbol value, (10,5--10,10)), Const (Int32 1, (10,11--10,12)), None, (10,1--10,12)), (10,0--10,13)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("value is %i", Regular, (11,9--11,22)), (11,9--11,22)); - Symbol (SynSymbol value)], (11,1--11,28)), (11,0--11,29)); + [Const (String ("value is %i", Regular, (11,9--11,22)), (11,9--11,22)); Symbol (SynSymbol value)], + (11,1--11,28)), (11,0--11,29)); Expr - (LetOrUse - (Named (SynSymbol valuemut, (14,5--14,13)), - Const (Int32 1, (14,14--14,15)), Mutable, (14,1--14,15)), + (LetOrUse (Named (SynSymbol valuemut, (14,5--14,13)), Const (Int32 1, (14,14--14,15)), Mutable, (14,1--14,15)), (14,0--14,16)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("valuemut is %i", Regular, (15,9--15,25)), - (15,9--15,25)); Symbol (SynSymbol valuemut)], (15,1--15,34)), - (15,0--15,35)); + [Const (String ("valuemut is %i", Regular, (15,9--15,25)), (15,9--15,25)); Symbol (SynSymbol valuemut)], + (15,1--15,34)), (15,0--15,35)); Expr (Set (Symbol (SynSymbol valuemut), - Op - (Infix - (SynSymbol +, - [Symbol (SynSymbol valuemut); Const (Int32 1, (19,27--19,28))], - (19,16--19,28))), (19,1--19,29)), (19,0--19,30)); + Op (Infix (SynSymbol +, [Symbol (SynSymbol valuemut); Const (Int32 1, (19,27--19,28))], (19,16--19,28))), + (19,1--19,29)), (19,0--19,30)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (21,0--21,35)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("valuemut is %i", Regular, (21,9--21,25)), - (21,9--21,25)); Symbol (SynSymbol valuemut)], (21,1--21,34)), - None, (21,0--21,35)), (21,0--21,35)); + [Const (String ("valuemut is %i", Regular, (21,9--21,25)), (21,9--21,25)); Symbol (SynSymbol valuemut)], + (21,1--21,34)), None, (21,0--21,35)), (21,0--21,35)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (21,0--21,35)), (21,0--21,35)); - Symbol (SynSymbol visp_result_todo)], (21,0--21,35)), - (21,0--21,35))], (10,0--21,35))] \ No newline at end of file + [Const (String ("%A", Regular, (21,0--21,35)), (21,0--21,35)); Symbol (SynSymbol visp_result_todo)], + (21,0--21,35)), (21,0--21,35))], (10,0--21,35))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-0.structured output.verified.txt index 32b0d3b..ff157ac 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-0.structured output.verified.txt @@ -6,18 +6,14 @@ ForIn (Named (SynSymbol var, (8,9--8,12)), RangeExpr - (Const (Int32 0, (8,17--8,18)), - Some (Const (Int32 1, (8,22--8,23))), - Const (Int32 10, (8,27--8,29)), (8,14--8,29)), + (Const (Int32 0, (8,17--8,18)), Some (Const (Int32 1, (8,22--8,23))), Const (Int32 10, (8,27--8,29)), + (8,14--8,29)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("var is: %O", Regular, (9,11--9,23)), - (9,11--9,23)); Symbol (SynSymbol var)], (9,3--9,27))], - (8,1--9,28)), None, (8,0--9,29)), (8,0--9,29)); + [Const (String ("var is: %O", Regular, (9,11--9,23)), (9,11--9,23)); Symbol (SynSymbol var)], + (9,3--9,27))], (8,1--9,28)), None, (8,0--9,29)), (8,0--9,29)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (8,0--9,29)), (8,0--9,29)); - Symbol (SynSymbol visp_result_todo)], (8,0--9,29)), (8,0--9,29))], - (8,0--9,29))] \ No newline at end of file + [Const (String ("%A", Regular, (8,0--9,29)), (8,0--9,29)); Symbol (SynSymbol visp_result_todo)], + (8,0--9,29)), (8,0--9,29))], (8,0--9,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-1.structured output.verified.txt index d286012..dcc111b 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-1.structured output.verified.txt @@ -8,21 +8,15 @@ Collection (SynCollection (FsList, - [Const (Int32 1, (8,20--8,21)); - Const (Int32 2, (8,22--8,23)); - Const (Int32 3, (8,24--8,25)); - Const (Int32 4, (8,26--8,27)); - Const (Int32 5, (8,28--8,29)); - Const (Int32 6, (8,30--8,31))], (8,14--8,31))), + [Const (Int32 1, (8,20--8,21)); Const (Int32 2, (8,22--8,23)); Const (Int32 3, (8,24--8,25)); + Const (Int32 4, (8,26--8,27)); Const (Int32 5, (8,28--8,29)); Const (Int32 6, (8,30--8,31))], + (8,14--8,31))), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("var is: %O", Regular, (9,11--9,23)), - (9,11--9,23)); Symbol (SynSymbol var)], (9,3--9,27))], - (8,1--9,28)), None, (8,0--9,29)), (8,0--9,29)); + [Const (String ("var is: %O", Regular, (9,11--9,23)), (9,11--9,23)); Symbol (SynSymbol var)], + (9,3--9,27))], (8,1--9,28)), None, (8,0--9,29)), (8,0--9,29)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (8,0--9,29)), (8,0--9,29)); - Symbol (SynSymbol visp_result_todo)], (8,0--9,29)), (8,0--9,29))], - (8,0--9,29))] \ No newline at end of file + [Const (String ("%A", Regular, (8,0--9,29)), (8,0--9,29)); Symbol (SynSymbol visp_result_todo)], + (8,0--9,29)), (8,0--9,29))], (8,0--9,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-2.structured output.verified.txt index 1be9025..e5559d7 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-2.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-2.structured output.verified.txt @@ -8,21 +8,15 @@ Collection (SynCollection (FsArray, - [Const (Int32 1, (8,21--8,22)); - Const (Int32 2, (8,23--8,24)); - Const (Int32 3, (8,25--8,26)); - Const (Int32 4, (8,27--8,28)); - Const (Int32 5, (8,29--8,30)); - Const (Int32 6, (8,31--8,32))], (8,14--8,32))), + [Const (Int32 1, (8,21--8,22)); Const (Int32 2, (8,23--8,24)); Const (Int32 3, (8,25--8,26)); + Const (Int32 4, (8,27--8,28)); Const (Int32 5, (8,29--8,30)); Const (Int32 6, (8,31--8,32))], + (8,14--8,32))), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("var is: %O", Regular, (9,11--9,23)), - (9,11--9,23)); Symbol (SynSymbol var)], (9,3--9,27))], - (8,1--9,28)), None, (8,0--9,29)), (8,0--9,29)); + [Const (String ("var is: %O", Regular, (9,11--9,23)), (9,11--9,23)); Symbol (SynSymbol var)], + (9,3--9,27))], (8,1--9,28)), None, (8,0--9,29)), (8,0--9,29)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (8,0--9,29)), (8,0--9,29)); - Symbol (SynSymbol visp_result_todo)], (8,0--9,29)), (8,0--9,29))], - (8,0--9,29))] \ No newline at end of file + [Const (String ("%A", Regular, (8,0--9,29)), (8,0--9,29)); Symbol (SynSymbol visp_result_todo)], + (8,0--9,29)), (8,0--9,29))], (8,0--9,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-3.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-3.structured output.verified.txt index 3a7f48a..a728c8b 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-3.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-3.structured output.verified.txt @@ -8,21 +8,15 @@ Collection (SynCollection (FsSet, - [Const (Int32 1, (9,19--9,20)); - Const (Int32 2, (9,21--9,22)); - Const (Int32 3, (9,23--9,24)); - Const (Int32 4, (9,25--9,26)); - Const (Int32 5, (9,27--9,28)); - Const (Int32 6, (9,29--9,30))], (9,14--9,30))), + [Const (Int32 1, (9,19--9,20)); Const (Int32 2, (9,21--9,22)); Const (Int32 3, (9,23--9,24)); + Const (Int32 4, (9,25--9,26)); Const (Int32 5, (9,27--9,28)); Const (Int32 6, (9,29--9,30))], + (9,14--9,30))), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("var is: %O", Regular, (10,11--10,23)), - (10,11--10,23)); Symbol (SynSymbol var)], (10,3--10,27))], - (9,1--10,28)), None, (9,0--10,29)), (9,0--10,29)); + [Const (String ("var is: %O", Regular, (10,11--10,23)), (10,11--10,23)); Symbol (SynSymbol var)], + (10,3--10,27))], (9,1--10,28)), None, (9,0--10,29)), (9,0--10,29)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (9,0--10,29)), (9,0--10,29)); - Symbol (SynSymbol visp_result_todo)], (9,0--10,29)), (9,0--10,29))], - (9,0--10,29))] \ No newline at end of file + [Const (String ("%A", Regular, (9,0--10,29)), (9,0--10,29)); Symbol (SynSymbol visp_result_todo)], + (9,0--10,29)), (9,0--10,29))], (9,0--10,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-4.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-4.structured output.verified.txt index efbd845..9d487a5 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-4.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-in_for-in-4.structured output.verified.txt @@ -8,25 +8,16 @@ Collection (SynCollection (FsMap, - [Tuple - ([Const (Int32 1, (9,20--9,21)); - Const (Int32 2, (9,24--9,25))], (9,20--9,25)); - Tuple - ([Const (Int32 3, (9,28--9,29)); - Const (Int32 4, (9,32--9,33))], (9,28--9,33)); - Tuple - ([Const (Int32 5, (9,36--9,37)); - Const (Int32 6, (9,40--9,41))], (9,36--9,41))], + [Tuple ([Const (Int32 1, (9,20--9,21)); Const (Int32 2, (9,24--9,25))], (9,20--9,25)); + Tuple ([Const (Int32 3, (9,28--9,29)); Const (Int32 4, (9,32--9,33))], (9,28--9,33)); + Tuple ([Const (Int32 5, (9,36--9,37)); Const (Int32 6, (9,40--9,41))], (9,36--9,41))], (9,14--9,42))), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("var is: %O", Regular, (10,11--10,23)), - (10,11--10,23)); Symbol (SynSymbol var)], (10,3--10,27))], - (9,1--10,28)), None, (9,0--10,29)), (9,0--10,29)); + [Const (String ("var is: %O", Regular, (10,11--10,23)), (10,11--10,23)); Symbol (SynSymbol var)], + (10,3--10,27))], (9,1--10,28)), None, (9,0--10,29)), (9,0--10,29)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (9,0--10,29)), (9,0--10,29)); - Symbol (SynSymbol visp_result_todo)], (9,0--10,29)), (9,0--10,29))], - (9,0--10,29))] \ No newline at end of file + [Const (String ("%A", Regular, (9,0--10,29)), (9,0--10,29)); Symbol (SynSymbol visp_result_todo)], + (9,0--10,29)), (9,0--10,29))], (9,0--10,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-to_for-to-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-to_for-to-0.structured output.verified.txt index e7d114d..3139758 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-to_for-to-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_for-to_for-to-0.structured output.verified.txt @@ -4,109 +4,71 @@ (FunctionDef (SynSymbol func1, None, Args (List [], (8,10--8,12)), [ForTo - (SynSymbol var, Const (Int32 1, (9,16--9,17)), - Const (Int32 10, (9,21--9,23)), + (SynSymbol var, Const (Int32 1, (9,16--9,17)), Const (Int32 10, (9,21--9,23)), [FunctionCall (Symbol (SynSymbol printf), - [Const - (String ("%d ", Regular, (10,12--10,17)), (10,12--10,17)); - Symbol (SynSymbol var)], (10,5--10,21))], false, - (9,3--10,22)); + [Const (String ("%d ", Regular, (10,12--10,17)), (10,12--10,17)); Symbol (SynSymbol var)], + (10,5--10,21))], false, (9,3--10,22)); FunctionCall - (Symbol (SynSymbol printfn), - [Const (String ("", Regular, (11,11--11,13)), (11,11--11,13))], + (Symbol (SynSymbol printfn), [Const (String ("", Regular, (11,11--11,13)), (11,11--11,13))], (11,3--11,13))], (8,1--11,14)), (8,0--11,15)); Expr (FunctionDef (SynSymbol func2, None, Args (List [], (13,10--13,12)), [ForTo - (SynSymbol var, Const (Int32 10, (14,16--14,18)), - Const (Int32 1, (14,26--14,27)), + (SynSymbol var, Const (Int32 10, (14,16--14,18)), Const (Int32 1, (14,26--14,27)), [FunctionCall (Symbol (SynSymbol printf), - [Const - (String ("%d ", Regular, (15,12--15,17)), (15,12--15,17)); - Symbol (SynSymbol var)], (15,5--15,21))], true, - (14,3--15,22)); + [Const (String ("%d ", Regular, (15,12--15,17)), (15,12--15,17)); Symbol (SynSymbol var)], + (15,5--15,21))], true, (14,3--15,22)); FunctionCall - (Symbol (SynSymbol printfn), - [Const (String ("", Regular, (16,11--16,13)), (16,11--16,13))], + (Symbol (SynSymbol printfn), [Const (String ("", Regular, (16,11--16,13)), (16,11--16,13))], (16,3--16,13))], (13,1--16,14)), (13,0--16,15)); - Expr - (FunctionCall (Symbol (SynSymbol func1), [], (18,1--18,6)), - (18,0--18,7)); - Expr - (FunctionCall (Symbol (SynSymbol func2), [], (19,1--19,6)), - (19,0--19,7)); + Expr (FunctionCall (Symbol (SynSymbol func1), [], (18,1--18,6)), (18,0--18,7)); + Expr (FunctionCall (Symbol (SynSymbol func2), [], (19,1--19,6)), (19,0--19,7)); Expr (FunctionDef (SynSymbol start, None, - Args - (List - [Named (SynSymbol x, (21,11--21,12)); - Named (SynSymbol y, (21,13--21,14))], (21,10--21,15)), + Args (List [Named (SynSymbol x, (21,11--21,12)); Named (SynSymbol y, (21,13--21,14))], (21,10--21,15)), [Op (Infix (SynSymbol -, [Symbol (SynSymbol x); - Op - (Infix - (SynSymbol *, - [Const (Int32 2, (21,24--21,25)); - Symbol (SynSymbol y)], (21,22--21,27)))], + Op (Infix (SynSymbol *, [Const (Int32 2, (21,24--21,25)); Symbol (SynSymbol y)], (21,22--21,27)))], (21,17--21,28)))], (21,1--21,29)), (21,0--21,30)); Expr (FunctionDef (SynSymbol end, None, - Args - (List - [Named (SynSymbol x, (22,9--22,10)); - Named (SynSymbol y, (22,11--22,12))], (22,8--22,13)), + Args (List [Named (SynSymbol x, (22,9--22,10)); Named (SynSymbol y, (22,11--22,12))], (22,8--22,13)), [Op (Infix (SynSymbol +, [Symbol (SynSymbol x); - Op - (Infix - (SynSymbol *, - [Const (Int32 2, (22,22--22,23)); - Symbol (SynSymbol y)], (22,20--22,25)))], + Op (Infix (SynSymbol *, [Const (Int32 2, (22,22--22,23)); Symbol (SynSymbol y)], (22,20--22,25)))], (22,15--22,26)))], (22,1--22,27)), (22,0--22,28)); Expr (FunctionDef (SynSymbol func3, None, - Args - (List - [Named (SynSymbol x, (24,11--24,12)); - Named (SynSymbol y, (24,13--24,14))], (24,10--24,15)), + Args (List [Named (SynSymbol x, (24,11--24,12)); Named (SynSymbol y, (24,13--24,14))], (24,10--24,15)), [ForTo (SynSymbol var, - FunctionCall - (Symbol (SynSymbol start), - [Symbol (SynSymbol x); Symbol (SynSymbol y)], (25,17--25,26)), - FunctionCall - (Symbol (SynSymbol end), - [Symbol (SynSymbol x); Symbol (SynSymbol y)], (25,32--25,39)), + FunctionCall (Symbol (SynSymbol start), [Symbol (SynSymbol x); Symbol (SynSymbol y)], (25,17--25,26)), + FunctionCall (Symbol (SynSymbol end), [Symbol (SynSymbol x); Symbol (SynSymbol y)], (25,32--25,39)), [FunctionCall (Symbol (SynSymbol printf), - [Const - (String ("%d ", Regular, (26,12--26,17)), (26,12--26,17)); - Symbol (SynSymbol var)], (26,5--26,21))], false, - (25,3--26,22)); + [Const (String ("%d ", Regular, (26,12--26,17)), (26,12--26,17)); Symbol (SynSymbol var)], + (26,5--26,21))], false, (25,3--26,22)); FunctionCall - (Symbol (SynSymbol printfn), - [Const (String ("", Regular, (27,11--27,13)), (27,11--27,13))], + (Symbol (SynSymbol printfn), [Const (String ("", Regular, (27,11--27,13)), (27,11--27,13))], (27,3--27,13))], (24,1--27,14)), (24,0--28,1)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (30,0--30,12)), FunctionCall - (Symbol (SynSymbol func3), - [Const (Int32 10, (30,7--30,9)); Const (Int32 4, (30,10--30,11))], + (Symbol (SynSymbol func3), [Const (Int32 10, (30,7--30,9)); Const (Int32 4, (30,10--30,11))], (30,1--30,11)), None, (30,0--30,12)), (30,0--30,12)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (30,0--30,12)), (30,0--30,12)); - Symbol (SynSymbol visp_result_todo)], (30,0--30,12)), - (30,0--30,12))], (8,0--30,12))] \ No newline at end of file + [Const (String ("%A", Regular, (30,0--30,12)), (30,0--30,12)); Symbol (SynSymbol visp_result_todo)], + (30,0--30,12)), (30,0--30,12))], (8,0--30,12))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_functions_apply-method-args-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_functions_apply-method-args-0.structured output.verified.txt index 7cb2bcb..e48cf2e 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_functions_apply-method-args-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_functions_apply-method-args-0.structured output.verified.txt @@ -1,9 +1,6 @@ ParsedFile [AnonModule - ([Expr - (TypeAlias - (SynSymbol Grid, Array (2, Ident char, (9,14--9,21)), (9,1--9,21)), - (9,0--9,22)); + ([Expr (TypeAlias (SynSymbol Grid, Array (2, Ident char, (9,14--9,21)), (9,1--9,21)), (9,0--9,22)); Expr (SyntaxMacroCall (SynMacroCall @@ -12,161 +9,103 @@ List (Paren, [List - (Bracket, - [Symbol (SynSymbol x); Trivia (Colon, (11,15--11,17)); - Symbol (SynSymbol int32)], (11,13--11,23)); + (Bracket, [Symbol (SynSymbol x); Trivia (Colon, (11,15--11,17)); Symbol (SynSymbol int32)], + (11,13--11,23)); List - (Bracket, - [Symbol (SynSymbol y); Trivia (Colon, (11,26--11,28)); - Symbol (SynSymbol int32)], (11,24--11,34))], - (11,12--11,35)); + (Bracket, [Symbol (SynSymbol y); Trivia (Colon, (11,26--11,28)); Symbol (SynSymbol int32)], + (11,24--11,34))], (11,12--11,35)); + List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.X); Symbol (SynSymbol x)], (12,2--12,16)); + List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); Symbol (SynSymbol y)], (13,2--13,16)); List (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.X); - Symbol (SynSymbol x)], (12,2--12,16)); - List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); - Symbol (SynSymbol y)], (13,2--13,16)); - List - (Paren, - [Symbol (SynSymbol override); Symbol (SynSymbol fn); - Symbol (SynSymbol _.ToString); Const (Unit, (15,26--15,28)); + [Symbol (SynSymbol override); Symbol (SynSymbol fn); Symbol (SynSymbol _.ToString); + Const (Unit, (15,26--15,28)); List (Paren, [Symbol (SynSymbol sprintf); - Const - (String ("(y: %A, x: %A)", Regular, (16,13--16,29)), - (16,13--16,29)); Symbol (SynSymbol y); - Symbol (SynSymbol x)], (16,4--16,34))], (15,2--17,3))], - (11,1--17,3))), (11,0--17,4)); + Const (String ("(y: %A, x: %A)", Regular, (16,13--16,29)), (16,13--16,29)); + Symbol (SynSymbol y); Symbol (SynSymbol x)], (16,4--16,34))], (15,2--17,3))], (11,1--17,3))), + (11,0--17,4)); Expr (FunctionDef (SynSymbol NorthOf, Inline, - Args - (List - [Typed - (Named (SynSymbol p, (19,21--19,22)), Ident Pos, - (19,20--19,28))], (19,19--19,29)), + Args (List [Typed (Named (SynSymbol p, (19,21--19,22)), Ident Pos, (19,20--19,28))], (19,19--19,29)), [FunctionCall (Symbol (SynSymbol mkPos), - [DotProperty - (Symbol (SynSymbol p), SynSymbol X, (20,10--20,14)); + [DotProperty (Symbol (SynSymbol p), SynSymbol X, (20,10--20,14)); FunctionCall - (Symbol (SynSymbol dec), - [DotProperty - (Symbol (SynSymbol p), SynSymbol Y, (20,22--20,26))], - (20,17--20,27))], (20,3--20,28))], (19,1--20,29)), - (19,0--20,30)); + (Symbol (SynSymbol dec), [DotProperty (Symbol (SynSymbol p), SynSymbol Y, (20,22--20,26))], + (20,17--20,27))], (20,3--20,28))], (19,1--20,29)), (19,0--20,30)); Expr (Type (SynSymbol TileMap, Args (Tuple - [Typed - (Named (SynSymbol grid, (22,16--22,20)), Ident Grid, - (22,15--22,27)); Trivia (Comma, (22,14--22,15)); + [Typed (Named (SynSymbol grid, (22,16--22,20)), Ident Grid, (22,15--22,27)); + Trivia (Comma, (22,14--22,15)); Typed - (Named (SynSymbol rocks, (22,29--22,34)), - Generic (Ident array, [Ident Pos], (22,36--22,46)), + (Named (SynSymbol rocks, (22,29--22,34)), Generic (Ident array, [Ident Pos], (22,36--22,46)), (22,28--22,47))], (22,14--22,48)), - [Let - (Named (SynSymbol grid, (23,7--23,11)), Symbol (SynSymbol grid), - (23,3--23,16)); + [Let (Named (SynSymbol grid, (23,7--23,11)), Symbol (SynSymbol grid), (23,3--23,16)); Let (Named (SynSymbol height, (24,7--24,13)), - FunctionCall - (Symbol (SynSymbol Array2D.length1), - [Symbol (SynSymbol grid)], (24,15--24,35)), (24,3--24,36)); + FunctionCall (Symbol (SynSymbol Array2D.length1), [Symbol (SynSymbol grid)], (24,15--24,35)), + (24,3--24,36)); Let (Named (SynSymbol width, (25,7--25,12)), - FunctionCall - (Symbol (SynSymbol Array2D.length2), - [Symbol (SynSymbol grid)], (25,14--25,34)), (25,3--25,35)); - Member - (SynSymbol _.Rocks, Symbol (SynSymbol rocks), (27,3--27,23)); + FunctionCall (Symbol (SynSymbol Array2D.length2), [Symbol (SynSymbol grid)], (25,14--25,34)), + (25,3--25,35)); Member (SynSymbol _.Rocks, Symbol (SynSymbol rocks), (27,3--27,23)); OverrideFn (SynSymbol _.ToString, Args (List [], (29,25--29,27)), [FunctionCall (Symbol (SynSymbol sprintf), - [Const - (String ("TileMap\n%A", Regular, (30,13--30,26)), - (30,13--30,26)); Symbol (SynSymbol grid)], + [Const (String ("TileMap\n%A", Regular, (30,13--30,26)), (30,13--30,26)); Symbol (SynSymbol grid)], (30,5--30,31))], (29,3--30,32)); MemberFn (SynSymbol t.MoveRock, Args (List - [Typed - (Named (SynSymbol from, (32,26--32,30)), Ident Pos, - (32,25--32,36)); - Typed - (Named (SynSymbol to, (32,38--32,40)), Ident Pos, - (32,37--32,46))], (32,24--32,47)), + [Typed (Named (SynSymbol from, (32,26--32,30)), Ident Pos, (32,25--32,36)); + Typed (Named (SynSymbol to, (32,38--32,40)), Ident Pos, (32,37--32,46))], (32,24--32,47)), [Match - (DotIndex - (Symbol (SynSymbol t), [Symbol (SynSymbol from)], - (33,12--33,21)), + (DotIndex (Symbol (SynSymbol t), [Symbol (SynSymbol from)], (33,12--33,21)), [SynMatch (Collection (SynCollection - (Paren, - [Named (SynSymbol Some, (34,8--34,12)); - Const (Char 'O', (34,13--34,16))], (34,7--34,17))), - None, + (Paren, [Named (SynSymbol Some, (34,8--34,12)); Const (Char 'O', (34,13--34,16))], + (34,7--34,17))), None, [Match - (DotIndex - (Symbol (SynSymbol t), [Symbol (SynSymbol to)], - (35,16--35,23)), + (DotIndex (Symbol (SynSymbol t), [Symbol (SynSymbol to)], (35,16--35,23)), [SynMatch (Collection (SynCollection - (Paren, - [Named (SynSymbol Some, (36,12--36,16)); - Const (Char '.', (36,17--36,20))], + (Paren, [Named (SynSymbol Some, (36,12--36,16)); Const (Char '.', (36,17--36,20))], (36,11--36,21))), None, [Set - (DotIndex - (Symbol (SynSymbol t), - [Symbol (SynSymbol from)], - (37,19--37,28)), - Const (Char '.', (37,30--37,33)), - (37,13--37,33)); + (DotIndex (Symbol (SynSymbol t), [Symbol (SynSymbol from)], (37,19--37,28)), + Const (Char '.', (37,30--37,33)), (37,13--37,33)); Set - (DotIndex - (Symbol (SynSymbol t), - [Symbol (SynSymbol to)], (38,19--38,26)), - Const (Char 'O', (38,28--38,31)), - (38,13--38,31)); - Const (Bool true, (39,12--39,16))], - (36,11--39,16)); + (DotIndex (Symbol (SynSymbol t), [Symbol (SynSymbol to)], (38,19--38,26)), + Const (Char 'O', (38,28--38,31)), (38,13--38,31)); + Const (Bool true, (39,12--39,16))], (36,11--39,16)); SynMatch - (Discard (41,11--41,12), None, - [Const (Bool false, (41,13--41,18))], - (41,11--41,18))], (35,9--41,19))], (34,7--42,9)); - SynMatch - (Discard (43,7--43,8), None, - [Const (Bool false, (43,9--43,14))], (43,7--43,14))], + (Discard (41,11--41,12), None, [Const (Bool false, (41,13--41,18))], (41,11--41,18))], + (35,9--41,19))], (34,7--42,9)); + SynMatch (Discard (43,7--43,8), None, [Const (Bool false, (43,9--43,14))], (43,7--43,14))], (33,5--43,15))], (32,3--44,5)); GetSet (SynSymbol _.Item, Some (SynMemberGet (Args - (Tuple - [Typed - (Named (SynSymbol pos, (47,11--47,14)), Ident Pos, - (47,10--47,20))], (47,9--47,21)), + (Tuple [Typed (Named (SynSymbol pos, (47,11--47,14)), Ident Pos, (47,10--47,20))], + (47,9--47,21)), [LetOrUse (Named (SynSymbol y, (48,11--48,12)), - DotProperty - (Symbol (SynSymbol pos), SynSymbol Y, - (48,14--48,20)), None, (48,7--48,21)); + DotProperty (Symbol (SynSymbol pos), SynSymbol Y, (48,14--48,20)), None, (48,7--48,21)); LetOrUse (Named (SynSymbol x, (49,11--49,12)), - DotProperty - (Symbol (SynSymbol pos), SynSymbol X, - (49,14--49,20)), None, (49,7--49,21)); + DotProperty (Symbol (SynSymbol pos), SynSymbol X, (49,14--49,20)), None, (49,7--49,21)); SyntaxMacroCall (SynMacroCall (SynSymbol cond_, @@ -181,32 +120,23 @@ [Symbol (SynSymbol and); List (Paren, - [Symbol (SynSymbol >=); - Symbol (SynSymbol y); - Const (Int32 0, (52,25--52,26))], - (52,19--52,27)); + [Symbol (SynSymbol >=); Symbol (SynSymbol y); + Const (Int32 0, (52,25--52,26))], (52,19--52,27)); List (Paren, - [Symbol (SynSymbol <); - Symbol (SynSymbol y); - Symbol (SynSymbol height)], + [Symbol (SynSymbol <); Symbol (SynSymbol y); Symbol (SynSymbol height)], (52,28--52,40))], (52,14--52,41)); List (Paren, [Symbol (SynSymbol and); List (Paren, - [Symbol (SynSymbol >=); - Symbol (SynSymbol x); - Const (Int32 0, (53,25--53,26))], - (53,19--53,27)); + [Symbol (SynSymbol >=); Symbol (SynSymbol x); + Const (Int32 0, (53,25--53,26))], (53,19--53,27)); List (Paren, - [Symbol (SynSymbol <); - Symbol (SynSymbol x); - Symbol (SynSymbol width)], - (53,28--53,39))], (53,14--53,40))], - (52,9--53,41)); + [Symbol (SynSymbol <); Symbol (SynSymbol x); Symbol (SynSymbol width)], + (53,28--53,39))], (53,14--53,40))], (52,9--53,41)); List (Paren, [Symbol (SynSymbol Some); @@ -214,36 +144,22 @@ (Paren, [List (DotBracket, - [Symbol (SynSymbol y); - Trivia (Comma, (54,20--54,21)); - Symbol (SynSymbol x)], - (54,17--54,24)); - Symbol (SynSymbol grid)], - (54,16--54,30))], (54,10--54,31))], - (52,8--55,9)); - List - (Bracket, - [Discard (56,9--56,10); - Symbol (SynSymbol None)], (56,8--56,16))], + [Symbol (SynSymbol y); Trivia (Comma, (54,20--54,21)); + Symbol (SynSymbol x)], (54,17--54,24)); Symbol (SynSymbol grid)], + (54,16--54,30))], (54,10--54,31))], (52,8--55,9)); + List (Bracket, [Discard (56,9--56,10); Symbol (SynSymbol None)], (56,8--56,16))], (51,7--56,16)))], (47,4--57,5))), Some (SynMemberSet (Args - (Tuple - [Typed - (Named (SynSymbol pos, (58,11--58,14)), Ident Pos, - (58,10--58,20))], (58,9--58,21)), - Named (SynSymbol ch, (58,22--58,24)), + (Tuple [Typed (Named (SynSymbol pos, (58,11--58,14)), Ident Pos, (58,10--58,20))], + (58,9--58,21)), Named (SynSymbol ch, (58,22--58,24)), [LetOrUse (Named (SynSymbol y, (59,11--59,12)), - DotProperty - (Symbol (SynSymbol pos), SynSymbol Y, - (59,14--59,20)), None, (59,7--59,21)); + DotProperty (Symbol (SynSymbol pos), SynSymbol Y, (59,14--59,20)), None, (59,7--59,21)); LetOrUse (Named (SynSymbol x, (60,11--60,12)), - DotProperty - (Symbol (SynSymbol pos), SynSymbol X, - (60,14--60,20)), None, (60,7--60,21)); + DotProperty (Symbol (SynSymbol pos), SynSymbol X, (60,14--60,20)), None, (60,7--60,21)); SyntaxMacroCall (SynMacroCall (SynSymbol cond_, @@ -258,32 +174,23 @@ [Symbol (SynSymbol and); List (Paren, - [Symbol (SynSymbol >=); - Symbol (SynSymbol y); - Const (Int32 0, (62,25--62,26))], - (62,19--62,27)); + [Symbol (SynSymbol >=); Symbol (SynSymbol y); + Const (Int32 0, (62,25--62,26))], (62,19--62,27)); List (Paren, - [Symbol (SynSymbol <); - Symbol (SynSymbol y); - Symbol (SynSymbol height)], + [Symbol (SynSymbol <); Symbol (SynSymbol y); Symbol (SynSymbol height)], (62,28--62,40))], (62,14--62,41)); List (Paren, [Symbol (SynSymbol and); List (Paren, - [Symbol (SynSymbol >=); - Symbol (SynSymbol x); - Const (Int32 0, (63,25--63,26))], - (63,19--63,27)); + [Symbol (SynSymbol >=); Symbol (SynSymbol x); + Const (Int32 0, (63,25--63,26))], (63,19--63,27)); List (Paren, - [Symbol (SynSymbol <); - Symbol (SynSymbol x); - Symbol (SynSymbol width)], - (63,28--63,39))], (63,14--63,40))], - (62,9--63,41)); + [Symbol (SynSymbol <); Symbol (SynSymbol x); Symbol (SynSymbol width)], + (63,28--63,39))], (63,14--63,40))], (62,9--63,41)); List (Paren, [Symbol (SynSymbol set!); @@ -291,32 +198,18 @@ (Paren, [List (DotBracket, - [Symbol (SynSymbol y); - Trivia (Comma, (65,20--65,21)); - Symbol (SynSymbol x)], - (65,17--65,24)); - Symbol (SynSymbol grid)], - (65,16--65,30)); Symbol (SynSymbol ch)], - (65,10--65,34))], (62,8--66,9)); - List - (Bracket, - [Discard (67,9--67,10); - Const (Unit, (67,11--67,13))], (67,8--67,14))], - (61,7--67,14)))], (58,4--68,5))), (46,3--68,5))], - [], (22,1--69,3)), (22,0--70,1)); + [Symbol (SynSymbol y); Trivia (Comma, (65,20--65,21)); + Symbol (SynSymbol x)], (65,17--65,24)); Symbol (SynSymbol grid)], + (65,16--65,30)); Symbol (SynSymbol ch)], (65,10--65,34))], (62,8--66,9)); + List (Bracket, [Discard (67,9--67,10); Const (Unit, (67,11--67,13))], (67,8--67,14))], + (61,7--67,14)))], (58,4--68,5))), (46,3--68,5))], [], (22,1--69,3)), (22,0--70,1)); Expr (FunctionDef (SynSymbol TiltNorth, None, - Args - (List - [Typed - (Named (SynSymbol tm, (72,16--72,18)), Ident TileMap, - (72,15--72,28))], (72,14--72,29)), + Args (List [Typed (Named (SynSymbol tm, (72,16--72,18)), Ident TileMap, (72,15--72,28))], (72,14--72,29)), [LetOrUse (Named (SynSymbol rocks, (73,7--73,12)), - DotProperty - (Symbol (SynSymbol tm), SynSymbol Rocks, (73,14--73,23)), - None, (73,3--73,24)); + DotProperty (Symbol (SynSymbol tm), SynSymbol Rocks, (73,14--73,23)), None, (73,3--73,24)); LetOrUse (Named (SynSymbol rocksToMove, (74,7--74,18)), ThreadLast @@ -328,52 +221,38 @@ (Op (Infix (SynSymbol >, - [DotProperty - (Symbol (SynSymbol %1), SynSymbol Y, - (74,49--74,54)); - Const (Int32 0, (74,56--74,57))], - (74,46--74,57))), (74,44--74,58))], - (74,31--74,58)), (74,30--74,59))], (74,20--74,59)), - None, (74,3--74,60)); + [DotProperty (Symbol (SynSymbol %1), SynSymbol Y, (74,49--74,54)); + Const (Int32 0, (74,56--74,57))], (74,46--74,57))), (74,44--74,58))], + (74,31--74,58)), (74,30--74,59))], (74,20--74,59)), None, (74,3--74,60)); ForIn - (Named (SynSymbol rock, (77,11--77,15)), - Symbol (SynSymbol rocksToMove), + (Named (SynSymbol rock, (77,11--77,15)), Symbol (SynSymbol rocksToMove), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("%A", Regular, (78,13--78,17)), (78,13--78,17)); - Symbol (SynSymbol rock)], (78,5--78,22)); - LetOrUse - (Named (SynSymbol pos, (79,9--79,12)), - Symbol (SynSymbol rock), Mutable, (79,5--79,17)); + [Const (String ("%A", Regular, (78,13--78,17)), (78,13--78,17)); Symbol (SynSymbol rock)], + (78,5--78,22)); + LetOrUse (Named (SynSymbol pos, (79,9--79,12)), Symbol (SynSymbol rock), Mutable, (79,5--79,17)); While (DotMethod (Symbol (SynSymbol tm), SynSymbol MoveRock, [Symbol (SynSymbol pos); - FunctionCall - (Symbol (SynSymbol NorthOf), [Symbol (SynSymbol pos)], - (80,30--80,41))], Apply, (80,12--80,42)), + FunctionCall (Symbol (SynSymbol NorthOf), [Symbol (SynSymbol pos)], (80,30--80,41))], Apply, + (80,12--80,42)), [Set (Symbol (SynSymbol pos), - FunctionCall - (Symbol (SynSymbol NorthOf), [Symbol (SynSymbol pos)], - (81,17--81,28)), (81,7--81,29))], (80,5--81,30))], - (77,3--82,5)); + FunctionCall (Symbol (SynSymbol NorthOf), [Symbol (SynSymbol pos)], (81,17--81,28)), + (81,7--81,29))], (80,5--81,30))], (77,3--82,5)); FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (84,11--84,15)), (84,11--84,15)); - Symbol (SynSymbol tm)], (84,3--84,18)); + [Const (String ("%A", Regular, (84,11--84,15)), (84,11--84,15)); Symbol (SynSymbol tm)], (84,3--84,18)); Const (Unit, (86,2--86,4))], (72,1--86,4)), (72,0--86,5)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (88,0--88,14)), FunctionCall - (Symbol (SynSymbol printfn), - [Const (String ("OK", Regular, (88,9--88,13)), (88,9--88,13))], + (Symbol (SynSymbol printfn), [Const (String ("OK", Regular, (88,9--88,13)), (88,9--88,13))], (88,1--88,13)), None, (88,0--88,14)), (88,0--88,14)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (88,0--88,14)), (88,0--88,14)); - Symbol (SynSymbol visp_result_todo)], (88,0--88,14)), - (88,0--88,14))], (9,0--88,14))] \ No newline at end of file + [Const (String ("%A", Regular, (88,0--88,14)), (88,0--88,14)); Symbol (SynSymbol visp_result_todo)], + (88,0--88,14)), (88,0--88,14))], (9,0--88,14))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashmap_hashmap-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashmap_hashmap-0.structured output.verified.txt index 8e36143..8104310 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashmap_hashmap-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashmap_hashmap-0.structured output.verified.txt @@ -6,24 +6,17 @@ Collection (SynCollection (Brace, - [Keyword (SynKeyword :this-is-a-key); - Const - (String ("value", Regular, (8,25--8,32)), (8,25--8,32)); - Const - (String ("string as key", Regular, (9,10--9,25)), - (9,10--9,25)); - Const - (String ("string value", Regular, (9,26--9,40)), - (9,26--9,40)); Const (Int32 0, (10,10--10,11)); - Const - (String ("int as key", Regular, (10,12--10,24)), - (10,12--10,24))], (8,9--10,25))), None, (8,1--10,25)), - (8,0--10,26)); + [Keyword (SynKeyword :this-is-a-key); Const (String ("value", Regular, (8,25--8,32)), (8,25--8,32)); + Const (String ("string as key", Regular, (9,10--9,25)), (9,10--9,25)); + Const (String ("string value", Regular, (9,26--9,40)), (9,26--9,40)); + Const (Int32 0, (10,10--10,11)); + Const (String ("int as key", Regular, (10,12--10,24)), (10,12--10,24))], (8,9--10,25))), None, + (8,1--10,25)), (8,0--10,26)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%O", Regular, (12,9--12,13)), (12,9--12,13)); - Symbol (SynSymbol map)], (12,1--12,17)), (12,0--12,18)); + [Const (String ("%O", Regular, (12,9--12,13)), (12,9--12,13)); Symbol (SynSymbol map)], (12,1--12,17)), + (12,0--12,18)); Expr (FunctionCall (Symbol (SynSymbol printfn), @@ -32,24 +25,18 @@ (Symbol (SynSymbol HashMap.find), [FunctionCall (Symbol (SynSymbol Value.string), - [Const - (String ("string as key", Regular, (14,42--14,57)), - (14,42--14,57))], (14,29--14,57)); - Symbol (SynSymbol map)], (14,15--14,62))], (14,1--14,63)), - (14,0--14,64)); + [Const (String ("string as key", Regular, (14,42--14,57)), (14,42--14,57))], (14,29--14,57)); + Symbol (SynSymbol map)], (14,15--14,62))], (14,1--14,63)), (14,0--14,64)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (16,0--16,35)), FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%O", Regular, (16,9--16,13)), (16,9--16,13)); - FunctionCall - (Keyword (SynKeyword :this-is-a-key), - [Symbol (SynSymbol map)], (16,15--16,33))], (16,1--16,34)), - None, (16,0--16,35)), (16,0--16,35)); + FunctionCall (Keyword (SynKeyword :this-is-a-key), [Symbol (SynSymbol map)], (16,15--16,33))], + (16,1--16,34)), None, (16,0--16,35)), (16,0--16,35)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (16,0--16,35)), (16,0--16,35)); - Symbol (SynSymbol visp_result_todo)], (16,0--16,35)), - (16,0--16,35))], (8,0--16,35))] \ No newline at end of file + [Const (String ("%A", Regular, (16,0--16,35)), (16,0--16,35)); Symbol (SynSymbol visp_result_todo)], + (16,0--16,35)), (16,0--16,35))], (8,0--16,35))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashset_hashset-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashset_hashset-0.structured output.verified.txt index d7a41b7..33910eb 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashset_hashset-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_hashset_hashset-0.structured output.verified.txt @@ -6,30 +6,21 @@ Collection (SynCollection (HashBrace, - [Keyword (SynKeyword :this-is-a-key); - Const - (String ("value", Regular, (9,26--9,33)), (9,26--9,33)); - Const - (String ("string as key", Regular, (10,10--10,25)), - (10,10--10,25)); - Const - (String ("string value", Regular, (10,26--10,40)), - (10,26--10,40)); Const (Int32 0, (11,10--11,11)); - Const - (String ("int as key", Regular, (11,12--11,24)), - (11,12--11,24))], (9,9--11,25))), None, (9,1--11,25)), - (9,0--11,26)); + [Keyword (SynKeyword :this-is-a-key); Const (String ("value", Regular, (9,26--9,33)), (9,26--9,33)); + Const (String ("string as key", Regular, (10,10--10,25)), (10,10--10,25)); + Const (String ("string value", Regular, (10,26--10,40)), (10,26--10,40)); + Const (Int32 0, (11,10--11,11)); + Const (String ("int as key", Regular, (11,12--11,24)), (11,12--11,24))], (9,9--11,25))), None, + (9,1--11,25)), (9,0--11,26)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (13,0--13,18)), FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%O", Regular, (13,9--13,13)), (13,9--13,13)); - Symbol (SynSymbol set)], (13,1--13,17)), None, (13,0--13,18)), - (13,0--13,18)); + [Const (String ("%O", Regular, (13,9--13,13)), (13,9--13,13)); Symbol (SynSymbol set)], (13,1--13,17)), + None, (13,0--13,18)), (13,0--13,18)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (13,0--13,18)), (13,0--13,18)); - Symbol (SynSymbol visp_result_todo)], (13,0--13,18)), - (13,0--13,18))], (9,0--13,18))] \ No newline at end of file + [Const (String ("%A", Regular, (13,0--13,18)), (13,0--13,18)); Symbol (SynSymbol visp_result_todo)], + (13,0--13,18)), (13,0--13,18))], (9,0--13,18))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_if_if-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_if_if-0.structured output.verified.txt index ea54330..603568d 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_if_if-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_if_if-0.structured output.verified.txt @@ -2,29 +2,26 @@ [AnonModule ([Expr (FunctionDef - (SynSymbol condition, None, Args (List [], (8,14--8,16)), - [Const (Bool false, (8,17--8,22))], (8,1--8,22)), (8,0--8,23)); + (SynSymbol condition, None, Args (List [], (8,14--8,16)), [Const (Bool false, (8,17--8,22))], (8,1--8,22)), + (8,0--8,23)); Expr (FunctionDef (SynSymbol then, None, Args (List [], (9,9--9,11)), - [Const (String ("then", Regular, (9,12--9,18)), (9,12--9,18))], - (9,1--9,18)), (9,0--9,19)); + [Const (String ("then", Regular, (9,12--9,18)), (9,12--9,18))], (9,1--9,18)), (9,0--9,19)); Expr (FunctionDef (SynSymbol alt, None, Args (List [], (10,8--10,10)), - [Const (String ("alt", Regular, (10,11--10,16)), (10,11--10,16))], - (10,1--10,16)), (10,0--10,17)); + [Const (String ("alt", Regular, (10,11--10,16)), (10,11--10,16))], (10,1--10,16)), (10,0--10,17)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (12,0--14,10)), If (FunctionCall (Symbol (SynSymbol condition), [], (12,5--12,14)), FunctionCall (Symbol (SynSymbol then), [], (13,5--13,9)), - Some (FunctionCall (Symbol (SynSymbol alt), [], (14,5--14,8))), - (12,1--14,9)), None, (12,0--14,10)), (12,0--14,10)); + Some (FunctionCall (Symbol (SynSymbol alt), [], (14,5--14,8))), (12,1--14,9)), None, (12,0--14,10)), + (12,0--14,10)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (12,0--14,10)), (12,0--14,10)); - Symbol (SynSymbol visp_result_todo)], (12,0--14,10)), - (12,0--14,10))], (8,0--14,10))] \ No newline at end of file + [Const (String ("%A", Regular, (12,0--14,10)), (12,0--14,10)); Symbol (SynSymbol visp_result_todo)], + (12,0--14,10)), (12,0--14,10))], (8,0--14,10))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_and-example-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_and-example-0.structured output.verified.txt index 1a4f12f..5035521 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_and-example-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_and-example-0.structured output.verified.txt @@ -4,112 +4,82 @@ (SyntaxMacro (SynMacro (SynSymbol my-and, - [SynMacroCase - ([Discard (9,4--9,5)], Const (Bool true, (9,7--9,11)), - (9,2--9,12)); + [SynMacroCase ([Discard (9,4--9,5)], Const (Bool true, (9,7--9,11)), (9,2--9,12)); SynMacroCase - ([Discard (10,4--10,5); Symbol (SynSymbol one, (10,6--10,9))], - Symbol (SynSymbol one), (10,2--10,15)); + ([Discard (10,4--10,5); Symbol (SynSymbol one, (10,6--10,9))], Symbol (SynSymbol one), (10,2--10,15)); SynMacroCase - ([Discard (11,4--11,5); - Symbol (SynSymbol cond, (11,6--11,10)); - Symbol (SynSymbol exprs, (11,11--11,16)); - Ellipsis (11,17--11,20)], + ([Discard (11,4--11,5); Symbol (SynSymbol cond, (11,6--11,10)); + Symbol (SynSymbol exprs, (11,11--11,16)); Ellipsis (11,17--11,20)], List (Paren, [Symbol (SynSymbol if); Symbol (SynSymbol cond); List - (Paren, - [Symbol (SynSymbol my-and); Symbol (SynSymbol exprs); - Ellipsis (13,20--13,23)], (13,6--13,24)); - Const (Bool false, (14,6--14,11))], (12,4--14,12)), - (11,2--15,3))], (8,1--15,3))), (8,0--15,4)); + (Paren, [Symbol (SynSymbol my-and); Symbol (SynSymbol exprs); Ellipsis (13,20--13,23)], + (13,6--13,24)); Const (Bool false, (14,6--14,11))], (12,4--14,12)), (11,2--15,3))], + (8,1--15,3))), (8,0--15,4)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("my-and %A", Regular, (17,9--17,20)), (17,9--17,20)); - SyntaxMacroCall - (SynMacroCall - (SynSymbol my-and, [Symbol (SynSymbol my-and)], - (17,22--17,28)))], (17,1--17,29)), (17,0--17,30)); + [Const (String ("my-and %A", Regular, (17,9--17,20)), (17,9--17,20)); + SyntaxMacroCall (SynMacroCall (SynSymbol my-and, [Symbol (SynSymbol my-and)], (17,22--17,28)))], + (17,1--17,29)), (17,0--17,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("my-and %A", Regular, (18,9--18,20)), (18,9--18,20)); + [Const (String ("my-and %A", Regular, (18,9--18,20)), (18,9--18,20)); SyntaxMacroCall (SynMacroCall - (SynSymbol my-and, - [Symbol (SynSymbol my-and); - Const (Bool false, (18,29--18,34))], (18,22--18,34)))], + (SynSymbol my-and, [Symbol (SynSymbol my-and); Const (Bool false, (18,29--18,34))], (18,22--18,34)))], (18,1--18,35)), (18,0--18,36)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("my-and %A", Regular, (19,9--19,20)), (19,9--19,20)); + [Const (String ("my-and %A", Regular, (19,9--19,20)), (19,9--19,20)); SyntaxMacroCall (SynMacroCall - (SynSymbol my-and, - [Symbol (SynSymbol my-and); - Const (Bool true, (19,29--19,33))], (19,22--19,33)))], + (SynSymbol my-and, [Symbol (SynSymbol my-and); Const (Bool true, (19,29--19,33))], (19,22--19,33)))], (19,1--19,34)), (19,0--19,35)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("my-and %A", Regular, (20,9--20,20)), (20,9--20,20)); + [Const (String ("my-and %A", Regular, (20,9--20,20)), (20,9--20,20)); SyntaxMacroCall (SynMacroCall (SynSymbol my-and, - [Symbol (SynSymbol my-and); - Const (Bool true, (20,29--20,33)); - Const (Bool false, (20,34--20,39))], (20,22--20,39)))], - (20,1--20,40)), (20,0--20,41)); + [Symbol (SynSymbol my-and); Const (Bool true, (20,29--20,33)); Const (Bool false, (20,34--20,39))], + (20,22--20,39)))], (20,1--20,40)), (20,0--20,41)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("my-and %A", Regular, (21,9--21,20)), (21,9--21,20)); + [Const (String ("my-and %A", Regular, (21,9--21,20)), (21,9--21,20)); SyntaxMacroCall (SynMacroCall (SynSymbol my-and, - [Symbol (SynSymbol my-and); - Const (Bool true, (21,29--21,33)); - Const (Bool true, (21,34--21,38))], (21,22--21,38)))], - (21,1--21,39)), (21,0--21,40)); + [Symbol (SynSymbol my-and); Const (Bool true, (21,29--21,33)); Const (Bool true, (21,34--21,38))], + (21,22--21,38)))], (21,1--21,39)), (21,0--21,40)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("my-and %A", Regular, (22,9--22,20)), (22,9--22,20)); + [Const (String ("my-and %A", Regular, (22,9--22,20)), (22,9--22,20)); SyntaxMacroCall (SynMacroCall (SynSymbol my-and, - [Symbol (SynSymbol my-and); - Const (Bool true, (22,29--22,33)); - Const (Bool true, (22,34--22,38)); - Const (Bool false, (22,39--22,44))], (22,22--22,44)))], - (22,1--22,45)), (22,0--22,46)); + [Symbol (SynSymbol my-and); Const (Bool true, (22,29--22,33)); Const (Bool true, (22,34--22,38)); + Const (Bool false, (22,39--22,44))], (22,22--22,44)))], (22,1--22,45)), (22,0--22,46)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (23,0--23,45)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("my-and %A", Regular, (23,9--23,20)), (23,9--23,20)); + [Const (String ("my-and %A", Regular, (23,9--23,20)), (23,9--23,20)); SyntaxMacroCall (SynMacroCall (SynSymbol my-and, - [Symbol (SynSymbol my-and); - Const (Bool true, (23,29--23,33)); - Const (Bool true, (23,34--23,38)); - Const (Bool true, (23,39--23,43))], (23,22--23,43)))], - (23,1--23,44)), None, (23,0--23,45)), (23,0--23,45)); + [Symbol (SynSymbol my-and); Const (Bool true, (23,29--23,33)); Const (Bool true, (23,34--23,38)); + Const (Bool true, (23,39--23,43))], (23,22--23,43)))], (23,1--23,44)), None, (23,0--23,45)), + (23,0--23,45)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (23,0--23,45)), (23,0--23,45)); - Symbol (SynSymbol visp_result_todo)], (23,0--23,45)), - (23,0--23,45))], (8,0--23,45))] \ No newline at end of file + [Const (String ("%A", Regular, (23,0--23,45)), (23,0--23,45)); Symbol (SynSymbol visp_result_todo)], + (23,0--23,45)), (23,0--23,45))], (8,0--23,45))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_bar-parens-in-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_bar-parens-in-macro-0.structured output.verified.txt index 12e9d70..c32a925 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_bar-parens-in-macro-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_bar-parens-in-macro-0.structured output.verified.txt @@ -5,13 +5,10 @@ (SynMacro (SynSymbol MyBegin, [SynMacroCase - ([Discard (9,4--9,5); Symbol (SynSymbol exprs, (9,6--9,11)); - Ellipsis (9,12--9,15)], + ([Discard (9,4--9,5); Symbol (SynSymbol exprs, (9,6--9,11)); Ellipsis (9,12--9,15)], List - (Paren, - [Symbol (SynSymbol begin); Symbol (SynSymbol exprs); - Ellipsis (10,17--10,20)], (10,4--10,21)), (9,2--11,3))], - (8,1--11,3))), (8,0--11,4)); + (Paren, [Symbol (SynSymbol begin); Symbol (SynSymbol exprs); Ellipsis (10,17--10,20)], + (10,4--10,21)), (9,2--11,3))], (8,1--11,3))), (8,0--11,4)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (13,0--13,21)), @@ -21,13 +18,11 @@ [Symbol (SynSymbol MyBegin); List (ParenBar, - [Const (Int32 1, (13,12--13,13)); - Const (Int32 2, (13,14--13,15)); - Const (Int32 3, (13,16--13,17))], (13,9--13,20))], - (13,1--13,20))), None, (13,0--13,21)), (13,0--13,21)); + [Const (Int32 1, (13,12--13,13)); Const (Int32 2, (13,14--13,15)); + Const (Int32 3, (13,16--13,17))], (13,9--13,20))], (13,1--13,20))), None, (13,0--13,21)), + (13,0--13,21)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (13,0--13,21)), (13,0--13,21)); - Symbol (SynSymbol visp_result_todo)], (13,0--13,21)), - (13,0--13,21))], (8,0--13,21))] \ No newline at end of file + [Const (String ("%A", Regular, (13,0--13,21)), (13,0--13,21)); Symbol (SynSymbol visp_result_todo)], + (13,0--13,21)), (13,0--13,21))], (8,0--13,21))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_chars-in-macros-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_chars-in-macros-0.structured output.verified.txt index d05444e..3f6554d 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_chars-in-macros-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_chars-in-macros-0.structured output.verified.txt @@ -5,19 +5,14 @@ (SynMacro (SynSymbol PrintChars, [SynMacroCase - ([Discard (9,4--9,5); Symbol (SynSymbol body, (9,6--9,10)); - Ellipsis (9,11--9,14)], + ([Discard (9,4--9,5); Symbol (SynSymbol body, (9,6--9,10)); Ellipsis (9,11--9,14)], List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("Values: %A", Regular, (10,13--10,25)), - (10,13--10,25)); + Const (String ("Values: %A", Regular, (10,13--10,25)), (10,13--10,25)); List - (Paren, - [Symbol (SynSymbol !list); Symbol (SynSymbol body); - Ellipsis (10,38--10,41)], (10,26--10,42))], - (10,4--10,43)), (9,2--11,3))], (8,1--11,3))), (8,0--11,4)); + (Paren, [Symbol (SynSymbol !list); Symbol (SynSymbol body); Ellipsis (10,38--10,41)], + (10,26--10,42))], (10,4--10,43)), (9,2--11,3))], (8,1--11,3))), (8,0--11,4)); Expr (SyntaxMacroCall (SynMacroCall @@ -25,45 +20,35 @@ [Symbol (SynSymbol PrintChars); List (Paren, - [Const (Char 'a', (13,13--13,16)); - Trivia (Dot, (13,17--13,19)); - Const (Char '=', (13,19--13,22)); - Trivia (Dot, (13,23--13,25)); - Const (Char 'B', (13,25--13,28)); - Trivia (Dot, (13,29--13,31)); - Const (Char '\010', (13,31--13,40)); - Trivia (Dot, (13,41--13,43)); - Const (Char ' ', (13,43--13,50)); - Trivia (Dot, (13,51--13,53)); - Const (Char '\009', (13,53--13,58))], (13,12--13,59))], - (13,1--13,59))), (13,0--13,60)); + [Const (Char 'a', (13,13--13,16)); Trivia (Dot, (13,17--13,19)); Const (Char '=', (13,19--13,22)); + Trivia (Dot, (13,23--13,25)); Const (Char 'B', (13,25--13,28)); Trivia (Dot, (13,29--13,31)); + Const (Char '\010', (13,31--13,40)); Trivia (Dot, (13,41--13,43)); Const (Char ' ', (13,43--13,50)); + Trivia (Dot, (13,51--13,53)); Const (Char '\009', (13,53--13,58))], (13,12--13,59))], (13,1--13,59))), + (13,0--13,60)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (15,9--15,13)), (15,9--15,13)); - Const (Char 'a', (15,14--15,17))], (15,1--15,17)), (15,0--15,18)); + [Const (String ("%A", Regular, (15,9--15,13)), (15,9--15,13)); Const (Char 'a', (15,14--15,17))], + (15,1--15,17)), (15,0--15,18)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (16,9--16,13)), (16,9--16,13)); - Const (Char '\010', (16,14--16,23))], (16,1--16,23)), - (16,0--16,24)); + [Const (String ("%A", Regular, (16,9--16,13)), (16,9--16,13)); Const (Char '\010', (16,14--16,23))], + (16,1--16,23)), (16,0--16,24)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,9--17,13)), (17,9--17,13)); - Const (Char ' ', (17,14--17,21))], (17,1--17,21)), (17,0--17,22)); + [Const (String ("%A", Regular, (17,9--17,13)), (17,9--17,13)); Const (Char ' ', (17,14--17,21))], + (17,1--17,21)), (17,0--17,22)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (18,0--18,20)), FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (18,9--18,13)), (18,9--18,13)); - Const (Char '\009', (18,14--18,19))], (18,1--18,19)), None, - (18,0--18,20)), (18,0--18,20)); + [Const (String ("%A", Regular, (18,9--18,13)), (18,9--18,13)); Const (Char '\009', (18,14--18,19))], + (18,1--18,19)), None, (18,0--18,20)), (18,0--18,20)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (18,0--18,20)), (18,0--18,20)); - Symbol (SynSymbol visp_result_todo)], (18,0--18,20)), - (18,0--18,20))], (8,0--18,20))] \ No newline at end of file + [Const (String ("%A", Regular, (18,0--18,20)), (18,0--18,20)); Symbol (SynSymbol visp_result_todo)], + (18,0--18,20)), (18,0--18,20))], (8,0--18,20))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-0.structured output.verified.txt index 228eefb..0f8af3e 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-0.structured output.verified.txt @@ -9,27 +9,19 @@ List (Paren, [Symbol (SynSymbol failwith); - Const - (String ("unreachable cond", Regular, (9,17--9,35)), - (9,17--9,35))], (9,7--9,36)), (9,2--9,37)); + Const (String ("unreachable cond", Regular, (9,17--9,35)), (9,17--9,35))], (9,7--9,36)), + (9,2--9,37)); SynMacroCase - ([Discard (10,4--10,5); Symbol (SynSymbol one, (10,6--10,9))], - Symbol (SynSymbol one), (10,2--10,15)); + ([Discard (10,4--10,5); Symbol (SynSymbol one, (10,6--10,9))], Symbol (SynSymbol one), (10,2--10,15)); SynMacroCase - ([Discard (11,4--11,5); Symbol (SynSymbol var, (11,6--11,9)); - Symbol (SynSymbol body, (11,10--11,14)); - Symbol (SynSymbol exprs, (11,15--11,20)); - Ellipsis (11,21--11,24)], + ([Discard (11,4--11,5); Symbol (SynSymbol var, (11,6--11,9)); Symbol (SynSymbol body, (11,10--11,14)); + Symbol (SynSymbol exprs, (11,15--11,20)); Ellipsis (11,21--11,24)], List (Paren, - [Symbol (SynSymbol if); Symbol (SynSymbol var); - Symbol (SynSymbol body); + [Symbol (SynSymbol if); Symbol (SynSymbol var); Symbol (SynSymbol body); List - (Paren, - [Symbol (SynSymbol my-cond); Symbol (SynSymbol exprs); - Ellipsis (14,21--14,24)], (14,6--14,25))], - (12,4--14,26)), (11,2--15,3))], (8,1--15,3))), - (8,0--15,4)); + (Paren, [Symbol (SynSymbol my-cond); Symbol (SynSymbol exprs); Ellipsis (14,21--14,24)], + (14,6--14,25))], (12,4--14,26)), (11,2--15,3))], (8,1--15,3))), (8,0--15,4)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (17,0--23,6)), @@ -38,20 +30,14 @@ (SynSymbol my-cond, [Symbol (SynSymbol my-cond); List - (Paren, - [Symbol (SynSymbol >); Const (Int32 0, (18,5--18,6)); - Const (Int32 0, (18,7--18,8))], (18,2--18,9)); - Const (Int32 1, (19,4--19,5)); + (Paren, [Symbol (SynSymbol >); Const (Int32 0, (18,5--18,6)); Const (Int32 0, (18,7--18,8))], + (18,2--18,9)); Const (Int32 1, (19,4--19,5)); List - (Paren, - [Symbol (SynSymbol <); Const (Int32 0, (20,5--20,6)); - Const (Int32 0, (20,7--20,8))], (20,2--20,9)); - Const (Int32 2, (21,4--21,5)); Keyword (SynKeyword :else); - Const (Int32 3, (23,4--23,5))], (17,1--23,5))), None, - (17,0--23,6)), (17,0--23,6)); + (Paren, [Symbol (SynSymbol <); Const (Int32 0, (20,5--20,6)); Const (Int32 0, (20,7--20,8))], + (20,2--20,9)); Const (Int32 2, (21,4--21,5)); Keyword (SynKeyword :else); + Const (Int32 3, (23,4--23,5))], (17,1--23,5))), None, (17,0--23,6)), (17,0--23,6)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,0--23,6)), (17,0--23,6)); - Symbol (SynSymbol visp_result_todo)], (17,0--23,6)), (17,0--23,6))], - (8,0--23,6))] \ No newline at end of file + [Const (String ("%A", Regular, (17,0--23,6)), (17,0--23,6)); Symbol (SynSymbol visp_result_todo)], + (17,0--23,6)), (17,0--23,6))], (8,0--23,6))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-1.structured output.verified.txt index 2bc0c13..a2166e0 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_cond-macro-1.structured output.verified.txt @@ -9,52 +9,39 @@ List (Paren, [Symbol (SynSymbol failwith); - Const - (String ("unbalanced cond", Regular, (9,17--9,34)), - (9,17--9,34))], (9,7--9,35)), (9,2--9,36)); + Const (String ("unbalanced cond", Regular, (9,17--9,34)), (9,17--9,34))], (9,7--9,35)), + (9,2--9,36)); SynMacroCase ([Discard (10,4--10,5); List - ([List - ([Symbol (SynSymbol ?discard, (10,8--10,16))], - (10,7--10,17)); - Symbol (SynSymbol body, (10,18--10,22)); - Ellipsis (10,23--10,26)], (10,6--10,27))], + ([List ([Symbol (SynSymbol ?discard, (10,8--10,16))], (10,7--10,17)); + Symbol (SynSymbol body, (10,18--10,22)); Ellipsis (10,23--10,26)], (10,6--10,27))], List (Paren, [Symbol (SynSymbol if); Const (Bool true, (11,8--11,12)); List - (Paren, - [Symbol (SynSymbol begin); Symbol (SynSymbol body); - Ellipsis (12,18--12,21)], (12,6--12,22)); + (Paren, [Symbol (SynSymbol begin); Symbol (SynSymbol body); Ellipsis (12,18--12,21)], + (12,6--12,22)); List (Paren, [Symbol (SynSymbol failwith); - Const - (String ("unreachable", Regular, (13,16--13,29)), - (13,16--13,29))], (13,6--13,30))], (11,4--13,31)), - (10,2--14,3)); + Const (String ("unreachable", Regular, (13,16--13,29)), (13,16--13,29))], (13,6--13,30))], + (11,4--13,31)), (10,2--14,3)); SynMacroCase ([Discard (15,4--15,5); List - ([Symbol (SynSymbol test, (15,7--15,11)); - Symbol (SynSymbol body, (15,12--15,16)); - Ellipsis (15,17--15,20)], (15,6--15,21)); - Symbol (SynSymbol rest, (15,22--15,26)); + ([Symbol (SynSymbol test, (15,7--15,11)); Symbol (SynSymbol body, (15,12--15,16)); + Ellipsis (15,17--15,20)], (15,6--15,21)); Symbol (SynSymbol rest, (15,22--15,26)); Ellipsis (15,27--15,30)], List (Paren, [Symbol (SynSymbol if); Symbol (SynSymbol test); List - (Paren, - [Symbol (SynSymbol begin); Symbol (SynSymbol body); - Ellipsis (17,18--17,21)], (17,6--17,22)); + (Paren, [Symbol (SynSymbol begin); Symbol (SynSymbol body); Ellipsis (17,18--17,21)], + (17,6--17,22)); List - (Paren, - [Symbol (SynSymbol my-cond_); Symbol (SynSymbol rest); - Ellipsis (18,21--18,24)], (18,6--18,25))], - (16,4--18,26)), (15,2--19,3))], (8,1--19,3))), - (8,0--20,1)); + (Paren, [Symbol (SynSymbol my-cond_); Symbol (SynSymbol rest); Ellipsis (18,21--18,24)], + (18,6--18,25))], (16,4--18,26)), (15,2--19,3))], (8,1--19,3))), (8,0--20,1)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (22,0--35,1)), @@ -65,59 +52,45 @@ List (Bracket, [List - (Paren, - [Symbol (SynSymbol >); Const (Int32 0, (23,6--23,7)); - Const (Int32 1, (23,8--23,9))], (23,3--23,10)); + (Paren, [Symbol (SynSymbol >); Const (Int32 0, (23,6--23,7)); Const (Int32 1, (23,8--23,9))], + (23,3--23,10)); List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("body here1", Regular, (24,13--24,25)), - (24,13--24,25))], (24,4--24,26)); + Const (String ("body here1", Regular, (24,13--24,25)), (24,13--24,25))], (24,4--24,26)); List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("body here2", Regular, (25,13--25,25)), - (25,13--25,25))], (25,4--25,26)); + Const (String ("body here2", Regular, (25,13--25,25)), (25,13--25,25))], (25,4--25,26)); Const (Unit, (26,4--26,6))], (23,2--26,7)); List (Bracket, [List - (Paren, - [Symbol (SynSymbol <); Const (Int32 1, (27,6--27,7)); - Const (Int32 0, (27,8--27,9))], (27,3--27,10)); + (Paren, [Symbol (SynSymbol <); Const (Int32 1, (27,6--27,7)); Const (Int32 0, (27,8--27,9))], + (27,3--27,10)); List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("here1", Regular, (28,13--28,20)), - (28,13--28,20))], (28,4--28,21)); + Const (String ("here1", Regular, (28,13--28,20)), (28,13--28,20))], (28,4--28,21)); List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("here2", Regular, (29,13--29,20)), - (29,13--29,20))], (29,4--29,21))], (27,2--30,3)); + Const (String ("here2", Regular, (29,13--29,20)), (29,13--29,20))], (29,4--29,21))], + (27,2--30,3)); List (Bracket, [Discard (31,3--31,4); List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("default1", Regular, (32,13--32,23)), - (32,13--32,23))], (32,4--32,24)); + Const (String ("default1", Regular, (32,13--32,23)), (32,13--32,23))], (32,4--32,24)); List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("default2", Regular, (33,13--33,23)), - (33,13--33,23))], (33,4--33,24))], (31,2--34,5))], - (22,1--34,5))), None, (22,0--35,1)), (22,0--35,1)); + Const (String ("default2", Regular, (33,13--33,23)), (33,13--33,23))], (33,4--33,24))], + (31,2--34,5))], (22,1--34,5))), None, (22,0--35,1)), (22,0--35,1)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (22,0--35,1)), (22,0--35,1)); - Symbol (SynSymbol visp_result_todo)], (22,0--35,1)), (22,0--35,1))], - (8,0--35,1))] \ No newline at end of file + [Const (String ("%A", Regular, (22,0--35,1)), (22,0--35,1)); Symbol (SynSymbol visp_result_todo)], + (22,0--35,1)), (22,0--35,1))], (8,0--35,1))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_count-exprs-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_count-exprs-0.structured output.verified.txt index fba5349..619a4d9 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_count-exprs-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_count-exprs-0.structured output.verified.txt @@ -4,53 +4,39 @@ (SyntaxMacro (SynMacro (SynSymbol CountExprsExampleTest1, - [SynMacroCase - ([Discard (9,4--9,5)], Const (Int32 0, (9,7--9,8)), - (9,2--9,9)); + [SynMacroCase ([Discard (9,4--9,5)], Const (Int32 0, (9,7--9,8)), (9,2--9,9)); SynMacroCase - ([Discard (10,4--10,5); Discard (10,6--10,7)], - Const (Int32 1, (10,9--10,10)), (10,2--10,11)); + ([Discard (10,4--10,5); Discard (10,6--10,7)], Const (Int32 1, (10,9--10,10)), (10,2--10,11)); SynMacroCase - ([Discard (11,4--11,5); - Symbol (SynSymbol head, (11,6--11,10)); - Symbol (SynSymbol tail, (11,11--11,15)); - Ellipsis (11,16--11,19)], + ([Discard (11,4--11,5); Symbol (SynSymbol head, (11,6--11,10)); + Symbol (SynSymbol tail, (11,11--11,15)); Ellipsis (11,16--11,19)], List (Paren, [Symbol (SynSymbol +); Const (Int32 1, (12,7--12,8)); List (Paren, - [Symbol (SynSymbol CountExprsExampleTest1); - Symbol (SynSymbol tail); Ellipsis (12,38--12,41)], - (12,9--12,42))], (12,4--12,43)), (11,2--12,44))], - (8,1--12,44))), (8,0--13,1)); + [Symbol (SynSymbol CountExprsExampleTest1); Symbol (SynSymbol tail); Ellipsis (12,38--12,41)], + (12,9--12,42))], (12,4--12,43)), (11,2--12,44))], (8,1--12,44))), (8,0--13,1)); Expr (LetOrUse (Named (SynSymbol exprCount, (15,5--15,14)), SyntaxMacroCall (SynMacroCall (SynSymbol CountExprsExampleTest1, - [Symbol (SynSymbol CountExprsExampleTest1); - List (Bracket, [], (15,39--15,41)); - List (Bracket, [], (15,42--15,44)); - List (Bracket, [], (15,45--15,47)); - List (Bracket, [], (15,48--15,50)); - List (Bracket, [], (15,51--15,53)); - List (Bracket, [], (15,54--15,56)); - List (Bracket, [], (15,57--15,59))], (15,16--15,59))), None, + [Symbol (SynSymbol CountExprsExampleTest1); List (Bracket, [], (15,39--15,41)); + List (Bracket, [], (15,42--15,44)); List (Bracket, [], (15,45--15,47)); + List (Bracket, [], (15,48--15,50)); List (Bracket, [], (15,51--15,53)); + List (Bracket, [], (15,54--15,56)); List (Bracket, [], (15,57--15,59))], (15,16--15,59))), None, (15,1--15,60)), (15,0--15,61)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (17,0--17,31)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("exprs: %A", Regular, (17,9--17,20)), (17,9--17,20)); - Symbol (SynSymbol exprCount)], (17,1--17,30)), None, - (17,0--17,31)), (17,0--17,31)); + [Const (String ("exprs: %A", Regular, (17,9--17,20)), (17,9--17,20)); Symbol (SynSymbol exprCount)], + (17,1--17,30)), None, (17,0--17,31)), (17,0--17,31)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,0--17,31)), (17,0--17,31)); - Symbol (SynSymbol visp_result_todo)], (17,0--17,31)), - (17,0--17,31))], (8,0--17,31))] \ No newline at end of file + [Const (String ("%A", Regular, (17,0--17,31)), (17,0--17,31)); Symbol (SynSymbol visp_result_todo)], + (17,0--17,31)), (17,0--17,31))], (8,0--17,31))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_macro-lambda-shorthand-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_macro-lambda-shorthand-0.structured output.verified.txt index 8197be2..f2e4d09 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_macro-lambda-shorthand-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_macro-lambda-shorthand-0.structured output.verified.txt @@ -8,23 +8,14 @@ (Collection (SynCollection (FsList, - [Const (Int32 1, (8,8--8,9)); - Const (Int32 2, (8,10--8,11)); - Const (Int32 3, (8,12--8,13)); - Const (Int32 4, (8,14--8,15)); - Const (Int32 5, (8,16--8,17)); - Const (Int32 6, (8,18--8,19)); - Const (Int32 7, (8,20--8,21)); - Const (Int32 8, (8,22--8,23)); - Const (Int32 9, (8,24--8,25)); - Const (Int32 10, (8,26--8,28))], (8,5--8,31))), - (8,5--8,31)); + [Const (Int32 1, (8,8--8,9)); Const (Int32 2, (8,10--8,11)); Const (Int32 3, (8,12--8,13)); + Const (Int32 4, (8,14--8,15)); Const (Int32 5, (8,16--8,17)); Const (Int32 6, (8,18--8,19)); + Const (Int32 7, (8,20--8,21)); Const (Int32 8, (8,22--8,23)); Const (Int32 9, (8,24--8,25)); + Const (Int32 10, (8,26--8,28))], (8,5--8,31))), (8,5--8,31)); Expr (LambdaShort (Begin - ([LetOrUse - (Named (SynSymbol lst, (10,9--10,12)), - Symbol (SynSymbol %1), None, (10,5--10,15)); + ([LetOrUse (Named (SynSymbol lst, (10,9--10,12)), Symbol (SynSymbol %1), None, (10,5--10,15)); SyntaxMacroCall (SynMacroCall (SynSymbol cond_, @@ -40,25 +31,17 @@ [Symbol (SynSymbol and); List (Paren, - [Symbol (SynSymbol >); - Symbol (SynSymbol %1); - Const - (Int32 1, (14,16--14,17))], - (14,10--14,18)); + [Symbol (SynSymbol >); Symbol (SynSymbol %1); + Const (Int32 1, (14,16--14,17))], (14,10--14,18)); List (Paren, - [Symbol (SynSymbol <); - Symbol (SynSymbol %1); - Const - (Int32 10, (15,16--15,18))], - (15,10--15,19))], (13,21--16,9)); - Symbol (SynSymbol lst)], (13,8--16,14))], - (12,6--17,7))], (11,5--17,7)))], Begin, - (9,4--17,8)), (9,2--17,9)), (9,2--17,9))], (8,1--17,9)), - None, (8,0--18,1)), (8,0--18,1)); + [Symbol (SynSymbol <); Symbol (SynSymbol %1); + Const (Int32 10, (15,16--15,18))], (15,10--15,19))], (13,21--16,9)); + Symbol (SynSymbol lst)], (13,8--16,14))], (12,6--17,7))], (11,5--17,7)))], + Begin, (9,4--17,8)), (9,2--17,9)), (9,2--17,9))], (8,1--17,9)), None, (8,0--18,1)), + (8,0--18,1)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (8,0--18,1)), (8,0--18,1)); - Symbol (SynSymbol visp_result_todo)], (8,0--18,1)), (8,0--18,1))], - (8,0--18,1))] \ No newline at end of file + [Const (String ("%A", Regular, (8,0--18,1)), (8,0--18,1)); Symbol (SynSymbol visp_result_todo)], + (8,0--18,1)), (8,0--18,1))], (8,0--18,1))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_my-rinit-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_my-rinit-0.structured output.verified.txt index f50b99c..d4d3ad3 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_my-rinit-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_my-rinit-0.structured output.verified.txt @@ -10,13 +10,9 @@ (SynSymbol this.Stuff, Args (List [], (13,23--13,25)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("doing stuff %A", Regular, (14,13--14,29)), - (14,13--14,29)); - DotProperty - (Symbol (SynSymbol this), SynSymbol src, (14,31--14,40))], - (14,5--14,41))], (13,3--14,42))], [], (8,1--14,43)), - (8,0--15,1)); + [Const (String ("doing stuff %A", Regular, (14,13--14,29)), (14,13--14,29)); + DotProperty (Symbol (SynSymbol this), SynSymbol src, (14,31--14,40))], (14,5--14,41))], + (13,3--14,42))], [], (8,1--14,43)), (8,0--15,1)); Expr (SyntaxMacro (SynMacro @@ -24,21 +20,15 @@ [SynMacroCase ([Discard (18,4--18,5); List - ([Symbol (SynSymbol sym, (18,7--18,10)); - Symbol (SynSymbol val, (18,11--18,14))], (18,6--18,15)); - List - ([Symbol (SynSymbol s, (18,17--18,18)); - Symbol (SynSymbol v, (18,19--18,20))], (18,16--18,21)); + ([Symbol (SynSymbol sym, (18,7--18,10)); Symbol (SynSymbol val, (18,11--18,14))], (18,6--18,15)); + List ([Symbol (SynSymbol s, (18,17--18,18)); Symbol (SynSymbol v, (18,19--18,20))], (18,16--18,21)); Ellipsis (18,22--18,25)], List (BraceBar, [Symbol (SynSymbol sym); Symbol (SynSymbol val); List - (Paren, - [Symbol (SynSymbol m-alternate); Symbol (SynSymbol s); - Symbol (SynSymbol v)], (19,15--19,32))], - (19,4--19,35)), (18,2--20,3))], (17,1--20,3))), - (17,0--20,4)); + (Paren, [Symbol (SynSymbol m-alternate); Symbol (SynSymbol s); Symbol (SynSymbol v)], + (19,15--19,32))], (19,4--19,35)), (18,2--20,3))], (17,1--20,3))), (17,0--20,4)); Expr (LetOrUse (Named (SynSymbol temp, (22,5--22,9)), @@ -46,36 +36,21 @@ (SynMacroCall (SynSymbol MyRinit, [Symbol (SynSymbol MyRinit); - List - (Bracket, - [Symbol (SynSymbol src); Const (Int32 1, (22,24--22,25))], - (22,19--22,26)); - List - (Bracket, - [Symbol (SynSymbol Mapping.dest); - Const (Int32 2, (22,41--22,42))], (22,27--22,43)); - List - (Bracket, - [Symbol (SynSymbol range); - Const (Int32 3, (22,51--22,52))], (22,44--22,53))], + List (Bracket, [Symbol (SynSymbol src); Const (Int32 1, (22,24--22,25))], (22,19--22,26)); + List (Bracket, [Symbol (SynSymbol Mapping.dest); Const (Int32 2, (22,41--22,42))], (22,27--22,43)); + List (Bracket, [Symbol (SynSymbol range); Const (Int32 3, (22,51--22,52))], (22,44--22,53))], (22,11--22,53))), None, (22,1--22,54)), (22,0--22,55)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Record is %A", Regular, (23,9--23,23)), (23,9--23,23)); - Symbol (SynSymbol temp)], (23,1--23,28)), (23,0--23,29)); - Expr - (DotMethod - (Symbol (SynSymbol temp), SynSymbol Stuff, [], Tuple, (24,1--24,12)), - (24,0--24,13)); + [Const (String ("Record is %A", Regular, (23,9--23,23)), (23,9--23,23)); Symbol (SynSymbol temp)], + (23,1--23,28)), (23,0--23,29)); + Expr (DotMethod (Symbol (SynSymbol temp), SynSymbol Stuff, [], Tuple, (24,1--24,12)), (24,0--24,13)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (26,0--26,2)), - Const (Unit, (26,0--26,2)), None, (26,0--26,2)), (26,0--26,2)); + (LetOrUse (Named (SynSymbol visp_result_todo, (26,0--26,2)), Const (Unit, (26,0--26,2)), None, (26,0--26,2)), + (26,0--26,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (26,0--26,2)), (26,0--26,2)); - Symbol (SynSymbol visp_result_todo)], (26,0--26,2)), (26,0--26,2))], - (8,0--26,2))] \ No newline at end of file + [Const (String ("%A", Regular, (26,0--26,2)), (26,0--26,2)); Symbol (SynSymbol visp_result_todo)], + (26,0--26,2)), (26,0--26,2))], (8,0--26,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-0.structured output.verified.txt index 7b25b6c..64fa939 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-0.structured output.verified.txt @@ -2,10 +2,8 @@ [AnonModule ([Expr (TypeAlias - (SynSymbol Grid, - Generic - (Ident array, [Generic (Ident array, [Ident char], (8,20--8,31))], - (8,14--8,32)), (8,1--8,32)), (8,0--8,33)); + (SynSymbol Grid, Generic (Ident array, [Generic (Ident array, [Ident char], (8,20--8,31))], (8,14--8,32)), + (8,1--8,32)), (8,0--8,33)); Expr (SyntaxMacroCall (SynMacroCall @@ -14,81 +12,53 @@ List (Paren, [List - (Bracket, - [Symbol (SynSymbol x); Trivia (Colon, (10,15--10,17)); - Symbol (SynSymbol int32)], (10,13--10,23)); + (Bracket, [Symbol (SynSymbol x); Trivia (Colon, (10,15--10,17)); Symbol (SynSymbol int32)], + (10,13--10,23)); List - (Bracket, - [Symbol (SynSymbol y); Trivia (Colon, (10,26--10,28)); - Symbol (SynSymbol int32)], (10,24--10,34))], - (10,12--10,35)); + (Bracket, [Symbol (SynSymbol y); Trivia (Colon, (10,26--10,28)); Symbol (SynSymbol int32)], + (10,24--10,34))], (10,12--10,35)); + List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.X); Symbol (SynSymbol x)], (11,2--11,16)); + List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); Symbol (SynSymbol y)], (12,2--12,16)); List (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.X); - Symbol (SynSymbol x)], (11,2--11,16)); - List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); - Symbol (SynSymbol y)], (12,2--12,16)); - List - (Paren, - [Symbol (SynSymbol override); Symbol (SynSymbol fn); - Symbol (SynSymbol _.ToString); Const (Unit, (14,26--14,28)); + [Symbol (SynSymbol override); Symbol (SynSymbol fn); Symbol (SynSymbol _.ToString); + Const (Unit, (14,26--14,28)); List (Paren, [Symbol (SynSymbol sprintf); - Const - (String - ("Pos(x: %A, y: %A)", Regular, (15,13--15,32)), - (15,13--15,32)); Symbol (SynSymbol x); - Symbol (SynSymbol y)], (15,4--15,37))], (14,2--16,3))], - (10,1--16,3))), (10,0--17,1)); + Const (String ("Pos(x: %A, y: %A)", Regular, (15,13--15,32)), (15,13--15,32)); + Symbol (SynSymbol x); Symbol (SynSymbol y)], (15,4--15,37))], (14,2--16,3))], (10,1--16,3))), + (10,0--17,1)); Expr (Type (SynSymbol TileMap, Args (Tuple - [Typed - (Named (SynSymbol grid, (19,16--19,20)), Ident Grid, - (19,15--19,27)); Trivia (Comma, (19,14--19,15)); - Typed - (Named (SynSymbol start, (19,29--19,34)), Ident Pos, - (19,28--19,40))], (19,14--19,41)), - [Let - (Named (SynSymbol grid, (20,7--20,11)), Symbol (SynSymbol grid), - (20,3--20,16)); - Let - (Named (SynSymbol start, (21,7--21,12)), - Symbol (SynSymbol start), (21,3--21,18)); + [Typed (Named (SynSymbol grid, (19,16--19,20)), Ident Grid, (19,15--19,27)); + Trivia (Comma, (19,14--19,15)); + Typed (Named (SynSymbol start, (19,29--19,34)), Ident Pos, (19,28--19,40))], (19,14--19,41)), + [Let (Named (SynSymbol grid, (20,7--20,11)), Symbol (SynSymbol grid), (20,3--20,16)); + Let (Named (SynSymbol start, (21,7--21,12)), Symbol (SynSymbol start), (21,3--21,18)); OverrideFn (SynSymbol _.ToString, Args (List [], (22,25--22,27)), [FunctionCall (Symbol (SynSymbol sprintf), - [Const - (String ("TileMap(%A)\n%A", Regular, (23,13--23,30)), - (23,13--23,30)); Symbol (SynSymbol start); - Symbol (SynSymbol grid)], (23,5--23,41))], (22,3--23,42)); - Member - (SynSymbol _.Start, Symbol (SynSymbol start), (26,3--26,23)); + [Const (String ("TileMap(%A)\n%A", Regular, (23,13--23,30)), (23,13--23,30)); + Symbol (SynSymbol start); Symbol (SynSymbol grid)], (23,5--23,41))], (22,3--23,42)); + Member (SynSymbol _.Start, Symbol (SynSymbol start), (26,3--26,23)); GetSet (SynSymbol _.Item, Some (SynMemberGet (Args - (Tuple - [Typed - (Named (SynSymbol pos, (29,11--29,14)), Ident Pos, - (29,10--29,20))], (29,9--29,21)), + (Tuple [Typed (Named (SynSymbol pos, (29,11--29,14)), Ident Pos, (29,10--29,20))], + (29,9--29,21)), [LetOrUse (Named (SynSymbol y, (30,11--30,12)), - DotProperty - (Symbol (SynSymbol pos), SynSymbol Y, - (30,14--30,20)), None, (30,7--30,21)); + DotProperty (Symbol (SynSymbol pos), SynSymbol Y, (30,14--30,20)), None, (30,7--30,21)); LetOrUse (Named (SynSymbol x, (31,11--31,12)), - DotProperty - (Symbol (SynSymbol pos), SynSymbol X, - (31,14--31,20)), None, (31,7--31,21)); + DotProperty (Symbol (SynSymbol pos), SynSymbol X, (31,14--31,20)), None, (31,7--31,21)); SyntaxMacroCall (SynMacroCall (SynSymbol cond_, @@ -103,87 +73,57 @@ [Symbol (SynSymbol and); List (Paren, - [Symbol (SynSymbol >=); - Symbol (SynSymbol y); - Const (Int32 0, (34,25--34,26))], - (34,19--34,27)); + [Symbol (SynSymbol >=); Symbol (SynSymbol y); + Const (Int32 0, (34,25--34,26))], (34,19--34,27)); List (Paren, - [Symbol (SynSymbol <); - Symbol (SynSymbol y); + [Symbol (SynSymbol <); Symbol (SynSymbol y); List - (Paren, - [Symbol (SynSymbol +Length); - Symbol (SynSymbol grid)], - (34,33--34,47))], - (34,28--34,48))], (34,14--34,49)); + (Paren, [Symbol (SynSymbol +Length); Symbol (SynSymbol grid)], + (34,33--34,47))], (34,28--34,48))], (34,14--34,49)); List (Paren, [Symbol (SynSymbol and); List (Paren, - [Symbol (SynSymbol >=); - Symbol (SynSymbol x); - Const (Int32 0, (35,25--35,26))], - (35,19--35,27)); + [Symbol (SynSymbol >=); Symbol (SynSymbol x); + Const (Int32 0, (35,25--35,26))], (35,19--35,27)); List (Paren, - [Symbol (SynSymbol <); - Symbol (SynSymbol x); + [Symbol (SynSymbol <); Symbol (SynSymbol x); List (Paren, [Symbol (SynSymbol +Length); List (Paren, [List - (DotBracket, - [Const - (Int32 0, - (35,45--35,46))], - (35,43--35,47)); - Symbol (SynSymbol grid)], - (35,42--35,53))], - (35,33--35,54))], - (35,28--35,55))], (35,14--35,56))], - (34,9--35,57)); + (DotBracket, [Const (Int32 0, (35,45--35,46))], (35,43--35,47)); + Symbol (SynSymbol grid)], (35,42--35,53))], (35,33--35,54))], + (35,28--35,55))], (35,14--35,56))], (34,9--35,57)); List (Paren, - [Symbol (SynSymbol let); - Symbol (SynSymbol row); + [Symbol (SynSymbol let); Symbol (SynSymbol row); List (Paren, - [List - (DotBracket, [Symbol (SynSymbol y)], - (37,20--37,24)); - Symbol (SynSymbol grid)], - (37,19--37,30))], (37,10--37,31)); + [List (DotBracket, [Symbol (SynSymbol y)], (37,20--37,24)); + Symbol (SynSymbol grid)], (37,19--37,30))], (37,10--37,31)); List (Paren, [Symbol (SynSymbol Some); List (Paren, - [List - (DotBracket, [Symbol (SynSymbol x)], - (38,17--38,21)); - Symbol (SynSymbol row)], - (38,16--38,26))], (38,10--38,27))], - (34,8--39,9)); - List - (Bracket, - [Discard (40,9--40,10); - Symbol (SynSymbol None)], (40,8--40,16))], - (33,7--40,16)))], (29,4--40,18))), None, - (28,3--40,18))], [], (19,1--41,3)), (19,0--41,4)); + [List (DotBracket, [Symbol (SynSymbol x)], (38,17--38,21)); + Symbol (SynSymbol row)], (38,16--38,26))], (38,10--38,27))], (34,8--39,9)); + List (Bracket, [Discard (40,9--40,10); Symbol (SynSymbol None)], (40,8--40,16))], + (33,7--40,16)))], (29,4--40,18))), None, (28,3--40,18))], [], (19,1--41,3)), (19,0--41,4)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (43,0--43,14)), FunctionCall - (Symbol (SynSymbol printfn), - [Const (String ("OK", Regular, (43,9--43,13)), (43,9--43,13))], + (Symbol (SynSymbol printfn), [Const (String ("OK", Regular, (43,9--43,13)), (43,9--43,13))], (43,1--43,13)), None, (43,0--43,14)), (43,0--43,14)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (43,0--43,14)), (43,0--43,14)); - Symbol (SynSymbol visp_result_todo)], (43,0--43,14)), - (43,0--43,14))], (8,0--43,14))] \ No newline at end of file + [Const (String ("%A", Regular, (43,0--43,14)), (43,0--43,14)); Symbol (SynSymbol visp_result_todo)], + (43,0--43,14)), (43,0--43,14))], (8,0--43,14))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-1.structured output.verified.txt index 19bc194..5307922 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_nested-macro-expansion-1.structured output.verified.txt @@ -5,86 +5,63 @@ (FunctionDef (SynSymbol Something, None, Args (List [], (9,14--9,16)), [LetOrUse - (Named (SynSymbol work, (10,7--10,11)), - New (Ident ResizeArray, [], (10,13--10,43)), - None, (10,3--10,44)); + (Named (SynSymbol work, (10,7--10,11)), New (Ident ResizeArray, [], (10,13--10,43)), None, + (10,3--10,44)); LetOrUse - (Named (SynSymbol conditions, (12,7--12,17)), - Collection (SynCollection (FsArray, [], (12,19--12,25))), None, - (12,3--12,26)); + (Named (SynSymbol conditions, (12,7--12,17)), Collection (SynCollection (FsArray, [], (12,19--12,25))), + None, (12,3--12,26)); LetOrUse - (Named (SynSymbol broken, (13,7--13,13)), - Collection (SynCollection (FsArray, [], (13,15--13,21))), None, + (Named (SynSymbol broken, (13,7--13,13)), Collection (SynCollection (FsArray, [], (13,15--13,21))), None, (13,3--13,22)); LetOrUse (Named (SynSymbol possibleOffsets, (14,7--14,22)), - Collection (SynCollection (FsArray, [], (14,24--14,30))), None, - (14,3--14,31)); + Collection (SynCollection (FsArray, [], (14,24--14,30))), None, (14,3--14,31)); FunctionDef (SynSymbol PopWork, None, Args (List [], (16,14--16,16)), [LetOrUse (Named (SynSymbol r, (17,9--17,10)), - DotIndex - (Symbol (SynSymbol work), - [Const (Int32 0, (17,14--17,15))], (17,12--17,21)), None, + DotIndex (Symbol (SynSymbol work), [Const (Int32 0, (17,14--17,15))], (17,12--17,21)), None, (17,5--17,22)); DotMethod - (Symbol (SynSymbol work), SynSymbol RemoveAt, - [Const (Int32 0, (18,20--18,21))], Tuple, (18,5--18,21)); - Symbol (SynSymbol r)], (16,3--19,5)); + (Symbol (SynSymbol work), SynSymbol RemoveAt, [Const (Int32 0, (18,20--18,21))], Tuple, + (18,5--18,21)); Symbol (SynSymbol r)], (16,3--19,5)); FunctionDef (SynSymbol EnqueueWork, None, Args (List - [Named (SynSymbol bi, (21,19--21,21)); - Named (SynSymbol offsetEnd, (21,22--21,31)); - Named (SynSymbol nextPos, (21,32--21,39)); - Named (SynSymbol count, (21,40--21,45))], (21,18--21,46)), - [Const (Unit, (22,4--22,6))], (21,3--22,6)); + [Named (SynSymbol bi, (21,19--21,21)); Named (SynSymbol offsetEnd, (21,22--21,31)); + Named (SynSymbol nextPos, (21,32--21,39)); Named (SynSymbol count, (21,40--21,45))], + (21,18--21,46)), [Const (Unit, (22,4--22,6))], (21,3--22,6)); LetOrUse - (Named (SynSymbol result, (24,7--24,13)), - Const (Int64 0L, (24,14--24,16)), Mutable, (24,3--24,16)); + (Named (SynSymbol result, (24,7--24,13)), Const (Int64 0L, (24,14--24,16)), Mutable, (24,3--24,16)); While (Op (Infix (SynSymbol >, - [DotProperty - (Symbol (SynSymbol work), SynSymbol Count, - (26,13--26,24)); Const (Int32 0, (26,26--26,27))], - (26,10--26,27))), + [DotProperty (Symbol (SynSymbol work), SynSymbol Count, (26,13--26,24)); + Const (Int32 0, (26,26--26,27))], (26,10--26,27))), [Match - (FunctionCall - (Symbol (SynSymbol PopWork), [], (27,12--27,19)), + (FunctionCall (Symbol (SynSymbol PopWork), [], (27,12--27,19)), [SynMatch (Collection (SynCollection (Paren, - [Named (SynSymbol bi, (28,8--28,10)); - Trivia (Dot, (28,11--28,12)); - Named (SynSymbol off, (28,13--28,16)); - Trivia (Dot, (28,17--28,18)); - Named (SynSymbol count, (28,19--28,24))], - (28,7--28,25))), None, + [Named (SynSymbol bi, (28,8--28,10)); Trivia (Dot, (28,11--28,12)); + Named (SynSymbol off, (28,13--28,16)); Trivia (Dot, (28,17--28,18)); + Named (SynSymbol count, (28,19--28,24))], (28,7--28,25))), None, [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("(%A,%A,%A)", Regular, (29,17--29,29)), - (29,17--29,29)); Symbol (SynSymbol bi); - Symbol (SynSymbol off); Symbol (SynSymbol count)], - (29,9--29,42)); + [Const (String ("(%A,%A,%A)", Regular, (29,17--29,29)), (29,17--29,29)); + Symbol (SynSymbol bi); Symbol (SynSymbol off); Symbol (SynSymbol count)], (29,9--29,42)); LetOrUse (Named (SynSymbol brokenLength, (30,13--30,25)), - DotIndex - (Symbol (SynSymbol broken), - [Symbol (SynSymbol bi)], (30,27--30,39)), None, + DotIndex (Symbol (SynSymbol broken), [Symbol (SynSymbol bi)], (30,27--30,39)), None, (30,9--30,40)); LetOrUse (Named (SynSymbol offsetEnd, (31,13--31,22)), Op (Infix - (SynSymbol +, - [Symbol (SynSymbol off); - Symbol (SynSymbol brokenLength)], + (SynSymbol +, [Symbol (SynSymbol off); Symbol (SynSymbol brokenLength)], (31,24--31,42))), None, (31,9--31,43)); SyntaxMacroCall (SynMacroCall @@ -103,11 +80,8 @@ [Symbol (SynSymbol or); List (Paren, - [Symbol (SynSymbol =); - Symbol (SynSymbol off); - Const - (Int32 0, (41,27--41,28))], - (41,20--41,29)); + [Symbol (SynSymbol =); Symbol (SynSymbol off); + Const (Int32 0, (41,27--41,28))], (41,20--41,29)); List (Paren, [Symbol (SynSymbol !=); @@ -116,112 +90,60 @@ [List (DotBracket, [List - (Paren, - [Symbol - (SynSymbol - dec); - Symbol - (SynSymbol - off)], - (41,37--41,46))], - (41,35--41,47)); - Symbol - (SynSymbol conditions)], - (41,34--41,59)); - Const - (Char '#', (41,60--41,63))], - (41,30--41,64))], - (41,16--41,65)); + (Paren, [Symbol (SynSymbol dec); Symbol (SynSymbol off)], + (41,37--41,46))], (41,35--41,47)); + Symbol (SynSymbol conditions)], (41,34--41,59)); + Const (Char '#', (41,60--41,63))], (41,30--41,64))], (41,16--41,65)); List (Paren, [Symbol (SynSymbol or); List (Paren, - [Symbol (SynSymbol =); - Symbol - (SynSymbol offsetEnd); + [Symbol (SynSymbol =); Symbol (SynSymbol offsetEnd); List (Paren, - [Symbol - (SynSymbol +Length); - Symbol - (SynSymbol conditions)], - (42,33--42,53))], - (42,20--42,54)); + [Symbol (SynSymbol +Length); Symbol (SynSymbol conditions)], + (42,33--42,53))], (42,20--42,54)); List (Paren, [Symbol (SynSymbol and); List (Paren, - [Symbol (SynSymbol <); - Symbol - (SynSymbol offsetEnd); + [Symbol (SynSymbol <); Symbol (SynSymbol offsetEnd); List (Paren, - [Symbol - (SynSymbol - +Length); - Symbol - (SynSymbol - conditions)], - (43,38--43,58))], - (43,25--43,59)); + [Symbol (SynSymbol +Length); Symbol (SynSymbol conditions)], + (43,38--43,58))], (43,25--43,59)); List (Paren, [Symbol (SynSymbol !=); List (Paren, [List - (DotBracket, - [Symbol - (SynSymbol - offsetEnd)], - (44,29--44,41)); - Symbol - (SynSymbol - conditions)], - (44,28--44,53)); - Const - (Char '#', - (44,54--44,57))], - (44,24--44,58))], - (43,20--44,59))], - (42,16--44,60)); + (DotBracket, [Symbol (SynSymbol offsetEnd)], + (44,29--44,41)); Symbol (SynSymbol conditions)], + (44,28--44,53)); Const (Char '#', (44,54--44,57))], + (44,24--44,58))], (43,20--44,59))], (42,16--44,60)); List (Paren, [Symbol (SynSymbol not); List (Paren, - [Symbol - (SynSymbol .Contains); + [Symbol (SynSymbol .Contains); List (Paren, - [Symbol - (SynSymbol .AsSpan); - Symbol - (SynSymbol conditions); - Symbol (SynSymbol off); - Symbol - (SynSymbol - brokenLength)], - (45,32--45,69)); - Const - (Char '.', (45,70--45,73))], - (45,21--45,74))], - (45,16--45,75))], (40,14--46,15))], - (39,11--46,16)); - Const (Unit, (47,12--47,14))], - (39,10--48,11)); + [Symbol (SynSymbol .AsSpan); Symbol (SynSymbol conditions); + Symbol (SynSymbol off); Symbol (SynSymbol brokenLength)], + (45,32--45,69)); Const (Char '.', (45,70--45,73))], + (45,21--45,74))], (45,16--45,75))], (40,14--46,15))], (39,11--46,16)); + Const (Unit, (47,12--47,14))], (39,10--48,11)); List (Bracket, [List (Paren, - [Symbol (SynSymbol =); - Symbol (SynSymbol bi); + [Symbol (SynSymbol =); Symbol (SynSymbol bi); List - (Paren, - [Symbol (SynSymbol dec); - Symbol (SynSymbol brokenLength)], + (Paren, [Symbol (SynSymbol dec); Symbol (SynSymbol brokenLength)], (50,17--50,35))], (50,11--50,36)); List (Paren, @@ -231,95 +153,61 @@ [Symbol (SynSymbol .Contains); List (Paren, - [Symbol (SynSymbol .AsSpan); - Symbol (SynSymbol conditions); - Symbol (SynSymbol offsetEnd)], - (51,31--51,61)); - Const (Char '#', (51,62--51,65))], - (51,20--51,66)); + [Symbol (SynSymbol .AsSpan); Symbol (SynSymbol conditions); + Symbol (SynSymbol offsetEnd)], (51,31--51,61)); + Const (Char '#', (51,62--51,65))], (51,20--51,66)); List (Paren, - [Symbol (SynSymbol set!); - Symbol (SynSymbol result); + [Symbol (SynSymbol set!); Symbol (SynSymbol result); List (Paren, - [Symbol (SynSymbol +); - Symbol (SynSymbol result); - Symbol (SynSymbol count)], - (52,27--52,43))], (52,14--52,44))], + [Symbol (SynSymbol +); Symbol (SynSymbol result); + Symbol (SynSymbol count)], (52,27--52,43))], (52,14--52,44))], (51,12--52,45))], (50,10--53,11)); List (Bracket, [Keyword (SynKeyword :else); List (Paren, - [Symbol (SynSymbol mut); - Symbol (SynSymbol nextPossibleIndex); + [Symbol (SynSymbol mut); Symbol (SynSymbol nextPossibleIndex); List (Paren, - [Symbol - (SynSymbol - System.Array.BinarySearch); + [Symbol (SynSymbol System.Array.BinarySearch); List (Paren, - [Symbol - (SynSymbol possibleOffsets); - Trivia (Dot, (55,79--55,81)); + [Symbol (SynSymbol possibleOffsets); Trivia (Dot, (55,79--55,81)); List - (Paren, - [Symbol (SynSymbol inc); - Symbol - (SynSymbol offsetEnd)], - (55,81--55,96))], - (55,62--55,97))], (55,35--55,98))], - (55,12--55,99)); + (Paren, [Symbol (SynSymbol inc); Symbol (SynSymbol offsetEnd)], + (55,81--55,96))], (55,62--55,97))], (55,35--55,98))], (55,12--55,99)); List (Paren, [Symbol (SynSymbol when); List (Paren, - [Symbol (SynSymbol <); - Symbol - (SynSymbol nextPossibleIndex); - Const (Int32 0, (57,39--57,40))], - (57,18--57,41)); + [Symbol (SynSymbol <); Symbol (SynSymbol nextPossibleIndex); + Const (Int32 0, (57,39--57,40))], (57,18--57,41)); List (Paren, - [Symbol (SynSymbol set!); - Symbol - (SynSymbol nextPossibleIndex); + [Symbol (SynSymbol set!); Symbol (SynSymbol nextPossibleIndex); List - (Paren, - [Symbol (SynSymbol bcompl); - Symbol - (SynSymbol nextPossibleIndex)], - (58,38--58,64))], (58,14--58,65))], - (57,12--58,66)); + (Paren, [Symbol (SynSymbol bcompl); Symbol (SynSymbol nextPossibleIndex)], + (58,38--58,64))], (58,14--58,65))], (57,12--58,66)); List (Paren, [Symbol (SynSymbol EnqueueWork); - List - (Paren, - [Symbol (SynSymbol inc); - Symbol (SynSymbol bi)], - (59,25--59,33)); - Symbol (SynSymbol offsetEnd); - Symbol (SynSymbol nextPossibleIndex); - Symbol (SynSymbol count)], - (59,12--59,68))], (54,10--60,11))], - (38,9--60,11))); Const (Unit, (62,8--62,10))], - (28,7--62,10))], (27,5--63,7))], (26,3--63,8))], - (9,1--64,5)), (9,0--65,1)); + List (Paren, [Symbol (SynSymbol inc); Symbol (SynSymbol bi)], (59,25--59,33)); + Symbol (SynSymbol offsetEnd); Symbol (SynSymbol nextPossibleIndex); + Symbol (SynSymbol count)], (59,12--59,68))], (54,10--60,11))], (38,9--60,11))); + Const (Unit, (62,8--62,10))], (28,7--62,10))], (27,5--63,7))], (26,3--63,8))], (9,1--64,5)), + (9,0--65,1)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (67,0--67,14)), FunctionCall - (Symbol (SynSymbol printfn), - [Const (String ("OK", Regular, (67,9--67,13)), (67,9--67,13))], + (Symbol (SynSymbol printfn), [Const (String ("OK", Regular, (67,9--67,13)), (67,9--67,13))], (67,1--67,13)), None, (67,0--67,14)), (67,0--67,14)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (67,0--67,14)), (67,0--67,14)); - Symbol (SynSymbol visp_result_todo)], (67,0--67,14)), - (67,0--67,14))], (7,0--67,14))] \ No newline at end of file + [Const (String ("%A", Regular, (67,0--67,14)), (67,0--67,14)); Symbol (SynSymbol visp_result_todo)], + (67,0--67,14)), (67,0--67,14))], (7,0--67,14))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_or-example-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_or-example-0.structured output.verified.txt index 1b17364..5590605 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_or-example-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_or-example-0.structured output.verified.txt @@ -4,42 +4,30 @@ (SyntaxMacro (SynMacro (SynSymbol my-or, - [SynMacroCase - ([Discard (9,4--9,5)], Const (Bool false, (9,7--9,12)), - (9,2--9,13)); + [SynMacroCase ([Discard (9,4--9,5)], Const (Bool false, (9,7--9,12)), (9,2--9,13)); SynMacroCase - ([Discard (10,4--10,5); Symbol (SynSymbol one, (10,6--10,9))], - Symbol (SynSymbol one), (10,2--10,15)); + ([Discard (10,4--10,5); Symbol (SynSymbol one, (10,6--10,9))], Symbol (SynSymbol one), (10,2--10,15)); SynMacroCase - ([Discard (11,4--11,5); - Symbol (SynSymbol test, (11,6--11,10)); - Symbol (SynSymbol exprs, (11,11--11,16)); - Ellipsis (11,17--11,20)], + ([Discard (11,4--11,5); Symbol (SynSymbol test, (11,6--11,10)); + Symbol (SynSymbol exprs, (11,11--11,16)); Ellipsis (11,17--11,20)], List (Paren, [Symbol (SynSymbol do); List - (Paren, - [Symbol (SynSymbol let); Symbol (SynSymbol orTemp); - Symbol (SynSymbol test)], (13,6--13,23)); + (Paren, [Symbol (SynSymbol let); Symbol (SynSymbol orTemp); Symbol (SynSymbol test)], + (13,6--13,23)); List (Paren, - [Symbol (SynSymbol if); Symbol (SynSymbol orTemp); - Symbol (SynSymbol orTemp); + [Symbol (SynSymbol if); Symbol (SynSymbol orTemp); Symbol (SynSymbol orTemp); List - (Paren, - [Symbol (SynSymbol my-or); - Symbol (SynSymbol exprs); - Ellipsis (16,21--16,24)], (16,8--16,25))], - (14,6--17,7))], (12,4--17,8)), (11,2--18,3))], - (8,1--18,3))), (8,0--18,4)); + (Paren, [Symbol (SynSymbol my-or); Symbol (SynSymbol exprs); Ellipsis (16,21--16,24)], + (16,8--16,25))], (14,6--17,7))], (12,4--17,8)), (11,2--18,3))], (8,1--18,3))), + (8,0--18,4)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("my-or %A", Regular, (20,9--20,19)), (20,9--20,19)); - SyntaxMacroCall - (SynMacroCall - (SynSymbol my-or, [Symbol (SynSymbol my-or)], (20,21--20,26)))], + SyntaxMacroCall (SynMacroCall (SynSymbol my-or, [Symbol (SynSymbol my-or)], (20,21--20,26)))], (20,1--20,27)), (20,0--20,28)); Expr (FunctionCall @@ -47,9 +35,7 @@ [Const (String ("my-or %A", Regular, (21,9--21,19)), (21,9--21,19)); SyntaxMacroCall (SynMacroCall - (SynSymbol my-or, - [Symbol (SynSymbol my-or); - Const (Bool false, (21,27--21,32))], (21,21--21,32)))], + (SynSymbol my-or, [Symbol (SynSymbol my-or); Const (Bool false, (21,27--21,32))], (21,21--21,32)))], (21,1--21,33)), (21,0--21,34)); Expr (FunctionCall @@ -57,9 +43,8 @@ [Const (String ("my-or %A", Regular, (22,9--22,19)), (22,9--22,19)); SyntaxMacroCall (SynMacroCall - (SynSymbol my-or, - [Symbol (SynSymbol my-or); Const (Bool true, (22,27--22,31))], - (22,21--22,31)))], (22,1--22,32)), (22,0--22,33)); + (SynSymbol my-or, [Symbol (SynSymbol my-or); Const (Bool true, (22,27--22,31))], (22,21--22,31)))], + (22,1--22,32)), (22,0--22,33)); Expr (FunctionCall (Symbol (SynSymbol printfn), @@ -67,9 +52,8 @@ SyntaxMacroCall (SynMacroCall (SynSymbol my-or, - [Symbol (SynSymbol my-or); Const (Bool true, (23,27--23,31)); - Const (Bool false, (23,32--23,37))], (23,21--23,37)))], - (23,1--23,38)), (23,0--23,39)); + [Symbol (SynSymbol my-or); Const (Bool true, (23,27--23,31)); Const (Bool false, (23,32--23,37))], + (23,21--23,37)))], (23,1--23,38)), (23,0--23,39)); Expr (FunctionCall (Symbol (SynSymbol printfn), @@ -77,9 +61,8 @@ SyntaxMacroCall (SynMacroCall (SynSymbol my-or, - [Symbol (SynSymbol my-or); Const (Bool true, (24,27--24,31)); - Const (Bool true, (24,32--24,36))], (24,21--24,36)))], - (24,1--24,37)), (24,0--24,38)); + [Symbol (SynSymbol my-or); Const (Bool true, (24,27--24,31)); Const (Bool true, (24,32--24,36))], + (24,21--24,36)))], (24,1--24,37)), (24,0--24,38)); Expr (FunctionCall (Symbol (SynSymbol printfn), @@ -87,10 +70,8 @@ SyntaxMacroCall (SynMacroCall (SynSymbol my-or, - [Symbol (SynSymbol my-or); Const (Bool true, (25,27--25,31)); - Const (Bool true, (25,32--25,36)); - Const (Bool false, (25,37--25,42))], (25,21--25,42)))], - (25,1--25,43)), (25,0--25,44)); + [Symbol (SynSymbol my-or); Const (Bool true, (25,27--25,31)); Const (Bool true, (25,32--25,36)); + Const (Bool false, (25,37--25,42))], (25,21--25,42)))], (25,1--25,43)), (25,0--25,44)); Expr (FunctionCall (Symbol (SynSymbol printfn), @@ -98,10 +79,8 @@ SyntaxMacroCall (SynMacroCall (SynSymbol my-or, - [Symbol (SynSymbol my-or); Const (Bool true, (26,27--26,31)); - Const (Bool true, (26,32--26,36)); - Const (Bool true, (26,37--26,41))], (26,21--26,41)))], - (26,1--26,42)), (26,0--26,43)); + [Symbol (SynSymbol my-or); Const (Bool true, (26,27--26,31)); Const (Bool true, (26,32--26,36)); + Const (Bool true, (26,37--26,41))], (26,21--26,41)))], (26,1--26,42)), (26,0--26,43)); Expr (FunctionCall (Symbol (SynSymbol printfn), @@ -110,10 +89,7 @@ (SynMacroCall (SynSymbol my-or, [Symbol (SynSymbol my-or); - List - (Paren, - [Symbol (SynSymbol Value.bool); - Const (Bool false, (28,39--28,44))], (28,27--28,45))], + List (Paren, [Symbol (SynSymbol Value.bool); Const (Bool false, (28,39--28,44))], (28,27--28,45))], (28,21--28,45)))], (28,1--28,46)), (28,0--28,47)); Expr (FunctionCall @@ -123,48 +99,33 @@ (SynMacroCall (SynSymbol my-or, [Symbol (SynSymbol my-or); - List - (Paren, - [Symbol (SynSymbol Value.bool); - Const (Bool false, (29,39--29,44))], (29,27--29,45)); + List (Paren, [Symbol (SynSymbol Value.bool); Const (Bool false, (29,39--29,44))], (29,27--29,45)); List (Paren, [Symbol (SynSymbol Value.string); - Const - (String ("this works, yay", Regular, (29,60--29,77)), - (29,60--29,77))], (29,46--29,78))], (29,21--29,78)))], - (29,1--29,79)), (29,0--29,80)); + Const (String ("this works, yay", Regular, (29,60--29,77)), (29,60--29,77))], (29,46--29,78))], + (29,21--29,78)))], (29,1--29,79)), (29,0--29,80)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (30,0--30,99)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("my-or %A", Regular, (30,9--30,19)), (30,9--30,19)); + [Const (String ("my-or %A", Regular, (30,9--30,19)), (30,9--30,19)); SyntaxMacroCall (SynMacroCall (SynSymbol my-or, [Symbol (SynSymbol my-or); List - (Paren, - [Symbol (SynSymbol Value.bool); - Const (Bool false, (30,39--30,44))], (30,27--30,45)); + (Paren, [Symbol (SynSymbol Value.bool); Const (Bool false, (30,39--30,44))], (30,27--30,45)); List - (Paren, - [Symbol (SynSymbol Value.bool); - Const (Bool false, (30,58--30,63))], (30,46--30,64)); + (Paren, [Symbol (SynSymbol Value.bool); Const (Bool false, (30,58--30,63))], (30,46--30,64)); List (Paren, [Symbol (SynSymbol Value.string); - Const - (String - ("this works, yay", Regular, (30,79--30,96)), - (30,79--30,96))], (30,65--30,97))], - (30,21--30,97)))], (30,1--30,98)), None, (30,0--30,99)), - (30,0--30,99)); + Const (String ("this works, yay", Regular, (30,79--30,96)), (30,79--30,96))], (30,65--30,97))], + (30,21--30,97)))], (30,1--30,98)), None, (30,0--30,99)), (30,0--30,99)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (30,0--30,99)), (30,0--30,99)); - Symbol (SynSymbol visp_result_todo)], (30,0--30,99)), - (30,0--30,99))], (8,0--30,99))] \ No newline at end of file + [Const (String ("%A", Regular, (30,0--30,99)), (30,0--30,99)); Symbol (SynSymbol visp_result_todo)], + (30,0--30,99)), (30,0--30,99))], (8,0--30,99))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-example-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-example-1.structured output.verified.txt index 33dc217..88868ad 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-example-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-example-1.structured output.verified.txt @@ -8,45 +8,34 @@ List (Paren, [List - (Bracket, - [Symbol (SynSymbol start); Trivia (Colon, (8,21--8,23)); - Symbol (SynSymbol int64)], (8,15--8,29)); + (Bracket, [Symbol (SynSymbol start); Trivia (Colon, (8,21--8,23)); Symbol (SynSymbol int64)], + (8,15--8,29)); List - (Bracket, - [Symbol (SynSymbol len); Trivia (Colon, (8,34--8,36)); - Symbol (SynSymbol int64)], (8,30--8,42))], (8,14--8,43)); + (Bracket, [Symbol (SynSymbol len); Trivia (Colon, (8,34--8,36)); Symbol (SynSymbol int64)], + (8,30--8,42))], (8,14--8,43)); List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.Start); - Symbol (SynSymbol start)], (9,2--9,24)); + (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Start); Symbol (SynSymbol start)], + (9,2--9,24)); List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.Len); - Symbol (SynSymbol len)], (10,2--10,20)); + (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Len); Symbol (SynSymbol len)], (10,2--10,20)); List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.End); List - (Paren, - [Symbol (SynSymbol +); Symbol (SynSymbol start); - Symbol (SynSymbol len)], (11,16--11,29))], + (Paren, [Symbol (SynSymbol +); Symbol (SynSymbol start); Symbol (SynSymbol len)], (11,16--11,29))], (11,2--11,30)); List (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol fn); - Symbol (SynSymbol d.Offset); + [Symbol (SynSymbol member); Symbol (SynSymbol fn); Symbol (SynSymbol d.Offset); List (Paren, [Symbol (SynSymbol v)], (13,22--13,25)); List (Paren, [Symbol (SynSymbol -); Symbol (SynSymbol v); - List - (Paren, - [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], - (14,9--14,19))], (14,4--14,20))], (13,2--14,21)); + List (Paren, [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], (14,9--14,19))], (14,4--14,20))], + (13,2--14,21)); List (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol fn); - Symbol (SynSymbol d.Contains); + [Symbol (SynSymbol member); Symbol (SynSymbol fn); Symbol (SynSymbol d.Contains); List (Paren, [Symbol (SynSymbol v)], (16,24--16,27)); List (Paren, @@ -54,61 +43,40 @@ List (Paren, [Symbol (SynSymbol >=); Symbol (SynSymbol v); - List - (Paren, - [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], - (18,12--18,22))], (18,6--18,23)); + List (Paren, [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], (18,12--18,22))], + (18,6--18,23)); List (Paren, [Symbol (SynSymbol <); Symbol (SynSymbol v); - List - (Paren, - [Symbol (SynSymbol +End); Symbol (SynSymbol d)], - (19,11--19,19))], (19,6--19,20))], (17,4--19,21))], - (16,2--20,3)); + List (Paren, [Symbol (SynSymbol +End); Symbol (SynSymbol d)], (19,11--19,19))], + (19,6--19,20))], (17,4--19,21))], (16,2--20,3)); List (Paren, - [Symbol (SynSymbol override); Symbol (SynSymbol fn); - Symbol (SynSymbol t.ToString); Const (Unit, (22,26--22,28)); + [Symbol (SynSymbol override); Symbol (SynSymbol fn); Symbol (SynSymbol t.ToString); + Const (Unit, (22,26--22,28)); List (Paren, [Symbol (SynSymbol sprintf); - Const - (String ("Range(%i, %i)", Regular, (23,13--23,28)), - (23,13--23,28)); - List - (Paren, - [Symbol (SynSymbol +Start); Symbol (SynSymbol t)], - (23,29--23,39)); - List - (Paren, - [Symbol (SynSymbol +Len); Symbol (SynSymbol t)], - (23,40--23,48))], (23,4--23,49))], (22,2--23,50))], - (8,1--23,50))), (8,0--24,1)); + Const (String ("Range(%i, %i)", Regular, (23,13--23,28)), (23,13--23,28)); + List (Paren, [Symbol (SynSymbol +Start); Symbol (SynSymbol t)], (23,29--23,39)); + List (Paren, [Symbol (SynSymbol +Len); Symbol (SynSymbol t)], (23,40--23,48))], (23,4--23,49))], + (22,2--23,50))], (8,1--23,50))), (8,0--24,1)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Range is: %A", Regular, (26,9--26,23)), (26,9--26,23)); - New - (Ident Range, - [Const (Int32 0, (26,35--26,36)); - Const (Int32 5, (26,37--26,38))], (26,25--26,38))], + [Const (String ("Range is: %A", Regular, (26,9--26,23)), (26,9--26,23)); + New (Ident Range, [Const (Int32 0, (26,35--26,36)); Const (Int32 5, (26,37--26,38))], (26,25--26,38))], (26,1--26,39)), (26,0--26,40)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Range end is: %A", Regular, (27,9--27,27)), - (27,9--27,27)); + [Const (String ("Range end is: %A", Regular, (27,9--27,27)), (27,9--27,27)); ThreadLast ([Expr (New - (Ident Range, - [Const (Int32 0, (27,44--27,45)); - Const (Int32 5, (27,46--27,47))], (27,34--27,47)), - (27,33--27,48)); Property (SynSymbol End, (27,49--27,53))], - (27,29--27,53))], (27,1--27,54)), (27,0--27,55)); + (Ident Range, [Const (Int32 0, (27,44--27,45)); Const (Int32 5, (27,46--27,47))], (27,34--27,47)), + (27,33--27,48)); Property (SynSymbol End, (27,49--27,53))], (27,29--27,53))], (27,1--27,54)), + (27,0--27,55)); Expr (SyntaxMacroCall (SynMacroCall @@ -117,56 +85,43 @@ List (Paren, [List - (Bracket, - [Symbol (SynSymbol dest); Trivia (Colon, (29,28--29,30)); - Symbol (SynSymbol int64)], (29,23--29,36)); + (Bracket, [Symbol (SynSymbol dest); Trivia (Colon, (29,28--29,30)); Symbol (SynSymbol int64)], + (29,23--29,36)); List - (Bracket, - [Symbol (SynSymbol src); Trivia (Colon, (29,41--29,43)); - Symbol (SynSymbol int64)], (29,37--29,49)); + (Bracket, [Symbol (SynSymbol src); Trivia (Colon, (29,41--29,43)); Symbol (SynSymbol int64)], + (29,37--29,49)); List - (Bracket, - [Symbol (SynSymbol len); Trivia (Colon, (29,54--29,56)); - Symbol (SynSymbol int64)], (29,50--29,62))], - (29,22--29,63)); + (Bracket, [Symbol (SynSymbol len); Trivia (Colon, (29,54--29,56)); Symbol (SynSymbol int64)], + (29,50--29,62))], (29,22--29,63)); List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Dest); List (Paren, - [Symbol (SynSymbol new); Symbol (SynSymbol Range); - Symbol (SynSymbol dest); Symbol (SynSymbol len)], - (30,17--30,37))], (30,2--30,38)); + [Symbol (SynSymbol new); Symbol (SynSymbol Range); Symbol (SynSymbol dest); + Symbol (SynSymbol len)], (30,17--30,37))], (30,2--30,38)); List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Src); List (Paren, - [Symbol (SynSymbol new); Symbol (SynSymbol Range); - Symbol (SynSymbol src); Symbol (SynSymbol len)], - (31,16--31,35))], (31,2--31,36)); + [Symbol (SynSymbol new); Symbol (SynSymbol Range); Symbol (SynSymbol src); + Symbol (SynSymbol len)], (31,16--31,35))], (31,2--31,36)); List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.Len); - Symbol (SynSymbol len)], (32,2--32,20)); + (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Len); Symbol (SynSymbol len)], (32,2--32,20)); List (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol fn); - Symbol (SynSymbol d.Contains); + [Symbol (SynSymbol member); Symbol (SynSymbol fn); Symbol (SynSymbol d.Contains); List (Paren, [Symbol (SynSymbol v)], (34,24--34,27)); List (Paren, - [Symbol (SynSymbol ->>); Symbol (SynSymbol d); - Symbol (SynSymbol +Src); + [Symbol (SynSymbol ->>); Symbol (SynSymbol d); Symbol (SynSymbol +Src); List - (HashParen, - [Symbol (SynSymbol -Contains); Symbol (SynSymbol %1); - Symbol (SynSymbol v)], (36,6--36,23))], - (35,4--37,5))], (34,2--37,6)); + (HashParen, [Symbol (SynSymbol -Contains); Symbol (SynSymbol %1); Symbol (SynSymbol v)], + (36,6--36,23))], (35,4--37,5))], (34,2--37,6)); List (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol fn); - Symbol (SynSymbol d.Get); + [Symbol (SynSymbol member); Symbol (SynSymbol fn); Symbol (SynSymbol d.Get); List (Paren, [Symbol (SynSymbol src)], (39,19--39,24)); List (Paren, @@ -174,59 +129,38 @@ List (Paren, [Symbol (SynSymbol -Contains); - List - (Paren, - [Symbol (SynSymbol +Src); Symbol (SynSymbol d)], - (41,17--41,25)); Symbol (SynSymbol src)], - (41,6--41,30)); + List (Paren, [Symbol (SynSymbol +Src); Symbol (SynSymbol d)], (41,17--41,25)); + Symbol (SynSymbol src)], (41,6--41,30)); List (Paren, [Symbol (SynSymbol +); List (Paren, - [Symbol (SynSymbol ->>); Symbol (SynSymbol d); - Symbol (SynSymbol +Dest); + [Symbol (SynSymbol ->>); Symbol (SynSymbol d); Symbol (SynSymbol +Dest); Symbol (SynSymbol +Start)], (42,11--42,31)); List (Paren, [Symbol (SynSymbol -Offset); - List - (Paren, - [Symbol (SynSymbol +Src); - Symbol (SynSymbol d)], (42,41--42,49)); - Symbol (SynSymbol src)], (42,32--42,54))], - (42,8--42,55)); Keyword (SynKeyword :else); + List (Paren, [Symbol (SynSymbol +Src); Symbol (SynSymbol d)], (42,41--42,49)); + Symbol (SynSymbol src)], (42,32--42,54))], (42,8--42,55)); Keyword (SynKeyword :else); Symbol (SynSymbol src)], (40,4--45,5))], (39,2--45,6)); List (Paren, - [Symbol (SynSymbol override); Symbol (SynSymbol fn); - Symbol (SynSymbol t.ToString); Const (Unit, (47,26--47,28)); + [Symbol (SynSymbol override); Symbol (SynSymbol fn); Symbol (SynSymbol t.ToString); + Const (Unit, (47,26--47,28)); List (Paren, [Symbol (SynSymbol sprintf); - Const - (String ("(%A, %A, %i)", Regular, (48,13--48,27)), - (48,13--48,27)); - List - (Paren, - [Symbol (SynSymbol +Dest); Symbol (SynSymbol t)], - (48,28--48,37)); - List - (Paren, - [Symbol (SynSymbol +Src); Symbol (SynSymbol t)], - (48,38--48,46)); - List - (Paren, - [Symbol (SynSymbol +Len); Symbol (SynSymbol t)], - (48,47--48,55))], (48,4--48,56))], (47,2--48,57))], - (29,1--48,57))), (29,0--49,1)); + Const (String ("(%A, %A, %i)", Regular, (48,13--48,27)), (48,13--48,27)); + List (Paren, [Symbol (SynSymbol +Dest); Symbol (SynSymbol t)], (48,28--48,37)); + List (Paren, [Symbol (SynSymbol +Src); Symbol (SynSymbol t)], (48,38--48,46)); + List (Paren, [Symbol (SynSymbol +Len); Symbol (SynSymbol t)], (48,47--48,55))], (48,4--48,56))], + (47,2--48,57))], (29,1--48,57))), (29,0--49,1)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (51,0--51,2)), - Const (Unit, (51,0--51,2)), None, (51,0--51,2)), (51,0--51,2)); + (LetOrUse (Named (SynSymbol visp_result_todo, (51,0--51,2)), Const (Unit, (51,0--51,2)), None, (51,0--51,2)), + (51,0--51,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (51,0--51,2)), (51,0--51,2)); - Symbol (SynSymbol visp_result_todo)], (51,0--51,2)), (51,0--51,2))], - (8,0--51,2))] \ No newline at end of file + [Const (String ("%A", Regular, (51,0--51,2)), (51,0--51,2)); Symbol (SynSymbol visp_result_todo)], + (51,0--51,2)), (51,0--51,2))], (8,0--51,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-0.structured output.verified.txt index 05feae8..1fd3d32 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-0.structured output.verified.txt @@ -7,23 +7,17 @@ [SynMacroCase ([Discard (9,4--9,5); Symbol (SynSymbol typ, (9,6--9,9)); List - ([Symbol (SynSymbol arg, (9,11--9,14)); - Symbol (SynSymbol ctor, (9,15--9,19)); - Ellipsis (9,20--9,23)], (9,10--9,24)); - Symbol (SynSymbol body, (9,25--9,29)); + ([Symbol (SynSymbol arg, (9,11--9,14)); Symbol (SynSymbol ctor, (9,15--9,19)); + Ellipsis (9,20--9,23)], (9,10--9,24)); Symbol (SynSymbol body, (9,25--9,29)); Ellipsis (9,30--9,33)], List (Paren, - [List - (HashBracket, [Symbol (SynSymbol Struct)], - (10,5--10,14)); Symbol (SynSymbol type); + [List (HashBracket, [Symbol (SynSymbol Struct)], (10,5--10,14)); Symbol (SynSymbol type); Symbol (SynSymbol typ); List - (Paren, - [Symbol (SynSymbol arg); Symbol (SynSymbol ctor); - Ellipsis (11,25--11,28)], (11,15--11,29)); - Symbol (SynSymbol body); Ellipsis (12,11--12,14)], - (10,4--13,5)), (9,2--14,3))], (8,1--14,3))), (8,0--14,4)); + (Paren, [Symbol (SynSymbol arg); Symbol (SynSymbol ctor); Ellipsis (11,25--11,28)], + (11,15--11,29)); Symbol (SynSymbol body); Ellipsis (12,11--12,14)], (10,4--13,5)), + (9,2--14,3))], (8,1--14,3))), (8,0--14,4)); Expr (SyntaxMacroCall (SynMacroCall @@ -32,77 +26,50 @@ List (Paren, [List - (Bracket, - [Symbol (SynSymbol x); Trivia (Colon, (16,21--16,23)); - Symbol (SynSymbol int)], (16,19--16,27)); + (Bracket, [Symbol (SynSymbol x); Trivia (Colon, (16,21--16,23)); Symbol (SynSymbol int)], + (16,19--16,27)); List - (Bracket, - [Symbol (SynSymbol y); Trivia (Colon, (16,30--16,32)); - Symbol (SynSymbol int)], (16,28--16,36))], - (16,18--16,37)); + (Bracket, [Symbol (SynSymbol y); Trivia (Colon, (16,30--16,32)); Symbol (SynSymbol int)], + (16,28--16,36))], (16,18--16,37)); + List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.X); Symbol (SynSymbol x)], (17,2--17,16)); + List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); Symbol (SynSymbol y)], (18,2--18,16)); List (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.X); - Symbol (SynSymbol x)], (17,2--17,16)); - List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); - Symbol (SynSymbol y)], (18,2--18,16)); - List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol fn); - Symbol (SynSymbol d.Sum); Const (Unit, (20,19--20,21)); + [Symbol (SynSymbol member); Symbol (SynSymbol fn); Symbol (SynSymbol d.Sum); + Const (Unit, (20,19--20,21)); List (Paren, [Symbol (SynSymbol +); - List - (Paren, [Symbol (SynSymbol +X); Symbol (SynSymbol d)], - (20,25--20,31)); - List - (Paren, [Symbol (SynSymbol +Y); Symbol (SynSymbol d)], - (20,32--20,38))], (20,22--20,39))], (20,2--20,40))], - (16,1--20,40))), (16,0--20,41)); + List (Paren, [Symbol (SynSymbol +X); Symbol (SynSymbol d)], (20,25--20,31)); + List (Paren, [Symbol (SynSymbol +Y); Symbol (SynSymbol d)], (20,32--20,38))], (20,22--20,39))], + (20,2--20,40))], (16,1--20,40))), (16,0--20,41)); Expr (LetOrUse (Named (SynSymbol instance, (22,5--22,13)), - New - (Ident Example, - [Const (Int32 1, (22,27--22,28)); - Const (Int32 2, (22,29--22,30))], (22,15--22,30)), None, - (22,1--22,31)), (22,0--22,32)); + New (Ident Example, [Const (Int32 1, (22,27--22,28)); Const (Int32 2, (22,29--22,30))], (22,15--22,30)), + None, (22,1--22,31)), (22,0--22,32)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Example Struct is %A", Regular, (24,9--24,31)), - (24,9--24,31)); Symbol (SynSymbol instance)], (24,1--24,40)), - (24,0--24,41)); + [Const (String ("Example Struct is %A", Regular, (24,9--24,31)), (24,9--24,31)); + Symbol (SynSymbol instance)], (24,1--24,40)), (24,0--24,41)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Example IsValueType %A", Regular, (25,9--25,33)), - (25,9--25,33)); + [Const (String ("Example IsValueType %A", Regular, (25,9--25,33)), (25,9--25,33)); ThreadLast - ([Expr (Symbol (SynSymbol instance), (25,39--25,47)); - Method (SynSymbol GetType, Tuple, (25,48--25,56)); - Property (SynSymbol IsValueType, (25,57--25,69))], - (25,35--25,69))], (25,1--25,70)), (25,0--25,71)); + ([Expr (Symbol (SynSymbol instance), (25,39--25,47)); Method (SynSymbol GetType, Tuple, (25,48--25,56)); + Property (SynSymbol IsValueType, (25,57--25,69))], (25,35--25,69))], (25,1--25,70)), (25,0--25,71)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (26,0--26,48)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Example Result is %i", Regular, (26,9--26,31)), - (26,9--26,31)); - DotMethod - (Symbol (SynSymbol instance), SynSymbol Sum, [], Tuple, - (26,33--26,46))], (26,1--26,47)), None, (26,0--26,48)), - (26,0--26,48)); + [Const (String ("Example Result is %i", Regular, (26,9--26,31)), (26,9--26,31)); + DotMethod (Symbol (SynSymbol instance), SynSymbol Sum, [], Tuple, (26,33--26,46))], (26,1--26,47)), + None, (26,0--26,48)), (26,0--26,48)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (26,0--26,48)), (26,0--26,48)); - Symbol (SynSymbol visp_result_todo)], (26,0--26,48)), - (26,0--26,48))], (8,0--26,48))] \ No newline at end of file + [Const (String ("%A", Regular, (26,0--26,48)), (26,0--26,48)); Symbol (SynSymbol visp_result_todo)], + (26,0--26,48)), (26,0--26,48))], (8,0--26,48))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-2.structured output.verified.txt index eb2feab..f2a826b 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-2.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-2.structured output.verified.txt @@ -8,62 +8,44 @@ ([Discard (9,4--9,5); Symbol (SynSymbol typ, (9,6--9,9)); List ([List - ([Symbol (SynSymbol arg1, (9,12--9,16)); - Trivia (Colon, (9,17--9,19)); - Symbol (SynSymbol argtyp1, (9,19--9,26))], - (9,11--9,27)); + ([Symbol (SynSymbol arg1, (9,12--9,16)); Trivia (Colon, (9,17--9,19)); + Symbol (SynSymbol argtyp1, (9,19--9,26))], (9,11--9,27)); List - ([Symbol (SynSymbol argrest, (9,29--9,36)); - Trivia (Colon, (9,37--9,39)); - Symbol (SynSymbol argresttyp, (9,39--9,49))], - (9,28--9,50)); Ellipsis (9,51--9,54)], (9,10--9,55)); - Symbol (SynSymbol body, (9,56--9,60)); - Ellipsis (9,61--9,64)], + ([Symbol (SynSymbol argrest, (9,29--9,36)); Trivia (Colon, (9,37--9,39)); + Symbol (SynSymbol argresttyp, (9,39--9,49))], (9,28--9,50)); Ellipsis (9,51--9,54)], + (9,10--9,55)); Symbol (SynSymbol body, (9,56--9,60)); Ellipsis (9,61--9,64)], List (Paren, [Symbol (SynSymbol begin); List (Paren, - [List - (HashBracket, [Symbol (SynSymbol Struct)], - (11,7--11,16)); Symbol (SynSymbol type); + [List (HashBracket, [Symbol (SynSymbol Struct)], (11,7--11,16)); Symbol (SynSymbol type); Symbol (SynSymbol typ); List (Paren, [List (Paren, - [Symbol (SynSymbol arg1); - Trivia (Colon, (12,24--12,26)); - Symbol (SynSymbol argtyp1)], (12,18--12,34)); + [Symbol (SynSymbol arg1); Trivia (Colon, (12,24--12,26)); Symbol (SynSymbol argtyp1)], + (12,18--12,34)); List (Paren, - [Symbol (SynSymbol argrest); - Trivia (Colon, (12,44--12,46)); - Symbol (SynSymbol argresttyp)], - (12,35--12,57)); Ellipsis (12,58--12,61)], - (12,17--12,62)); Symbol (SynSymbol body); - Ellipsis (13,13--13,16)], (11,6--14,7)); + [Symbol (SynSymbol argrest); Trivia (Colon, (12,44--12,46)); + Symbol (SynSymbol argresttyp)], (12,35--12,57)); Ellipsis (12,58--12,61)], + (12,17--12,62)); Symbol (SynSymbol body); Ellipsis (13,13--13,16)], (11,6--14,7)); List (Paren, [Symbol (SynSymbol fn); List - (Paren, - [Symbol (SynSymbol m-concat-id); - Symbol (SynSymbol mk); Symbol (SynSymbol typ)], + (Paren, [Symbol (SynSymbol m-concat-id); Symbol (SynSymbol mk); Symbol (SynSymbol typ)], (16,10--16,30)); List - (Paren, - [Symbol (SynSymbol arg1); - Symbol (SynSymbol argrest); - Ellipsis (17,22--17,25)], (17,8--17,26)); + (Paren, [Symbol (SynSymbol arg1); Symbol (SynSymbol argrest); Ellipsis (17,22--17,25)], + (17,8--17,26)); List (Paren, - [Symbol (SynSymbol new); Symbol (SynSymbol typ); - Symbol (SynSymbol arg1); - Symbol (SynSymbol argrest); - Ellipsis (18,30--18,33)], (18,8--18,34))], - (16,6--19,7))], (10,4--20,5)), (9,2--21,3))], - (8,1--21,3))), (8,0--21,4)); + [Symbol (SynSymbol new); Symbol (SynSymbol typ); Symbol (SynSymbol arg1); + Symbol (SynSymbol argrest); Ellipsis (18,30--18,33)], (18,8--18,34))], (16,6--19,7))], + (10,4--20,5)), (9,2--21,3))], (8,1--21,3))), (8,0--21,4)); Expr (SyntaxMacroCall (SynMacroCall @@ -72,101 +54,62 @@ List (Paren, [List - (Bracket, - [Symbol (SynSymbol x); Trivia (Colon, (23,22--23,24)); - Symbol (SynSymbol int)], (23,20--23,28)); + (Bracket, [Symbol (SynSymbol x); Trivia (Colon, (23,22--23,24)); Symbol (SynSymbol int)], + (23,20--23,28)); List - (Bracket, - [Symbol (SynSymbol y); Trivia (Colon, (23,31--23,33)); - Symbol (SynSymbol int)], (23,29--23,37)); + (Bracket, [Symbol (SynSymbol y); Trivia (Colon, (23,31--23,33)); Symbol (SynSymbol int)], + (23,29--23,37)); List - (Bracket, - [Symbol (SynSymbol z); Trivia (Colon, (23,40--23,42)); - Symbol (SynSymbol int)], (23,38--23,46)); + (Bracket, [Symbol (SynSymbol z); Trivia (Colon, (23,40--23,42)); Symbol (SynSymbol int)], + (23,38--23,46)); List - (Bracket, - [Symbol (SynSymbol w); Trivia (Colon, (23,49--23,51)); - Symbol (SynSymbol int)], (23,47--23,55))], - (23,19--23,56)); - List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.X); - Symbol (SynSymbol x)], (24,2--24,16)); - List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); - Symbol (SynSymbol y)], (25,2--25,16)); - List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.Z); - Symbol (SynSymbol z)], (26,2--26,16)); - List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.W); - Symbol (SynSymbol w)], (27,2--27,16)); + (Bracket, [Symbol (SynSymbol w); Trivia (Colon, (23,49--23,51)); Symbol (SynSymbol int)], + (23,47--23,55))], (23,19--23,56)); + List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.X); Symbol (SynSymbol x)], (24,2--24,16)); + List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Y); Symbol (SynSymbol y)], (25,2--25,16)); + List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Z); Symbol (SynSymbol z)], (26,2--26,16)); + List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.W); Symbol (SynSymbol w)], (27,2--27,16)); List (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol fn); - Symbol (SynSymbol d.Sum); Const (Unit, (29,19--29,21)); + [Symbol (SynSymbol member); Symbol (SynSymbol fn); Symbol (SynSymbol d.Sum); + Const (Unit, (29,19--29,21)); List (Paren, [Symbol (SynSymbol +); - List - (Paren, [Symbol (SynSymbol +X); Symbol (SynSymbol d)], - (29,25--29,31)); - List - (Paren, [Symbol (SynSymbol +Y); Symbol (SynSymbol d)], - (29,32--29,38)); - List - (Paren, [Symbol (SynSymbol +Z); Symbol (SynSymbol d)], - (29,39--29,45)); - List - (Paren, [Symbol (SynSymbol +W); Symbol (SynSymbol d)], - (29,46--29,52))], (29,22--29,53))], (29,2--29,54))], - (23,1--29,54))), (23,0--29,55)); + List (Paren, [Symbol (SynSymbol +X); Symbol (SynSymbol d)], (29,25--29,31)); + List (Paren, [Symbol (SynSymbol +Y); Symbol (SynSymbol d)], (29,32--29,38)); + List (Paren, [Symbol (SynSymbol +Z); Symbol (SynSymbol d)], (29,39--29,45)); + List (Paren, [Symbol (SynSymbol +W); Symbol (SynSymbol d)], (29,46--29,52))], (29,22--29,53))], + (29,2--29,54))], (23,1--29,54))), (23,0--29,55)); Expr (LetOrUse (Named (SynSymbol instance, (31,5--31,13)), FunctionCall (Symbol (SynSymbol mkExample), - [Const (Int32 1, (31,25--31,26)); - Const (Int32 2, (31,27--31,28)); - Const (Int32 3, (31,29--31,30)); - Const (Int32 4, (31,31--31,32))], (31,15--31,32)), None, - (31,1--31,33)), (31,0--31,34)); + [Const (Int32 1, (31,25--31,26)); Const (Int32 2, (31,27--31,28)); Const (Int32 3, (31,29--31,30)); + Const (Int32 4, (31,31--31,32))], (31,15--31,32)), None, (31,1--31,33)), (31,0--31,34)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Example Struct is %A", Regular, (33,9--33,31)), - (33,9--33,31)); Symbol (SynSymbol instance)], (33,1--33,40)), - (33,0--33,41)); + [Const (String ("Example Struct is %A", Regular, (33,9--33,31)), (33,9--33,31)); + Symbol (SynSymbol instance)], (33,1--33,40)), (33,0--33,41)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Example IsValueType %A", Regular, (34,9--34,33)), - (34,9--34,33)); + [Const (String ("Example IsValueType %A", Regular, (34,9--34,33)), (34,9--34,33)); ThreadLast - ([Expr (Symbol (SynSymbol instance), (34,39--34,47)); - Method (SynSymbol GetType, Tuple, (34,48--34,56)); - Property (SynSymbol IsValueType, (34,57--34,69))], - (34,35--34,69))], (34,1--34,70)), (34,0--34,71)); + ([Expr (Symbol (SynSymbol instance), (34,39--34,47)); Method (SynSymbol GetType, Tuple, (34,48--34,56)); + Property (SynSymbol IsValueType, (34,57--34,69))], (34,35--34,69))], (34,1--34,70)), (34,0--34,71)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (35,0--35,48)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Example Result is %i", Regular, (35,9--35,31)), - (35,9--35,31)); - DotMethod - (Symbol (SynSymbol instance), SynSymbol Sum, [], Tuple, - (35,33--35,46))], (35,1--35,47)), None, (35,0--35,48)), - (35,0--35,48)); + [Const (String ("Example Result is %i", Regular, (35,9--35,31)), (35,9--35,31)); + DotMethod (Symbol (SynSymbol instance), SynSymbol Sum, [], Tuple, (35,33--35,46))], (35,1--35,47)), + None, (35,0--35,48)), (35,0--35,48)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (35,0--35,48)), (35,0--35,48)); - Symbol (SynSymbol visp_result_todo)], (35,0--35,48)), - (35,0--35,48))], (8,0--35,48))] \ No newline at end of file + [Const (String ("%A", Regular, (35,0--35,48)), (35,0--35,48)); Symbol (SynSymbol visp_result_todo)], + (35,0--35,48)), (35,0--35,48))], (8,0--35,48))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-3.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-3.structured output.verified.txt index 0f1588e..5082fee 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-3.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_struct-macro-3.structured output.verified.txt @@ -7,48 +7,34 @@ [SynMacroCase ([Discard (9,4--9,5); Symbol (SynSymbol typ, (9,6--9,9)); List - ([Symbol (SynSymbol arg, (9,11--9,14)); - Symbol (SynSymbol ctor, (9,15--9,19)); - Ellipsis (9,20--9,23)], (9,10--9,24)); - Symbol (SynSymbol body, (9,25--9,29)); + ([Symbol (SynSymbol arg, (9,11--9,14)); Symbol (SynSymbol ctor, (9,15--9,19)); + Ellipsis (9,20--9,23)], (9,10--9,24)); Symbol (SynSymbol body, (9,25--9,29)); Ellipsis (9,30--9,33)], List (Paren, - [List - (HashBracket, [Symbol (SynSymbol Struct)], - (10,5--10,14)); Symbol (SynSymbol type); + [List (HashBracket, [Symbol (SynSymbol Struct)], (10,5--10,14)); Symbol (SynSymbol type); Symbol (SynSymbol typ); List - (Paren, - [Symbol (SynSymbol arg); Symbol (SynSymbol ctor); - Ellipsis (11,25--11,28)], (11,15--11,29)); - Symbol (SynSymbol body); Ellipsis (12,11--12,14)], - (10,4--13,5)), (9,2--14,3))], (8,1--14,3))), (8,0--14,4)); + (Paren, [Symbol (SynSymbol arg); Symbol (SynSymbol ctor); Ellipsis (11,25--11,28)], + (11,15--11,29)); Symbol (SynSymbol body); Ellipsis (12,11--12,14)], (10,4--13,5)), + (9,2--14,3))], (8,1--14,3))), (8,0--14,4)); Expr (SyntaxMacro (SynMacro (SynSymbol my-and-3, - [SynMacroCase - ([Discard (17,4--17,5)], Const (Bool true, (17,7--17,11)), - (17,2--17,12)); + [SynMacroCase ([Discard (17,4--17,5)], Const (Bool true, (17,7--17,11)), (17,2--17,12)); SynMacroCase - ([Discard (18,4--18,5); Symbol (SynSymbol one, (18,6--18,9))], - Symbol (SynSymbol one), (18,2--18,15)); + ([Discard (18,4--18,5); Symbol (SynSymbol one, (18,6--18,9))], Symbol (SynSymbol one), (18,2--18,15)); SynMacroCase - ([Discard (19,4--19,5); - Symbol (SynSymbol cond, (19,6--19,10)); - Symbol (SynSymbol exprs, (19,11--19,16)); - Ellipsis (19,17--19,20)], + ([Discard (19,4--19,5); Symbol (SynSymbol cond, (19,6--19,10)); + Symbol (SynSymbol exprs, (19,11--19,16)); Ellipsis (19,17--19,20)], List (Paren, [Symbol (SynSymbol if); Symbol (SynSymbol cond); List - (Paren, - [Symbol (SynSymbol my-and-3); - Symbol (SynSymbol exprs); Ellipsis (21,22--21,25)], - (21,6--21,26)); Const (Bool false, (22,6--22,11))], - (20,4--22,12)), (19,2--23,3))], (16,1--23,3))), - (16,0--23,4)); + (Paren, [Symbol (SynSymbol my-and-3); Symbol (SynSymbol exprs); Ellipsis (21,22--21,25)], + (21,6--21,26)); Const (Bool false, (22,6--22,11))], (20,4--22,12)), (19,2--23,3))], + (16,1--23,3))), (16,0--23,4)); Expr (SyntaxMacroCall (SynMacroCall @@ -57,47 +43,34 @@ List (Paren, [List - (Bracket, - [Symbol (SynSymbol start); - Trivia (Colon, (25,24--25,26)); - Symbol (SynSymbol int64)], (25,18--25,32)); + (Bracket, [Symbol (SynSymbol start); Trivia (Colon, (25,24--25,26)); Symbol (SynSymbol int64)], + (25,18--25,32)); List - (Bracket, - [Symbol (SynSymbol len); Trivia (Colon, (25,37--25,39)); - Symbol (SynSymbol int64)], (25,33--25,45))], - (25,17--25,46)); + (Bracket, [Symbol (SynSymbol len); Trivia (Colon, (25,37--25,39)); Symbol (SynSymbol int64)], + (25,33--25,45))], (25,17--25,46)); List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.Start); - Symbol (SynSymbol start)], (26,2--26,24)); + (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Start); Symbol (SynSymbol start)], + (26,2--26,24)); List - (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol _.Len); - Symbol (SynSymbol len)], (27,2--27,20)); + (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.Len); Symbol (SynSymbol len)], (27,2--27,20)); List (Paren, [Symbol (SynSymbol member); Symbol (SynSymbol _.End); List - (Paren, - [Symbol (SynSymbol +); Symbol (SynSymbol start); - Symbol (SynSymbol len)], (28,16--28,29))], + (Paren, [Symbol (SynSymbol +); Symbol (SynSymbol start); Symbol (SynSymbol len)], (28,16--28,29))], (28,2--28,30)); List (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol fn); - Symbol (SynSymbol d.Offset); + [Symbol (SynSymbol member); Symbol (SynSymbol fn); Symbol (SynSymbol d.Offset); List (Paren, [Symbol (SynSymbol v)], (30,22--30,25)); List (Paren, [Symbol (SynSymbol -); Symbol (SynSymbol v); - List - (Paren, - [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], - (31,9--31,19))], (31,4--31,20))], (30,2--31,21)); + List (Paren, [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], (31,9--31,19))], (31,4--31,20))], + (30,2--31,21)); List (Paren, - [Symbol (SynSymbol member); Symbol (SynSymbol fn); - Symbol (SynSymbol d.Contains); + [Symbol (SynSymbol member); Symbol (SynSymbol fn); Symbol (SynSymbol d.Contains); List (Paren, [Symbol (SynSymbol v)], (33,24--33,27)); List (Paren, @@ -105,78 +78,51 @@ List (Paren, [Symbol (SynSymbol >=); Symbol (SynSymbol v); - List - (Paren, - [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], - (35,12--35,22))], (35,6--35,23)); + List (Paren, [Symbol (SynSymbol +Start); Symbol (SynSymbol d)], (35,12--35,22))], + (35,6--35,23)); List (Paren, [Symbol (SynSymbol <); Symbol (SynSymbol v); - List - (Paren, - [Symbol (SynSymbol +End); Symbol (SynSymbol d)], - (36,11--36,19))], (36,6--36,20))], (34,4--36,21))], - (33,2--37,3)); + List (Paren, [Symbol (SynSymbol +End); Symbol (SynSymbol d)], (36,11--36,19))], + (36,6--36,20))], (34,4--36,21))], (33,2--37,3)); List (Paren, - [Symbol (SynSymbol override); Symbol (SynSymbol fn); - Symbol (SynSymbol t.ToString); Const (Unit, (39,26--39,28)); + [Symbol (SynSymbol override); Symbol (SynSymbol fn); Symbol (SynSymbol t.ToString); + Const (Unit, (39,26--39,28)); List (Paren, [Symbol (SynSymbol sprintf); - Const - (String ("Range(%i, %i)", Regular, (40,13--40,28)), - (40,13--40,28)); - List - (Paren, - [Symbol (SynSymbol +Start); Symbol (SynSymbol t)], - (40,29--40,39)); - List - (Paren, - [Symbol (SynSymbol +Len); Symbol (SynSymbol t)], - (40,40--40,48))], (40,4--40,49))], (39,2--40,50))], - (25,1--40,50))), (25,0--41,1)); + Const (String ("Range(%i, %i)", Regular, (40,13--40,28)), (40,13--40,28)); + List (Paren, [Symbol (SynSymbol +Start); Symbol (SynSymbol t)], (40,29--40,39)); + List (Paren, [Symbol (SynSymbol +Len); Symbol (SynSymbol t)], (40,40--40,48))], (40,4--40,49))], + (39,2--40,50))], (25,1--40,50))), (25,0--41,1)); Expr (LetOrUse (Named (SynSymbol instance, (43,5--43,13)), - New - (Ident Range, - [Const (Int32 1, (43,25--43,26)); - Const (Int32 2, (43,27--43,28))], (43,15--43,28)), None, + New (Ident Range, [Const (Int32 1, (43,25--43,26)); Const (Int32 2, (43,27--43,28))], (43,15--43,28)), None, (43,1--43,29)), (43,0--43,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Example Struct is %A", Regular, (45,9--45,31)), - (45,9--45,31)); Symbol (SynSymbol instance)], (45,1--45,40)), - (45,0--45,41)); + [Const (String ("Example Struct is %A", Regular, (45,9--45,31)), (45,9--45,31)); + Symbol (SynSymbol instance)], (45,1--45,40)), (45,0--45,41)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Example IsValueType %A", Regular, (46,9--46,33)), - (46,9--46,33)); + [Const (String ("Example IsValueType %A", Regular, (46,9--46,33)), (46,9--46,33)); ThreadLast - ([Expr (Symbol (SynSymbol instance), (46,39--46,47)); - Method (SynSymbol GetType, Tuple, (46,48--46,56)); - Property (SynSymbol IsValueType, (46,57--46,69))], - (46,35--46,69))], (46,1--46,70)), (46,0--46,71)); + ([Expr (Symbol (SynSymbol instance), (46,39--46,47)); Method (SynSymbol GetType, Tuple, (46,48--46,56)); + Property (SynSymbol IsValueType, (46,57--46,69))], (46,35--46,69))], (46,1--46,70)), (46,0--46,71)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (47,0--47,53)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Example Result is %A", Regular, (47,9--47,31)), - (47,9--47,31)); - DotMethod - (Symbol (SynSymbol instance), SynSymbol ToString, [], Tuple, - (47,33--47,51))], (47,1--47,52)), None, (47,0--47,53)), - (47,0--47,53)); + [Const (String ("Example Result is %A", Regular, (47,9--47,31)), (47,9--47,31)); + DotMethod (Symbol (SynSymbol instance), SynSymbol ToString, [], Tuple, (47,33--47,51))], (47,1--47,52)), + None, (47,0--47,53)), (47,0--47,53)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (47,0--47,53)), (47,0--47,53)); - Symbol (SynSymbol visp_result_todo)], (47,0--47,53)), - (47,0--47,53))], (8,0--47,53))] \ No newline at end of file + [Const (String ("%A", Regular, (47,0--47,53)), (47,0--47,53)); Symbol (SynSymbol visp_result_todo)], + (47,0--47,53)), (47,0--47,53))], (8,0--47,53))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-0.structured output.verified.txt index fd2edf0..b4e11fd 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-0.structured output.verified.txt @@ -1,29 +1,23 @@ ParsedFile [AnonModule ([HashDirective - (ParsedHashDirective - ("nowarn", [String ("0026", Regular, (10,8--10,14))], (10,0--10,14)), - (10,0--10,14)); + (ParsedHashDirective ("nowarn", [String ("0026", Regular, (10,8--10,14))], (10,0--10,14)), (10,0--10,14)); Expr (SyntaxMacro (SynMacro (SynSymbol matchfnexample, [SynMacroCase - ([Discard (13,4--13,5); Symbol (SynSymbol sym, (13,6--13,9)); - Symbol (SynSymbol m, (13,10--13,11)); - Symbol (SynSymbol rest, (13,12--13,16)); - Ellipsis (13,17--13,20)], + ([Discard (13,4--13,5); Symbol (SynSymbol sym, (13,6--13,9)); Symbol (SynSymbol m, (13,10--13,11)); + Symbol (SynSymbol rest, (13,12--13,16)); Ellipsis (13,17--13,20)], List (Paren, [Symbol (SynSymbol fn); Symbol (SynSymbol sym); List (Paren, [Symbol (SynSymbol arg)], (14,12--14,17)); List (Paren, - [Symbol (SynSymbol match); Symbol (SynSymbol arg); - Symbol (SynSymbol m); Symbol (SynSymbol rest); - Ellipsis (17,13--17,16)], (15,6--18,7))], - (14,4--18,8)), (13,2--19,3))], (12,1--19,3))), - (12,0--19,4)); + [Symbol (SynSymbol match); Symbol (SynSymbol arg); Symbol (SynSymbol m); + Symbol (SynSymbol rest); Ellipsis (17,13--17,16)], (15,6--18,7))], (14,4--18,8)), + (13,2--19,3))], (12,1--19,3))), (12,0--19,4)); Expr (SyntaxMacroCall (SynMacroCall @@ -32,63 +26,41 @@ List (Bracket, [List - (Paren, - [Symbol (SynSymbol !tuple); Symbol (SynSymbol a); - Symbol (SynSymbol b)], (22,3--22,15)); - List - (Paren, - [Symbol (SynSymbol +); Symbol (SynSymbol a); - Symbol (SynSymbol b)], (23,4--23,11))], (22,2--23,12)); - List - (Bracket, - [Discard (24,3--24,4); Const (Int32 0, (24,5--24,6))], - (24,2--24,7))], (21,1--24,7))), (21,0--24,8)); + (Paren, [Symbol (SynSymbol !tuple); Symbol (SynSymbol a); Symbol (SynSymbol b)], (22,3--22,15)); + List (Paren, [Symbol (SynSymbol +); Symbol (SynSymbol a); Symbol (SynSymbol b)], (23,4--23,11))], + (22,2--23,12)); List (Bracket, [Discard (24,3--24,4); Const (Int32 0, (24,5--24,6))], (24,2--24,7))], + (21,1--24,7))), (21,0--24,8)); Expr (FunctionDef - (SynSymbol name2, None, - Args (List [Named (SynSymbol tup, (26,11--26,14))], (26,10--26,15)), + (SynSymbol name2, None, Args (List [Named (SynSymbol tup, (26,11--26,14))], (26,10--26,15)), [Match (Symbol (SynSymbol tup), [SynMatch (Collection (SynCollection (Paren, - [Named (SynSymbol a, (28,13--28,14)); - Trivia (Comma, (28,5--28,6)); - Named (SynSymbol b, (28,15--28,16))], (28,5--28,17))), - None, - [Op - (Infix - (SynSymbol +, - [Symbol (SynSymbol a); Symbol (SynSymbol b)], - (28,19--28,24)))], (28,5--28,25)); - SynMatch - (Discard (29,5--29,6), None, [Const (Int32 0, (29,7--29,8))], - (29,5--29,8))], (27,3--29,9))], (26,1--29,10)), - (26,0--29,11)); + [Named (SynSymbol a, (28,13--28,14)); Trivia (Comma, (28,5--28,6)); + Named (SynSymbol b, (28,15--28,16))], (28,5--28,17))), None, + [Op (Infix (SynSymbol +, [Symbol (SynSymbol a); Symbol (SynSymbol b)], (28,19--28,24)))], + (28,5--28,25)); + SynMatch (Discard (29,5--29,6), None, [Const (Int32 0, (29,7--29,8))], (29,5--29,8))], (27,3--29,9))], + (26,1--29,10)), (26,0--29,11)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (31,0--33,23)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("%A & %A", Regular, (31,9--31,18)), (31,9--31,18)); + [Const (String ("%A & %A", Regular, (31,9--31,18)), (31,9--31,18)); FunctionCall (Symbol (SynSymbol name), - [Tuple - ([Const (Int32 1, (32,16--32,17)); - Const (Int32 2, (32,18--32,19))], (32,9--32,19))], + [Tuple ([Const (Int32 1, (32,16--32,17)); Const (Int32 2, (32,18--32,19))], (32,9--32,19))], (32,3--32,20)); FunctionCall (Symbol (SynSymbol name2), - [Tuple - ([Const (Int32 1, (33,17--33,18)); - Const (Int32 2, (33,19--33,20))], (33,10--33,20))], - (33,3--33,21))], (31,1--33,22)), None, (31,0--33,23)), - (31,0--33,23)); + [Tuple ([Const (Int32 1, (33,17--33,18)); Const (Int32 2, (33,19--33,20))], (33,10--33,20))], + (33,3--33,21))], (31,1--33,22)), None, (31,0--33,23)), (31,0--33,23)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (31,0--33,23)), (31,0--33,23)); - Symbol (SynSymbol visp_result_todo)], (31,0--33,23)), - (31,0--33,23))], (10,0--33,23))] \ No newline at end of file + [Const (String ("%A", Regular, (31,0--33,23)), (31,0--33,23)); Symbol (SynSymbol visp_result_todo)], + (31,0--33,23)), (31,0--33,23))], (10,0--33,23))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-2.structured output.verified.txt index db52823..52cbc99 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-2.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_syntax-macro-2.structured output.verified.txt @@ -1,49 +1,35 @@ ParsedFile [AnonModule - ([HashDirective - (ParsedHashDirective - ("nowarn", [String ("0026", Regular, (9,8--9,14))], (9,0--9,14)), - (9,0--9,14)); + ([HashDirective (ParsedHashDirective ("nowarn", [String ("0026", Regular, (9,8--9,14))], (9,0--9,14)), (9,0--9,14)); Expr (SyntaxMacro (SynMacro (SynSymbol custom-match-fn, [SynMacroCase ([Discard (12,4--12,5); - List - ([Symbol (SynSymbol c, (12,7--12,8)); - Ellipsis (12,9--12,12)], (12,6--12,13)); - Symbol (SynSymbol rest, (12,14--12,18)); - Ellipsis (12,19--12,22)], + List ([Symbol (SynSymbol c, (12,7--12,8)); Ellipsis (12,9--12,12)], (12,6--12,13)); + Symbol (SynSymbol rest, (12,14--12,18)); Ellipsis (12,19--12,22)], List (Paren, - [Symbol (SynSymbol fn); - List (Paren, [Symbol (SynSymbol arg)], (13,8--13,13)); + [Symbol (SynSymbol fn); List (Paren, [Symbol (SynSymbol arg)], (13,8--13,13)); List (Paren, [Symbol (SynSymbol match); Symbol (SynSymbol arg); - List - (Bracket, - [Symbol (SynSymbol c); Ellipsis (15,11--15,14)], - (15,8--15,15)); Symbol (SynSymbol rest); - Ellipsis (16,13--16,16)], (14,6--17,7))], - (13,4--17,8)), (12,2--18,3)); + List (Bracket, [Symbol (SynSymbol c); Ellipsis (15,11--15,14)], (15,8--15,15)); + Symbol (SynSymbol rest); Ellipsis (16,13--16,16)], (14,6--17,7))], (13,4--17,8)), + (12,2--18,3)); SynMacroCase - ([Discard (19,4--19,5); Symbol (SynSymbol sym, (19,6--19,9)); - Symbol (SynSymbol m, (19,10--19,11)); - Symbol (SynSymbol rest, (19,12--19,16)); - Ellipsis (19,17--19,20)], + ([Discard (19,4--19,5); Symbol (SynSymbol sym, (19,6--19,9)); Symbol (SynSymbol m, (19,10--19,11)); + Symbol (SynSymbol rest, (19,12--19,16)); Ellipsis (19,17--19,20)], List (Paren, [Symbol (SynSymbol fn); Symbol (SynSymbol sym); List (Paren, [Symbol (SynSymbol arg)], (20,12--20,17)); List (Paren, - [Symbol (SynSymbol match); Symbol (SynSymbol arg); - Symbol (SynSymbol m); Symbol (SynSymbol rest); - Ellipsis (23,13--23,16)], (21,6--24,7))], - (20,4--24,8)), (19,2--25,3))], (11,1--25,3))), - (11,0--26,1)); + [Symbol (SynSymbol match); Symbol (SynSymbol arg); Symbol (SynSymbol m); + Symbol (SynSymbol rest); Ellipsis (23,13--23,16)], (21,6--24,7))], (20,4--24,8)), + (19,2--25,3))], (11,1--25,3))), (11,0--26,1)); Expr (LetOrUse (Named (SynSymbol lambda, (28,5--28,11)), @@ -54,15 +40,10 @@ List (Bracket, [List - (Paren, - [Symbol (SynSymbol a); Trivia (Dot, (28,33--28,35)); - Symbol (SynSymbol b)], (28,30--28,37)); - List - (Paren, - [Symbol (SynSymbol +); Symbol (SynSymbol a); - Symbol (SynSymbol b)], (28,38--28,45))], - (28,29--28,46))], (28,13--28,46))), None, (28,1--28,47)), - (28,0--28,48)); + (Paren, [Symbol (SynSymbol a); Trivia (Dot, (28,33--28,35)); Symbol (SynSymbol b)], + (28,30--28,37)); + List (Paren, [Symbol (SynSymbol +); Symbol (SynSymbol a); Symbol (SynSymbol b)], (28,38--28,45))], + (28,29--28,46))], (28,13--28,46))), None, (28,1--28,47)), (28,0--28,48)); Expr (SyntaxMacroCall (SynMacroCall @@ -71,42 +52,29 @@ List (Bracket, [List - (Paren, - [Symbol (SynSymbol a); Trivia (Dot, (30,6--30,8)); - Symbol (SynSymbol b)], (30,3--30,10)); - List - (Paren, - [Symbol (SynSymbol +); Symbol (SynSymbol a); - Symbol (SynSymbol b)], (30,11--30,18))], (30,2--30,19))], - (29,1--30,19))), (29,0--30,20)); + (Paren, [Symbol (SynSymbol a); Trivia (Dot, (30,6--30,8)); Symbol (SynSymbol b)], (30,3--30,10)); + List (Paren, [Symbol (SynSymbol +); Symbol (SynSymbol a); Symbol (SynSymbol b)], (30,11--30,18))], + (30,2--30,19))], (29,1--30,19))), (29,0--30,20)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("lambda: %i", Regular, (32,9--32,21)), (32,9--32,21)); + [Const (String ("lambda: %i", Regular, (32,9--32,21)), (32,9--32,21)); FunctionCall (Symbol (SynSymbol lambda), - [Tuple - ([Const (Int32 1, (32,31--32,32)); - Const (Int32 2, (32,35--32,36))], (32,31--32,36))], + [Tuple ([Const (Int32 1, (32,31--32,32)); Const (Int32 2, (32,35--32,36))], (32,31--32,36))], (32,23--32,37))], (32,1--32,38)), (32,0--32,39)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (33,0--33,37)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("named: %i", Regular, (33,9--33,20)), (33,9--33,20)); + [Const (String ("named: %i", Regular, (33,9--33,20)), (33,9--33,20)); FunctionCall (Symbol (SynSymbol named), - [Tuple - ([Const (Int32 1, (33,29--33,30)); - Const (Int32 2, (33,33--33,34))], (33,29--33,34))], - (33,22--33,35))], (33,1--33,36)), None, (33,0--33,37)), - (33,0--33,37)); + [Tuple ([Const (Int32 1, (33,29--33,30)); Const (Int32 2, (33,33--33,34))], (33,29--33,34))], + (33,22--33,35))], (33,1--33,36)), None, (33,0--33,37)), (33,0--33,37)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (33,0--33,37)), (33,0--33,37)); - Symbol (SynSymbol visp_result_todo)], (33,0--33,37)), - (33,0--33,37))], (9,0--33,37))] \ No newline at end of file + [Const (String ("%A", Regular, (33,0--33,37)), (33,0--33,37)); Symbol (SynSymbol visp_result_todo)], + (33,0--33,37)), (33,0--33,37))], (9,0--33,37))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_up-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_up-macro-0.structured output.verified.txt index 08a2fb4..4ed389a 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_up-macro-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_up-macro-0.structured output.verified.txt @@ -4,34 +4,26 @@ (FunctionDef (SynSymbol DoingThings, None, Args (List [], (8,16--8,18)), [LetOrUse - (Named (SynSymbol items, (9,7--9,12)), - Collection (SynCollection (FsSet, [], (9,14--9,18))), Mutable, + (Named (SynSymbol items, (9,7--9,12)), Collection (SynCollection (FsSet, [], (9,14--9,18))), Mutable, (9,3--9,19)); ForTo - (SynSymbol i, Const (Int32 0, (11,14--11,15)), - Const (Int32 5, (11,19--11,20)), + (SynSymbol i, Const (Int32 0, (11,14--11,15)), Const (Int32 5, (11,19--11,20)), [SyntaxMacroCall (SynMacroCall (SynSymbol up!, [Symbol (SynSymbol up!); Symbol (SynSymbol items); - List - (Paren, - [Symbol (SynSymbol Set.add); Symbol (SynSymbol i)], - (12,15--12,26))], (12,5--12,26)))], false, - (11,3--12,27)); Symbol (SynSymbol items)], (8,1--14,7)), - (8,0--14,8)); + List (Paren, [Symbol (SynSymbol Set.add); Symbol (SynSymbol i)], (12,15--12,26))], + (12,5--12,26)))], false, (11,3--12,27)); Symbol (SynSymbol items)], (8,1--14,7)), (8,0--14,8)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (17,0--17,28)), FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (17,9--17,13)), (17,9--17,13)); - FunctionCall - (Symbol (SynSymbol DoingThings), [], (17,15--17,26))], - (17,1--17,27)), None, (17,0--17,28)), (17,0--17,28)); + FunctionCall (Symbol (SynSymbol DoingThings), [], (17,15--17,26))], (17,1--17,27)), None, (17,0--17,28)), + (17,0--17,28)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,0--17,28)), (17,0--17,28)); - Symbol (SynSymbol visp_result_todo)], (17,0--17,28)), - (17,0--17,28))], (8,0--17,28))] \ No newline at end of file + [Const (String ("%A", Regular, (17,0--17,28)), (17,0--17,28)); Symbol (SynSymbol visp_result_todo)], + (17,0--17,28)), (17,0--17,28))], (8,0--17,28))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_when-unless-example-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_when-unless-example-0.structured output.verified.txt index 4225ad4..18540ed 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_when-unless-example-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_when-unless-example-0.structured output.verified.txt @@ -5,39 +5,28 @@ (SynMacro (SynSymbol MyWhen1, [SynMacroCase - ([Discard (9,4--9,5); Symbol (SynSymbol test, (9,6--9,10)); - Symbol (SynSymbol body, (9,11--9,15)); + ([Discard (9,4--9,5); Symbol (SynSymbol test, (9,6--9,10)); Symbol (SynSymbol body, (9,11--9,15)); Ellipsis (9,16--9,19)], List (Paren, [Symbol (SynSymbol if); Symbol (SynSymbol test); List - (Paren, - [Symbol (SynSymbol begin); Symbol (SynSymbol body); - Ellipsis (11,18--11,21)], (11,6--11,22))], - (10,4--11,23)), (9,2--12,3))], (8,1--12,3))), (8,0--12,4)); + (Paren, [Symbol (SynSymbol begin); Symbol (SynSymbol body); Ellipsis (11,18--11,21)], + (11,6--11,22))], (10,4--11,23)), (9,2--12,3))], (8,1--12,3))), (8,0--12,4)); Expr (SyntaxMacro (SynMacro (SynSymbol MyUnless1, [SynMacroCase - ([Discard (15,4--15,5); - Symbol (SynSymbol test, (15,6--15,10)); - Symbol (SynSymbol body, (15,11--15,15)); - Ellipsis (15,16--15,19)], + ([Discard (15,4--15,5); Symbol (SynSymbol test, (15,6--15,10)); + Symbol (SynSymbol body, (15,11--15,15)); Ellipsis (15,16--15,19)], List (Paren, [Symbol (SynSymbol if); + List (Paren, [Symbol (SynSymbol not); Symbol (SynSymbol test)], (16,8--16,18)); List - (Paren, - [Symbol (SynSymbol not); Symbol (SynSymbol test)], - (16,8--16,18)); - List - (Paren, - [Symbol (SynSymbol begin); Symbol (SynSymbol body); - Ellipsis (17,18--17,21)], (17,6--17,22))], - (16,4--17,23)), (15,2--18,3))], (14,1--18,3))), - (14,0--18,4)); + (Paren, [Symbol (SynSymbol begin); Symbol (SynSymbol body); Ellipsis (17,18--17,21)], + (17,6--17,22))], (16,4--17,23)), (15,2--18,3))], (14,1--18,3))), (14,0--18,4)); Expr (SyntaxMacroCall (SynMacroCall @@ -46,40 +35,30 @@ List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("inside when 1", Regular, (21,11--21,26)), - (21,11--21,26))], (21,2--21,27)); + Const (String ("inside when 1", Regular, (21,11--21,26)), (21,11--21,26))], (21,2--21,27)); List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("inside when 2", Regular, (22,11--22,26)), - (22,11--22,26))], (22,2--22,27))], (20,1--22,27))), - (20,0--23,1)); + Const (String ("inside when 2", Regular, (22,11--22,26)), (22,11--22,26))], (22,2--22,27))], + (20,1--22,27))), (20,0--23,1)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (25,0--27,30)), SyntaxMacroCall (SynMacroCall (SynSymbol MyUnless1, - [Symbol (SynSymbol MyUnless1); - Const (Bool false, (25,11--25,16)); + [Symbol (SynSymbol MyUnless1); Const (Bool false, (25,11--25,16)); List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("inside unless 3", Regular, (26,11--26,28)), - (26,11--26,28))], (26,2--26,29)); + Const (String ("inside unless 3", Regular, (26,11--26,28)), (26,11--26,28))], (26,2--26,29)); List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("inside unless 4", Regular, (27,11--27,28)), - (27,11--27,28))], (27,2--27,29))], (25,1--27,29))), - None, (25,0--27,30)), (25,0--27,30)); + Const (String ("inside unless 4", Regular, (27,11--27,28)), (27,11--27,28))], (27,2--27,29))], + (25,1--27,29))), None, (25,0--27,30)), (25,0--27,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (25,0--27,30)), (25,0--27,30)); - Symbol (SynSymbol visp_result_todo)], (25,0--27,30)), - (25,0--27,30))], (8,0--27,30))] \ No newline at end of file + [Const (String ("%A", Regular, (25,0--27,30)), (25,0--27,30)); Symbol (SynSymbol visp_result_todo)], + (25,0--27,30)), (25,0--27,30))], (8,0--27,30))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_while-match-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_while-match-0.structured output.verified.txt index 48d434b..f1afe54 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_while-match-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_macros_while-match-0.structured output.verified.txt @@ -3,35 +3,24 @@ ([Expr (Type (SynSymbol Counter, Args (Tuple [], (8,14--8,16)), - [Mut - (Named (SynSymbol count, (9,7--9,12)), - Const (Int32 0, (9,13--9,14)), (9,3--9,14)); + [Mut (Named (SynSymbol count, (9,7--9,12)), Const (Int32 0, (9,13--9,14)), (9,3--9,14)); MemberFn (SynSymbol _.DoStuff, Args (List [], (10,23--10,25)), [If (Op - (Infix - (SynSymbol >, - [Symbol (SynSymbol count); - Const (Int32 6, (11,17--11,18))], (11,9--11,18))), + (Infix (SynSymbol >, [Symbol (SynSymbol count); Const (Int32 6, (11,17--11,18))], (11,9--11,18))), Symbol (SynSymbol None), Some (Begin ([Set (Symbol (SynSymbol count), - FunctionCall - (Symbol (SynSymbol inc), - [Symbol (SynSymbol count)], (14,21--14,30)), + FunctionCall (Symbol (SynSymbol inc), [Symbol (SynSymbol count)], (14,21--14,30)), (14,9--14,31)); - FunctionCall - (Symbol (SynSymbol Some), - [Symbol (SynSymbol count)], (15,9--15,19))], Do, - (13,7--15,20))), (11,5--16,7))], (10,3--17,5))], [], - (8,1--17,6)), (8,0--17,7)); + FunctionCall (Symbol (SynSymbol Some), [Symbol (SynSymbol count)], (15,9--15,19))], Do, + (13,7--15,20))), (11,5--16,7))], (10,3--17,5))], [], (8,1--17,6)), (8,0--17,7)); Expr (LetOrUse - (Named (SynSymbol counter, (19,5--19,12)), - New (Ident Counter, [], (19,14--19,25)), None, (19,1--19,26)), + (Named (SynSymbol counter, (19,5--19,12)), New (Ident Counter, [], (19,14--19,25)), None, (19,1--19,26)), (19,0--19,27)); Expr (LetOrUse @@ -40,40 +29,24 @@ (SynMacroCall (SynSymbol while-match, [Symbol (SynSymbol while-match); - List - (Paren, - [Symbol (SynSymbol .DoStuff); Symbol (SynSymbol counter)], - (21,13--21,31)); - List - (Bracket, - [Symbol (SynSymbol None); - Const (Bool false, (22,8--22,13))], (22,2--22,14)); + List (Paren, [Symbol (SynSymbol .DoStuff); Symbol (SynSymbol counter)], (21,13--21,31)); + List (Bracket, [Symbol (SynSymbol None); Const (Bool false, (22,8--22,13))], (22,2--22,14)); List (Bracket, - [List - (Paren, - [Symbol (SynSymbol Some); Symbol (SynSymbol c)], - (23,3--23,11)); + [List (Paren, [Symbol (SynSymbol Some); Symbol (SynSymbol c)], (23,3--23,11)); List (Paren, [Symbol (SynSymbol printfn); - Const - (String ("Count is: %i", Regular, (24,13--24,27)), - (24,13--24,27)); Symbol (SynSymbol c)], - (24,4--24,30)); + Const (String ("Count is: %i", Regular, (24,13--24,27)), (24,13--24,27)); + Symbol (SynSymbol c)], (24,4--24,30)); List (Paren, [Symbol (SynSymbol let); Discard (25,9--25,10); - List - (Paren, - [Symbol (SynSymbol .DoStuff); - Symbol (SynSymbol counter)], (25,11--25,29))], - (25,4--25,30)); Const (Bool true, (26,4--26,8))], - (23,2--26,9))], (21,1--26,9))), None, (21,0--26,10)), - (21,0--26,10)); + List (Paren, [Symbol (SynSymbol .DoStuff); Symbol (SynSymbol counter)], (25,11--25,29))], + (25,4--25,30)); Const (Bool true, (26,4--26,8))], (23,2--26,9))], (21,1--26,9))), None, + (21,0--26,10)), (21,0--26,10)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (21,0--26,10)), (21,0--26,10)); - Symbol (SynSymbol visp_result_todo)], (21,0--26,10)), - (21,0--26,10))], (8,0--26,10))] \ No newline at end of file + [Const (String ("%A", Regular, (21,0--26,10)), (21,0--26,10)); Symbol (SynSymbol visp_result_todo)], + (21,0--26,10)), (21,0--26,10))], (8,0--26,10))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_numbers_int-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_numbers_int-0.structured output.verified.txt index 33fedc0..9fcaa0a 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_numbers_int-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_numbers_int-0.structured output.verified.txt @@ -3,26 +3,22 @@ ([Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("int32 is %A", Regular, (9,9--9,22)), (9,9--9,22)); - Const (Int32 99, (9,23--9,25))], (9,1--9,25)), (9,0--9,26)); + [Const (String ("int32 is %A", Regular, (9,9--9,22)), (9,9--9,22)); Const (Int32 99, (9,23--9,25))], + (9,1--9,25)), (9,0--9,26)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("int32 is %A", Regular, (10,9--10,22)), (10,9--10,22)); - Const (Int32 99, (10,23--10,26))], (10,1--10,26)), (10,0--10,27)); + [Const (String ("int32 is %A", Regular, (10,9--10,22)), (10,9--10,22)); Const (Int32 99, (10,23--10,26))], + (10,1--10,26)), (10,0--10,27)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (11,0--11,27)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("int64 is %A", Regular, (11,9--11,22)), - (11,9--11,22)); Const (Int64 99L, (11,23--11,26))], - (11,1--11,26)), None, (11,0--11,27)), (11,0--11,27)); + [Const (String ("int64 is %A", Regular, (11,9--11,22)), (11,9--11,22)); + Const (Int64 99L, (11,23--11,26))], (11,1--11,26)), None, (11,0--11,27)), (11,0--11,27)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (11,0--11,27)), (11,0--11,27)); - Symbol (SynSymbol visp_result_todo)], (11,0--11,27)), - (11,0--11,27))], (9,0--11,27))] \ No newline at end of file + [Const (String ("%A", Regular, (11,0--11,27)), (11,0--11,27)); Symbol (SynSymbol visp_result_todo)], + (11,0--11,27)), (11,0--11,27))], (9,0--11,27))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_call-tuple-args-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_call-tuple-args-0.structured output.verified.txt index 21c81a5..a4d7bca 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_call-tuple-args-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_call-tuple-args-0.structured output.verified.txt @@ -3,43 +3,29 @@ ([Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("result is is %A", Regular, (8,9--8,26)), (8,9--8,26)); + [Const (String ("result is is %A", Regular, (8,9--8,26)), (8,9--8,26)); DotMethod (Symbol (SynSymbol System.String), SynSymbol Concat, [Tuple - ([Const - (String ("first", Regular, (8,51--8,58)), (8,51--8,58)); - Const - (String ("second", Regular, (8,60--8,68)), (8,60--8,68)); - Const - (String ("third", Regular, (8,70--8,77)), (8,70--8,77))], - (8,51--8,77))], Apply, (8,28--8,78))], (8,1--8,79)), - (8,0--8,80)); + ([Const (String ("first", Regular, (8,51--8,58)), (8,51--8,58)); + Const (String ("second", Regular, (8,60--8,68)), (8,60--8,68)); + Const (String ("third", Regular, (8,70--8,77)), (8,70--8,77))], (8,51--8,77))], Apply, + (8,28--8,78))], (8,1--8,79)), (8,0--8,80)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (9,0--9,79)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("result is is %A", Regular, (9,9--9,26)), - (9,9--9,26)); + [Const (String ("result is is %A", Regular, (9,9--9,26)), (9,9--9,26)); FunctionCall (Symbol (SynSymbol System.String.Concat), [Tuple - ([Const - (String ("first", Regular, (9,50--9,57)), - (9,50--9,57)); - Const - (String ("second", Regular, (9,59--9,67)), - (9,59--9,67)); - Const - (String ("third", Regular, (9,69--9,76)), - (9,69--9,76))], (9,50--9,76))], (9,28--9,77))], + ([Const (String ("first", Regular, (9,50--9,57)), (9,50--9,57)); + Const (String ("second", Regular, (9,59--9,67)), (9,59--9,67)); + Const (String ("third", Regular, (9,69--9,76)), (9,69--9,76))], (9,50--9,76))], (9,28--9,77))], (9,1--9,78)), None, (9,0--9,79)), (9,0--9,79)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (9,0--9,79)), (9,0--9,79)); - Symbol (SynSymbol visp_result_todo)], (9,0--9,79)), (9,0--9,79))], - (8,0--9,79))] \ No newline at end of file + [Const (String ("%A", Regular, (9,0--9,79)), (9,0--9,79)); Symbol (SynSymbol visp_result_todo)], + (9,0--9,79)), (9,0--9,79))], (8,0--9,79))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_lambda-shorthand-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_lambda-shorthand-0.structured output.verified.txt index b75cb37..079dff1 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_lambda-shorthand-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_lambda-shorthand-0.structured output.verified.txt @@ -4,22 +4,16 @@ (LetOrUse (Named (SynSymbol temp, (8,5--8,9)), LambdaShort - (Op - (Infix - (SynSymbol +, - [Symbol (SynSymbol %1); Symbol (SynSymbol %2)], - (8,12--8,19))), (8,10--8,20)), None, (8,1--8,20)), - (8,0--8,21)); + (Op (Infix (SynSymbol +, [Symbol (SynSymbol %1); Symbol (SynSymbol %2)], (8,12--8,19))), (8,10--8,20)), + None, (8,1--8,20)), (8,0--8,21)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (9,0--9,10)), FunctionCall - (Symbol (SynSymbol temp), - [Const (Int32 1, (9,6--9,7)); Const (Int32 2, (9,8--9,9))], - (9,1--9,9)), None, (9,0--9,10)), (9,0--9,10)); + (Symbol (SynSymbol temp), [Const (Int32 1, (9,6--9,7)); Const (Int32 2, (9,8--9,9))], (9,1--9,9)), None, + (9,0--9,10)), (9,0--9,10)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (9,0--9,10)), (9,0--9,10)); - Symbol (SynSymbol visp_result_todo)], (9,0--9,10)), (9,0--9,10))], - (8,0--9,10))] \ No newline at end of file + [Const (String ("%A", Regular, (9,0--9,10)), (9,0--9,10)); Symbol (SynSymbol visp_result_todo)], + (9,0--9,10)), (9,0--9,10))], (8,0--9,10))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_let-values.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_let-values.structured output.verified.txt index 389df01..640eff8 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_let-values.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_let-values.structured output.verified.txt @@ -5,10 +5,8 @@ (Symbol (SynSymbol printfn), [Const (String ("%i", Regular, (13,9--13,13)), (13,9--13,13)); FunctionCall - (Symbol (SynSymbol add), - [Const (Int32 1, (13,19--13,20)); - Const (Int32 2, (13,21--13,22))], (13,15--13,22))], - (13,1--13,23)), (13,0--13,24)); + (Symbol (SynSymbol add), [Const (Int32 1, (13,19--13,20)); Const (Int32 2, (13,21--13,22))], + (13,15--13,22))], (13,1--13,23)), (13,0--13,24)); Expr (FunctionCall (Symbol (SynSymbol printfn), @@ -19,21 +17,17 @@ Collection (SynCollection (FsList, - [Const (Int32 1, (14,38--14,39)); - Const (Int32 2, (14,40--14,41)); - Const (Int32 3, (14,42--14,43)); - Const (Int32 4, (14,44--14,45)); - Const (Int32 5, (14,46--14,47))], (14,32--14,47)))], - (14,15--14,48))], (14,1--14,49)), (14,0--14,50)); + [Const (Int32 1, (14,38--14,39)); Const (Int32 2, (14,40--14,41)); + Const (Int32 3, (14,42--14,43)); Const (Int32 4, (14,44--14,45)); + Const (Int32 5, (14,46--14,47))], (14,32--14,47)))], (14,15--14,48))], (14,1--14,49)), + (14,0--14,50)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (16,0--16,20)), - Const - (String ("let-value support?", Regular, (16,0--16,20)), - (16,0--16,20)), None, (16,0--16,20)), (16,0--16,20)); + Const (String ("let-value support?", Regular, (16,0--16,20)), (16,0--16,20)), None, (16,0--16,20)), + (16,0--16,20)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (16,0--16,20)), (16,0--16,20)); - Symbol (SynSymbol visp_result_todo)], (16,0--16,20)), - (16,0--16,20))], (13,0--16,20))] \ No newline at end of file + [Const (String ("%A", Regular, (16,0--16,20)), (16,0--16,20)); Symbol (SynSymbol visp_result_todo)], + (16,0--16,20)), (16,0--16,20))], (13,0--16,20))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-0.structured output.verified.txt index c6b41e3..9a2b9dd 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-0.structured output.verified.txt @@ -1,217 +1,140 @@ ParsedFile [AnonModule - ([HashDirective - (ParsedHashDirective - ("nowarn", [String ("26", Regular, (9,8--9,12))], (9,0--9,12)), - (9,0--9,12)); + ([HashDirective (ParsedHashDirective ("nowarn", [String ("26", Regular, (9,8--9,12))], (9,0--9,12)), (9,0--9,12)); Expr (Match (Const (String ("hello", Regular, (11,7--11,14)), (11,7--11,14)), [SynMatch - (Const (String ("hello", Regular, (12,3--12,10)), (12,3--12,10)), - None, + (Const (String ("hello", Regular, (12,3--12,10)), (12,3--12,10)), None, [FunctionCall - (Symbol (SynSymbol printfn), - [Const - (String ("was hello", Regular, (13,13--13,24)), - (13,13--13,24))], (13,5--13,24))], (12,3--13,25)); + (Symbol (SynSymbol printfn), [Const (String ("was hello", Regular, (13,13--13,24)), (13,13--13,24))], + (13,5--13,24))], (12,3--13,25)); SynMatch (Discard (15,3--15,4), None, [FunctionCall - (Symbol (SynSymbol printfn), - [Const - (String ("default", Regular, (16,13--16,22)), - (16,13--16,22))], (16,5--16,22))], (15,3--16,23))], - (11,1--17,3)), (11,0--17,4)); + (Symbol (SynSymbol printfn), [Const (String ("default", Regular, (16,13--16,22)), (16,13--16,22))], + (16,5--16,22))], (15,3--16,23))], (11,1--17,3)), (11,0--17,4)); Expr (Match - (Tuple - ([Const (Int32 1, (19,15--19,16)); - Const (Int32 2, (19,17--19,18))], (19,8--19,18)), + (Tuple ([Const (Int32 1, (19,15--19,16)); Const (Int32 2, (19,17--19,18))], (19,8--19,18)), [SynMatch (Collection (SynCollection (Paren, - [Named (SynSymbol a, (20,12--20,13)); - Trivia (Comma, (20,4--20,5)); + [Named (SynSymbol a, (20,12--20,13)); Trivia (Comma, (20,4--20,5)); Const (Int32 2, (20,14--20,15))], (20,4--20,16))), Some - (Op - (Infix - (SynSymbol >=, - [Symbol (SynSymbol a); Const (Int32 0, (21,16--21,17))], - (21,11--21,17)))), + (Op (Infix (SynSymbol >=, [Symbol (SynSymbol a); Const (Int32 0, (21,16--21,17))], (21,11--21,17)))), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("a is %A", Regular, (22,13--22,22)), - (22,13--22,22)); Symbol (SynSymbol a)], (22,5--22,24))], - (20,4--22,25)); + [Const (String ("a is %A", Regular, (22,13--22,22)), (22,13--22,22)); Symbol (SynSymbol a)], + (22,5--22,24))], (20,4--22,25)); SynMatch (Discard (24,3--24,4), None, [FunctionCall - (Symbol (SynSymbol printfn), - [Const - (String ("default", Regular, (25,13--25,22)), - (25,13--25,22))], (25,5--25,22))], (24,3--25,23))], - (19,1--26,3)), (19,0--26,4)); + (Symbol (SynSymbol printfn), [Const (String ("default", Regular, (25,13--25,22)), (25,13--25,22))], + (25,5--25,22))], (24,3--25,23))], (19,1--26,3)), (19,0--26,4)); Expr (Match - (Tuple - ([Const (Int32 1, (28,15--28,16)); - Const (Int32 2, (28,17--28,18))], (28,8--28,18)), + (Tuple ([Const (Int32 1, (28,15--28,16)); Const (Int32 2, (28,17--28,18))], (28,8--28,18)), [SynMatch (Collection (SynCollection (Paren, - [Named (SynSymbol a, (29,5--29,6)); - Trivia (Comma, (29,6--29,7)); - Const (Int32 2, (29,8--29,9))], (29,4--29,10))), + [Named (SynSymbol a, (29,5--29,6)); Trivia (Comma, (29,6--29,7)); Const (Int32 2, (29,8--29,9))], + (29,4--29,10))), Some - (Op - (Infix - (SynSymbol >=, - [Symbol (SynSymbol a); Const (Int32 0, (30,16--30,17))], - (30,11--30,17)))), + (Op (Infix (SynSymbol >=, [Symbol (SynSymbol a); Const (Int32 0, (30,16--30,17))], (30,11--30,17)))), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("a is %A", Regular, (31,13--31,22)), - (31,13--31,22)); Symbol (SynSymbol a)], (31,5--31,24))], - (29,4--31,25)); + [Const (String ("a is %A", Regular, (31,13--31,22)), (31,13--31,22)); Symbol (SynSymbol a)], + (31,5--31,24))], (29,4--31,25)); SynMatch (Discard (33,3--33,4), None, [FunctionCall - (Symbol (SynSymbol printfn), - [Const - (String ("default", Regular, (34,13--34,22)), - (34,13--34,22))], (34,5--34,22))], (33,3--34,23))], - (28,1--35,3)), (28,0--35,4)); + (Symbol (SynSymbol printfn), [Const (String ("default", Regular, (34,13--34,22)), (34,13--34,22))], + (34,5--34,22))], (33,3--34,23))], (28,1--35,3)), (28,0--35,4)); Expr (Match - (FunctionCall - (Symbol (SynSymbol Some), [Const (Int32 1, (37,13--37,14))], - (37,8--37,14)), + (FunctionCall (Symbol (SynSymbol Some), [Const (Int32 1, (37,13--37,14))], (37,8--37,14)), [SynMatch (Collection (SynCollection - (Paren, - [Named (SynSymbol Some, (38,5--38,9)); - Named (SynSymbol a, (38,10--38,11))], (38,4--38,12))), + (Paren, [Named (SynSymbol Some, (38,5--38,9)); Named (SynSymbol a, (38,10--38,11))], (38,4--38,12))), Some - (Op - (Infix - (SynSymbol >=, - [Symbol (SynSymbol a); Const (Int32 0, (39,16--39,17))], - (39,11--39,17)))), + (Op (Infix (SynSymbol >=, [Symbol (SynSymbol a); Const (Int32 0, (39,16--39,17))], (39,11--39,17)))), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("a is %A", Regular, (40,13--40,22)), - (40,13--40,22)); Symbol (SynSymbol a)], (40,5--40,24))], - (38,4--40,25)); + [Const (String ("a is %A", Regular, (40,13--40,22)), (40,13--40,22)); Symbol (SynSymbol a)], + (40,5--40,24))], (38,4--40,25)); SynMatch (Collection - (SynCollection - (Paren, - [Named (SynSymbol Some, (42,5--42,9)); - Discard (42,10--42,11)], (42,4--42,12))), None, + (SynCollection (Paren, [Named (SynSymbol Some, (42,5--42,9)); Discard (42,10--42,11)], (42,4--42,12))), + None, [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("some other", Regular, (43,13--43,25)), - (43,13--43,25))], (43,5--43,25))], (42,4--43,26)); + [Const (String ("some other", Regular, (43,13--43,25)), (43,13--43,25))], (43,5--43,25))], + (42,4--43,26)); SynMatch (Discard (45,3--45,4), None, [FunctionCall - (Symbol (SynSymbol printfn), - [Const - (String ("default", Regular, (46,13--46,22)), - (46,13--46,22))], (46,5--46,22))], (45,3--46,23))], - (37,1--47,3)), (37,0--48,1)); + (Symbol (SynSymbol printfn), [Const (String ("default", Regular, (46,13--46,22)), (46,13--46,22))], + (46,5--46,22))], (45,3--46,23))], (37,1--47,3)), (37,0--48,1)); Expr (Match (Collection (SynCollection (FsList, - [Const (Int32 1, (50,8--50,9)); - Const (Int32 2, (50,13--50,14)); - Const (Int32 3, (50,18--50,19)); - Const (Int32 4, (50,23--50,24)); - Const (Unit, (50,28--50,30))], (50,8--50,30))), + [Const (Int32 1, (50,8--50,9)); Const (Int32 2, (50,13--50,14)); Const (Int32 3, (50,18--50,19)); + Const (Int32 4, (50,23--50,24)); Const (Unit, (50,28--50,30))], (50,8--50,30))), [SynMatch (Collection (SynCollection (Paren, - [Named (SynSymbol x, (51,4--51,5)); - Trivia (ColonColon, (51,6--51,8)); - Named (SynSymbol y, (51,9--51,10)); - Trivia (ColonColon, (51,11--51,13)); - Named (SynSymbol rest, (51,14--51,18))], (51,3--51,19))), - None, + [Named (SynSymbol x, (51,4--51,5)); Trivia (ColonColon, (51,6--51,8)); + Named (SynSymbol y, (51,9--51,10)); Trivia (ColonColon, (51,11--51,13)); + Named (SynSymbol rest, (51,14--51,18))], (51,3--51,19))), None, [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String - ("x is %A y is %A rest is %A", Regular, - (52,13--52,41)), (52,13--52,41)); - Symbol (SynSymbol x); Symbol (SynSymbol y); - Symbol (SynSymbol rest)], (52,5--52,50))], (51,3--52,51)); + [Const (String ("x is %A y is %A rest is %A", Regular, (52,13--52,41)), (52,13--52,41)); + Symbol (SynSymbol x); Symbol (SynSymbol y); Symbol (SynSymbol rest)], (52,5--52,50))], + (51,3--52,51)); SynMatch (Collection (SynCollection (Paren, - [Named (SynSymbol x, (54,4--54,5)); - Trivia (ColonColon, (54,6--54,8)); - Named (SynSymbol rest, (54,9--54,13))], (54,3--54,14))), - None, + [Named (SynSymbol x, (54,4--54,5)); Trivia (ColonColon, (54,6--54,8)); + Named (SynSymbol rest, (54,9--54,13))], (54,3--54,14))), None, [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("x is %A rest is %A", Regular, (55,13--55,33)), - (55,13--55,33)); Symbol (SynSymbol x); - Symbol (SynSymbol rest)], (55,5--55,40))], (54,3--55,41)); + [Const (String ("x is %A rest is %A", Regular, (55,13--55,33)), (55,13--55,33)); + Symbol (SynSymbol x); Symbol (SynSymbol rest)], (55,5--55,40))], (54,3--55,41)); SynMatch (Collection (SynCollection (Paren, - [Named (SynSymbol x, (57,4--57,5)); - Trivia (ColonColon, (57,6--57,8)); - Collection (SynCollection (Bracket, [], (57,9--57,11)))], - (57,3--57,12))), None, + [Named (SynSymbol x, (57,4--57,5)); Trivia (ColonColon, (57,6--57,8)); + Collection (SynCollection (Bracket, [], (57,9--57,11)))], (57,3--57,12))), None, [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String - ("x is %A rest is empty", Regular, (58,13--58,36)), - (58,13--58,36)); Symbol (SynSymbol x)], (58,5--58,38))], - (57,3--58,39)); + [Const (String ("x is %A rest is empty", Regular, (58,13--58,36)), (58,13--58,36)); + Symbol (SynSymbol x)], (58,5--58,38))], (57,3--58,39)); SynMatch (Collection - (SynCollection - (Paren, - [Collection (SynCollection (Bracket, [], (60,4--60,6)))], - (60,3--60,7))), None, + (SynCollection (Paren, [Collection (SynCollection (Bracket, [], (60,4--60,6)))], (60,3--60,7))), None, [FunctionCall - (Symbol (SynSymbol printfn), - [Const - (String ("empty", Regular, (60,17--60,24)), - (60,17--60,24))], (60,9--60,24))], (60,3--60,25)); + (Symbol (SynSymbol printfn), [Const (String ("empty", Regular, (60,17--60,24)), (60,17--60,24))], + (60,9--60,24))], (60,3--60,25)); SynMatch (Collection (SynCollection (Bracket, [], (61,3--61,5))), None, [FunctionCall - (Symbol (SynSymbol printfn), - [Const - (String ("empty", Regular, (61,15--61,22)), - (61,15--61,22))], (61,7--61,22))], (61,3--61,23))], - (50,1--61,24)), (50,0--62,1)); + (Symbol (SynSymbol printfn), [Const (String ("empty", Regular, (61,15--61,22)), (61,15--61,22))], + (61,7--61,22))], (61,3--61,23))], (50,1--61,24)), (50,0--62,1)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (64,0--64,2)), - Const (Unit, (64,0--64,2)), None, (64,0--64,2)), (64,0--64,2)); + (LetOrUse (Named (SynSymbol visp_result_todo, (64,0--64,2)), Const (Unit, (64,0--64,2)), None, (64,0--64,2)), + (64,0--64,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (64,0--64,2)), (64,0--64,2)); - Symbol (SynSymbol visp_result_todo)], (64,0--64,2)), (64,0--64,2))], - (9,0--64,2))] \ No newline at end of file + [Const (String ("%A", Regular, (64,0--64,2)), (64,0--64,2)); Symbol (SynSymbol visp_result_todo)], + (64,0--64,2)), (64,0--64,2))], (9,0--64,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-1.structured output.verified.txt index 67f7362..56290fd 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_match-1.structured output.verified.txt @@ -3,35 +3,22 @@ ([Expr (FunctionDef (SynSymbol IsString, None, - Args - (List - [Typed - (Named (SynSymbol lhs, (8,15--8,18)), Ident obj, - (8,14--8,24))], (8,13--8,25)), + Args (List [Typed (Named (SynSymbol lhs, (8,15--8,18)), Ident obj, (8,14--8,24))], (8,13--8,25)), [Match (Symbol (SynSymbol lhs), [SynMatch - (IsInst (Ident string, (10,5--10,16)), None, - [Const (Bool true, (10,17--10,21))], (10,5--10,21)); - SynMatch - (Discard (11,5--11,6), None, - [Const (Bool false, (11,7--11,12))], (11,5--11,12))], + (IsInst (Ident string, (10,5--10,16)), None, [Const (Bool true, (10,17--10,21))], (10,5--10,21)); + SynMatch (Discard (11,5--11,6), None, [Const (Bool false, (11,7--11,12))], (11,5--11,12))], (9,3--11,13))], (8,1--12,3)), (8,0--12,4)); Expr (FunctionDef (SynSymbol AreEqualStrings, None, Args (List - [Typed - (Named (SynSymbol lhs, (14,22--14,25)), Ident obj, - (14,21--14,31)); - Typed - (Named (SynSymbol rhs, (14,33--14,36)), Ident obj, - (14,32--14,42))], (14,20--14,43)), + [Typed (Named (SynSymbol lhs, (14,22--14,25)), Ident obj, (14,21--14,31)); + Typed (Named (SynSymbol rhs, (14,33--14,36)), Ident obj, (14,32--14,42))], (14,20--14,43)), [Match - (Tuple - ([Symbol (SynSymbol lhs); Symbol (SynSymbol rhs)], - (15,10--15,18)), + (Tuple ([Symbol (SynSymbol lhs); Symbol (SynSymbol rhs)], (15,10--15,18)), [SynMatch (Collection (SynCollection @@ -40,100 +27,68 @@ (SynCollection (Paren, [As - (IsInst (Ident string, (16,7--16,16)), - Named (SynSymbol lhss, (16,17--16,21)), - (16,6--16,22))], (16,6--16,22))); - Trivia (Dot, (16,23--16,24)); + (IsInst (Ident string, (16,7--16,16)), Named (SynSymbol lhss, (16,17--16,21)), + (16,6--16,22))], (16,6--16,22))); Trivia (Dot, (16,23--16,24)); Collection (SynCollection (Paren, [As - (IsInst (Ident string, (16,26--16,35)), - Named (SynSymbol rhss, (16,36--16,40)), - (16,25--16,41))], (16,25--16,41)))], - (16,5--16,42))), None, - [Op - (Infix - (SynSymbol =, - [Symbol (SynSymbol lhss); Symbol (SynSymbol rhss)], - (17,7--17,18)))], (16,5--17,19)); - SynMatch - (Discard (19,5--19,6), None, - [Const (Bool false, (19,7--19,12))], (19,5--19,12))], + (IsInst (Ident string, (16,26--16,35)), Named (SynSymbol rhss, (16,36--16,40)), + (16,25--16,41))], (16,25--16,41)))], (16,5--16,42))), None, + [Op (Infix (SynSymbol =, [Symbol (SynSymbol lhss); Symbol (SynSymbol rhss)], (17,7--17,18)))], + (16,5--17,19)); + SynMatch (Discard (19,5--19,6), None, [Const (Bool false, (19,7--19,12))], (19,5--19,12))], (15,3--19,13))], (14,1--20,3)), (14,0--21,1)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("IsString: %A", Regular, (23,9--23,23)), (23,9--23,23)); - FunctionCall - (Symbol (SynSymbol IsString), [Const (Int32 1, (23,34--23,35))], - (23,25--23,35))], (23,1--23,36)), (23,0--23,37)); + [Const (String ("IsString: %A", Regular, (23,9--23,23)), (23,9--23,23)); + FunctionCall (Symbol (SynSymbol IsString), [Const (Int32 1, (23,34--23,35))], (23,25--23,35))], + (23,1--23,36)), (23,0--23,37)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("IsString: %A", Regular, (24,9--24,23)), (24,9--24,23)); + [Const (String ("IsString: %A", Regular, (24,9--24,23)), (24,9--24,23)); FunctionCall - (Symbol (SynSymbol IsString), - [Const - (String ("foo", Regular, (24,34--24,39)), (24,34--24,39))], + (Symbol (SynSymbol IsString), [Const (String ("foo", Regular, (24,34--24,39)), (24,34--24,39))], (24,25--24,39))], (24,1--24,40)), (24,0--24,41)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("AreEqualStrings: %A", Regular, (26,9--26,30)), - (26,9--26,30)); + [Const (String ("AreEqualStrings: %A", Regular, (26,9--26,30)), (26,9--26,30)); FunctionCall - (Symbol (SynSymbol AreEqualStrings), - [Const (Int32 1, (26,48--26,49)); - Const (Int32 2, (26,50--26,51))], (26,32--26,51))], - (26,1--26,52)), (26,0--26,53)); + (Symbol (SynSymbol AreEqualStrings), [Const (Int32 1, (26,48--26,49)); Const (Int32 2, (26,50--26,51))], + (26,32--26,51))], (26,1--26,52)), (26,0--26,53)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("AreEqualStrings: %A", Regular, (27,9--27,30)), - (27,9--27,30)); + [Const (String ("AreEqualStrings: %A", Regular, (27,9--27,30)), (27,9--27,30)); FunctionCall (Symbol (SynSymbol AreEqualStrings), - [Const - (String ("foo", Regular, (27,48--27,53)), (27,48--27,53)); - Const (Int32 2, (27,54--27,55))], (27,32--27,55))], - (27,1--27,56)), (27,0--27,57)); + [Const (String ("foo", Regular, (27,48--27,53)), (27,48--27,53)); Const (Int32 2, (27,54--27,55))], + (27,32--27,55))], (27,1--27,56)), (27,0--27,57)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("AreEqualStrings: %A", Regular, (28,9--28,30)), - (28,9--28,30)); + [Const (String ("AreEqualStrings: %A", Regular, (28,9--28,30)), (28,9--28,30)); FunctionCall (Symbol (SynSymbol AreEqualStrings), - [Const - (String ("foo", Regular, (28,48--28,53)), (28,48--28,53)); - Const - (String ("foo", Regular, (28,54--28,59)), (28,54--28,59))], - (28,32--28,59))], (28,1--28,60)), (28,0--28,61)); + [Const (String ("foo", Regular, (28,48--28,53)), (28,48--28,53)); + Const (String ("foo", Regular, (28,54--28,59)), (28,54--28,59))], (28,32--28,59))], (28,1--28,60)), + (28,0--28,61)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (29,0--29,61)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("AreEqualStrings: %A", Regular, (29,9--29,30)), - (29,9--29,30)); + [Const (String ("AreEqualStrings: %A", Regular, (29,9--29,30)), (29,9--29,30)); FunctionCall (Symbol (SynSymbol AreEqualStrings), - [Const - (String ("foo", Regular, (29,48--29,53)), (29,48--29,53)); - Const - (String ("bar", Regular, (29,54--29,59)), (29,54--29,59))], - (29,32--29,59))], (29,1--29,60)), None, (29,0--29,61)), - (29,0--29,61)); + [Const (String ("foo", Regular, (29,48--29,53)), (29,48--29,53)); + Const (String ("bar", Regular, (29,54--29,59)), (29,54--29,59))], (29,32--29,59))], (29,1--29,60)), + None, (29,0--29,61)), (29,0--29,61)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (29,0--29,61)), (29,0--29,61)); - Symbol (SynSymbol visp_result_todo)], (29,0--29,61)), - (29,0--29,61))], (8,0--29,61))] \ No newline at end of file + [Const (String ("%A", Regular, (29,0--29,61)), (29,0--29,61)); Symbol (SynSymbol visp_result_todo)], + (29,0--29,61)), (29,0--29,61))], (8,0--29,61))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_operators-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_operators-0.structured output.verified.txt index 19d118d..5d32b17 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_operators-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_operators-0.structured output.verified.txt @@ -3,110 +3,75 @@ ([Expr (FunctionDef (SynSymbol OrTest, None, - Args - (List - [Named (SynSymbol a, (8,12--8,13)); - Named (SynSymbol b, (8,14--8,15))], (8,11--8,16)), - [Op - (Infix - (SynSymbol ||, [Symbol (SynSymbol a); Symbol (SynSymbol b)], - (8,18--8,25)))], (8,1--8,26)), (8,0--8,27)); + Args (List [Named (SynSymbol a, (8,12--8,13)); Named (SynSymbol b, (8,14--8,15))], (8,11--8,16)), + [Op (Infix (SynSymbol ||, [Symbol (SynSymbol a); Symbol (SynSymbol b)], (8,18--8,25)))], (8,1--8,26)), + (8,0--8,27)); Expr (FunctionDef (SynSymbol AndTest, None, - Args - (List - [Named (SynSymbol a, (9,13--9,14)); - Named (SynSymbol b, (9,15--9,16))], (9,12--9,17)), - [Op - (Infix - (SynSymbol &&, [Symbol (SynSymbol a); Symbol (SynSymbol b)], - (9,19--9,25)))], (9,1--9,26)), (9,0--9,27)); + Args (List [Named (SynSymbol a, (9,13--9,14)); Named (SynSymbol b, (9,15--9,16))], (9,12--9,17)), + [Op (Infix (SynSymbol &&, [Symbol (SynSymbol a); Symbol (SynSymbol b)], (9,19--9,25)))], (9,1--9,26)), + (9,0--9,27)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("OrTest %A", Regular, (11,9--11,20)), (11,9--11,20)); + [Const (String ("OrTest %A", Regular, (11,9--11,20)), (11,9--11,20)); FunctionCall - (Symbol (SynSymbol OrTest), - [Const (Bool false, (11,29--11,34)); - Const (Bool false, (11,35--11,40))], (11,22--11,40))], - (11,1--11,41)), (11,0--11,42)); + (Symbol (SynSymbol OrTest), [Const (Bool false, (11,29--11,34)); Const (Bool false, (11,35--11,40))], + (11,22--11,40))], (11,1--11,41)), (11,0--11,42)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("OrTest %A", Regular, (12,9--12,20)), (12,9--12,20)); + [Const (String ("OrTest %A", Regular, (12,9--12,20)), (12,9--12,20)); FunctionCall - (Symbol (SynSymbol OrTest), - [Const (Bool false, (12,29--12,34)); - Const (Bool true, (12,35--12,39))], (12,22--12,39))], - (12,1--12,40)), (12,0--12,41)); + (Symbol (SynSymbol OrTest), [Const (Bool false, (12,29--12,34)); Const (Bool true, (12,35--12,39))], + (12,22--12,39))], (12,1--12,40)), (12,0--12,41)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("OrTest %A", Regular, (13,9--13,20)), (13,9--13,20)); + [Const (String ("OrTest %A", Regular, (13,9--13,20)), (13,9--13,20)); FunctionCall - (Symbol (SynSymbol OrTest), - [Const (Bool true, (13,29--13,33)); - Const (Bool false, (13,34--13,39))], (13,22--13,39))], - (13,1--13,40)), (13,0--13,41)); + (Symbol (SynSymbol OrTest), [Const (Bool true, (13,29--13,33)); Const (Bool false, (13,34--13,39))], + (13,22--13,39))], (13,1--13,40)), (13,0--13,41)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("OrTest %A", Regular, (14,9--14,20)), (14,9--14,20)); + [Const (String ("OrTest %A", Regular, (14,9--14,20)), (14,9--14,20)); FunctionCall - (Symbol (SynSymbol OrTest), - [Const (Bool true, (14,29--14,33)); - Const (Bool true, (14,34--14,38))], (14,22--14,38))], - (14,1--14,39)), (14,0--14,40)); + (Symbol (SynSymbol OrTest), [Const (Bool true, (14,29--14,33)); Const (Bool true, (14,34--14,38))], + (14,22--14,38))], (14,1--14,39)), (14,0--14,40)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("AndTest %A", Regular, (16,9--16,21)), (16,9--16,21)); + [Const (String ("AndTest %A", Regular, (16,9--16,21)), (16,9--16,21)); FunctionCall - (Symbol (SynSymbol AndTest), - [Const (Bool false, (16,31--16,36)); - Const (Bool false, (16,37--16,42))], (16,23--16,42))], - (16,1--16,43)), (16,0--16,44)); + (Symbol (SynSymbol AndTest), [Const (Bool false, (16,31--16,36)); Const (Bool false, (16,37--16,42))], + (16,23--16,42))], (16,1--16,43)), (16,0--16,44)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("AndTest %A", Regular, (17,9--17,21)), (17,9--17,21)); + [Const (String ("AndTest %A", Regular, (17,9--17,21)), (17,9--17,21)); FunctionCall - (Symbol (SynSymbol AndTest), - [Const (Bool false, (17,31--17,36)); - Const (Bool true, (17,37--17,41))], (17,23--17,41))], - (17,1--17,42)), (17,0--17,43)); + (Symbol (SynSymbol AndTest), [Const (Bool false, (17,31--17,36)); Const (Bool true, (17,37--17,41))], + (17,23--17,41))], (17,1--17,42)), (17,0--17,43)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("AndTest %A", Regular, (18,9--18,21)), (18,9--18,21)); + [Const (String ("AndTest %A", Regular, (18,9--18,21)), (18,9--18,21)); FunctionCall - (Symbol (SynSymbol AndTest), - [Const (Bool true, (18,31--18,35)); - Const (Bool false, (18,36--18,41))], (18,23--18,41))], - (18,1--18,42)), (18,0--18,43)); + (Symbol (SynSymbol AndTest), [Const (Bool true, (18,31--18,35)); Const (Bool false, (18,36--18,41))], + (18,23--18,41))], (18,1--18,42)), (18,0--18,43)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (19,0--19,42)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("AndTest %A", Regular, (19,9--19,21)), (19,9--19,21)); + [Const (String ("AndTest %A", Regular, (19,9--19,21)), (19,9--19,21)); FunctionCall - (Symbol (SynSymbol AndTest), - [Const (Bool true, (19,31--19,35)); - Const (Bool true, (19,36--19,40))], (19,23--19,40))], - (19,1--19,41)), None, (19,0--19,42)), (19,0--19,42)); + (Symbol (SynSymbol AndTest), [Const (Bool true, (19,31--19,35)); Const (Bool true, (19,36--19,40))], + (19,23--19,40))], (19,1--19,41)), None, (19,0--19,42)), (19,0--19,42)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (19,0--19,42)), (19,0--19,42)); - Symbol (SynSymbol visp_result_todo)], (19,0--19,42)), - (19,0--19,42))], (8,0--19,42))] \ No newline at end of file + [Const (String ("%A", Regular, (19,0--19,42)), (19,0--19,42)); Symbol (SynSymbol visp_result_todo)], + (19,0--19,42)), (19,0--19,42))], (8,0--19,42))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_props.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_props.structured output.verified.txt index f605bb6..fa2756a 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_props.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_props.structured output.verified.txt @@ -2,18 +2,14 @@ [AnonModule ([Expr (LetOrUse - (Named (SynSymbol hello, (8,5--8,10)), - Const (String ("world", Regular, (8,11--8,18)), (8,11--8,18)), None, + (Named (SynSymbol hello, (8,5--8,10)), Const (String ("world", Regular, (8,11--8,18)), (8,11--8,18)), None, (8,1--8,18)), (8,0--8,19)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (9,0--9,15)), - DotProperty - (Symbol (SynSymbol hello), SynSymbol Length, (9,1--9,14)), None, - (9,0--9,15)), (9,0--9,15)); + DotProperty (Symbol (SynSymbol hello), SynSymbol Length, (9,1--9,14)), None, (9,0--9,15)), (9,0--9,15)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (9,0--9,15)), (9,0--9,15)); - Symbol (SynSymbol visp_result_todo)], (9,0--9,15)), (9,0--9,15))], - (8,0--9,15))] \ No newline at end of file + [Const (String ("%A", Regular, (9,0--9,15)), (9,0--9,15)); Symbol (SynSymbol visp_result_todo)], + (9,0--9,15)), (9,0--9,15))], (8,0--9,15))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_seq-as-generic-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_seq-as-generic-0.structured output.verified.txt index 3409ced..ccc0db9 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_seq-as-generic-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_seq-as-generic-0.structured output.verified.txt @@ -6,31 +6,24 @@ Args (List [Typed - (Named (SynSymbol items, (8,15--8,20)), - Generic (Ident seq, [Ident ^T], (8,22--8,29)), - (8,14--8,30))], (8,13--8,31)), - [FunctionCall - (Symbol (SynSymbol Seq.length), [Symbol (SynSymbol items)], - (8,33--8,49))], (8,1--8,50)), (8,0--8,51)); + (Named (SynSymbol items, (8,15--8,20)), Generic (Ident seq, [Ident ^T], (8,22--8,29)), (8,14--8,30))], + (8,13--8,31)), [FunctionCall (Symbol (SynSymbol Seq.length), [Symbol (SynSymbol items)], (8,33--8,49))], + (8,1--8,50)), (8,0--8,51)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (10,9--10,13)), (10,9--10,13)); FunctionCall - (Symbol (SynSymbol SeqAsArg), - [Collection (SynCollection (FsList, [], (10,24--10,28)))], - (10,15--10,28))], (10,1--10,29)), (10,0--10,30)); + (Symbol (SynSymbol SeqAsArg), [Collection (SynCollection (FsList, [], (10,24--10,28)))], (10,15--10,28))], + (10,1--10,29)), (10,0--10,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (11,9--11,13)), (11,9--11,13)); FunctionCall (Symbol (SynSymbol SeqAsArg), - [Collection - (SynCollection - (FsList, [Const (Int32 1, (11,26--11,27))], - (11,24--11,29)))], (11,15--11,29))], (11,1--11,30)), - (11,0--11,31)); + [Collection (SynCollection (FsList, [Const (Int32 1, (11,26--11,27))], (11,24--11,29)))], + (11,15--11,29))], (11,1--11,30)), (11,0--11,31)); Expr (FunctionCall (Symbol (SynSymbol printfn), @@ -39,29 +32,23 @@ (Symbol (SynSymbol SeqAsArg), [Collection (SynCollection - (FsList, - [Const (Int32 1, (12,26--12,27)); - Const (Int32 2, (12,28--12,29))], (12,24--12,31)))], + (FsList, [Const (Int32 1, (12,26--12,27)); Const (Int32 2, (12,28--12,29))], (12,24--12,31)))], (12,15--12,31))], (12,1--12,32)), (12,0--12,33)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (13,9--13,13)), (13,9--13,13)); FunctionCall - (Symbol (SynSymbol SeqAsArg), - [Collection (SynCollection (FsArray, [], (13,24--13,28)))], - (13,15--13,28))], (13,1--13,29)), (13,0--13,30)); + (Symbol (SynSymbol SeqAsArg), [Collection (SynCollection (FsArray, [], (13,24--13,28)))], (13,15--13,28))], + (13,1--13,29)), (13,0--13,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (14,9--14,13)), (14,9--14,13)); FunctionCall (Symbol (SynSymbol SeqAsArg), - [Collection - (SynCollection - (FsArray, [Const (Int32 1, (14,26--14,27))], - (14,24--14,29)))], (14,15--14,29))], (14,1--14,30)), - (14,0--14,31)); + [Collection (SynCollection (FsArray, [Const (Int32 1, (14,26--14,27))], (14,24--14,29)))], + (14,15--14,29))], (14,1--14,30)), (14,0--14,31)); Expr (FunctionCall (Symbol (SynSymbol printfn), @@ -70,9 +57,7 @@ (Symbol (SynSymbol SeqAsArg), [Collection (SynCollection - (FsArray, - [Const (Int32 1, (15,26--15,27)); - Const (Int32 2, (15,28--15,29))], (15,24--15,31)))], + (FsArray, [Const (Int32 1, (15,26--15,27)); Const (Int32 2, (15,28--15,29))], (15,24--15,31)))], (15,15--15,31))], (15,1--15,32)), (15,0--15,33)); Expr (FunctionCall @@ -80,10 +65,8 @@ [Const (String ("%A", Regular, (16,9--16,13)), (16,9--16,13)); FunctionCall (Symbol (SynSymbol SeqAsArg), - [Computation - (SynSymbol seq, [Const (Unit, (16,31--16,33))], - (16,25--16,33))], (16,15--16,34))], (16,1--16,35)), - (16,0--16,36)); + [Computation (SynSymbol seq, [Const (Unit, (16,31--16,33))], (16,25--16,33))], (16,15--16,34))], + (16,1--16,35)), (16,0--16,36)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (17,0--17,53)), @@ -94,16 +77,11 @@ (Symbol (SynSymbol SeqAsArg), [Computation (SynSymbol seq, - [FsYield - (Const (Int32 1, (17,38--17,39)), false, - (17,32--17,39)); - FsYield - (Const (Int32 2, (17,48--17,49)), false, - (17,42--17,49))], (17,25--17,50))], (17,15--17,51))], - (17,1--17,52)), None, (17,0--17,53)), (17,0--17,53)); + [FsYield (Const (Int32 1, (17,38--17,39)), false, (17,32--17,39)); + FsYield (Const (Int32 2, (17,48--17,49)), false, (17,42--17,49))], (17,25--17,50))], + (17,15--17,51))], (17,1--17,52)), None, (17,0--17,53)), (17,0--17,53)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,0--17,53)), (17,0--17,53)); - Symbol (SynSymbol visp_result_todo)], (17,0--17,53)), - (17,0--17,53))], (8,0--17,53))] \ No newline at end of file + [Const (String ("%A", Regular, (17,0--17,53)), (17,0--17,53)); Symbol (SynSymbol visp_result_todo)], + (17,0--17,53)), (17,0--17,53))], (8,0--17,53))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_span-to-int32-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_span-to-int32-0.structured output.verified.txt index 8dc2b6e..2b8b165 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_span-to-int32-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_span-to-int32-0.structured output.verified.txt @@ -4,34 +4,25 @@ Expr (FunctionDef (SynSymbol Test, None, - Args - (List - [Typed - (Named (SynSymbol text, (10,11--10,15)), Ident string, - (10,10--10,24))], (10,9--10,25)), + Args (List [Typed (Named (SynSymbol text, (10,11--10,15)), Ident string, (10,10--10,24))], (10,9--10,25)), [LetOrUse (Named (SynSymbol span1, (11,7--11,12)), - DotMethod - (Symbol (SynSymbol text), SynSymbol AsSpan, [], Tuple, - (11,14--11,26)), None, (11,3--11,27)); - FunctionCall - (Symbol (SynSymbol span->int32), [Symbol (SynSymbol span1)], - (12,3--12,20))], (10,1--12,21)), (10,0--13,1)); + DotMethod (Symbol (SynSymbol text), SynSymbol AsSpan, [], Tuple, (11,14--11,26)), None, (11,3--11,27)); + FunctionCall (Symbol (SynSymbol span->int32), [Symbol (SynSymbol span1)], (12,3--12,20))], (10,1--12,21)), + (10,0--13,1)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (15,9--15,13)), (15,9--15,13)); FunctionCall - (Symbol (SynSymbol Test), - [Const (String ("99", Regular, (15,20--15,24)), (15,20--15,24))], + (Symbol (SynSymbol Test), [Const (String ("99", Regular, (15,20--15,24)), (15,20--15,24))], (15,15--15,24))], (15,1--15,25)), (15,0--15,26)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (16,9--16,13)), (16,9--16,13)); FunctionCall - (Symbol (SynSymbol Test), - [Const (String ("0", Regular, (16,20--16,23)), (16,20--16,23))], + (Symbol (SynSymbol Test), [Const (String ("0", Regular, (16,20--16,23)), (16,20--16,23))], (16,15--16,23))], (16,1--16,24)), (16,0--16,25)); Expr (LetOrUse @@ -40,14 +31,10 @@ (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (17,9--17,13)), (17,9--17,13)); FunctionCall - (Symbol (SynSymbol Test), - [Const - (String ("1", Regular, (17,20--17,23)), (17,20--17,23))], - (17,15--17,23))], (17,1--17,24)), None, (17,0--17,25)), - (17,0--17,25)); + (Symbol (SynSymbol Test), [Const (String ("1", Regular, (17,20--17,23)), (17,20--17,23))], + (17,15--17,23))], (17,1--17,24)), None, (17,0--17,25)), (17,0--17,25)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,0--17,25)), (17,0--17,25)); - Symbol (SynSymbol visp_result_todo)], (17,0--17,25)), - (17,0--17,25))], (8,0--17,25))] \ No newline at end of file + [Const (String ("%A", Regular, (17,0--17,25)), (17,0--17,25)); Symbol (SynSymbol visp_result_todo)], + (17,0--17,25)), (17,0--17,25))], (8,0--17,25))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt index 2c2899c..9857097 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt @@ -3,35 +3,26 @@ ([Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is: '%s'", Regular, (9,9--9,26)), (9,9--9,26)); - Const - (String - (" + [Const (String ("string is: '%s'", Regular, (9,9--9,26)), (9,9--9,26)); + Const (String (" this is a multiline string -", Regular, (9,27--13,1)), - (9,27--13,1))], (9,1--13,1)), (9,0--13,2)); +", Regular, (9,27--13,1)), (9,27--13,1))], (9,1--13,1)), + (9,0--13,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is: '%s'", Regular, (15,9--15,26)), - (15,9--15,26)); - Const - (String - (" + [Const (String ("string is: '%s'", Regular, (15,9--15,26)), (15,9--15,26)); + Const (String (" this is a multiline string -", TripleQuote, - (15,27--19,3)), (15,27--19,3))], (15,1--19,3)), (15,0--19,4)); +", TripleQuote, (15,27--19,3)), (15,27--19,3))], + (15,1--19,3)), (15,0--19,4)); Expr (FunctionDef - (SynSymbol generate-test, None, - Args - (List [Named (SynSymbol path, (21,19--21,23))], (21,18--21,24)), + (SynSymbol generate-test, None, Args (List [Named (SynSymbol path, (21,19--21,23))], (21,18--21,24)), [LetOrUse (Named (SynSymbol template, (22,7--22,15)), FunctionCall @@ -42,28 +33,21 @@ let ``can parse %s`` = TestUtils.runTest %s |> Async.AwaitTask - ", - TripleQuote, (22,25--26,5)), (22,25--26,5)); - Symbol (SynSymbol path); Symbol (SynSymbol path)], - (22,17--26,15)), None, (22,3--26,16)); - Symbol (SynSymbol template)], (21,1--28,10)), (21,0--28,11)); + ", TripleQuote, + (22,25--26,5)), (22,25--26,5)); Symbol (SynSymbol path); Symbol (SynSymbol path)], + (22,17--26,15)), None, (22,3--26,16)); Symbol (SynSymbol template)], (21,1--28,10)), (21,0--28,11)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (30,0--30,49)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("test is: '%s'", Regular, (30,9--30,24)), - (30,9--30,24)); + [Const (String ("test is: '%s'", Regular, (30,9--30,24)), (30,9--30,24)); FunctionCall (Symbol (SynSymbol generate-test), - [Const - (String ("hello", Regular, (30,40--30,47)), - (30,40--30,47))], (30,26--30,47))], (30,1--30,48)), None, - (30,0--30,49)), (30,0--30,49)); + [Const (String ("hello", Regular, (30,40--30,47)), (30,40--30,47))], (30,26--30,47))], (30,1--30,48)), + None, (30,0--30,49)), (30,0--30,49)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (30,0--30,49)), (30,0--30,49)); - Symbol (SynSymbol visp_result_todo)], (30,0--30,49)), - (30,0--30,49))], (9,0--30,49))] \ No newline at end of file + [Const (String ("%A", Regular, (30,0--30,49)), (30,0--30,49)); Symbol (SynSymbol visp_result_todo)], + (30,0--30,49)), (30,0--30,49))], (9,0--30,49))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt index 3fca28d..d361839 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt @@ -3,69 +3,48 @@ ([Expr (LetOrUse (Named (SynSymbol value, (8,5--8,10)), - Const - (String ("r:\rt:\tn:\na:\a\"", Regular, (8,11--8,31)), - (8,11--8,31)), None, (8,1--8,31)), (8,0--8,32)); + Const (String ("r:\rt:\tn:\na:\a\"", Regular, (8,11--8,31)), (8,11--8,31)), None, (8,1--8,31)), (8,0--8,32)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is '%s'", Regular, (10,9--10,25)), - (10,9--10,25)); Symbol (SynSymbol value)], (10,1--10,31)), - (10,0--10,32)); + [Const (String ("string is '%s'", Regular, (10,9--10,25)), (10,9--10,25)); Symbol (SynSymbol value)], + (10,1--10,31)), (10,0--10,32)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is '%s'", Regular, (11,9--11,25)), - (11,9--11,25)); - Const - (String ("r:\rt:\tn:\na:\a", TripleQuote, (11,26--11,48)), - (11,26--11,48))], (11,1--11,48)), (11,0--11,49)); + [Const (String ("string is '%s'", Regular, (11,9--11,25)), (11,9--11,25)); + Const (String ("r:\rt:\tn:\na:\a", TripleQuote, (11,26--11,48)), (11,26--11,48))], (11,1--11,48)), + (11,0--11,49)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is '%s'", Regular, (12,9--12,25)), - (12,9--12,25)); - Const - (String ("r:\rt:\tn:\na:\a", TripleQuote, (12,26--12,50)), - (12,26--12,50))], (12,1--12,50)), (12,0--12,51)); + [Const (String ("string is '%s'", Regular, (12,9--12,25)), (12,9--12,25)); + Const (String ("r:\rt:\tn:\na:\a", TripleQuote, (12,26--12,50)), (12,26--12,50))], (12,1--12,50)), + (12,0--12,51)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is '%s'", Regular, (13,9--13,25)), - (13,9--13,25)); - Const - (String - (" + [Const (String ("string is '%s'", Regular, (13,9--13,25)), (13,9--13,25)); + Const (String (" multiple lines are okay? -", TripleQuote, (13,26--15,3)), - (13,26--15,3))], (13,1--15,3)), (13,0--15,4)); +", TripleQuote, (13,26--15,3)), (13,26--15,3))], (13,1--15,3)), + (13,0--15,4)); Expr (Begin ([Begin ([Begin ([FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is '%s'", Regular, (19,15--19,31)), - (19,15--19,31)); + [Const (String ("string is '%s'", Regular, (19,15--19,31)), (19,15--19,31)); Const - (String - (" + (String (" multiple lines are okay? - ", - TripleQuote, (19,32--21,9)), (19,32--21,9))], - (19,7--21,9))], Do, (18,5--21,10))], Do, (17,3--22,5))], - Do, (16,1--22,6)), (16,0--22,7)); + ", TripleQuote, (19,32--21,9)), + (19,32--21,9))], (19,7--21,9))], Do, (18,5--21,10))], Do, (17,3--22,5))], Do, (16,1--22,6)), + (16,0--22,7)); Expr (FunctionDef - (SynSymbol genTestHeader, None, - Args - (List [Named (SynSymbol moduleName, (24,19--24,29))], - (24,18--24,30)), + (SynSymbol genTestHeader, None, Args (List [Named (SynSymbol moduleName, (24,19--24,29))], (24,18--24,30)), [ThreadLast ([Expr (FunctionCall @@ -82,36 +61,27 @@ module %s ", - TripleQuote, (25,16--34,5)), (25,16--34,5)); - Symbol (SynSymbol moduleName); - Symbol (SynSymbol moduleName)], (25,8--34,27)), - (25,7--34,28))], (25,3--34,28))], (24,1--35,5)), + TripleQuote, (25,16--34,5)), (25,16--34,5)); Symbol (SynSymbol moduleName); + Symbol (SynSymbol moduleName)], (25,8--34,27)), (25,7--34,28))], (25,3--34,28))], (24,1--35,5)), (24,0--35,6)); Expr (LetOrUse - (Named (SynSymbol lf, (37,5--37,7)), - Symbol (SynSymbol System.Environment.NewLine), None, (37,1--37,34)), + (Named (SynSymbol lf, (37,5--37,7)), Symbol (SynSymbol System.Environment.NewLine), None, (37,1--37,34)), (37,0--37,35)); Expr (FunctionDef (SynSymbol genTestTemplate, None, Args (List - [Typed - (Named (SynSymbol prefix, (39,22--39,28)), Ident string, - (39,21--39,37)); - Typed - (Named (SynSymbol path, (39,39--39,43)), Ident string, - (39,38--39,52))], (39,20--39,53)), + [Typed (Named (SynSymbol prefix, (39,22--39,28)), Ident string, (39,21--39,37)); + Typed (Named (SynSymbol path, (39,39--39,43)), Ident string, (39,38--39,52))], (39,20--39,53)), [LetOrUse (Named (SynSymbol path, (40,7--40,11)), DotMethod (Symbol (SynSymbol path), SynSymbol Replace, - [Const - (String ("\\", Regular, (40,27--40,31)), (40,27--40,31)); - Const - (String ("/", Regular, (40,32--40,35)), (40,32--40,35))], - Tuple, (40,13--40,35)), None, (40,3--40,36)); + [Const (String ("\\", Regular, (40,27--40,31)), (40,27--40,31)); + Const (String ("/", Regular, (40,32--40,35)), (40,32--40,35))], Tuple, (40,13--40,35)), None, + (40,3--40,36)); LetOrUse (Named (SynSymbol testname, (41,7--41,15)), ThreadLast @@ -120,14 +90,9 @@ (LambdaShort (DotMethod (Symbol (SynSymbol %1), SynSymbol Replace, - [Const - (String ("/", Regular, (41,40--41,43)), - (41,40--41,43)); - Const - (String ("_", Regular, (41,44--41,47)), - (41,44--41,47))], Tuple, (41,28--41,47)), - (41,26--41,48)), (41,26--41,48))], (41,17--41,48)), - None, (41,3--41,49)); + [Const (String ("/", Regular, (41,40--41,43)), (41,40--41,43)); + Const (String ("_", Regular, (41,44--41,47)), (41,44--41,47))], Tuple, (41,28--41,47)), + (41,26--41,48)), (41,26--41,48))], (41,17--41,48)), None, (41,3--41,49)); Begin ([Begin ([LetOrUse @@ -140,11 +105,8 @@ [] let ``%s %s`` () = TestUtils.runTest "%s" ", - TripleQuote, (45,29--48,9)), (45,29--48,9)); - Symbol (SynSymbol prefix); - Symbol (SynSymbol testname); - Symbol (SynSymbol path)], (45,21--48,30)), None, - (45,7--48,31)); + TripleQuote, (45,29--48,9)), (45,29--48,9)); Symbol (SynSymbol prefix); + Symbol (SynSymbol testname); Symbol (SynSymbol path)], (45,21--48,30)), None, (45,7--48,31)); LetOrUse (Named (SynSymbol template2, (49,11--49,20)), Const @@ -153,8 +115,7 @@ [] let ``interpolated {prefix} {testname}`` () = TestUtils.runTest "{path}" ", - InterpolatedTripleQuote 1, (49,21--52,9)), - (49,21--52,9)), None, (49,7--52,9)); + InterpolatedTripleQuote 1, (49,21--52,9)), (49,21--52,9)), None, (49,7--52,9)); LetOrUse (Named (SynSymbol template3, (53,11--53,20)), Const @@ -163,8 +124,7 @@ [] let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{path}} {path}" ", - InterpolatedTripleQuote 2, (53,21--56,9)), - (53,21--56,9)), None, (53,7--56,9)); + InterpolatedTripleQuote 2, (53,21--56,9)), (53,21--56,9)), None, (53,7--56,9)); LetOrUse (Named (SynSymbol template4, (57,11--57,20)), Const @@ -173,17 +133,14 @@ [] let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{(+ 1 2 3)}} {{(+ 1 2 3)}} {(+ 1 2 3)}" ", - InterpolatedTripleQuote 2, (57,21--60,9)), - (57,21--60,9)), None, (57,7--60,9)); + InterpolatedTripleQuote 2, (57,21--60,9)), (57,21--60,9)), None, (57,7--60,9)); Op (Infix (SynSymbol +, - [Symbol (SynSymbol template); Symbol (SynSymbol lf); - Symbol (SynSymbol template2); Symbol (SynSymbol lf); - Symbol (SynSymbol template3); Symbol (SynSymbol lf); - Symbol (SynSymbol template4); Symbol (SynSymbol lf)], - (61,7--61,59)))], Do, (44,5--61,60))], Do, - (43,3--62,5))], (39,1--62,6)), (39,0--63,1)); + [Symbol (SynSymbol template); Symbol (SynSymbol lf); Symbol (SynSymbol template2); + Symbol (SynSymbol lf); Symbol (SynSymbol template3); Symbol (SynSymbol lf); + Symbol (SynSymbol template4); Symbol (SynSymbol lf)], (61,7--61,59)))], Do, (44,5--61,60))], + Do, (43,3--62,5))], (39,1--62,6)), (39,0--63,1)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (65,0--65,91)), @@ -192,22 +149,15 @@ (SynSymbol +, [FunctionCall (Symbol (SynSymbol genTestHeader), - [Const - (String ("Temp", Regular, (65,18--65,24)), - (65,18--65,24))], (65,4--65,24)); + [Const (String ("Temp", Regular, (65,18--65,24)), (65,18--65,24))], (65,4--65,24)); Symbol (SynSymbol System.Environment.NewLine); FunctionCall (Symbol (SynSymbol genTestTemplate), - [Const - (String ("example", Regular, (65,70--65,79)), - (65,70--65,79)); - Const - (String ("example", Regular, (65,80--65,89)), - (65,80--65,89))], (65,54--65,89))], (65,1--65,90))), - None, (65,0--65,91)), (65,0--65,91)); + [Const (String ("example", Regular, (65,70--65,79)), (65,70--65,79)); + Const (String ("example", Regular, (65,80--65,89)), (65,80--65,89))], (65,54--65,89))], + (65,1--65,90))), None, (65,0--65,91)), (65,0--65,91)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (65,0--65,91)), (65,0--65,91)); - Symbol (SynSymbol visp_result_todo)], (65,0--65,91)), - (65,0--65,91))], (8,0--65,91))] \ No newline at end of file + [Const (String ("%A", Regular, (65,0--65,91)), (65,0--65,91)); Symbol (SynSymbol visp_result_todo)], + (65,0--65,91)), (65,0--65,91))], (8,0--65,91))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt index 16c6dca..aa66f53 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt @@ -2,59 +2,41 @@ [AnonModule ([Expr (LetOrUse - (Named (SynSymbol value, (8,5--8,10)), - Const (String ("hello world", Regular, (8,11--8,24)), (8,11--8,24)), + (Named (SynSymbol value, (8,5--8,10)), Const (String ("hello world", Regular, (8,11--8,24)), (8,11--8,24)), None, (8,1--8,24)), (8,0--8,25)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is '%s'", Regular, (10,9--10,25)), - (10,9--10,25)); - Const - (String - ("interpolated: {value} {value.Length}", Interpolated 1, - (10,26--10,65)), (10,26--10,65))], (10,1--10,65)), - (10,0--10,66)); + [Const (String ("string is '%s'", Regular, (10,9--10,25)), (10,9--10,25)); + Const (String ("interpolated: {value} {value.Length}", Interpolated 1, (10,26--10,65)), (10,26--10,65))], + (10,1--10,65)), (10,0--10,66)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is '%s'", Regular, (11,9--11,25)), - (11,9--11,25)); + [Const (String ("string is '%s'", Regular, (11,9--11,25)), (11,9--11,25)); Const - (String - ("interpolated: {value} {value.Length}", - InterpolatedTripleQuote 1, (11,26--11,69)), (11,26--11,69))], - (11,1--11,69)), (11,0--11,70)); + (String ("interpolated: {value} {value.Length}", InterpolatedTripleQuote 1, (11,26--11,69)), + (11,26--11,69))], (11,1--11,69)), (11,0--11,70)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is '%s'", Regular, (12,9--12,25)), - (12,9--12,25)); + [Const (String ("string is '%s'", Regular, (12,9--12,25)), (12,9--12,25)); Const (String - ("interpolated: {value} {{ value }} {{ value.Length }}", - InterpolatedTripleQuote 2, (12,26--12,86)), (12,26--12,86))], - (12,1--12,86)), (12,0--12,87)); + ("interpolated: {value} {{ value }} {{ value.Length }}", InterpolatedTripleQuote 2, (12,26--12,86)), + (12,26--12,86))], (12,1--12,86)), (12,0--12,87)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (13,0--13,104)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is '%s'", Regular, (13,9--13,25)), - (13,9--13,25)); + [Const (String ("string is '%s'", Regular, (13,9--13,25)), (13,9--13,25)); Const (String - ("interpolated: {value} {{ value }} {{{ value }}} {{{ value.Length }}}", - InterpolatedTripleQuote 3, (13,26--13,103)), - (13,26--13,103))], (13,1--13,103)), None, (13,0--13,104)), - (13,0--13,104)); + ("interpolated: {value} {{ value }} {{{ value }}} {{{ value.Length }}}", InterpolatedTripleQuote 3, + (13,26--13,103)), (13,26--13,103))], (13,1--13,103)), None, (13,0--13,104)), (13,0--13,104)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (13,0--13,104)), (13,0--13,104)); - Symbol (SynSymbol visp_result_todo)], (13,0--13,104)), - (13,0--13,104))], (8,0--13,104))] \ No newline at end of file + [Const (String ("%A", Regular, (13,0--13,104)), (13,0--13,104)); Symbol (SynSymbol visp_result_todo)], + (13,0--13,104)), (13,0--13,104))], (8,0--13,104))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-1.structured output.verified.txt index fe8e61a..db81c88 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-1.structured output.verified.txt @@ -2,25 +2,19 @@ [AnonModule ([Expr (LetOrUse - (Named (SynSymbol value, (8,5--8,10)), - Const (String ("hello world", Regular, (8,11--8,24)), (8,11--8,24)), + (Named (SynSymbol value, (8,5--8,10)), Const (String ("hello world", Regular, (8,11--8,24)), (8,11--8,24)), None, (8,1--8,24)), (8,0--8,25)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (10,0--10,67)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("string is '%s'", Regular, (10,9--10,25)), - (10,9--10,25)); + [Const (String ("string is '%s'", Regular, (10,9--10,25)), (10,9--10,25)); Const - (String - ("interpolated: {value} {value} {value}", Interpolated 1, - (10,26--10,66)), (10,26--10,66))], (10,1--10,66)), None, - (10,0--10,67)), (10,0--10,67)); + (String ("interpolated: {value} {value} {value}", Interpolated 1, (10,26--10,66)), (10,26--10,66))], + (10,1--10,66)), None, (10,0--10,67)), (10,0--10,67)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (10,0--10,67)), (10,0--10,67)); - Symbol (SynSymbol visp_result_todo)], (10,0--10,67)), - (10,0--10,67))], (8,0--10,67))] \ No newline at end of file + [Const (String ("%A", Regular, (10,0--10,67)), (10,0--10,67)); Symbol (SynSymbol visp_result_todo)], + (10,0--10,67)), (10,0--10,67))], (8,0--10,67))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_sym-with-arrow-in-macro-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_sym-with-arrow-in-macro-0.structured output.verified.txt index 7c1e9ce..ea8a7f5 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_sym-with-arrow-in-macro-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_sym-with-arrow-in-macro-0.structured output.verified.txt @@ -6,38 +6,29 @@ (SynMacro (SynSymbol noop-macro-1, [SynMacroCase - ([Discard (11,4--11,5); Symbol (SynSymbol ids, (11,6--11,9)); - Ellipsis (11,10--11,13)], + ([Discard (11,4--11,5); Symbol (SynSymbol ids, (11,6--11,9)); Ellipsis (11,10--11,13)], List - (Paren, - [Symbol (SynSymbol begin); Symbol (SynSymbol ids); - Ellipsis (11,26--11,29)], (11,15--11,30)), (11,2--11,31))], - (10,1--11,31))), (10,0--11,32)); + (Paren, [Symbol (SynSymbol begin); Symbol (SynSymbol ids); Ellipsis (11,26--11,29)], + (11,15--11,30)), (11,2--11,31))], (10,1--11,31))), (10,0--11,32)); Expr (FunctionDef - (SynSymbol something->nothing, Inline, - Args (List [Named (SynSymbol i, (13,31--13,32))], (13,30--13,33)), + (SynSymbol something->nothing, Inline, Args (List [Named (SynSymbol i, (13,31--13,32))], (13,30--13,33)), [Symbol (SynSymbol i)], (13,1--13,35)), (13,0--13,36)); Expr (FunctionDef - (SynSymbol Test, Inline, - Args (List [Named (SynSymbol i, (15,17--15,18))], (15,16--15,19)), + (SynSymbol Test, Inline, Args (List [Named (SynSymbol i, (15,17--15,18))], (15,16--15,19)), [SyntaxMacroCall (SynMacroCall (SynSymbol noop-macro-1, [Symbol (SynSymbol noop-macro-1); - List - (Paren, - [Symbol (SynSymbol something->nothing); - Symbol (SynSymbol i)], (16,16--16,38))], (16,3--16,38)))], - (15,1--16,39)), (15,0--16,40)); + List (Paren, [Symbol (SynSymbol something->nothing); Symbol (SynSymbol i)], (16,16--16,38))], + (16,3--16,38)))], (15,1--16,39)), (15,0--16,40)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (18,9--18,13)), (18,9--18,13)); - FunctionCall - (Symbol (SynSymbol Test), [Const (Int32 1, (18,20--18,21))], - (18,15--18,21))], (18,1--18,22)), (18,0--18,23)); + FunctionCall (Symbol (SynSymbol Test), [Const (Int32 1, (18,20--18,21))], (18,15--18,21))], (18,1--18,22)), + (18,0--18,23)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (19,0--19,29)), @@ -45,14 +36,10 @@ (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (19,9--19,13)), (19,9--19,13)); FunctionCall - (Symbol (SynSymbol Test), - [Const - (String ("hello", Regular, (19,20--19,27)), - (19,20--19,27))], (19,15--19,27))], (19,1--19,28)), None, - (19,0--19,29)), (19,0--19,29)); + (Symbol (SynSymbol Test), [Const (String ("hello", Regular, (19,20--19,27)), (19,20--19,27))], + (19,15--19,27))], (19,1--19,28)), None, (19,0--19,29)), (19,0--19,29)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (19,0--19,29)), (19,0--19,29)); - Symbol (SynSymbol visp_result_todo)], (19,0--19,29)), - (19,0--19,29))], (8,0--19,29))] \ No newline at end of file + [Const (String ("%A", Regular, (19,0--19,29)), (19,0--19,29)); Symbol (SynSymbol visp_result_todo)], + (19,0--19,29)), (19,0--19,29))], (8,0--19,29))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_tuple-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_tuple-0.structured output.verified.txt index 831a779..50cb1b7 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_tuple-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_tuple-0.structured output.verified.txt @@ -4,17 +4,15 @@ (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (8,9--8,13)), (8,9--8,13)); - Tuple - ([Const (Int32 1, (8,22--8,23)); Const (Int32 2, (8,24--8,25))], - (8,15--8,25))], (8,1--8,26)), (8,0--8,27)); + Tuple ([Const (Int32 1, (8,22--8,23)); Const (Int32 2, (8,24--8,25))], (8,15--8,25))], (8,1--8,26)), + (8,0--8,27)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (9,9--9,13)), (9,9--9,13)); Tuple - ([Const (Int32 1, (9,22--9,23)); Const (Int32 2, (9,24--9,25)); - Const (Int32 3, (9,26--9,27))], (9,15--9,27))], (9,1--9,28)), - (9,0--9,29)); + ([Const (Int32 1, (9,22--9,23)); Const (Int32 2, (9,24--9,25)); Const (Int32 3, (9,26--9,27))], + (9,15--9,27))], (9,1--9,28)), (9,0--9,29)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (10,0--10,31)), @@ -22,14 +20,11 @@ (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (10,9--10,13)), (10,9--10,13)); Tuple - ([Const (Int32 1, (10,22--10,23)); - Const (Int32 2, (10,24--10,25)); - Const (Int32 3, (10,26--10,27)); - Const (Int32 4, (10,28--10,29))], (10,15--10,29))], - (10,1--10,30)), None, (10,0--10,31)), (10,0--10,31)); + ([Const (Int32 1, (10,22--10,23)); Const (Int32 2, (10,24--10,25)); Const (Int32 3, (10,26--10,27)); + Const (Int32 4, (10,28--10,29))], (10,15--10,29))], (10,1--10,30)), None, (10,0--10,31)), + (10,0--10,31)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (10,0--10,31)), (10,0--10,31)); - Symbol (SynSymbol visp_result_todo)], (10,0--10,31)), - (10,0--10,31))], (8,0--10,31))] \ No newline at end of file + [Const (String ("%A", Regular, (10,0--10,31)), (10,0--10,31)); Symbol (SynSymbol visp_result_todo)], + (10,0--10,31)), (10,0--10,31))], (8,0--10,31))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-0.structured output.verified.txt index d4f9c63..477c323 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-0.structured output.verified.txt @@ -2,65 +2,47 @@ [AnonModule ([Expr (FunctionDef - (SynSymbol no-type, None, - Args (List [Named (SynSymbol s, (8,13--8,14))], (8,12--8,15)), + (SynSymbol no-type, None, Args (List [Named (SynSymbol s, (8,13--8,14))], (8,12--8,15)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("no-type %A", Regular, (8,25--8,37)), (8,25--8,37)); - Symbol (SynSymbol s)], (8,17--8,39))], (8,1--8,40)), - (8,0--8,41)); + [Const (String ("no-type %A", Regular, (8,25--8,37)), (8,25--8,37)); Symbol (SynSymbol s)], + (8,17--8,39))], (8,1--8,40)), (8,0--8,41)); Expr (FunctionCall - (Symbol (SynSymbol no-type), - [Const (String ("hello", Regular, (9,9--9,16)), (9,9--9,16))], - (9,1--9,16)), (9,0--9,17)); + (Symbol (SynSymbol no-type), [Const (String ("hello", Regular, (9,9--9,16)), (9,9--9,16))], (9,1--9,16)), + (9,0--9,17)); Expr (FunctionDef (SynSymbol with-type, None, - Args - (List - [Typed - (Named (SynSymbol s, (11,16--11,17)), Ident string, - (11,15--11,26))], (11,14--11,27)), + Args (List [Typed (Named (SynSymbol s, (11,16--11,17)), Ident string, (11,15--11,26))], (11,14--11,27)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("with-type %A", Regular, (11,37--11,51)), - (11,37--11,51)); Symbol (SynSymbol s)], (11,29--11,53))], - (11,1--11,54)), (11,0--11,55)); + [Const (String ("with-type %A", Regular, (11,37--11,51)), (11,37--11,51)); Symbol (SynSymbol s)], + (11,29--11,53))], (11,1--11,54)), (11,0--11,55)); Expr (FunctionCall - (Symbol (SynSymbol with-type), - [Const (String ("hello", Regular, (12,11--12,18)), (12,11--12,18))], + (Symbol (SynSymbol with-type), [Const (String ("hello", Regular, (12,11--12,18)), (12,11--12,18))], (12,1--12,18)), (12,0--12,19)); Expr (FunctionDef (SynSymbol with-type-multiple, None, Args (List - [Typed - (Named (SynSymbol s, (14,25--14,26)), Ident string, - (14,24--14,35)); - Typed - (Named (SynSymbol b, (14,37--14,38)), Ident int, - (14,36--14,44))], (14,23--14,45)), + [Typed (Named (SynSymbol s, (14,25--14,26)), Ident string, (14,24--14,35)); + Typed (Named (SynSymbol b, (14,37--14,38)), Ident int, (14,36--14,44))], (14,23--14,45)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("with-type-multiple %A", Regular, (15,11--15,34)), - (15,11--15,34)); Symbol (SynSymbol s)], (15,3--15,36)); + [Const (String ("with-type-multiple %A", Regular, (15,11--15,34)), (15,11--15,34)); + Symbol (SynSymbol s)], (15,3--15,36)); FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("with-type-multiple %A", Regular, (16,11--16,34)), - (16,11--16,34)); Symbol (SynSymbol b)], (16,3--16,36))], - (14,1--16,37)), (14,0--17,3)); + [Const (String ("with-type-multiple %A", Regular, (16,11--16,34)), (16,11--16,34)); + Symbol (SynSymbol b)], (16,3--16,36))], (14,1--16,37)), (14,0--17,3)); Expr (FunctionCall (Symbol (SynSymbol with-type-multiple), - [Const (String ("hello", Regular, (18,20--18,27)), (18,20--18,27)); - Const (Int32 99, (18,28--18,30))], (18,1--18,30)), (18,0--18,31)); + [Const (String ("hello", Regular, (18,20--18,27)), (18,20--18,27)); Const (Int32 99, (18,28--18,30))], + (18,1--18,30)), (18,0--18,31)); Expr (FunctionDef (SynSymbol with-tuple, None, @@ -69,26 +51,18 @@ [Collection (SynCollection (Paren, - [Named (SynSymbol x, (20,17--20,18)); - Trivia (Comma, (20,18--20,19)); - Named (SynSymbol y, (20,20--20,21))], (20,16--20,22)))], - (20,15--20,23)), + [Named (SynSymbol x, (20,17--20,18)); Trivia (Comma, (20,18--20,19)); + Named (SynSymbol y, (20,20--20,21))], (20,16--20,22)))], (20,15--20,23)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("with-tuple %A", Regular, (20,33--20,48)), - (20,33--20,48)); - Tuple - ([Symbol (SynSymbol x); Symbol (SynSymbol y)], - (20,50--20,55))], (20,25--20,56))], (20,1--20,57)), + [Const (String ("with-tuple %A", Regular, (20,33--20,48)), (20,33--20,48)); + Tuple ([Symbol (SynSymbol x); Symbol (SynSymbol y)], (20,50--20,55))], (20,25--20,56))], (20,1--20,57)), (20,0--20,58)); Expr (FunctionCall (Symbol (SynSymbol with-tuple), - [Tuple - ([Const (Int32 1, (21,13--21,14)); - Const (Int32 2, (21,17--21,18))], (21,13--21,18))], - (21,1--21,19)), (21,0--21,20)); + [Tuple ([Const (Int32 1, (21,13--21,14)); Const (Int32 2, (21,17--21,18))], (21,13--21,18))], (21,1--21,19)), + (21,0--21,20)); Expr (FunctionDef (SynSymbol with-tuple-type, None, @@ -98,31 +72,20 @@ (Collection (SynCollection (Paren, - [Named (SynSymbol x, (23,23--23,24)); - Trivia (Comma, (23,24--23,25)); - Named (SynSymbol y, (23,26--23,27))], - (23,22--23,28))), - Tuple - (false, - [Type (Ident int); Star (23,34--23,35); - Type (Ident int)], (23,30--23,39)), (23,21--23,40))], - (23,20--23,41)), + [Named (SynSymbol x, (23,23--23,24)); Trivia (Comma, (23,24--23,25)); + Named (SynSymbol y, (23,26--23,27))], (23,22--23,28))), + Tuple (false, [Type (Ident int); Star (23,34--23,35); Type (Ident int)], (23,30--23,39)), + (23,21--23,40))], (23,20--23,41)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("with-tuple-type %A", Regular, (23,51--23,71)), - (23,51--23,71)); - Tuple - ([Symbol (SynSymbol x); Symbol (SynSymbol y)], - (23,73--23,78))], (23,43--23,79))], (23,1--23,80)), + [Const (String ("with-tuple-type %A", Regular, (23,51--23,71)), (23,51--23,71)); + Tuple ([Symbol (SynSymbol x); Symbol (SynSymbol y)], (23,73--23,78))], (23,43--23,79))], (23,1--23,80)), (23,0--23,81)); Expr (FunctionCall (Symbol (SynSymbol with-tuple-type), - [Tuple - ([Const (Int32 1, (24,18--24,19)); - Const (Int32 2, (24,22--24,23))], (24,18--24,23))], - (24,1--24,24)), (24,0--24,25)); + [Tuple ([Const (Int32 1, (24,18--24,19)); Const (Int32 2, (24,22--24,23))], (24,18--24,23))], (24,1--24,24)), + (24,0--24,25)); Expr (FunctionDef (SynSymbol with-tuple-multiple, None, @@ -132,61 +95,38 @@ (Collection (SynCollection (Paren, - [Named (SynSymbol x, (26,27--26,28)); - Trivia (Comma, (26,28--26,29)); - Named (SynSymbol y, (26,30--26,31))], - (26,26--26,32))), - Tuple - (false, - [Type (Ident int); Star (26,38--26,39); - Type (Ident int)], (26,34--26,43)), (26,25--26,44)); + [Named (SynSymbol x, (26,27--26,28)); Trivia (Comma, (26,28--26,29)); + Named (SynSymbol y, (26,30--26,31))], (26,26--26,32))), + Tuple (false, [Type (Ident int); Star (26,38--26,39); Type (Ident int)], (26,34--26,43)), + (26,25--26,44)); Typed (Collection (SynCollection (Paren, - [Named (SynSymbol x2, (26,47--26,49)); - Trivia (Comma, (26,49--26,50)); - Named (SynSymbol y2, (26,51--26,53))], - (26,46--26,54))), - Tuple - (false, - [Type (Ident int); Star (26,60--26,61); - Type (Ident int)], (26,56--26,65)), (26,45--26,66))], - (26,24--26,67)), + [Named (SynSymbol x2, (26,47--26,49)); Trivia (Comma, (26,49--26,50)); + Named (SynSymbol y2, (26,51--26,53))], (26,46--26,54))), + Tuple (false, [Type (Ident int); Star (26,60--26,61); Type (Ident int)], (26,56--26,65)), + (26,45--26,66))], (26,24--26,67)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("with-tuple-multiple %A", Regular, (27,11--27,35)), - (27,11--27,35)); - Tuple - ([Symbol (SynSymbol x); Symbol (SynSymbol y)], - (27,37--27,42))], (27,3--27,43)); + [Const (String ("with-tuple-multiple %A", Regular, (27,11--27,35)), (27,11--27,35)); + Tuple ([Symbol (SynSymbol x); Symbol (SynSymbol y)], (27,37--27,42))], (27,3--27,43)); FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("with-tuple-multiple %A", Regular, (28,11--28,35)), - (28,11--28,35)); - Tuple - ([Symbol (SynSymbol x2); Symbol (SynSymbol y2)], - (28,37--28,44))], (28,3--28,45))], (26,1--28,46)), - (26,0--29,3)); + [Const (String ("with-tuple-multiple %A", Regular, (28,11--28,35)), (28,11--28,35)); + Tuple ([Symbol (SynSymbol x2); Symbol (SynSymbol y2)], (28,37--28,44))], (28,3--28,45))], + (26,1--28,46)), (26,0--29,3)); Expr (FunctionCall (Symbol (SynSymbol with-tuple-multiple), - [Tuple - ([Const (Int32 1, (30,22--30,23)); - Const (Int32 2, (30,26--30,27))], (30,22--30,27)); - Tuple - ([Const (Int32 3, (30,30--30,31)); - Const (Int32 4, (30,34--30,35))], (30,30--30,35))], - (30,1--30,36)), (30,0--30,37)); + [Tuple ([Const (Int32 1, (30,22--30,23)); Const (Int32 2, (30,26--30,27))], (30,22--30,27)); + Tuple ([Const (Int32 3, (30,30--30,31)); Const (Int32 4, (30,34--30,35))], (30,30--30,35))], (30,1--30,36)), + (30,0--30,37)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (32,0--32,2)), - Const (Unit, (32,0--32,2)), None, (32,0--32,2)), (32,0--32,2)); + (LetOrUse (Named (SynSymbol visp_result_todo, (32,0--32,2)), Const (Unit, (32,0--32,2)), None, (32,0--32,2)), + (32,0--32,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (32,0--32,2)), (32,0--32,2)); - Symbol (SynSymbol visp_result_todo)], (32,0--32,2)), (32,0--32,2))], - (8,0--32,2))] \ No newline at end of file + [Const (String ("%A", Regular, (32,0--32,2)), (32,0--32,2)); Symbol (SynSymbol visp_result_todo)], + (32,0--32,2)), (32,0--32,2))], (8,0--32,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-1.structured output.verified.txt index 19bbf18..595a54f 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_fn-1.structured output.verified.txt @@ -7,50 +7,32 @@ (List [Typed (Named (SynSymbol pred, (8,15--8,19)), - Paren - (Fun (Ident ^T, Ident bool, (8,22--8,32)), (8,21--8,33)), - (8,14--8,34)); Named (SynSymbol t, (8,35--8,36))], - (8,13--8,37)), - [FunctionCall - (Symbol (SynSymbol pred), [Symbol (SynSymbol t)], (9,3--9,9))], - (8,1--9,10)), (8,0--9,11)); + Paren (Fun (Ident ^T, Ident bool, (8,22--8,32)), (8,21--8,33)), (8,14--8,34)); + Named (SynSymbol t, (8,35--8,36))], (8,13--8,37)), + [FunctionCall (Symbol (SynSymbol pred), [Symbol (SynSymbol t)], (9,3--9,9))], (8,1--9,10)), (8,0--9,11)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("WithPred: %A", Regular, (11,9--11,23)), (11,9--11,23)); + [Const (String ("WithPred: %A", Regular, (11,9--11,23)), (11,9--11,23)); FunctionCall (Symbol (SynSymbol WithPred), [LambdaShort - (Op - (Infix - (SynSymbol =, - [Symbol (SynSymbol %1); - Const (Int32 1, (11,41--11,42))], (11,36--11,42))), - (11,34--11,43)); Const (Int32 1, (11,44--11,45))], - (11,25--11,45))], (11,1--11,46)), (11,0--11,47)); + (Op (Infix (SynSymbol =, [Symbol (SynSymbol %1); Const (Int32 1, (11,41--11,42))], (11,36--11,42))), + (11,34--11,43)); Const (Int32 1, (11,44--11,45))], (11,25--11,45))], (11,1--11,46)), (11,0--11,47)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("WithPred: %A", Regular, (12,9--12,23)), (12,9--12,23)); + [Const (String ("WithPred: %A", Regular, (12,9--12,23)), (12,9--12,23)); FunctionCall (Symbol (SynSymbol WithPred), [LambdaShort - (Op - (Infix - (SynSymbol =, - [Symbol (SynSymbol %1); - Const (Int32 1, (12,41--12,42))], (12,36--12,42))), - (12,34--12,43)); Const (Int32 0, (12,44--12,45))], - (12,25--12,45))], (12,1--12,46)), (12,0--12,47)); + (Op (Infix (SynSymbol =, [Symbol (SynSymbol %1); Const (Int32 1, (12,41--12,42))], (12,36--12,42))), + (12,34--12,43)); Const (Int32 0, (12,44--12,45))], (12,25--12,45))], (12,1--12,46)), (12,0--12,47)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (14,0--14,2)), - Const (Unit, (14,0--14,2)), None, (14,0--14,2)), (14,0--14,2)); + (LetOrUse (Named (SynSymbol visp_result_todo, (14,0--14,2)), Const (Unit, (14,0--14,2)), None, (14,0--14,2)), + (14,0--14,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (14,0--14,2)), (14,0--14,2)); - Symbol (SynSymbol visp_result_todo)], (14,0--14,2)), (14,0--14,2))], - (8,0--14,2))] \ No newline at end of file + [Const (String ("%A", Regular, (14,0--14,2)), (14,0--14,2)); Symbol (SynSymbol visp_result_todo)], + (14,0--14,2)), (14,0--14,2))], (8,0--14,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_let-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_let-0.structured output.verified.txt index 7a04de4..ed2a0d3 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_let-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_pats_let-0.structured output.verified.txt @@ -3,107 +3,83 @@ ([Expr (LetOrUse (Typed (Named (SynSymbol n, (8,6--8,7)), Ident string, (8,5--8,16)), - Const (String ("hello", Regular, (8,17--8,24)), (8,17--8,24)), None, - (8,1--8,24)), (8,0--8,25)); + Const (String ("hello", Regular, (8,17--8,24)), (8,17--8,24)), None, (8,1--8,24)), (8,0--8,25)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("n is: %s", Regular, (10,9--10,19)), (10,9--10,19)); - Symbol (SynSymbol n)], (10,1--10,21)), (10,0--10,22)); + [Const (String ("n is: %s", Regular, (10,9--10,19)), (10,9--10,19)); Symbol (SynSymbol n)], (10,1--10,21)), + (10,0--10,22)); Expr (LetOrUse (Typed (Collection (SynCollection (Paren, - [Named (SynSymbol x, (12,7--12,8)); - Trivia (Comma, (12,8--12,9)); + [Named (SynSymbol x, (12,7--12,8)); Trivia (Comma, (12,8--12,9)); Named (SynSymbol y, (12,10--12,11))], (12,6--12,12))), - Tuple - (false, - [Type (Ident int); Star (12,19--12,20); Type (Ident int)], - (12,15--12,24)), (12,5--12,25)), - Tuple - ([Const (Int32 1, (12,27--12,28)); - Const (Int32 2, (12,30--12,31))], (12,27--12,31)), None, + Tuple (false, [Type (Ident int); Star (12,19--12,20); Type (Ident int)], (12,15--12,24)), (12,5--12,25)), + Tuple ([Const (Int32 1, (12,27--12,28)); Const (Int32 2, (12,30--12,31))], (12,27--12,31)), None, (12,1--12,32)), (12,0--12,33)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("x is: %i", Regular, (13,9--13,19)), (13,9--13,19)); - Symbol (SynSymbol x)], (13,1--13,21)), (13,0--13,22)); + [Const (String ("x is: %i", Regular, (13,9--13,19)), (13,9--13,19)); Symbol (SynSymbol x)], (13,1--13,21)), + (13,0--13,22)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("y is: %i", Regular, (14,9--14,19)), (14,9--14,19)); - Symbol (SynSymbol y)], (14,1--14,21)), (14,0--14,22)); + [Const (String ("y is: %i", Regular, (14,9--14,19)), (14,9--14,19)); Symbol (SynSymbol y)], (14,1--14,21)), + (14,0--14,22)); Expr (LetOrUse (Collection (SynCollection (Paren, - [Named (SynSymbol x2, (16,6--16,8)); - Trivia (Comma, (16,8--16,9)); + [Named (SynSymbol x2, (16,6--16,8)); Trivia (Comma, (16,8--16,9)); Named (SynSymbol y2, (16,10--16,12))], (16,5--16,13))), - Tuple - ([Const (Int32 3, (16,15--16,16)); - Const (Int32 4, (16,18--16,19))], (16,15--16,19)), None, + Tuple ([Const (Int32 3, (16,15--16,16)); Const (Int32 4, (16,18--16,19))], (16,15--16,19)), None, (16,1--16,20)), (16,0--16,21)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("x2 is: %i", Regular, (17,9--17,20)), (17,9--17,20)); - Symbol (SynSymbol x2)], (17,1--17,23)), (17,0--17,24)); + [Const (String ("x2 is: %i", Regular, (17,9--17,20)), (17,9--17,20)); Symbol (SynSymbol x2)], (17,1--17,23)), + (17,0--17,24)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("y2 is: %i", Regular, (18,9--18,20)), (18,9--18,20)); - Symbol (SynSymbol y2)], (18,1--18,23)), (18,0--18,24)); + [Const (String ("y2 is: %i", Regular, (18,9--18,20)), (18,9--18,20)); Symbol (SynSymbol y2)], (18,1--18,23)), + (18,0--18,24)); Expr (LetOrUse (Collection (SynCollection - (Paren, - [Named (SynSymbol x3, (20,6--20,8)); - Trivia (Comma, (20,8--20,9)); Discard (20,10--20,11)], + (Paren, [Named (SynSymbol x3, (20,6--20,8)); Trivia (Comma, (20,8--20,9)); Discard (20,10--20,11)], (20,5--20,12))), - Tuple - ([Const (Int32 5, (20,14--20,15)); - Const (Int32 6, (20,17--20,18))], (20,14--20,18)), None, + Tuple ([Const (Int32 5, (20,14--20,15)); Const (Int32 6, (20,17--20,18))], (20,14--20,18)), None, (20,1--20,19)), (20,0--20,20)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("x3 is: %i", Regular, (21,9--21,20)), (21,9--21,20)); - Symbol (SynSymbol x3)], (21,1--21,23)), (21,0--21,24)); + [Const (String ("x3 is: %i", Regular, (21,9--21,20)), (21,9--21,20)); Symbol (SynSymbol x3)], (21,1--21,23)), + (21,0--21,24)); Expr (LetOrUse (Collection (SynCollection (Paren, - [Typed - (Named (SynSymbol x4, (23,7--23,9)), Ident int, - (23,6--23,15)); Trivia (Comma, (23,15--23,16)); + [Typed (Named (SynSymbol x4, (23,7--23,9)), Ident int, (23,6--23,15)); Trivia (Comma, (23,15--23,16)); Discard (23,17--23,18)], (23,5--23,19))), - Tuple - ([Const (Int32 7, (23,21--23,22)); - Const (Int32 8, (23,24--23,25))], (23,21--23,25)), None, + Tuple ([Const (Int32 7, (23,21--23,22)); Const (Int32 8, (23,24--23,25))], (23,21--23,25)), None, (23,1--23,26)), (23,0--23,27)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (24,0--24,24)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("x4 is: %i", Regular, (24,9--24,20)), (24,9--24,20)); - Symbol (SynSymbol x4)], (24,1--24,23)), None, (24,0--24,24)), - (24,0--24,24)); + [Const (String ("x4 is: %i", Regular, (24,9--24,20)), (24,9--24,20)); Symbol (SynSymbol x4)], + (24,1--24,23)), None, (24,0--24,24)), (24,0--24,24)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (24,0--24,24)), (24,0--24,24)); - Symbol (SynSymbol visp_result_todo)], (24,0--24,24)), - (24,0--24,24))], (8,0--24,24))] \ No newline at end of file + [Const (String ("%A", Regular, (24,0--24,24)), (24,0--24,24)); Symbol (SynSymbol visp_result_todo)], + (24,0--24,24)), (24,0--24,24))], (8,0--24,24))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_quotation_quote-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_quotation_quote-0.structured output.verified.txt index 16abec9..2830555 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_quotation_quote-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_quotation_quote-0.structured output.verified.txt @@ -8,16 +8,12 @@ Collection (SynCollection (Paren, - [Const (Int32 1, (9,13--9,14)); - Const (Int32 2, (9,15--9,16)); - Const (Int32 3, (9,17--9,18)); - Const (Int32 4, (9,19--9,20)); - Const (Int32 5, (9,21--9,22))], (9,12--9,23))), - (9,11--9,23)), None, (9,1--9,23)), (9,0--9,24)); + [Const (Int32 1, (9,13--9,14)); Const (Int32 2, (9,15--9,16)); Const (Int32 3, (9,17--9,18)); + Const (Int32 4, (9,19--9,20)); Const (Int32 5, (9,21--9,22))], (9,12--9,23))), (9,11--9,23)), + None, (9,1--9,23)), (9,0--9,24)); Expr (LetOrUse - (Named (SynSymbol sym, (10,5--10,8)), - Quote (true, Symbol (SynSymbol symbol), (10,9--10,16)), None, + (Named (SynSymbol sym, (10,5--10,8)), Quote (true, Symbol (SynSymbol symbol), (10,9--10,16)), None, (10,1--10,16)), (10,0--10,17)); Expr (LetOrUse @@ -28,47 +24,37 @@ (SynCollection (Paren, [Symbol (SynSymbol fn); - Collection - (SynCollection - (Bracket, [Symbol (SynSymbol a)], (11,20--11,23))); + Collection (SynCollection (Bracket, [Symbol (SynSymbol a)], (11,20--11,23))); Collection (SynCollection (Paren, - [Symbol (SynSymbol +); Symbol (SynSymbol a); - Symbol (SynSymbol b); + [Symbol (SynSymbol +); Symbol (SynSymbol a); Symbol (SynSymbol b); Const (Int32 1, (11,31--11,32)); Collection (SynCollection (Paren, - [Symbol (SynSymbol call); - Symbol (SynSymbol +); - Const (Int32 1, (11,41--11,42)); - Const (Int32 2, (11,43--11,44))], - (11,33--11,45)))], (11,24--11,46)))], - (11,16--11,47))), (11,15--11,47)), None, (11,1--11,47)), - (11,0--11,48)); + [Symbol (SynSymbol call); Symbol (SynSymbol +); Const (Int32 1, (11,41--11,42)); + Const (Int32 2, (11,43--11,44))], (11,33--11,45)))], (11,24--11,46)))], + (11,16--11,47))), (11,15--11,47)), None, (11,1--11,47)), (11,0--11,48)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("items: %O", Regular, (13,9--13,20)), (13,9--13,20)); - Symbol (SynSymbol items)], (13,1--13,26)), (13,0--13,27)); + [Const (String ("items: %O", Regular, (13,9--13,20)), (13,9--13,20)); Symbol (SynSymbol items)], + (13,1--13,26)), (13,0--13,27)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("sym: %O", Regular, (14,9--14,18)), (14,9--14,18)); - Symbol (SynSymbol sym)], (14,1--14,22)), (14,0--14,23)); + [Const (String ("sym: %O", Regular, (14,9--14,18)), (14,9--14,18)); Symbol (SynSymbol sym)], (14,1--14,22)), + (14,0--14,23)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("something: %O", Regular, (15,9--15,24)), (15,9--15,24)); - Symbol (SynSymbol something)], (15,1--15,34)), (15,0--15,35)); + [Const (String ("something: %O", Regular, (15,9--15,24)), (15,9--15,24)); Symbol (SynSymbol something)], + (15,1--15,34)), (15,0--15,35)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("nested: %O", Regular, (16,9--16,21)), (16,9--16,21)); + [Const (String ("nested: %O", Regular, (16,9--16,21)), (16,9--16,21)); Quote (true, Collection @@ -86,23 +72,16 @@ Collection (SynCollection (Paren, - [Symbol (SynSymbol nested4); - Symbol (SynSymbol and); - Symbol (SynSymbol on); - Symbol (SynSymbol and); - Symbol (SynSymbol on); - Keyword (SynKeyword :keyword)], - (16,50--16,82)))], (16,41--16,83)))], - (16,32--16,84)))], (16,23--16,85))), - (16,22--16,85))], (16,1--16,85)), (16,0--16,86)); + [Symbol (SynSymbol nested4); Symbol (SynSymbol and); Symbol (SynSymbol on); + Symbol (SynSymbol and); Symbol (SynSymbol on); + Keyword (SynKeyword :keyword)], (16,50--16,82)))], (16,41--16,83)))], + (16,32--16,84)))], (16,23--16,85))), (16,22--16,85))], (16,1--16,85)), (16,0--16,86)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (17,0--17,90)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("nested vec: %O", Regular, (17,9--17,25)), - (17,9--17,25)); + [Const (String ("nested vec: %O", Regular, (17,9--17,25)), (17,9--17,25)); Quote (true, Collection @@ -120,19 +99,13 @@ Collection (SynCollection (Paren, - [Symbol (SynSymbol nested4); - Symbol (SynSymbol and); - Symbol (SynSymbol on); - Symbol (SynSymbol and); - Symbol (SynSymbol on); - Keyword (SynKeyword :keyword)], - (17,54--17,86)))], (17,45--17,87)))], - (17,36--17,88)))], (17,27--17,89))), - (17,26--17,89))], (17,1--17,89)), None, (17,0--17,90)), - (17,0--17,90)); + [Symbol (SynSymbol nested4); Symbol (SynSymbol and); + Symbol (SynSymbol on); Symbol (SynSymbol and); Symbol (SynSymbol on); + Keyword (SynKeyword :keyword)], (17,54--17,86)))], (17,45--17,87)))], + (17,36--17,88)))], (17,27--17,89))), (17,26--17,89))], (17,1--17,89)), None, + (17,0--17,90)), (17,0--17,90)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,0--17,90)), (17,0--17,90)); - Symbol (SynSymbol visp_result_todo)], (17,0--17,90)), - (17,0--17,90))], (9,0--17,90))] \ No newline at end of file + [Const (String ("%A", Regular, (17,0--17,90)), (17,0--17,90)); Symbol (SynSymbol visp_result_todo)], + (17,0--17,90)), (17,0--17,90))], (9,0--17,90))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_custom-comparison-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_custom-comparison-0.structured output.verified.txt index 64f78fa..03a65cd 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_custom-comparison-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_custom-comparison-0.structured output.verified.txt @@ -5,36 +5,27 @@ (Union (SynSymbol MyCustomValue, [UnionCase (SynSymbol Nil, [], (12,2--12,5)); - UnionCase - (SynSymbol String, [Type (Ident string, (13,10--13,16))], - (13,3--13,16))], + UnionCase (SynSymbol String, [Type (Ident string, (13,10--13,16))], (13,3--13,16))], [OverrideFn (SynSymbol t.GetHashCode, Args (List [], (15,29--15,31)), [Match (Symbol (SynSymbol t), [SynMatch - (Named (SynSymbol Nil, (17,7--17,10)), None, - [Const (Int32 919321, (17,11--17,17))], (17,7--17,17)); + (Named (SynSymbol Nil, (17,7--17,10)), None, [Const (Int32 919321, (17,11--17,17))], + (17,7--17,17)); SynMatch (Collection (SynCollection - (Paren, - [Named (SynSymbol String, (18,8--18,14)); - Named (SynSymbol s, (18,15--18,16))], + (Paren, [Named (SynSymbol String, (18,8--18,14)); Named (SynSymbol s, (18,15--18,16))], (18,7--18,17))), None, [FunctionCall (Symbol (SynSymbol System.HashCode.Combine), [Tuple - ([Const - (String ("string", Regular, (18,44--18,52)), - (18,44--18,52)); Symbol (SynSymbol s)], - (18,44--18,55))], (18,19--18,56))], - (18,7--18,57))], (16,5--18,58))], (15,3--19,5)); + ([Const (String ("string", Regular, (18,44--18,52)), (18,44--18,52)); + Symbol (SynSymbol s)], (18,44--18,55))], (18,19--18,56))], (18,7--18,57))], + (16,5--18,58))], (15,3--19,5)); OverrideFn - (SynSymbol t.Equals, - Args - (List [Named (SynSymbol other, (21,25--21,30))], - (21,24--21,31)), + (SynSymbol t.Equals, Args (List [Named (SynSymbol other, (21,25--21,30))], (21,24--21,31)), [Match (Symbol (SynSymbol other), [SynMatch @@ -42,41 +33,28 @@ (SynCollection (Paren, [As - (IsInst (Ident MyCustomValue, (23,8--23,24)), - Named (SynSymbol v, (23,25--23,26)), + (IsInst (Ident MyCustomValue, (23,8--23,24)), Named (SynSymbol v, (23,25--23,26)), (23,7--23,27))], (23,7--23,27))), None, [DotMethod (Op (Infix - (SynSymbol :>, - [Symbol (SynSymbol t); - Symbol (SynSymbol IEquatable<_>)], - (24,18--24,36))), SynSymbol Equals, - [Symbol (SynSymbol v)], Tuple, (24,9--24,39))], + (SynSymbol :>, [Symbol (SynSymbol t); Symbol (SynSymbol IEquatable<_>)], + (24,18--24,36))), SynSymbol Equals, [Symbol (SynSymbol v)], Tuple, (24,9--24,39))], (23,7--24,40)); - SynMatch - (Discard (26,7--26,8), None, - [Const (Bool false, (26,9--26,14))], (26,7--26,14))], + SynMatch (Discard (26,7--26,8), None, [Const (Bool false, (26,9--26,14))], (26,7--26,14))], (22,5--26,15))], (21,3--27,5)); Interface (SynSymbol IEquatable, [MemberFn - (SynSymbol t.Equals, - Args - (List [Named (SynSymbol other, (30,25--30,30))], - (30,24--30,31)), + (SynSymbol t.Equals, Args (List [Named (SynSymbol other, (30,25--30,30))], (30,24--30,31)), [Match - (Tuple - ([Symbol (SynSymbol t); Symbol (SynSymbol other)], - (31,14--31,22)), + (Tuple ([Symbol (SynSymbol t); Symbol (SynSymbol other)], (31,14--31,22)), [SynMatch (Collection (SynCollection (Paren, - [Named (SynSymbol Nil, (32,10--32,13)); - Trivia (Dot, (32,14--32,15)); - Named (SynSymbol Nil, (32,16--32,19))], - (32,9--32,20))), None, + [Named (SynSymbol Nil, (32,10--32,13)); Trivia (Dot, (32,14--32,15)); + Named (SynSymbol Nil, (32,16--32,19))], (32,9--32,20))), None, [Const (Bool true, (32,21--32,25))], (32,9--32,25)); SynMatch (Collection @@ -85,42 +63,27 @@ [Collection (SynCollection (Paren, - [Named - (SynSymbol String, (33,11--33,17)); - Named (SynSymbol lhs, (33,18--33,21))], - (33,10--33,22))); + [Named (SynSymbol String, (33,11--33,17)); + Named (SynSymbol lhs, (33,18--33,21))], (33,10--33,22))); Trivia (Dot, (33,23--33,24)); Collection (SynCollection (Paren, - [Named - (SynSymbol String, (33,26--33,32)); - Named (SynSymbol rhs, (33,33--33,36))], - (33,25--33,37)))], (33,9--33,38))), + [Named (SynSymbol String, (33,26--33,32)); + Named (SynSymbol rhs, (33,33--33,36))], (33,25--33,37)))], (33,9--33,38))), None, - [Op - (Infix - (SynSymbol =, - [Symbol (SynSymbol lhs); - Symbol (SynSymbol rhs)], (33,40--33,49)))], + [Op (Infix (SynSymbol =, [Symbol (SynSymbol lhs); Symbol (SynSymbol rhs)], (33,40--33,49)))], (33,9--33,50)); SynMatch (Collection (SynCollection - (Paren, - [Discard (34,10--34,11); - Trivia (Dot, (34,12--34,13)); - Discard (34,14--34,15)], (34,9--34,16))), - None, [Const (Bool false, (34,17--34,22))], - (34,9--34,22))], (31,7--34,23))], (30,5--35,7))], - (29,3--36,5)); + (Paren, [Discard (34,10--34,11); Trivia (Dot, (34,12--34,13)); Discard (34,14--34,15)], + (34,9--34,16))), None, [Const (Bool false, (34,17--34,22))], (34,9--34,22))], + (31,7--34,23))], (30,5--35,7))], (29,3--36,5)); Interface (SynSymbol IComparable, [MemberFn - (SynSymbol t.CompareTo, - Args - (List [Named (SynSymbol other, (39,28--39,33))], - (39,27--39,34)), + (SynSymbol t.CompareTo, Args (List [Named (SynSymbol other, (39,28--39,33))], (39,27--39,34)), [Match (Symbol (SynSymbol other), [SynMatch @@ -128,60 +91,41 @@ (SynCollection (Paren, [As - (IsInst - (Ident MyCustomValue, (41,10--41,26)), - Named (SynSymbol v, (41,27--41,28)), + (IsInst (Ident MyCustomValue, (41,10--41,26)), Named (SynSymbol v, (41,27--41,28)), (41,9--41,29))], (41,9--41,29))), None, [DotMethod (Op (Infix - (SynSymbol :>, - [Symbol (SynSymbol t); - Symbol (SynSymbol IComparable<_>)], - (42,23--42,42))), SynSymbol CompareTo, - [Symbol (SynSymbol v)], Tuple, (42,11--42,45))], - (41,9--42,46)); + (SynSymbol :>, [Symbol (SynSymbol t); Symbol (SynSymbol IComparable<_>)], + (42,23--42,42))), SynSymbol CompareTo, [Symbol (SynSymbol v)], Tuple, + (42,11--42,45))], (41,9--42,46)); SynMatch - (Named (SynSymbol null, (44,9--44,13)), None, - [Const (Int32 1, (44,14--44,15))], (44,9--44,15)); - SynMatch - (Discard (45,9--45,10), None, - [Const (Int32 -1, (45,11--45,13))], (45,9--45,13))], + (Named (SynSymbol null, (44,9--44,13)), None, [Const (Int32 1, (44,14--44,15))], + (44,9--44,15)); + SynMatch (Discard (45,9--45,10), None, [Const (Int32 -1, (45,11--45,13))], (45,9--45,13))], (40,7--45,14))], (39,5--46,7))], (38,3--46,8)); Interface (SynSymbol IComparable, [MemberFn - (SynSymbol t.CompareTo, - Args - (List [Named (SynSymbol other, (49,28--49,33))], - (49,27--49,34)), + (SynSymbol t.CompareTo, Args (List [Named (SynSymbol other, (49,28--49,33))], (49,27--49,34)), [Match - (Tuple - ([Symbol (SynSymbol t); Symbol (SynSymbol other)], - (50,14--50,22)), + (Tuple ([Symbol (SynSymbol t); Symbol (SynSymbol other)], (50,14--50,22)), [SynMatch (Collection (SynCollection (Paren, - [Named (SynSymbol Nil, (51,10--51,13)); - Trivia (Comma, (51,13--51,14)); - Named (SynSymbol Nil, (51,15--51,18))], - (51,9--51,19))), None, + [Named (SynSymbol Nil, (51,10--51,13)); Trivia (Comma, (51,13--51,14)); + Named (SynSymbol Nil, (51,15--51,18))], (51,9--51,19))), None, [Const (Int32 0, (51,20--51,21))], (51,9--51,21)); SynMatch (Collection (SynCollection (Paren, - [Named (SynSymbol Nil, (52,10--52,13)); - Trivia (Comma, (52,13--52,14)); + [Named (SynSymbol Nil, (52,10--52,13)); Trivia (Comma, (52,13--52,14)); Collection (SynCollection - (Paren, - [Named - (SynSymbol String, (52,16--52,22)); - Discard (52,23--52,24)], - (52,15--52,25)))], (52,9--52,26))), - None, [Const (Int32 -1, (52,27--52,29))], + (Paren, [Named (SynSymbol String, (52,16--52,22)); Discard (52,23--52,24)], + (52,15--52,25)))], (52,9--52,26))), None, [Const (Int32 -1, (52,27--52,29))], (52,9--52,29)); SynMatch (Collection @@ -189,14 +133,9 @@ (Paren, [Collection (SynCollection - (Paren, - [Named - (SynSymbol String, (53,11--53,17)); - Discard (53,18--53,19)], - (53,10--53,20))); - Trivia (Comma, (53,20--53,21)); - Named (SynSymbol Nil, (53,22--53,25))], - (53,9--53,26))), None, + (Paren, [Named (SynSymbol String, (53,11--53,17)); Discard (53,18--53,19)], + (53,10--53,20))); Trivia (Comma, (53,20--53,21)); + Named (SynSymbol Nil, (53,22--53,25))], (53,9--53,26))), None, [Const (Int32 1, (53,27--53,28))], (53,9--53,28)); SynMatch (Collection @@ -205,94 +144,70 @@ [Collection (SynCollection (Paren, - [Named - (SynSymbol String, (54,11--54,17)); - Named (SynSymbol lhs, (54,18--54,21))], - (54,10--54,22))); + [Named (SynSymbol String, (54,11--54,17)); + Named (SynSymbol lhs, (54,18--54,21))], (54,10--54,22))); Trivia (Comma, (54,22--54,23)); Collection (SynCollection (Paren, - [Named - (SynSymbol String, (54,25--54,31)); - Named (SynSymbol rhs, (54,32--54,35))], - (54,24--54,36)))], (54,9--54,37))), + [Named (SynSymbol String, (54,25--54,31)); + Named (SynSymbol rhs, (54,32--54,35))], (54,24--54,36)))], (54,9--54,37))), None, [DotMethod - (Symbol (SynSymbol lhs), SynSymbol CompareTo, - [Symbol (SynSymbol rhs)], Tuple, (54,39--54,57))], - (54,9--54,58))], (50,7--54,59))], (49,5--55,7))], - (48,3--55,8))], + (Symbol (SynSymbol lhs), SynSymbol CompareTo, [Symbol (SynSymbol rhs)], Tuple, + (54,39--54,57))], (54,9--54,58))], (50,7--54,59))], (49,5--55,7))], (48,3--55,8))], [{ Attributes = [{ TypeName = Ident CustomEquality ArgExpr = Const (Unit, (10,3--10,17)) - Range = (10,3--10,17) }; - { TypeName = Ident CustomComparison - ArgExpr = Const (Unit, (10,20--10,36)) - Range = (10,20--10,36) }; - { TypeName = Ident RequireQualifiedAccess - ArgExpr = Const (Unit, (10,39--10,61)) - Range = (10,39--10,61) }] + Range = (10,3--10,17) }; { TypeName = Ident CustomComparison + ArgExpr = Const (Unit, (10,20--10,36)) + Range = (10,20--10,36) }; { TypeName = Ident RequireQualifiedAccess + ArgExpr = Const (Unit, (10,39--10,61)) + Range = (10,39--10,61) }] Range = (10,1--10,62) }], (10,1--55,9)), (10,0--56,1)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Nil < String %A", Regular, (58,9--58,26)), - (58,9--58,26)); + [Const (String ("Nil < String %A", Regular, (58,9--58,26)), (58,9--58,26)); Op (Infix (SynSymbol <, [Symbol (SynSymbol MyCustomValue.Nil); FunctionCall (Symbol (SynSymbol MyCustomValue.String), - [Const - (String ("hello", Regular, (58,70--58,77)), - (58,70--58,77))], (58,49--58,77))], (58,28--58,78)))], - (58,1--58,79)), (58,0--58,80)); + [Const (String ("hello", Regular, (58,70--58,77)), (58,70--58,77))], (58,49--58,77))], + (58,28--58,78)))], (58,1--58,79)), (58,0--58,80)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Nil > String %A", Regular, (59,9--59,26)), - (59,9--59,26)); + [Const (String ("Nil > String %A", Regular, (59,9--59,26)), (59,9--59,26)); Op (Infix (SynSymbol >, [Symbol (SynSymbol MyCustomValue.Nil); FunctionCall (Symbol (SynSymbol MyCustomValue.String), - [Const - (String ("hello", Regular, (59,70--59,77)), - (59,70--59,77))], (59,49--59,77))], (59,28--59,78)))], - (59,1--59,79)), (59,0--59,80)); + [Const (String ("hello", Regular, (59,70--59,77)), (59,70--59,77))], (59,49--59,77))], + (59,28--59,78)))], (59,1--59,79)), (59,0--59,80)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("String = String %A", Regular, (60,9--60,29)), - (60,9--60,29)); + [Const (String ("String = String %A", Regular, (60,9--60,29)), (60,9--60,29)); Op (Infix (SynSymbol =, [FunctionCall (Symbol (SynSymbol MyCustomValue.String), - [Const - (String ("hello", Regular, (60,55--60,62)), - (60,55--60,62))], (60,34--60,62)); + [Const (String ("hello", Regular, (60,55--60,62)), (60,55--60,62))], (60,34--60,62)); FunctionCall (Symbol (SynSymbol MyCustomValue.String), - [Const - (String ("hello", Regular, (60,86--60,93)), - (60,86--60,93))], (60,65--60,93))], (60,31--60,94)))], - (60,1--60,95)), (60,0--60,96)); + [Const (String ("hello", Regular, (60,86--60,93)), (60,86--60,93))], (60,65--60,93))], + (60,31--60,94)))], (60,1--60,95)), (60,0--60,96)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (62,0--62,2)), - Const (Unit, (62,0--62,2)), None, (62,0--62,2)), (62,0--62,2)); + (LetOrUse (Named (SynSymbol visp_result_todo, (62,0--62,2)), Const (Unit, (62,0--62,2)), None, (62,0--62,2)), + (62,0--62,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (62,0--62,2)), (62,0--62,2)); - Symbol (SynSymbol visp_result_todo)], (62,0--62,2)), (62,0--62,2))], - (8,0--62,2))] \ No newline at end of file + [Const (String ("%A", Regular, (62,0--62,2)), (62,0--62,2)); Symbol (SynSymbol visp_result_todo)], + (62,0--62,2)), (62,0--62,2))], (8,0--62,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-fn-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-fn-0.structured output.verified.txt index 2b5e235..1b31761 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-fn-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-fn-0.structured output.verified.txt @@ -5,15 +5,13 @@ (Type (SynSymbol Mapping, Args (Tuple [], (10,14--10,16)), [Let - (Named (SynSymbol src_to_dest, (11,7--11,18)), - New (Ident Dictionary, [], (11,20--11,43)), + (Named (SynSymbol src_to_dest, (11,7--11,18)), New (Ident Dictionary, [], (11,20--11,43)), (11,3--11,44)); MemberFn (SynSymbol _.AddRange, Args (List - [Named (SynSymbol dest, (13,25--13,29)); - Named (SynSymbol src, (13,30--13,33)); + [Named (SynSymbol dest, (13,25--13,29)); Named (SynSymbol src, (13,30--13,33)); Named (SynSymbol len, (13,34--13,37))], (13,24--13,38)), [ForIn (Named (SynSymbol src_range, (14,13--14,22)), @@ -23,36 +21,27 @@ (Infix (SynSymbol +, [Symbol (SynSymbol src); - FunctionCall - (Symbol (SynSymbol dec), - [Symbol (SynSymbol len)], (14,46--14,53))], + FunctionCall (Symbol (SynSymbol dec), [Symbol (SynSymbol len)], (14,46--14,53))], (14,39--14,54))), (14,24--14,55)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("src %i", Regular, (15,15--15,23)), - (15,15--15,23)); Symbol (SynSymbol src_range)], - (15,7--15,33))], (14,5--15,34)); - Const (Unit, (17,4--17,6))], (13,3--17,6))], [], (10,1--18,5)), - (10,0--18,6)); + [Const (String ("src %i", Regular, (15,15--15,23)), (15,15--15,23)); + Symbol (SynSymbol src_range)], (15,7--15,33))], (14,5--15,34)); Const (Unit, (17,4--17,6))], + (13,3--17,6))], [], (10,1--18,5)), (10,0--18,6)); Expr (LetOrUse - (Named (SynSymbol mapping, (20,5--20,12)), - New (Ident Mapping, [], (20,14--20,25)), None, (20,1--20,26)), + (Named (SynSymbol mapping, (20,5--20,12)), New (Ident Mapping, [], (20,14--20,25)), None, (20,1--20,26)), (20,0--20,27)); Expr (DotMethod (Symbol (SynSymbol mapping), SynSymbol AddRange, - [Const (Int32 0, (21,19--21,20)); Const (Int32 1, (21,21--21,22)); - Const (Int32 5, (21,23--21,24))], Apply, (21,1--21,24)), - (21,0--21,25)); + [Const (Int32 0, (21,19--21,20)); Const (Int32 1, (21,21--21,22)); Const (Int32 5, (21,23--21,24))], Apply, + (21,1--21,24)), (21,0--21,25)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (23,0--23,2)), - Const (Unit, (23,0--23,2)), None, (23,0--23,2)), (23,0--23,2)); + (LetOrUse (Named (SynSymbol visp_result_todo, (23,0--23,2)), Const (Unit, (23,0--23,2)), None, (23,0--23,2)), + (23,0--23,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (23,0--23,2)), (23,0--23,2)); - Symbol (SynSymbol visp_result_todo)], (23,0--23,2)), (23,0--23,2))], - (8,0--23,2))] \ No newline at end of file + [Const (String ("%A", Regular, (23,0--23,2)), (23,0--23,2)); Symbol (SynSymbol visp_result_todo)], + (23,0--23,2)), (23,0--23,2))], (8,0--23,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-get-set-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-get-set-0.structured output.verified.txt index 627d4dc..0c48e4c 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-get-set-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_member-get-set-0.structured output.verified.txt @@ -6,161 +6,117 @@ Args (Tuple [Typed - (Named (SynSymbol items, (8,20--8,25)), - Generic (Ident array, [Ident ^T], (8,27--8,36)), + (Named (SynSymbol items, (8,20--8,25)), Generic (Ident array, [Ident ^T], (8,27--8,36)), (8,19--8,37))], (8,18--8,38)), - [Let - (Named (SynSymbol items, (9,7--9,12)), Symbol (SynSymbol items), - (9,3--9,18)); + [Let (Named (SynSymbol items, (9,7--9,12)), Symbol (SynSymbol items), (9,3--9,18)); GetSet (SynSymbol _.Item, Some (SynMemberGet (Args - (Tuple - [Typed - (Named (SynSymbol i, (11,11--11,12)), Ident int, - (11,10--11,18))], (11,9--11,19)), - [DotIndex - (Symbol (SynSymbol items), [Symbol (SynSymbol i)], - (12,7--12,17))], (11,4--12,19))), None, (10,3--12,19))], - [], (8,1--12,20)), (8,0--12,21)); + (Tuple [Typed (Named (SynSymbol i, (11,11--11,12)), Ident int, (11,10--11,18))], (11,9--11,19)), + [DotIndex (Symbol (SynSymbol items), [Symbol (SynSymbol i)], (12,7--12,17))], (11,4--12,19))), + None, (10,3--12,19))], [], (8,1--12,20)), (8,0--12,21)); Expr (Type (SynSymbol SetOnly<^T>, Args (Tuple [Typed - (Named (SynSymbol items, (14,20--14,25)), - Generic (Ident array, [Ident ^T], (14,27--14,36)), + (Named (SynSymbol items, (14,20--14,25)), Generic (Ident array, [Ident ^T], (14,27--14,36)), (14,19--14,37))], (14,18--14,38)), - [Let - (Named (SynSymbol items, (15,7--15,12)), - Symbol (SynSymbol items), (15,3--15,18)); + [Let (Named (SynSymbol items, (15,7--15,12)), Symbol (SynSymbol items), (15,3--15,18)); GetSet (SynSymbol _.Item, None, Some (SynMemberSet (Args - (Tuple - [Typed - (Named (SynSymbol i, (17,11--17,12)), Ident int, - (17,10--17,18))], (17,9--17,19)), + (Tuple [Typed (Named (SynSymbol i, (17,11--17,12)), Ident int, (17,10--17,18))], (17,9--17,19)), Named (SynSymbol v, (17,20--17,21)), [Set - (DotIndex - (Symbol (SynSymbol items), [Symbol (SynSymbol i)], - (18,13--18,23)), Symbol (SynSymbol v), - (18,7--18,26))], (17,4--18,28))), (16,3--18,28))], [], - (14,1--18,29)), (14,0--18,30)); + (DotIndex (Symbol (SynSymbol items), [Symbol (SynSymbol i)], (18,13--18,23)), + Symbol (SynSymbol v), (18,7--18,26))], (17,4--18,28))), (16,3--18,28))], [], (14,1--18,29)), + (14,0--18,30)); Expr (Type (SynSymbol GetAndSet<^T>, Args (Tuple [Typed - (Named (SynSymbol items, (20,22--20,27)), - Generic (Ident array, [Ident ^T], (20,29--20,38)), + (Named (SynSymbol items, (20,22--20,27)), Generic (Ident array, [Ident ^T], (20,29--20,38)), (20,21--20,39))], (20,20--20,40)), - [Let - (Named (SynSymbol items, (21,7--21,12)), - Symbol (SynSymbol items), (21,3--21,18)); + [Let (Named (SynSymbol items, (21,7--21,12)), Symbol (SynSymbol items), (21,3--21,18)); GetSet (SynSymbol _.Item, Some (SynMemberGet (Args - (Tuple - [Typed - (Named (SynSymbol i, (23,11--23,12)), Ident int, - (23,10--23,18))], (23,9--23,19)), - [DotIndex - (Symbol (SynSymbol items), [Symbol (SynSymbol i)], - (24,7--24,17))], (23,4--24,19))), + (Tuple [Typed (Named (SynSymbol i, (23,11--23,12)), Ident int, (23,10--23,18))], (23,9--23,19)), + [DotIndex (Symbol (SynSymbol items), [Symbol (SynSymbol i)], (24,7--24,17))], (23,4--24,19))), Some (SynMemberSet (Args - (Tuple - [Typed - (Named (SynSymbol i, (25,11--25,12)), Ident int, - (25,10--25,18))], (25,9--25,19)), + (Tuple [Typed (Named (SynSymbol i, (25,11--25,12)), Ident int, (25,10--25,18))], (25,9--25,19)), Named (SynSymbol v, (25,20--25,21)), [Set - (DotIndex - (Symbol (SynSymbol items), [Symbol (SynSymbol i)], - (26,13--26,23)), Symbol (SynSymbol v), - (26,7--26,26))], (25,4--26,28))), (22,3--26,28))], [], - (20,1--26,29)), (20,0--27,3)); + (DotIndex (Symbol (SynSymbol items), [Symbol (SynSymbol i)], (26,13--26,23)), + Symbol (SynSymbol v), (26,7--26,26))], (25,4--26,28))), (22,3--26,28))], [], (20,1--26,29)), + (20,0--27,3)); Expr (LetOrUse (Named (SynSymbol array, (29,5--29,10)), Collection (SynCollection (FsArray, - [Const (Int32 1, (29,19--29,20)); - Const (Int32 2, (29,21--29,22)); - Const (Int32 3, (29,23--29,24)); - Const (Int32 4, (29,25--29,26)); - Const (Int32 5, (29,27--29,28))], (29,12--29,28))), None, + [Const (Int32 1, (29,19--29,20)); Const (Int32 2, (29,21--29,22)); Const (Int32 3, (29,23--29,24)); + Const (Int32 4, (29,25--29,26)); Const (Int32 5, (29,27--29,28))], (29,12--29,28))), None, (29,1--29,29)), (29,0--29,30)); Expr (LetOrUse (Named (SynSymbol getOnly, (31,5--31,12)), - New (Ident GetOnly<_>, [Symbol (SynSymbol array)], (31,14--31,34)), - None, (31,1--31,35)), (31,0--31,36)); + New (Ident GetOnly<_>, [Symbol (SynSymbol array)], (31,14--31,34)), None, (31,1--31,35)), (31,0--31,36)); Expr (LetOrUse (Named (SynSymbol setOnly, (32,5--32,12)), - New (Ident SetOnly<_>, [Symbol (SynSymbol array)], (32,14--32,34)), - None, (32,1--32,35)), (32,0--32,36)); + New (Ident SetOnly<_>, [Symbol (SynSymbol array)], (32,14--32,34)), None, (32,1--32,35)), (32,0--32,36)); Expr (LetOrUse (Named (SynSymbol getAndSet, (33,5--33,14)), - New - (Ident GetAndSet<_>, [Symbol (SynSymbol array)], (33,16--33,38)), - None, (33,1--33,39)), (33,0--33,40)); + New (Ident GetAndSet<_>, [Symbol (SynSymbol array)], (33,16--33,38)), None, (33,1--33,39)), (33,0--33,40)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (35,9--35,13)), (35,9--35,13)); - DotIndex - (Symbol (SynSymbol getOnly), [Const (Int32 0, (35,17--35,18))], - (35,15--35,27))], (35,1--35,28)), (35,0--35,29)); + DotIndex (Symbol (SynSymbol getOnly), [Const (Int32 0, (35,17--35,18))], (35,15--35,27))], (35,1--35,28)), + (35,0--35,29)); Expr (Set - (DotIndex - (Symbol (SynSymbol setOnly), [Const (Int32 0, (37,9--37,10))], - (37,7--37,19)), Const (Int32 99, (37,21--37,23)), (37,1--37,23)), - (37,0--37,24)); + (DotIndex (Symbol (SynSymbol setOnly), [Const (Int32 0, (37,9--37,10))], (37,7--37,19)), + Const (Int32 99, (37,21--37,23)), (37,1--37,23)), (37,0--37,24)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (39,9--39,13)), (39,9--39,13)); - Symbol (SynSymbol array)], (39,1--39,19)), (39,0--39,20)); + [Const (String ("%A", Regular, (39,9--39,13)), (39,9--39,13)); Symbol (SynSymbol array)], (39,1--39,19)), + (39,0--39,20)); Expr (Set - (DotIndex - (Symbol (SynSymbol getAndSet), [Const (Int32 1, (41,9--41,10))], - (41,7--41,21)), Const (Int32 99, (41,23--41,25)), (41,1--41,25)), - (41,0--41,26)); + (DotIndex (Symbol (SynSymbol getAndSet), [Const (Int32 1, (41,9--41,10))], (41,7--41,21)), + Const (Int32 99, (41,23--41,25)), (41,1--41,25)), (41,0--41,26)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (43,9--43,13)), (43,9--43,13)); - DotIndex - (Symbol (SynSymbol getAndSet), [Const (Int32 1, (43,17--43,18))], - (43,15--43,29))], (43,1--43,30)), (43,0--43,31)); + DotIndex (Symbol (SynSymbol getAndSet), [Const (Int32 1, (43,17--43,18))], (43,15--43,29))], (43,1--43,30)), + (43,0--43,31)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (45,0--45,20)), FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (45,9--45,13)), (45,9--45,13)); - Symbol (SynSymbol array)], (45,1--45,19)), None, (45,0--45,20)), - (45,0--45,20)); + [Const (String ("%A", Regular, (45,9--45,13)), (45,9--45,13)); Symbol (SynSymbol array)], (45,1--45,19)), + None, (45,0--45,20)), (45,0--45,20)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (45,0--45,20)), (45,0--45,20)); - Symbol (SynSymbol visp_result_todo)], (45,0--45,20)), - (45,0--45,20))], (8,0--45,20))] \ No newline at end of file + [Const (String ("%A", Regular, (45,0--45,20)), (45,0--45,20)); Symbol (SynSymbol visp_result_todo)], + (45,0--45,20)), (45,0--45,20))], (8,0--45,20))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-0.structured output.verified.txt index f697616..15b14f0 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-0.structured output.verified.txt @@ -10,68 +10,42 @@ (SynSymbol this.Stuff, Args (List [], (13,23--13,25)), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("doing stuff %A", Regular, (14,13--14,29)), - (14,13--14,29)); - DotProperty - (Symbol (SynSymbol this), SynSymbol src, (14,31--14,40))], - (14,5--14,41))], (13,3--14,42))], [], (8,1--14,43)), - (8,0--15,1)); + [Const (String ("doing stuff %A", Regular, (14,13--14,29)), (14,13--14,29)); + DotProperty (Symbol (SynSymbol this), SynSymbol src, (14,31--14,40))], (14,5--14,41))], + (13,3--14,42))], [], (8,1--14,43)), (8,0--15,1)); Expr (LetOrUse (Named (SynSymbol temp, (17,5--17,9)), RecordInit - ([SynInit - (SynSymbol src, Const (Int32 1, (17,22--17,23)), - (17,17--17,24)); - SynInit - (SynSymbol Mapping.dest, Const (Int32 2, (17,39--17,40)), - (17,25--17,41)); - SynInit - (SynSymbol range, Const (Int32 3, (17,49--17,50)), - (17,42--17,51))], (17,11--17,51)), None, (17,1--17,52)), - (17,0--17,53)); + ([SynInit (SynSymbol src, Const (Int32 1, (17,22--17,23)), (17,17--17,24)); + SynInit (SynSymbol Mapping.dest, Const (Int32 2, (17,39--17,40)), (17,25--17,41)); + SynInit (SynSymbol range, Const (Int32 3, (17,49--17,50)), (17,42--17,51))], (17,11--17,51)), None, + (17,1--17,52)), (17,0--17,53)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Record is %A", Regular, (18,9--18,23)), (18,9--18,23)); - Symbol (SynSymbol temp)], (18,1--18,28)), (18,0--18,29)); - Expr - (DotMethod - (Symbol (SynSymbol temp), SynSymbol Stuff, [], Tuple, (19,1--19,12)), - (19,0--19,13)); + [Const (String ("Record is %A", Regular, (18,9--18,23)), (18,9--18,23)); Symbol (SynSymbol temp)], + (18,1--18,28)), (18,0--18,29)); + Expr (DotMethod (Symbol (SynSymbol temp), SynSymbol Stuff, [], Tuple, (19,1--19,12)), (19,0--19,13)); Expr (LetOrUse (Named (SynSymbol temp2, (21,5--21,10)), RecordInit - ([SynInit - (SynSymbol src, Const (Int32 3, (21,18--21,19)), - (21,14--21,19)); - SynInit - (SynSymbol Mapping.dest, Const (Int32 5, (21,33--21,34)), - (21,20--21,34)); - SynInit - (SynSymbol range, Const (Int32 8, (21,41--21,42)), - (21,35--21,42))], (21,11--21,45)), None, (21,1--21,45)), - (21,0--21,46)); + ([SynInit (SynSymbol src, Const (Int32 3, (21,18--21,19)), (21,14--21,19)); + SynInit (SynSymbol Mapping.dest, Const (Int32 5, (21,33--21,34)), (21,20--21,34)); + SynInit (SynSymbol range, Const (Int32 8, (21,41--21,42)), (21,35--21,42))], (21,11--21,45)), None, + (21,1--21,45)), (21,0--21,46)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Record is %A", Regular, (23,9--23,23)), (23,9--23,23)); - Symbol (SynSymbol temp2)], (23,1--23,29)), (23,0--23,30)); - Expr - (DotMethod - (Symbol (SynSymbol temp2), SynSymbol Stuff, [], Tuple, (24,1--24,13)), - (24,0--24,14)); + [Const (String ("Record is %A", Regular, (23,9--23,23)), (23,9--23,23)); Symbol (SynSymbol temp2)], + (23,1--23,29)), (23,0--23,30)); + Expr (DotMethod (Symbol (SynSymbol temp2), SynSymbol Stuff, [], Tuple, (24,1--24,13)), (24,0--24,14)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (27,0--27,2)), - Const (Unit, (27,0--27,2)), None, (27,0--27,2)), (27,0--27,2)); + (LetOrUse (Named (SynSymbol visp_result_todo, (27,0--27,2)), Const (Unit, (27,0--27,2)), None, (27,0--27,2)), + (27,0--27,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (27,0--27,2)), (27,0--27,2)); - Symbol (SynSymbol visp_result_todo)], (27,0--27,2)), (27,0--27,2))], - (8,0--27,2))] \ No newline at end of file + [Const (String ("%A", Regular, (27,0--27,2)), (27,0--27,2)); Symbol (SynSymbol visp_result_todo)], + (27,0--27,2)), (27,0--27,2))], (8,0--27,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-1.structured output.verified.txt index bcbe46f..f99aebb 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-1.structured output.verified.txt @@ -3,24 +3,19 @@ ([Expr (Union (SynSymbol Dir, - [UnionCase (SynSymbol Up, [], (9,2--9,4)); - UnionCase (SynSymbol Left, [], (10,2--10,6)); - UnionCase (SynSymbol Down, [], (11,2--11,6)); - UnionCase (SynSymbol Right, [], (12,2--12,7))], [], [], + [UnionCase (SynSymbol Up, [], (9,2--9,4)); UnionCase (SynSymbol Left, [], (10,2--10,6)); + UnionCase (SynSymbol Down, [], (11,2--11,6)); UnionCase (SynSymbol Right, [], (12,2--12,7))], [], [], (8,1--12,7)), (8,0--12,8)); Expr (TypeAlias - (SynSymbol Pos, - Tuple - (false, [Type (Ident int); Star (14,17--14,18); Type (Ident int)], - (14,13--14,22)), (14,1--14,22)), (14,0--14,23)); + (SynSymbol Pos, Tuple (false, [Type (Ident int); Star (14,17--14,18); Type (Ident int)], (14,13--14,22)), + (14,1--14,22)), (14,0--14,23)); Expr (Record (SynSymbol Node, [RecordLabel (Default, SynSymbol pos, Ident Pos, (17,3--17,11)); RecordLabel (Default, SynSymbol dir, Ident Dir, (18,3--18,11)); - RecordLabel (Default, SynSymbol steps, Ident int, (19,3--19,13))], - [], [], (16,1--19,14)), (16,0--19,15)); + RecordLabel (Default, SynSymbol steps, Ident int, (19,3--19,13))], [], [], (16,1--19,14)), (16,0--19,15)); Expr (FunctionDef (SynSymbol LeftOf, Inline, @@ -30,16 +25,12 @@ (Collection (SynCollection (Paren, - [Named (SynSymbol x, (21,21--21,22)); - Trivia (Comma, (21,22--21,23)); - Named (SynSymbol y, (21,24--21,25))], - (21,20--21,26))), Ident Pos, (21,19--21,32))], + [Named (SynSymbol x, (21,21--21,22)); Trivia (Comma, (21,22--21,23)); + Named (SynSymbol y, (21,24--21,25))], (21,20--21,26))), Ident Pos, (21,19--21,32))], (21,18--21,33)), [Tuple - ([FunctionCall - (Symbol (SynSymbol dec), [Symbol (SynSymbol x)], - (21,36--21,41)); Symbol (SynSymbol y)], (21,35--21,45))], - (21,1--21,46)), (21,0--21,47)); + ([FunctionCall (Symbol (SynSymbol dec), [Symbol (SynSymbol x)], (21,36--21,41)); Symbol (SynSymbol y)], + (21,35--21,45))], (21,1--21,46)), (21,0--21,47)); Expr (FunctionDef (SynSymbol RightOf, Inline, @@ -49,16 +40,12 @@ (Collection (SynCollection (Paren, - [Named (SynSymbol x, (22,22--22,23)); - Trivia (Comma, (22,23--22,24)); - Named (SynSymbol y, (22,25--22,26))], - (22,21--22,27))), Ident Pos, (22,20--22,33))], + [Named (SynSymbol x, (22,22--22,23)); Trivia (Comma, (22,23--22,24)); + Named (SynSymbol y, (22,25--22,26))], (22,21--22,27))), Ident Pos, (22,20--22,33))], (22,19--22,34)), [Tuple - ([FunctionCall - (Symbol (SynSymbol inc), [Symbol (SynSymbol x)], - (22,37--22,42)); Symbol (SynSymbol y)], (22,36--22,46))], - (22,1--22,47)), (22,0--22,48)); + ([FunctionCall (Symbol (SynSymbol inc), [Symbol (SynSymbol x)], (22,37--22,42)); Symbol (SynSymbol y)], + (22,36--22,46))], (22,1--22,47)), (22,0--22,48)); Expr (FunctionDef (SynSymbol UpOf, Inline, @@ -68,17 +55,12 @@ (Collection (SynCollection (Paren, - [Named (SynSymbol x, (23,19--23,20)); - Trivia (Comma, (23,20--23,21)); - Named (SynSymbol y, (23,22--23,23))], - (23,18--23,24))), Ident Pos, (23,17--23,30))], + [Named (SynSymbol x, (23,19--23,20)); Trivia (Comma, (23,20--23,21)); + Named (SynSymbol y, (23,22--23,23))], (23,18--23,24))), Ident Pos, (23,17--23,30))], (23,16--23,31)), [Tuple - ([Symbol (SynSymbol x); - FunctionCall - (Symbol (SynSymbol dec), [Symbol (SynSymbol y)], - (23,37--23,42))], (23,33--23,43))], (23,1--23,44)), - (23,0--23,45)); + ([Symbol (SynSymbol x); FunctionCall (Symbol (SynSymbol dec), [Symbol (SynSymbol y)], (23,37--23,42))], + (23,33--23,43))], (23,1--23,44)), (23,0--23,45)); Expr (FunctionDef (SynSymbol DownOf, Inline, @@ -88,60 +70,35 @@ (Collection (SynCollection (Paren, - [Named (SynSymbol x, (24,21--24,22)); - Trivia (Comma, (24,22--24,23)); - Named (SynSymbol y, (24,24--24,25))], - (24,20--24,26))), Ident Pos, (24,19--24,32))], + [Named (SynSymbol x, (24,21--24,22)); Trivia (Comma, (24,22--24,23)); + Named (SynSymbol y, (24,24--24,25))], (24,20--24,26))), Ident Pos, (24,19--24,32))], (24,18--24,33)), [Tuple - ([Symbol (SynSymbol x); - FunctionCall - (Symbol (SynSymbol inc), [Symbol (SynSymbol y)], - (24,39--24,44))], (24,35--24,45))], (24,1--24,46)), - (24,0--24,47)); + ([Symbol (SynSymbol x); FunctionCall (Symbol (SynSymbol inc), [Symbol (SynSymbol y)], (24,39--24,44))], + (24,35--24,45))], (24,1--24,46)), (24,0--24,47)); Expr (FunctionDef (SynSymbol GetDirFun, Inline, - Args - (List - [Typed - (Named (SynSymbol d, (26,23--26,24)), Ident Dir, - (26,22--26,30))], (26,21--26,31)), + Args (List [Typed (Named (SynSymbol d, (26,23--26,24)), Ident Dir, (26,22--26,30))], (26,21--26,31)), [Match (Symbol (SynSymbol d), - [SynMatch - (Named (SynSymbol Up, (28,5--28,7)), None, - [Symbol (SynSymbol UpOf)], (28,5--28,12)); - SynMatch - (Named (SynSymbol Down, (29,5--29,9)), None, - [Symbol (SynSymbol DownOf)], (29,5--29,16)); - SynMatch - (Named (SynSymbol Left, (30,5--30,9)), None, - [Symbol (SynSymbol LeftOf)], (30,5--30,16)); - SynMatch - (Named (SynSymbol Right, (31,5--31,10)), None, - [Symbol (SynSymbol RightOf)], (31,5--31,18))], + [SynMatch (Named (SynSymbol Up, (28,5--28,7)), None, [Symbol (SynSymbol UpOf)], (28,5--28,12)); + SynMatch (Named (SynSymbol Down, (29,5--29,9)), None, [Symbol (SynSymbol DownOf)], (29,5--29,16)); + SynMatch (Named (SynSymbol Left, (30,5--30,9)), None, [Symbol (SynSymbol LeftOf)], (30,5--30,16)); + SynMatch (Named (SynSymbol Right, (31,5--31,10)), None, [Symbol (SynSymbol RightOf)], (31,5--31,18))], (27,3--31,19))], (26,1--32,3)), (26,0--32,4)); Expr (FunctionDef (SynSymbol MoveNode, None, - Args - (List - [Named (SynSymbol v, (34,14--34,15)); - Named (SynSymbol dir, (34,16--34,19))], (34,13--34,20)), + Args (List [Named (SynSymbol v, (34,14--34,15)); Named (SynSymbol dir, (34,16--34,19))], (34,13--34,20)), [RecordInit ([SynInit (SynSymbol dir, Symbol (SynSymbol dir), (36,4--36,11)); SynInit (SynSymbol pos, ThreadLast - ([Expr - (DotProperty - (Symbol (SynSymbol v), SynSymbol pos, - (37,14--37,20)), (37,13--37,21)); + ([Expr (DotProperty (Symbol (SynSymbol v), SynSymbol pos, (37,14--37,20)), (37,13--37,21)); Expr - (FunctionCall - (Symbol (SynSymbol GetDirFun), - [Symbol (SynSymbol dir)], (37,23--37,36)), + (FunctionCall (Symbol (SynSymbol GetDirFun), [Symbol (SynSymbol dir)], (37,23--37,36)), (37,22--37,37))], (37,9--37,37)), (37,4--37,38)); SynInit (SynSymbol steps, @@ -149,28 +106,20 @@ (Op (Infix (SynSymbol =, - [Symbol (SynSymbol dir); - DotProperty - (Symbol (SynSymbol v), SynSymbol dir, - (38,22--38,28))], (38,15--38,29))), + [Symbol (SynSymbol dir); DotProperty (Symbol (SynSymbol v), SynSymbol dir, (38,22--38,28))], + (38,15--38,29))), FunctionCall - (Symbol (SynSymbol inc), - [DotProperty - (Symbol (SynSymbol v), SynSymbol steps, - (38,37--38,45))], (38,32--38,46)), - Some (Const (Int32 1, (38,48--38,49))), (38,11--38,49)), - (38,4--38,50))], (35,2--39,4))], (34,1--39,4)), - (34,0--40,1)); + (Symbol (SynSymbol inc), [DotProperty (Symbol (SynSymbol v), SynSymbol steps, (38,37--38,45))], + (38,32--38,46)), Some (Const (Int32 1, (38,48--38,49))), (38,11--38,49)), (38,4--38,50))], + (35,2--39,4))], (34,1--39,4)), (34,0--40,1)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (42,0--42,14)), FunctionCall - (Symbol (SynSymbol printfn), - [Const (String ("OK", Regular, (42,9--42,13)), (42,9--42,13))], + (Symbol (SynSymbol printfn), [Const (String ("OK", Regular, (42,9--42,13)), (42,9--42,13))], (42,1--42,13)), None, (42,0--42,14)), (42,0--42,14)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (42,0--42,14)), (42,0--42,14)); - Symbol (SynSymbol visp_result_todo)], (42,0--42,14)), - (42,0--42,14))], (8,0--42,14))] \ No newline at end of file + [Const (String ("%A", Regular, (42,0--42,14)), (42,0--42,14)); Symbol (SynSymbol visp_result_todo)], + (42,0--42,14)), (42,0--42,14))], (8,0--42,14))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-2.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-2.structured output.verified.txt index e8cdefb..c3f5a5e 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-2.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-2.structured output.verified.txt @@ -5,46 +5,33 @@ (SynSymbol Mapping, [RecordLabel (Default, SynSymbol src, Ident int64, (9,3--9,14)); RecordLabel (Default, SynSymbol dest, Ident int64, (10,3--10,15)); - RecordLabel (Default, SynSymbol range, Ident int64, (11,3--11,16))], - [], [], (8,1--11,17)), (8,0--12,1)); + RecordLabel (Default, SynSymbol range, Ident int64, (11,3--11,16))], [], [], (8,1--11,17)), (8,0--12,1)); Expr (LetOrUse (Named (SynSymbol initial, (14,5--14,12)), RecordInit - ([SynInit - (SynSymbol src, Const (Int32 3, (14,22--14,23)), - (14,16--14,25)); - SynInit - (SynSymbol Mapping.dest, Const (Int32 5, (14,40--14,41)), - (14,26--14,42)); - SynInit - (SynSymbol range, Const (Int32 8, (14,51--14,52)), - (14,43--14,54))], (14,13--14,57)), None, (14,1--14,57)), - (14,0--14,58)); + ([SynInit (SynSymbol src, Const (Int32 3, (14,22--14,23)), (14,16--14,25)); + SynInit (SynSymbol Mapping.dest, Const (Int32 5, (14,40--14,41)), (14,26--14,42)); + SynInit (SynSymbol range, Const (Int32 8, (14,51--14,52)), (14,43--14,54))], (14,13--14,57)), None, + (14,1--14,57)), (14,0--14,58)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("initial is %A", Regular, (16,9--16,24)), (16,9--16,24)); - Symbol (SynSymbol initial)], (16,1--16,32)), (16,0--16,33)); + [Const (String ("initial is %A", Regular, (16,9--16,24)), (16,9--16,24)); Symbol (SynSymbol initial)], + (16,1--16,32)), (16,0--16,33)); Expr (LetOrUse (Named (SynSymbol updated1, (18,5--18,13)), FunctionCall (Symbol (SynSymbol with), [Symbol (SynSymbol initial); - RecordInit - ([SynInit - (SynSymbol src, Const (Int32 5, (18,36--18,37)), - (18,31--18,38))], (18,28--18,41))], (18,15--18,41)), - None, (18,1--18,42)), (18,0--18,43)); + RecordInit ([SynInit (SynSymbol src, Const (Int32 5, (18,36--18,37)), (18,31--18,38))], (18,28--18,41))], + (18,15--18,41)), None, (18,1--18,42)), (18,0--18,43)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("updated1 is %A", Regular, (20,9--20,25)), - (20,9--20,25)); Symbol (SynSymbol updated1)], (20,1--20,34)), - (20,0--20,35)); + [Const (String ("updated1 is %A", Regular, (20,9--20,25)), (20,9--20,25)); Symbol (SynSymbol updated1)], + (20,1--20,34)), (20,0--20,35)); Expr (LetOrUse (Named (SynSymbol updated2, (22,5--22,13)), @@ -52,27 +39,19 @@ (Symbol (SynSymbol with), [Symbol (SynSymbol initial); RecordInit - ([SynInit - (SynSymbol src, Const (Int32 99, (22,36--22,38)), - (22,31--22,39)); - SynInit - (SynSymbol Mapping.dest, Const (Int32 12, (22,54--22,56)), - (22,40--22,57))], (22,28--22,60))], (22,15--22,60)), - None, (22,1--22,61)), (22,0--22,62)); + ([SynInit (SynSymbol src, Const (Int32 99, (22,36--22,38)), (22,31--22,39)); + SynInit (SynSymbol Mapping.dest, Const (Int32 12, (22,54--22,56)), (22,40--22,57))], (22,28--22,60))], + (22,15--22,60)), None, (22,1--22,61)), (22,0--22,62)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("updated2 is %A", Regular, (24,9--24,25)), - (24,9--24,25)); Symbol (SynSymbol updated2)], (24,1--24,34)), - (24,0--24,35)); + [Const (String ("updated2 is %A", Regular, (24,9--24,25)), (24,9--24,25)); Symbol (SynSymbol updated2)], + (24,1--24,34)), (24,0--24,35)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (26,0--26,2)), - Const (Unit, (26,0--26,2)), None, (26,0--26,2)), (26,0--26,2)); + (LetOrUse (Named (SynSymbol visp_result_todo, (26,0--26,2)), Const (Unit, (26,0--26,2)), None, (26,0--26,2)), + (26,0--26,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (26,0--26,2)), (26,0--26,2)); - Symbol (SynSymbol visp_result_todo)], (26,0--26,2)), (26,0--26,2))], - (8,0--26,2))] \ No newline at end of file + [Const (String ("%A", Regular, (26,0--26,2)), (26,0--26,2)); Symbol (SynSymbol visp_result_todo)], + (26,0--26,2)), (26,0--26,2))], (8,0--26,2))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-3.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-3.structured output.verified.txt index 2dfc30b..1ae15e5 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-3.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-3.structured output.verified.txt @@ -2,29 +2,18 @@ [AnonModule ([Expr (Record - (SynSymbol TestRec, - [RecordLabel (Default, SynSymbol value, Ident int, (9,3--9,13))], - [], [], (8,1--9,14)), (8,0--9,15)); + (SynSymbol TestRec, [RecordLabel (Default, SynSymbol value, Ident int, (9,3--9,13))], [], [], (8,1--9,14)), + (8,0--9,15)); Expr (FunctionDef (SynSymbol SomeFun, None, - Args - (List - [Typed - (Named (SynSymbol r, (11,14--11,15)), Ident TestRec, - (11,13--11,25))], (11,12--11,26)), + Args (List [Typed (Named (SynSymbol r, (11,14--11,15)), Ident TestRec, (11,13--11,25))], (11,12--11,26)), [LetOrUse - (Named (SynSymbol counter, (12,7--12,14)), - Const (Int32 0, (12,15--12,16)), Mutable, (12,3--12,16)); - LetOrUse - (Named (SynSymbol value, (14,7--14,12)), Symbol (SynSymbol r), - Mutable, (14,3--14,14)); + (Named (SynSymbol counter, (12,7--12,14)), Const (Int32 0, (12,15--12,16)), Mutable, (12,3--12,16)); + LetOrUse (Named (SynSymbol value, (14,7--14,12)), Symbol (SynSymbol r), Mutable, (14,3--14,14)); While (Op - (Infix - (SynSymbol <, - [Symbol (SynSymbol counter); - Const (Int32 10, (16,20--16,22))], (16,10--16,22))), + (Infix (SynSymbol <, [Symbol (SynSymbol counter); Const (Int32 10, (16,20--16,22))], (16,10--16,22))), [Set (Symbol (SynSymbol value), FunctionCall @@ -35,18 +24,12 @@ (SynSymbol value, FunctionCall (Symbol (SynSymbol inc), - [DotProperty - (Symbol (SynSymbol value), SynSymbol value, - (17,44--17,56))], (17,39--17,57)), - (17,31--17,59))], (17,28--17,62))], - (17,17--17,62)), (17,5--17,63)); + [DotProperty (Symbol (SynSymbol value), SynSymbol value, (17,44--17,56))], + (17,39--17,57)), (17,31--17,59))], (17,28--17,62))], (17,17--17,62)), (17,5--17,63)); SyntaxMacroCall (SynMacroCall - (SynSymbol up!, - [Symbol (SynSymbol up!); Symbol (SynSymbol counter); - Symbol (SynSymbol inc)], (18,5--18,20)))], - (16,3--18,21)); Symbol (SynSymbol value)], (11,1--21,7)), - (11,0--22,1)); + (SynSymbol up!, [Symbol (SynSymbol up!); Symbol (SynSymbol counter); Symbol (SynSymbol inc)], + (18,5--18,20)))], (16,3--18,21)); Symbol (SynSymbol value)], (11,1--21,7)), (11,0--22,1)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (24,0--24,40)), @@ -56,13 +39,10 @@ FunctionCall (Symbol (SynSymbol SomeFun), [RecordInit - ([SynInit - (SynSymbol value, Const (Int32 0, (24,33--24,34)), - (24,26--24,35))], (24,23--24,38))], (24,15--24,38))], - (24,1--24,39)), None, (24,0--24,40)), (24,0--24,40)); + ([SynInit (SynSymbol value, Const (Int32 0, (24,33--24,34)), (24,26--24,35))], (24,23--24,38))], + (24,15--24,38))], (24,1--24,39)), None, (24,0--24,40)), (24,0--24,40)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (24,0--24,40)), (24,0--24,40)); - Symbol (SynSymbol visp_result_todo)], (24,0--24,40)), - (24,0--24,40))], (8,0--24,40))] \ No newline at end of file + [Const (String ("%A", Regular, (24,0--24,40)), (24,0--24,40)); Symbol (SynSymbol visp_result_todo)], + (24,0--24,40)), (24,0--24,40))], (8,0--24,40))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-4.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-4.structured output.verified.txt index c4c3908..6b2de4f 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-4.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_record-4.structured output.verified.txt @@ -2,40 +2,27 @@ [AnonModule ([Expr (Record - (SynSymbol TestRec, - [RecordLabel (Default, SynSymbol value, Ident int, (10,3--10,13))], + (SynSymbol TestRec, [RecordLabel (Default, SynSymbol value, Ident int, (10,3--10,13))], [Member (SynSymbol t.Structuredtext, - DotMethod - (Symbol (SynSymbol t), SynSymbol ToString, [], Tuple, - (12,28--12,39)), (12,3--12,40)); + DotMethod (Symbol (SynSymbol t), SynSymbol ToString, [], Tuple, (12,28--12,39)), (12,3--12,40)); OverrideFn (SynSymbol t.ToString, Args (List [], (14,25--14,27)), [FunctionCall (Symbol (SynSymbol sprintf), - [Const - (String ("TestRec(%i)", Regular, (14,37--14,50)), - (14,37--14,50)); - DotProperty - (Symbol (SynSymbol t), SynSymbol value, (14,52--14,60))], - (14,29--14,61))], (14,3--14,62))], - [{ Attributes = - [{ TypeName = Ident StructuredFormatDisplay - ArgExpr = - Const - (String ("{Structuredtext}", Regular, (8,27--8,45)), - (8,27--8,45)) - Range = (8,3--8,46) }] + [Const (String ("TestRec(%i)", Regular, (14,37--14,50)), (14,37--14,50)); + DotProperty (Symbol (SynSymbol t), SynSymbol value, (14,52--14,60))], (14,29--14,61))], + (14,3--14,62))], + [{ Attributes = [{ TypeName = Ident StructuredFormatDisplay + ArgExpr = Const (String ("{Structuredtext}", Regular, (8,27--8,45)), (8,27--8,45)) + Range = (8,3--8,46) }] Range = (8,1--8,47) }], (8,1--14,63)), (8,0--15,1)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (19,9--19,13)), (19,9--19,13)); - RecordInit - ([SynInit - (SynSymbol value, Const (Int32 99, (19,24--19,26)), - (19,17--19,27))], (19,14--19,30))], (19,1--19,30)), - (19,0--19,31)); + RecordInit ([SynInit (SynSymbol value, Const (Int32 99, (19,24--19,26)), (19,17--19,27))], (19,14--19,30))], + (19,1--19,30)), (19,0--19,31)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (20,0--20,30)), @@ -43,13 +30,10 @@ (Symbol (SynSymbol printfn), [Const (String ("%A", Regular, (20,9--20,13)), (20,9--20,13)); RecordInit - ([SynInit - (SynSymbol value, Const (Int32 1, (20,24--20,25)), - (20,17--20,26))], (20,14--20,29))], (20,1--20,29)), None, - (20,0--20,30)), (20,0--20,30)); + ([SynInit (SynSymbol value, Const (Int32 1, (20,24--20,25)), (20,17--20,26))], (20,14--20,29))], + (20,1--20,29)), None, (20,0--20,30)), (20,0--20,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (20,0--20,30)), (20,0--20,30)); - Symbol (SynSymbol visp_result_todo)], (20,0--20,30)), - (20,0--20,30))], (8,0--20,30))] \ No newline at end of file + [Const (String ("%A", Regular, (20,0--20,30)), (20,0--20,30)); Symbol (SynSymbol visp_result_todo)], + (20,0--20,30)), (20,0--20,30))], (8,0--20,30))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-0.structured output.verified.txt index 1b62d64..5bc05f7 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-0.structured output.verified.txt @@ -3,44 +3,32 @@ ([Expr (Type (SynSymbol MyType, - Args - (Tuple - [Typed - (Named (SynSymbol value, (8,15--8,20)), Ident int32, - (8,14--8,28))], (8,13--8,29)), - [Let - (Named (SynSymbol field, (9,7--9,12)), Symbol (SynSymbol value), - (9,3--9,18)); - Member - (SynSymbol this.Foo, Symbol (SynSymbol value), (10,3--10,24)); + Args (Tuple [Typed (Named (SynSymbol value, (8,15--8,20)), Ident int32, (8,14--8,28))], (8,13--8,29)), + [Let (Named (SynSymbol field, (9,7--9,12)), Symbol (SynSymbol value), (9,3--9,18)); + Member (SynSymbol this.Foo, Symbol (SynSymbol value), (10,3--10,24)); MemberFn (SynSymbol this.Thing, Args (List [], (11,23--11,25)), - [Const - (String ("hello", Regular, (11,26--11,33)), (11,26--11,33))], - (11,3--11,33))], [], (8,1--11,34)), (8,0--12,1)); + [Const (String ("hello", Regular, (11,26--11,33)), (11,26--11,33))], (11,3--11,33))], [], (8,1--11,34)), + (8,0--12,1)); Expr (LetOrUse (Named (SynSymbol myObject, (14,5--14,13)), - New - (Ident MyType, [Const (Int32 99, (14,26--14,28))], (14,15--14,28)), - None, (14,1--14,29)), (14,0--14,30)); + New (Ident MyType, [Const (Int32 99, (14,26--14,28))], (14,15--14,28)), None, (14,1--14,29)), (14,0--14,30)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%O", Regular, (16,9--16,13)), (16,9--16,13)); - Symbol (SynSymbol myObject)], (16,1--16,22)), (16,0--16,23)); + [Const (String ("%O", Regular, (16,9--16,13)), (16,9--16,13)); Symbol (SynSymbol myObject)], (16,1--16,22)), + (16,0--16,23)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (17,0--17,31)), FunctionCall (Symbol (SynSymbol printfn), [Const (String ("%O", Regular, (17,9--17,13)), (17,9--17,13)); - DotProperty - (Symbol (SynSymbol myObject), SynSymbol Foo, (17,15--17,29))], - (17,1--17,30)), None, (17,0--17,31)), (17,0--17,31)); + DotProperty (Symbol (SynSymbol myObject), SynSymbol Foo, (17,15--17,29))], (17,1--17,30)), None, + (17,0--17,31)), (17,0--17,31)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,0--17,31)), (17,0--17,31)); - Symbol (SynSymbol visp_result_todo)], (17,0--17,31)), - (17,0--17,31))], (8,0--17,31))] \ No newline at end of file + [Const (String ("%A", Regular, (17,0--17,31)), (17,0--17,31)); Symbol (SynSymbol visp_result_todo)], + (17,0--17,31)), (17,0--17,31))], (8,0--17,31))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-alias-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-alias-0.structured output.verified.txt index 31b0b53..4318519 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-alias-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_type-alias-0.structured output.verified.txt @@ -4,46 +4,30 @@ (TypeAlias (SynSymbol range, Paren - (Tuple - (false, - [Type (Ident int64); Star (8,22--8,23); Type (Ident int64)], - (8,16--8,29)), (8,15--8,30)), (8,1--8,30)), (8,0--8,31)); + (Tuple (false, [Type (Ident int64); Star (8,22--8,23); Type (Ident int64)], (8,16--8,29)), (8,15--8,30)), + (8,1--8,30)), (8,0--8,31)); Expr (FunctionDef (SynSymbol things, None, - Args - (List - [Typed - (Named (SynSymbol r, (10,13--10,14)), Ident range, - (10,12--10,23))], (10,11--10,24)), + Args (List [Typed (Named (SynSymbol r, (10,13--10,14)), Ident range, (10,12--10,23))], (10,11--10,24)), [Op (Infix (SynSymbol +, - [FunctionCall - (Symbol (SynSymbol fst), [Symbol (SynSymbol r)], - (11,6--11,11)); - FunctionCall - (Symbol (SynSymbol snd), [Symbol (SynSymbol r)], - (11,14--11,19))], (11,3--11,20)))], (10,1--11,21)), - (10,0--11,22)); + [FunctionCall (Symbol (SynSymbol fst), [Symbol (SynSymbol r)], (11,6--11,11)); + FunctionCall (Symbol (SynSymbol snd), [Symbol (SynSymbol r)], (11,14--11,19))], (11,3--11,20)))], + (10,1--11,21)), (10,0--11,22)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (13,0--13,41)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("Result is %A", Regular, (13,9--13,23)), - (13,9--13,23)); + [Const (String ("Result is %A", Regular, (13,9--13,23)), (13,9--13,23)); FunctionCall (Symbol (SynSymbol things), - [Tuple - ([Const (Int32 1, (13,33--13,34)); - Const (Int32 2, (13,37--13,38))], (13,33--13,38))], - (13,25--13,39))], (13,1--13,40)), None, (13,0--13,41)), - (13,0--13,41)); + [Tuple ([Const (Int32 1, (13,33--13,34)); Const (Int32 2, (13,37--13,38))], (13,33--13,38))], + (13,25--13,39))], (13,1--13,40)), None, (13,0--13,41)), (13,0--13,41)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (13,0--13,41)), (13,0--13,41)); - Symbol (SynSymbol visp_result_todo)], (13,0--13,41)), - (13,0--13,41))], (8,0--13,41))] \ No newline at end of file + [Const (String ("%A", Regular, (13,0--13,41)), (13,0--13,41)); Symbol (SynSymbol visp_result_todo)], + (13,0--13,41)), (13,0--13,41))], (8,0--13,41))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_union-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_union-0.structured output.verified.txt index 67d80ad..2fb2ffb 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_union-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_type_union-0.structured output.verified.txt @@ -6,27 +6,22 @@ [UnionCase (SynSymbol Empty, [], (9,2--9,7)); UnionCase (SynSymbol Cons, - [Type (Ident ^a, (10,8--10,10)); - Named (SynSymbol tail, Ident MyList<^a>, (10,11--10,29))], + [Type (Ident ^a, (10,8--10,10)); Named (SynSymbol tail, Ident MyList<^a>, (10,11--10,29))], (10,3--10,29))], [Member (SynSymbol t.TIsEmpty, Match (Symbol (SynSymbol t), [SynMatch - (Named (SynSymbol Empty, (14,7--14,12)), None, - [Const (Bool true, (14,13--14,17))], (14,7--14,17)); - SynMatch - (Discard (15,7--15,8), None, - [Const (Bool false, (15,9--15,14))], (15,7--15,14))], + (Named (SynSymbol Empty, (14,7--14,12)), None, [Const (Bool true, (14,13--14,17))], (14,7--14,17)); + SynMatch (Discard (15,7--15,8), None, [Const (Bool false, (15,9--15,14))], (15,7--15,14))], (13,5--15,15)), (12,3--15,16)); MemberFn (SynSymbol t.Length, Args (List [], (17,22--17,24)), [Match (Symbol (SynSymbol t), [SynMatch - (Named (SynSymbol Empty, (19,7--19,12)), None, - [Const (Int32 0, (19,13--19,14))], (19,7--19,14)); + (Named (SynSymbol Empty, (19,7--19,12)), None, [Const (Int32 0, (19,13--19,14))], (19,7--19,14)); SynMatch (Collection (SynCollection @@ -35,19 +30,14 @@ Collection (SynCollection (Paren, - [Discard (20,14--20,15); - Trivia (Comma, (20,15--20,16)); - Named (SynSymbol rest, (20,17--20,21))], - (20,13--20,22)))], (20,7--20,23))), None, + [Discard (20,14--20,15); Trivia (Comma, (20,15--20,16)); + Named (SynSymbol rest, (20,17--20,21))], (20,13--20,22)))], (20,7--20,23))), None, [Op (Infix (SynSymbol +, [Const (Int32 1, (21,11--21,12)); - FunctionCall - (Symbol (SynSymbol rest.Length), [], - (21,14--21,25))], (21,9--21,26)))], - (20,7--21,27))], (18,5--22,7))], (17,3--23,5))], [], - (8,1--23,6)), (8,0--24,1)); + FunctionCall (Symbol (SynSymbol rest.Length), [], (21,14--21,25))], (21,9--21,26)))], + (20,7--21,27))], (18,5--22,7))], (17,3--23,5))], [], (8,1--23,6)), (8,0--24,1)); Expr (LetOrUse (Named (SynSymbol linkedList, (26,5--26,15)), @@ -61,74 +51,55 @@ ([Const (Int32 2, (26,33--26,34)); FunctionCall (Symbol (SynSymbol Cons), - [Tuple - ([Const (Int32 3, (26,43--26,44)); - Symbol (SynSymbol Empty)], (26,43--26,51))], - (26,37--26,52))], (26,33--26,53))], - (26,27--26,54))], (26,23--26,55))], (26,17--26,56)), + [Tuple ([Const (Int32 3, (26,43--26,44)); Symbol (SynSymbol Empty)], (26,43--26,51))], + (26,37--26,52))], (26,33--26,53))], (26,27--26,54))], (26,23--26,55))], (26,17--26,56)), None, (26,1--26,57)), (26,0--26,58)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("List is %A", Regular, (28,9--28,21)), (28,9--28,21)); - Symbol (SynSymbol linkedList)], (28,1--28,32)), (28,0--28,33)); + [Const (String ("List is %A", Regular, (28,9--28,21)), (28,9--28,21)); Symbol (SynSymbol linkedList)], + (28,1--28,32)), (28,0--28,33)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("List length %A", Regular, (29,9--29,25)), - (29,9--29,25)); - FunctionCall - (Symbol (SynSymbol linkedList.Length), [], (29,27--29,44))], - (29,1--29,45)), (29,0--29,46)); + [Const (String ("List length %A", Regular, (29,9--29,25)), (29,9--29,25)); + FunctionCall (Symbol (SynSymbol linkedList.Length), [], (29,27--29,44))], (29,1--29,45)), (29,0--29,46)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("List isEmpty %A", Regular, (30,9--30,26)), - (30,9--30,26)); Symbol (SynSymbol linkedList.TIsEmpty)], - (30,1--30,46)), (30,0--30,47)); + [Const (String ("List isEmpty %A", Regular, (30,9--30,26)), (30,9--30,26)); + Symbol (SynSymbol linkedList.TIsEmpty)], (30,1--30,46)), (30,0--30,47)); Expr (Union (SynSymbol MyOption<^T>, [UnionCase (SynSymbol None, [], (35,2--35,6)); - UnionCase - (SynSymbol Some, [Type (Ident ^T, (36,8--36,10))], (36,3--36,10))], - [], [{ Attributes = [{ TypeName = Ident RequireQualifiedAccess - ArgExpr = Const (Unit, (33,3--33,25)) - Range = (33,3--33,25) }] - Range = (33,1--33,26) }], (33,1--36,11)), (33,0--36,12)); + UnionCase (SynSymbol Some, [Type (Ident ^T, (36,8--36,10))], (36,3--36,10))], [], + [{ Attributes = [{ TypeName = Ident RequireQualifiedAccess + ArgExpr = Const (Unit, (33,3--33,25)) + Range = (33,3--33,25) }] + Range = (33,1--33,26) }], (33,1--36,11)), (33,0--36,12)); Expr - (LetOrUse - (Named (SynSymbol myOptNone, (38,5--38,14)), - Symbol (SynSymbol MyOption.None), None, (38,1--38,28)), + (LetOrUse (Named (SynSymbol myOptNone, (38,5--38,14)), Symbol (SynSymbol MyOption.None), None, (38,1--38,28)), (38,0--38,29)); Expr (LetOrUse (Named (SynSymbol myOptSome, (39,5--39,14)), - FunctionCall - (Symbol (SynSymbol MyOption.Some), - [Const (Int32 1, (39,30--39,31))], (39,16--39,31)), None, + FunctionCall (Symbol (SynSymbol MyOption.Some), [Const (Int32 1, (39,30--39,31))], (39,16--39,31)), None, (39,1--39,32)), (39,0--39,33)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("myOptNone %A", Regular, (41,9--41,23)), (41,9--41,23)); - Symbol (SynSymbol myOptNone)], (41,1--41,33)), (41,0--41,34)); + [Const (String ("myOptNone %A", Regular, (41,9--41,23)), (41,9--41,23)); Symbol (SynSymbol myOptNone)], + (41,1--41,33)), (41,0--41,34)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (42,0--42,34)), FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("myOptSome %A", Regular, (42,9--42,23)), - (42,9--42,23)); Symbol (SynSymbol myOptSome)], (42,1--42,33)), - None, (42,0--42,34)), (42,0--42,34)); + [Const (String ("myOptSome %A", Regular, (42,9--42,23)), (42,9--42,23)); Symbol (SynSymbol myOptSome)], + (42,1--42,33)), None, (42,0--42,34)), (42,0--42,34)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (42,0--42,34)), (42,0--42,34)); - Symbol (SynSymbol visp_result_todo)], (42,0--42,34)), - (42,0--42,34))], (8,0--42,34))] \ No newline at end of file + [Const (String ("%A", Regular, (42,0--42,34)), (42,0--42,34)); Symbol (SynSymbol visp_result_todo)], + (42,0--42,34)), (42,0--42,34))], (8,0--42,34))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_vector_vector-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_vector_vector-0.structured output.verified.txt index 75b10e7..f584e04 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_vector_vector-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_vector_vector-0.structured output.verified.txt @@ -6,42 +6,33 @@ Collection (SynCollection (Bracket, - [Const (Int32 1, (8,10--8,11)); Const (Int32 2, (8,12--8,13)); - Const (Int32 3, (8,14--8,15)); Const (Int32 4, (8,16--8,17)); - Const (Int32 5, (8,18--8,19)); Const (Int32 6, (8,20--8,21))], + [Const (Int32 1, (8,10--8,11)); Const (Int32 2, (8,12--8,13)); Const (Int32 3, (8,14--8,15)); + Const (Int32 4, (8,16--8,17)); Const (Int32 5, (8,18--8,19)); Const (Int32 6, (8,20--8,21))], (8,9--8,22))), Mutable, (8,1--8,22)), (8,0--8,23)); Expr (LetOrUse - (Named (SynSymbol empty, (9,5--9,10)), - Collection (SynCollection (Bracket, [], (9,11--9,13))), None, + (Named (SynSymbol empty, (9,5--9,10)), Collection (SynCollection (Bracket, [], (9,11--9,13))), None, (9,1--9,13)), (9,0--9,14)); Expr (Set - (DotIndex - (Symbol (SynSymbol vec), [Const (Int32 1, (11,9--11,10))], - (11,7--11,15)), - FunctionCall - (Symbol (SynSymbol Value.int), [Const (Int32 -1, (11,28--11,30))], - (11,18--11,30)), (11,1--11,31)), (11,0--11,32)); + (DotIndex (Symbol (SynSymbol vec), [Const (Int32 1, (11,9--11,10))], (11,7--11,15)), + FunctionCall (Symbol (SynSymbol Value.int), [Const (Int32 -1, (11,28--11,30))], (11,18--11,30)), + (11,1--11,31)), (11,0--11,32)); Expr (DotMethod (Symbol (SynSymbol empty), SynSymbol Add, - [FunctionCall - (Symbol (SynSymbol Value.int), - [Const (Int32 99, (13,23--13,25))], (13,13--13,25))], Tuple, + [FunctionCall (Symbol (SynSymbol Value.int), [Const (Int32 99, (13,23--13,25))], (13,13--13,25))], Tuple, (13,1--13,26)), (13,0--13,27)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%O", Regular, (15,9--15,13)), (15,9--15,13)); - Symbol (SynSymbol empty)], (15,1--15,19)), (15,0--15,20)); + [Const (String ("%O", Regular, (15,9--15,13)), (15,9--15,13)); Symbol (SynSymbol empty)], (15,1--15,19)), + (15,0--15,20)); Expr - (LetOrUse - (Named (SynSymbol visp_result_todo, (17,0--17,3)), - Symbol (SynSymbol vec), None, (17,0--17,3)), (17,0--17,3)); + (LetOrUse (Named (SynSymbol visp_result_todo, (17,0--17,3)), Symbol (SynSymbol vec), None, (17,0--17,3)), + (17,0--17,3)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (17,0--17,3)), (17,0--17,3)); - Symbol (SynSymbol visp_result_todo)], (17,0--17,3)), (17,0--17,3))], - (8,0--17,3))] \ No newline at end of file + [Const (String ("%A", Regular, (17,0--17,3)), (17,0--17,3)); Symbol (SynSymbol visp_result_todo)], + (17,0--17,3)), (17,0--17,3))], (8,0--17,3))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-0.structured output.verified.txt index a144b45..f6314e6 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-0.structured output.verified.txt @@ -1,31 +1,21 @@ ParsedFile [AnonModule - ([HashDirective - (ParsedHashDirective - ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), - (9,0--9,12)); + ([HashDirective (ParsedHashDirective ("nowarn", [String ("20", Regular, (9,8--9,12))], (9,0--9,12)), (9,0--9,12)); Expr (FunctionDef (SynSymbol inc, None, - Args - (List - [Typed - (Named (SynSymbol v, (11,10--11,11)), Ident Value, - (11,9--11,19))], (11,8--11,20)), + Args (List [Typed (Named (SynSymbol v, (11,10--11,11)), Ident Value, (11,9--11,19))], (11,8--11,20)), [FunctionCall (Symbol (SynSymbol Value.from), [Op (Infix (SynSymbol +, [Const (Int64 1L, (12,19--12,21)); - FunctionCall - (Symbol (SynSymbol unwrapInt), [Symbol (SynSymbol v)], - (12,23--12,34))], (12,17--12,35)))], (12,5--12,36))], - (11,1--12,37)), (11,0--12,38)); + FunctionCall (Symbol (SynSymbol unwrapInt), [Symbol (SynSymbol v)], (12,23--12,34))], + (12,17--12,35)))], (12,5--12,36))], (11,1--12,37)), (11,0--12,38)); Expr (LetOrUse - (Named (SynSymbol count, (14,5--14,10)), - Atom (Const (Int64 0L, (14,17--14,19)), (14,12--14,19)), None, + (Named (SynSymbol count, (14,5--14,10)), Atom (Const (Int64 0L, (14,17--14,19)), (14,12--14,19)), None, (14,1--14,20)), (14,0--14,21)); Expr (LetOrUse @@ -35,26 +25,17 @@ (Infix (SynSymbol <, [FunctionCall - (Symbol (SynSymbol unwrapInt), - [Deref - (true, Symbol (SynSymbol count), (15,21--15,27))], - (15,11--15,27)); Const (Int64 5L, (15,29--15,31))], - (15,8--15,31))), + (Symbol (SynSymbol unwrapInt), [Deref (true, Symbol (SynSymbol count), (15,21--15,27))], + (15,11--15,27)); Const (Int64 5L, (15,29--15,31))], (15,8--15,31))), [FunctionCall (Symbol (SynSymbol printfn), - [Const - (String ("in loop %O", Regular, (16,13--16,25)), - (16,13--16,25)); - Deref (true, Symbol (SynSymbol count), (16,26--16,32))], - (16,5--16,32)); + [Const (String ("in loop %O", Regular, (16,13--16,25)), (16,13--16,25)); + Deref (true, Symbol (SynSymbol count), (16,26--16,32))], (16,5--16,32)); FunctionCall - (Symbol (SynSymbol swap!), - [Symbol (SynSymbol count); Symbol (SynSymbol inc)], - (17,5--17,20))], (15,1--17,21)), None, (15,0--17,22)), - (15,0--17,22)); + (Symbol (SynSymbol swap!), [Symbol (SynSymbol count); Symbol (SynSymbol inc)], (17,5--17,20))], + (15,1--17,21)), None, (15,0--17,22)), (15,0--17,22)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (15,0--17,22)), (15,0--17,22)); - Symbol (SynSymbol visp_result_todo)], (15,0--17,22)), - (15,0--17,22))], (9,0--17,22))] \ No newline at end of file + [Const (String ("%A", Regular, (15,0--17,22)), (15,0--17,22)); Symbol (SynSymbol visp_result_todo)], + (15,0--17,22)), (15,0--17,22))], (9,0--17,22))] \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-1.structured output.verified.txt index 375d2c7..f06f29d 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_while_while-1.structured output.verified.txt @@ -6,22 +6,14 @@ Args (List [Typed - (Named (SynSymbol lhs, (8,23--8,26)), - Generic (Ident array, [Ident ^T], (8,28--8,37)), - (8,22--8,38)); + (Named (SynSymbol lhs, (8,23--8,26)), Generic (Ident array, [Ident ^T], (8,28--8,37)), (8,22--8,38)); Typed - (Named (SynSymbol rhs, (8,40--8,43)), - Generic (Ident array, [Ident ^T], (8,45--8,54)), - (8,39--8,55))], (8,21--8,56)), - [LetOrUse - (Named (SynSymbol index, (9,7--9,12)), - Const (Int32 0, (9,13--9,14)), Mutable, (9,3--9,14)); + (Named (SynSymbol rhs, (8,40--8,43)), Generic (Ident array, [Ident ^T], (8,45--8,54)), (8,39--8,55))], + (8,21--8,56)), + [LetOrUse (Named (SynSymbol index, (9,7--9,12)), Const (Int32 0, (9,13--9,14)), Mutable, (9,3--9,14)); LetOrUse - (Named (SynSymbol loop, (10,7--10,11)), - Const (Bool true, (10,12--10,16)), Mutable, (10,3--10,16)); - LetOrUse - (Named (SynSymbol diff, (11,7--11,11)), - Const (Int32 0, (11,12--11,13)), Mutable, (11,3--11,13)); + (Named (SynSymbol loop, (10,7--10,11)), Const (Bool true, (10,12--10,16)), Mutable, (10,3--10,16)); + LetOrUse (Named (SynSymbol diff, (11,7--11,11)), Const (Int32 0, (11,12--11,13)), Mutable, (11,3--11,13)); While (SyntaxMacroCall (SynMacroCall @@ -30,69 +22,51 @@ List (Paren, [Symbol (SynSymbol <); Symbol (SynSymbol index); - List - (Paren, - [Symbol (SynSymbol +Length); - Symbol (SynSymbol lhs)], (13,28--13,41))], + List (Paren, [Symbol (SynSymbol +Length); Symbol (SynSymbol lhs)], (13,28--13,41))], (13,19--13,42))], (13,10--13,42))), [LetOrUse (Named (SynSymbol lhs, (14,9--14,12)), - DotIndex - (Symbol (SynSymbol lhs), [Symbol (SynSymbol index)], - (14,14--14,26)), None, (14,5--14,27)); + DotIndex (Symbol (SynSymbol lhs), [Symbol (SynSymbol index)], (14,14--14,26)), None, (14,5--14,27)); LetOrUse (Named (SynSymbol rhs, (15,9--15,12)), - DotIndex - (Symbol (SynSymbol rhs), [Symbol (SynSymbol index)], - (15,14--15,26)), None, (15,5--15,27)); + DotIndex (Symbol (SynSymbol rhs), [Symbol (SynSymbol index)], (15,14--15,26)), None, (15,5--15,27)); SyntaxMacroCall (SynMacroCall (SynSymbol unless, [Symbol (SynSymbol unless); List - (Paren, - [Symbol (SynSymbol =); Symbol (SynSymbol lhs); - Symbol (SynSymbol rhs)], (17,12--17,23)); + (Paren, [Symbol (SynSymbol =); Symbol (SynSymbol lhs); Symbol (SynSymbol rhs)], + (17,12--17,23)); List (Paren, [Symbol (SynSymbol set!); Symbol (SynSymbol diff); - List - (Paren, - [Symbol (SynSymbol inc); Symbol (SynSymbol diff)], - (18,17--18,27))], (18,6--18,28))], (17,5--18,28))); + List (Paren, [Symbol (SynSymbol inc); Symbol (SynSymbol diff)], (18,17--18,27))], + (18,6--18,28))], (17,5--18,28))); SyntaxMacroCall (SynMacroCall (SynSymbol when, [Symbol (SynSymbol when); List - (Paren, - [Symbol (SynSymbol >); Symbol (SynSymbol diff); - Const (Int32 1, (20,18--20,19))], (20,10--20,20)); + (Paren, [Symbol (SynSymbol >); Symbol (SynSymbol diff); Const (Int32 1, (20,18--20,19))], + (20,10--20,20)); List (Paren, - [Symbol (SynSymbol set!); Symbol (SynSymbol loop); - Const (Bool false, (21,17--21,22))], (21,6--21,23))], - (20,5--21,23))); + [Symbol (SynSymbol set!); Symbol (SynSymbol loop); Const (Bool false, (21,17--21,22))], + (21,6--21,23))], (20,5--21,23))); Set (Symbol (SynSymbol index), - FunctionCall - (Symbol (SynSymbol inc), [Symbol (SynSymbol index)], - (23,17--23,26)), (23,5--23,27))], (13,3--23,28)); - Op - (Infix - (SynSymbol =, - [Symbol (SynSymbol diff); Const (Int32 1, (26,10--26,11))], - (26,3--26,11)))], (8,1--26,12)), (8,0--26,13)); + FunctionCall (Symbol (SynSymbol inc), [Symbol (SynSymbol index)], (23,17--23,26)), (23,5--23,27))], + (13,3--23,28)); + Op (Infix (SynSymbol =, [Symbol (SynSymbol diff); Const (Int32 1, (26,10--26,11))], (26,3--26,11)))], + (8,1--26,12)), (8,0--26,13)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (29,0--29,14)), FunctionCall - (Symbol (SynSymbol printfn), - [Const (String ("OK", Regular, (29,9--29,13)), (29,9--29,13))], + (Symbol (SynSymbol printfn), [Const (String ("OK", Regular, (29,9--29,13)), (29,9--29,13))], (29,1--29,13)), None, (29,0--29,14)), (29,0--29,14)); Expr (FunctionCall (Symbol (SynSymbol printfn), - [Const (String ("%A", Regular, (29,0--29,14)), (29,0--29,14)); - Symbol (SynSymbol visp_result_todo)], (29,0--29,14)), - (29,0--29,14))], (8,0--29,14))] \ No newline at end of file + [Const (String ("%A", Regular, (29,0--29,14)), (29,0--29,14)); Symbol (SynSymbol visp_result_todo)], + (29,0--29,14)), (29,0--29,14))], (8,0--29,14))] \ No newline at end of file From e8e5b3ff920570312dc441dd8e9fbf30ad718adf Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Sat, 23 Dec 2023 11:52:24 +0100 Subject: [PATCH 5/6] Normalize SynConst.String structured output --- src/Visp.Compiler/Syntax/Syntax.fs | 41 ++++++++++++- tests/Visp.Compiler.UnitTests/TestUtils.fs | 2 +- ...g_strings-0.structured output.verified.txt | 25 ++------ ...g_strings-1.structured output.verified.txt | 61 +++++-------------- ...rpolation-0.structured output.verified.txt | 8 +-- 5 files changed, 65 insertions(+), 72 deletions(-) diff --git a/src/Visp.Compiler/Syntax/Syntax.fs b/src/Visp.Compiler/Syntax/Syntax.fs index 92bf425..b4b3289 100644 --- a/src/Visp.Compiler/Syntax/Syntax.fs +++ b/src/Visp.Compiler/Syntax/Syntax.fs @@ -7,6 +7,7 @@ namespace rec Visp.Compiler.Syntax open Visp.Compiler.Writer open Visp.Compiler.Text open System.Diagnostics +open Visp.Common [] type Ident(text: string, range: range) = @@ -111,7 +112,7 @@ type SynStringKind = | Interpolated of plain: int | InterpolatedTripleQuote of triple: int -[] +[] type SynConst = | Unit | Nil @@ -132,6 +133,44 @@ type SynConst = | Decimal of System.Decimal | String of text: string * synStringKind: SynStringKind * range: range + member t.StructuredText = + match t with + | Unit -> "Unit" + | Nil -> "Nil" + | Bool it -> sprintf "Bool %A" it + | SByte it -> sprintf "SByte %A" it + | Byte it -> sprintf "Byte %A" it + | Int16 it -> sprintf "Int16 %A" it + | UInt16 it -> sprintf "UInt16 %A" it + | UInt32 it -> sprintf "UInt32 %A" it + | UInt64 it -> sprintf "UInt64 %A" it + | IntPtr it -> sprintf "IntPtr %A" it + | UIntPtr it -> sprintf "UIntPtr %A" it + | Single it -> sprintf "Single %A" it + | Double it -> sprintf "Double %A" it + | Int64 it -> sprintf "Int64 %A" it + | Int32 it -> sprintf "Int32 %A" it + | Char it -> sprintf "Char %A" it + | Decimal it -> sprintf "Decimal %A" it + | String(text, k, r) -> + let sb = PooledStringBuilder.Get() + sb.Append "String (\"" |> ignore + + for ch in text do + match ch with + | '\r' -> ignore (sb.Append "\\r") + | '\n' -> ignore (sb.Append "\\n") + | it -> ignore (sb.Append it) + + sb.Append "\", " |> ignore + sb.Append(sprintf "%A" k) |> ignore + sb.Append(", ") |> ignore + sb.Append(sprintf "%A" r) |> ignore + + sb.Append ")" |> ignore + + sb.ToStringAndReturn() + type SynTyped = SynTyped of name: SynSymbol * argtype: SynType * range: range [] diff --git a/tests/Visp.Compiler.UnitTests/TestUtils.fs b/tests/Visp.Compiler.UnitTests/TestUtils.fs index e33748d..0bdf602 100644 --- a/tests/Visp.Compiler.UnitTests/TestUtils.fs +++ b/tests/Visp.Compiler.UnitTests/TestUtils.fs @@ -54,7 +54,7 @@ let runStructuredOutputTest (name: string) = let nameParam = name.Replace('/', '_').Replace('\\', '_') - let output = (sprintf "%120A" parsed).Replace("\r\n", "\n") + let output = (sprintf "%120A" parsed).Replace("\\r\\n", "\\n").Replace("\r\n", "\n") return! verify output "parsing-snapshots" nameParam with :? ParseHelpers.SyntaxError as syn -> diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt index 9857097..7292c37 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt @@ -4,21 +4,13 @@ (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("string is: '%s'", Regular, (9,9--9,26)), (9,9--9,26)); - Const (String (" - this is - a multiline - string -", Regular, (9,27--13,1)), (9,27--13,1))], (9,1--13,1)), - (9,0--13,2)); + Const (String ("\n this is\n a multiline\n string\n", Regular, (9,27--13,1)), (9,27--13,1))], + (9,1--13,1)), (9,0--13,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("string is: '%s'", Regular, (15,9--15,26)), (15,9--15,26)); - Const (String (" - this is - a multiline - string -", TripleQuote, (15,27--19,3)), (15,27--19,3))], + Const (String ("\n this is\n a multiline\n string\n", TripleQuote, (15,27--19,3)), (15,27--19,3))], (15,1--19,3)), (15,0--19,4)); Expr (FunctionDef @@ -28,14 +20,9 @@ FunctionCall (Symbol (SynSymbol sprintf), [Const - (String - (" -let ``can parse %s`` = - TestUtils.runTest %s - |> Async.AwaitTask - ", TripleQuote, - (22,25--26,5)), (22,25--26,5)); Symbol (SynSymbol path); Symbol (SynSymbol path)], - (22,17--26,15)), None, (22,3--26,16)); Symbol (SynSymbol template)], (21,1--28,10)), (21,0--28,11)); + (String ("\nlet ``can parse %s`` =\n TestUtils.runTest %s\n |> Async.AwaitTask\n ", TripleQuote, (22,25--26,5)), + (22,25--26,5)); Symbol (SynSymbol path); Symbol (SynSymbol path)], (22,17--26,15)), None, + (22,3--26,16)); Symbol (SynSymbol template)], (21,1--28,10)), (21,0--28,11)); Expr (LetOrUse (Named (SynSymbol visp_result_todo, (30,0--30,49)), diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt index d361839..77320f2 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt @@ -25,10 +25,8 @@ (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("string is '%s'", Regular, (13,9--13,25)), (13,9--13,25)); - Const (String (" - multiple lines are okay? -", TripleQuote, (13,26--15,3)), (13,26--15,3))], (13,1--15,3)), - (13,0--15,4)); + Const (String ("\n multiple lines are okay?\n", TripleQuote, (13,26--15,3)), (13,26--15,3))], + (13,1--15,3)), (13,0--15,4)); Expr (Begin ([Begin @@ -37,9 +35,7 @@ (Symbol (SynSymbol printfn), [Const (String ("string is '%s'", Regular, (19,15--19,31)), (19,15--19,31)); Const - (String (" - multiple lines are okay? - ", TripleQuote, (19,32--21,9)), + (String ("\n multiple lines are okay?\n ", TripleQuote, (19,32--21,9)), (19,32--21,9))], (19,7--21,9))], Do, (18,5--21,10))], Do, (17,3--22,5))], Do, (16,1--22,6)), (16,0--22,7)); Expr @@ -50,20 +46,9 @@ (FunctionCall (Symbol (SynSymbol sprintf), [Const - (String - (" - // AUTO GENERATED - // DO NOT MODIFY BY HAND - - namespace %s - - open Xunit - - module %s - ", - TripleQuote, (25,16--34,5)), (25,16--34,5)); Symbol (SynSymbol moduleName); - Symbol (SynSymbol moduleName)], (25,8--34,27)), (25,7--34,28))], (25,3--34,28))], (24,1--35,5)), - (24,0--35,6)); + (String ("\n // AUTO GENERATED\n // DO NOT MODIFY BY HAND\n\n namespace %s\n\n open Xunit\n\n module %s\n ", TripleQuote, (25,16--34,5)), + (25,16--34,5)); Symbol (SynSymbol moduleName); Symbol (SynSymbol moduleName)], (25,8--34,27)), + (25,7--34,28))], (25,3--34,28))], (24,1--35,5)), (24,0--35,6)); Expr (LetOrUse (Named (SynSymbol lf, (37,5--37,7)), Symbol (SynSymbol System.Environment.NewLine), None, (37,1--37,34)), @@ -100,40 +85,24 @@ FunctionCall (Symbol (SynSymbol sprintf), [Const - (String - (" - [] - let ``%s %s`` () = TestUtils.runTest "%s" - ", - TripleQuote, (45,29--48,9)), (45,29--48,9)); Symbol (SynSymbol prefix); - Symbol (SynSymbol testname); Symbol (SynSymbol path)], (45,21--48,30)), None, (45,7--48,31)); + (String ("\n []\n let ``%s %s`` () = TestUtils.runTest "%s"\n ", TripleQuote, (45,29--48,9)), + (45,29--48,9)); Symbol (SynSymbol prefix); Symbol (SynSymbol testname); + Symbol (SynSymbol path)], (45,21--48,30)), None, (45,7--48,31)); LetOrUse (Named (SynSymbol template2, (49,11--49,20)), Const - (String - (" - [] - let ``interpolated {prefix} {testname}`` () = TestUtils.runTest "{path}" - ", - InterpolatedTripleQuote 1, (49,21--52,9)), (49,21--52,9)), None, (49,7--52,9)); + (String ("\n []\n let ``interpolated {prefix} {testname}`` () = TestUtils.runTest "{path}"\n ", InterpolatedTripleQuote 1, (49,21--52,9)), + (49,21--52,9)), None, (49,7--52,9)); LetOrUse (Named (SynSymbol template3, (53,11--53,20)), Const - (String - (" - [] - let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{path}} {path}" - ", - InterpolatedTripleQuote 2, (53,21--56,9)), (53,21--56,9)), None, (53,7--56,9)); + (String ("\n []\n let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{path}} {path}"\n ", InterpolatedTripleQuote 2, (53,21--56,9)), + (53,21--56,9)), None, (53,7--56,9)); LetOrUse (Named (SynSymbol template4, (57,11--57,20)), Const - (String - (" - [] - let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{(+ 1 2 3)}} {{(+ 1 2 3)}} {(+ 1 2 3)}" - ", - InterpolatedTripleQuote 2, (57,21--60,9)), (57,21--60,9)), None, (57,7--60,9)); + (String ("\n []\n let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{(+ 1 2 3)}} {{(+ 1 2 3)}} {(+ 1 2 3)}"\n ", InterpolatedTripleQuote 2, (57,21--60,9)), + (57,21--60,9)), None, (57,7--60,9)); Op (Infix (SynSymbol +, diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt index aa66f53..e2b3b5f 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-interpolation-0.structured output.verified.txt @@ -22,8 +22,7 @@ (Symbol (SynSymbol printfn), [Const (String ("string is '%s'", Regular, (12,9--12,25)), (12,9--12,25)); Const - (String - ("interpolated: {value} {{ value }} {{ value.Length }}", InterpolatedTripleQuote 2, (12,26--12,86)), + (String ("interpolated: {value} {{ value }} {{ value.Length }}", InterpolatedTripleQuote 2, (12,26--12,86)), (12,26--12,86))], (12,1--12,86)), (12,0--12,87)); Expr (LetOrUse @@ -32,9 +31,8 @@ (Symbol (SynSymbol printfn), [Const (String ("string is '%s'", Regular, (13,9--13,25)), (13,9--13,25)); Const - (String - ("interpolated: {value} {{ value }} {{{ value }}} {{{ value.Length }}}", InterpolatedTripleQuote 3, - (13,26--13,103)), (13,26--13,103))], (13,1--13,103)), None, (13,0--13,104)), (13,0--13,104)); + (String ("interpolated: {value} {{ value }} {{{ value }}} {{{ value.Length }}}", InterpolatedTripleQuote 3, (13,26--13,103)), + (13,26--13,103))], (13,1--13,103)), None, (13,0--13,104)), (13,0--13,104)); Expr (FunctionCall (Symbol (SynSymbol printfn), From a73d50e6b50b987f45dfc096472764fe308f983d Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Sat, 23 Dec 2023 12:20:04 +0100 Subject: [PATCH 6/6] Optionally normalize line endings when outputting strings in structured format --- src/Visp.Compiler/Syntax/Syntax.fs | 12 ++++-- tests/Visp.Compiler.UnitTests/TestUtils.fs | 2 + ...g_strings-0.structured output.verified.txt | 20 +++++++-- ...g_strings-1.structured output.verified.txt | 41 +++++++++++++++---- 4 files changed, 60 insertions(+), 15 deletions(-) diff --git a/src/Visp.Compiler/Syntax/Syntax.fs b/src/Visp.Compiler/Syntax/Syntax.fs index b4b3289..5d097d6 100644 --- a/src/Visp.Compiler/Syntax/Syntax.fs +++ b/src/Visp.Compiler/Syntax/Syntax.fs @@ -4,7 +4,6 @@ namespace rec Visp.Compiler.Syntax -open Visp.Compiler.Writer open Visp.Compiler.Text open System.Diagnostics open Visp.Common @@ -112,6 +111,14 @@ type SynStringKind = | Interpolated of plain: int | InterpolatedTripleQuote of triple: int +type SyntaxWriteUtilThreadStatics = + [] + static val mutable private normalizeLineEndings: bool + + static member NormalizeLineEndings + with get () = SyntaxWriteUtilThreadStatics.normalizeLineEndings + and set v = SyntaxWriteUtilThreadStatics.normalizeLineEndings <- v + [] type SynConst = | Unit @@ -158,8 +165,7 @@ type SynConst = for ch in text do match ch with - | '\r' -> ignore (sb.Append "\\r") - | '\n' -> ignore (sb.Append "\\n") + | '\r' when SyntaxWriteUtilThreadStatics.NormalizeLineEndings -> () | it -> ignore (sb.Append it) sb.Append "\", " |> ignore diff --git a/tests/Visp.Compiler.UnitTests/TestUtils.fs b/tests/Visp.Compiler.UnitTests/TestUtils.fs index 0bdf602..f701332 100644 --- a/tests/Visp.Compiler.UnitTests/TestUtils.fs +++ b/tests/Visp.Compiler.UnitTests/TestUtils.fs @@ -54,6 +54,8 @@ let runStructuredOutputTest (name: string) = let nameParam = name.Replace('/', '_').Replace('\\', '_') + Syntax.SyntaxWriteUtilThreadStatics.NormalizeLineEndings <- true + let output = (sprintf "%120A" parsed).Replace("\\r\\n", "\\n").Replace("\r\n", "\n") return! verify output "parsing-snapshots" nameParam diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt index 7292c37..b19ba9e 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-0.structured output.verified.txt @@ -4,13 +4,21 @@ (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("string is: '%s'", Regular, (9,9--9,26)), (9,9--9,26)); - Const (String ("\n this is\n a multiline\n string\n", Regular, (9,27--13,1)), (9,27--13,1))], - (9,1--13,1)), (9,0--13,2)); + Const (String (" + this is + a multiline + string +", Regular, (9,27--13,1)), (9,27--13,1))], (9,1--13,1)), + (9,0--13,2)); Expr (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("string is: '%s'", Regular, (15,9--15,26)), (15,9--15,26)); - Const (String ("\n this is\n a multiline\n string\n", TripleQuote, (15,27--19,3)), (15,27--19,3))], + Const (String (" + this is + a multiline + string +", TripleQuote, (15,27--19,3)), (15,27--19,3))], (15,1--19,3)), (15,0--19,4)); Expr (FunctionDef @@ -20,7 +28,11 @@ FunctionCall (Symbol (SynSymbol sprintf), [Const - (String ("\nlet ``can parse %s`` =\n TestUtils.runTest %s\n |> Async.AwaitTask\n ", TripleQuote, (22,25--26,5)), + (String (" +let ``can parse %s`` = + TestUtils.runTest %s + |> Async.AwaitTask + ", TripleQuote, (22,25--26,5)), (22,25--26,5)); Symbol (SynSymbol path); Symbol (SynSymbol path)], (22,17--26,15)), None, (22,3--26,16)); Symbol (SynSymbol template)], (21,1--28,10)), (21,0--28,11)); Expr diff --git a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt index 77320f2..e3f51a9 100644 --- a/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt +++ b/tests/Visp.Compiler.UnitTests/parsing-snapshots/tests_parsing_strings-1.structured output.verified.txt @@ -25,8 +25,10 @@ (FunctionCall (Symbol (SynSymbol printfn), [Const (String ("string is '%s'", Regular, (13,9--13,25)), (13,9--13,25)); - Const (String ("\n multiple lines are okay?\n", TripleQuote, (13,26--15,3)), (13,26--15,3))], - (13,1--15,3)), (13,0--15,4)); + Const (String (" + multiple lines are okay? +", TripleQuote, (13,26--15,3)), (13,26--15,3))], (13,1--15,3)), + (13,0--15,4)); Expr (Begin ([Begin @@ -35,7 +37,9 @@ (Symbol (SynSymbol printfn), [Const (String ("string is '%s'", Regular, (19,15--19,31)), (19,15--19,31)); Const - (String ("\n multiple lines are okay?\n ", TripleQuote, (19,32--21,9)), + (String (" + multiple lines are okay? + ", TripleQuote, (19,32--21,9)), (19,32--21,9))], (19,7--21,9))], Do, (18,5--21,10))], Do, (17,3--22,5))], Do, (16,1--22,6)), (16,0--22,7)); Expr @@ -46,7 +50,16 @@ (FunctionCall (Symbol (SynSymbol sprintf), [Const - (String ("\n // AUTO GENERATED\n // DO NOT MODIFY BY HAND\n\n namespace %s\n\n open Xunit\n\n module %s\n ", TripleQuote, (25,16--34,5)), + (String (" + // AUTO GENERATED + // DO NOT MODIFY BY HAND + + namespace %s + + open Xunit + + module %s + ", TripleQuote, (25,16--34,5)), (25,16--34,5)); Symbol (SynSymbol moduleName); Symbol (SynSymbol moduleName)], (25,8--34,27)), (25,7--34,28))], (25,3--34,28))], (24,1--35,5)), (24,0--35,6)); Expr @@ -85,23 +98,35 @@ FunctionCall (Symbol (SynSymbol sprintf), [Const - (String ("\n []\n let ``%s %s`` () = TestUtils.runTest "%s"\n ", TripleQuote, (45,29--48,9)), + (String (" + [] + let ``%s %s`` () = TestUtils.runTest "%s" + ", TripleQuote, (45,29--48,9)), (45,29--48,9)); Symbol (SynSymbol prefix); Symbol (SynSymbol testname); Symbol (SynSymbol path)], (45,21--48,30)), None, (45,7--48,31)); LetOrUse (Named (SynSymbol template2, (49,11--49,20)), Const - (String ("\n []\n let ``interpolated {prefix} {testname}`` () = TestUtils.runTest "{path}"\n ", InterpolatedTripleQuote 1, (49,21--52,9)), + (String (" + [] + let ``interpolated {prefix} {testname}`` () = TestUtils.runTest "{path}" + ", InterpolatedTripleQuote 1, (49,21--52,9)), (49,21--52,9)), None, (49,7--52,9)); LetOrUse (Named (SynSymbol template3, (53,11--53,20)), Const - (String ("\n []\n let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{path}} {path}"\n ", InterpolatedTripleQuote 2, (53,21--56,9)), + (String (" + [] + let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{path}} {path}" + ", InterpolatedTripleQuote 2, (53,21--56,9)), (53,21--56,9)), None, (53,7--56,9)); LetOrUse (Named (SynSymbol template4, (57,11--57,20)), Const - (String ("\n []\n let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{(+ 1 2 3)}} {{(+ 1 2 3)}} {(+ 1 2 3)}"\n ", InterpolatedTripleQuote 2, (57,21--60,9)), + (String (" + [] + let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{(+ 1 2 3)}} {{(+ 1 2 3)}} {(+ 1 2 3)}" + ", InterpolatedTripleQuote 2, (57,21--60,9)), (57,21--60,9)), None, (57,7--60,9)); Op (Infix