diff --git a/src/Visp.Compiler/CoreParser.fs b/src/Visp.Compiler/CoreParser.fs index bc35fe7..ed9e1f3 100644 --- a/src/Visp.Compiler/CoreParser.fs +++ b/src/Visp.Compiler/CoreParser.fs @@ -113,6 +113,13 @@ let state = { Todo = () } reraise () + let debugLexFile filePath = + let (stream, reader, lexbuf) = UnicodeFileAsLexbuf(filePath, None) + use _ = stream + use _ = reader + let args = mkDefaultLextArgs () + ParseUtils.debugTokenOutput args lexbuf |> List.ofSeq + let getTokens str fileName = let lexbuf = LexBuffer<_>.FromString str lexbuf.EndPos <- Position.FirstLine fileName diff --git a/src/Visp.Compiler/ParseUtils.fs b/src/Visp.Compiler/ParseUtils.fs index fa128f9..5e9ee23 100644 --- a/src/Visp.Compiler/ParseUtils.fs +++ b/src/Visp.Compiler/ParseUtils.fs @@ -124,6 +124,12 @@ let parseStringToExpr fileName str = reraise () let debugTokenOutput args (lexbuf: LexBuffer<_>) = + let debugToken = + function + | STRING(text, kind, cont) -> + Syntax.StringWriterUtils.writeDebugStringType "STRING" text kind cont + | it -> sprintf "%A" it + seq { let tokenizer = mkTokenizerWithArgs args @@ -132,8 +138,8 @@ let debugTokenOutput args (lexbuf: LexBuffer<_>) = yield sprintf - "%A %A %i %i %A" - next + "%s %A %i %i %A" + (debugToken next) args.mode args.depth args.ContextCount diff --git a/src/Visp.Compiler/Syntax/Syntax.fs b/src/Visp.Compiler/Syntax/Syntax.fs index c755dd8..9ce12db 100644 --- a/src/Visp.Compiler/Syntax/Syntax.fs +++ b/src/Visp.Compiler/Syntax/Syntax.fs @@ -119,6 +119,28 @@ type SyntaxWriteUtilThreadStatics = with get () = SyntaxWriteUtilThreadStatics.normalizeLineEndings and set v = SyntaxWriteUtilThreadStatics.normalizeLineEndings <- v +module StringWriterUtils = + let inline writeDebugStringType (name: string) (text: string) kind range = + let sb = PooledStringBuilder.Get() + // Reserve capacity for the text + all the extra data being written + sb.EnsureCapacity(text.Length + 60) |> ignore + sb.Append name |> ignore + sb.Append " (\"" |> ignore + + for ch in text do + match ch with + | '\r' when SyntaxWriteUtilThreadStatics.NormalizeLineEndings -> () + | it -> ignore (sb.Append it) + + sb.Append "\", " |> ignore + sb.Append(sprintf "%A" kind) |> ignore + sb.Append(", ") |> ignore + sb.Append(sprintf "%A" range) |> ignore + + sb.Append ")" |> ignore + + sb.ToStringAndReturn() + [] type SynConst = | Unit @@ -159,25 +181,7 @@ type SynConst = | 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() - // Reserve capacity for the text + all the extra data being written - sb.EnsureCapacity(text.Length + 60) |> ignore - sb.Append "String (\"" |> ignore - - for ch in text do - match ch with - | '\r' when SyntaxWriteUtilThreadStatics.NormalizeLineEndings -> () - | 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() + | String(text, k, r) -> StringWriterUtils.writeDebugStringType "String" text k r 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 f701332..a444067 100644 --- a/tests/Visp.Compiler.UnitTests/TestUtils.fs +++ b/tests/Visp.Compiler.UnitTests/TestUtils.fs @@ -44,6 +44,21 @@ let inline private verify (out: string) dir (param: string) = return! (task |> Async.AwaitTask) } +let runTokenTest (name: string) = + async { + parseCoreLibs () + let path = getVispFilePath name + + try + let parsed = CoreParser.debugLexFile path + let nameParam = name.Replace('/', '_').Replace('\\', '_') + Syntax.SyntaxWriteUtilThreadStatics.NormalizeLineEndings <- true + let output = parsed |> String.concat "\n" + return! verify output "token-snapshots" nameParam + with :? ParseHelpers.SyntaxError as syn -> + return raise <| (LexHelpers.syntaxErrorToParseError syn) + } + let runStructuredOutputTest (name: string) = async { parseCoreLibs () diff --git a/tests/Visp.Compiler.UnitTests/TokenOutputTests.generated.fs b/tests/Visp.Compiler.UnitTests/TokenOutputTests.generated.fs new file mode 100644 index 0000000..58a8988 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/TokenOutputTests.generated.fs @@ -0,0 +1,512 @@ +// 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 TokenOutputTests + +open Xunit + +[] +module ``tests_while_while-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/while/while-1.visp" + +[] +module ``tests_while_while-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/while/while-0.visp" + +[] +module ``tests_for-to_for-to-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/for-to/for-to-0.visp" + +[] +module ``tests_dot_dot-shorthands`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/dot/dot-shorthands.visp" + +[] +module ``tests_pats_fn-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/pats/fn-1.visp" + +[] +module ``tests_pats_fn-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/pats/fn-0.visp" + +[] +module ``tests_pats_let-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/pats/let-0.visp" + +[] +module ``tests_type_member-get-set-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/type/member-get-set-0.visp" + +[] +module ``tests_type_type-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/type/type-0.visp" + +[] +module ``tests_type_custom-comparison-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/type/custom-comparison-0.visp" + +[] +module ``tests_type_record-2`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/type/record-2.visp" + +[] +module ``tests_type_member-fn-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/type/member-fn-0.visp" + +[] +module ``tests_type_union-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/type/union-0.visp" + +[] +module ``tests_type_record-3`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/type/record-3.visp" + +[] +module ``tests_type_type-alias-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/type/type-alias-0.visp" + +[] +module ``tests_type_record-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/type/record-1.visp" + +[] +module ``tests_type_record-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/type/record-0.visp" + +[] +module ``tests_type_record-4`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/type/record-4.visp" + +[] +module ``tests_functions_apply-method-args-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/functions/apply-method-args-0.visp" + +[] +module ``tests_hashset_hashset-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/hashset/hashset-0.visp" + +[] +module ``tests_parsing_strings-interpolation-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/strings-interpolation-0.visp" + +[] +module ``tests_parsing_strings-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/strings-1.visp" + +[] +module ``tests_parsing_match-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/match-0.visp" + +[] +module ``tests_parsing_sym-with-arrow-in-macro-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/sym-with-arrow-in-macro-0.visp" + +[] +module ``tests_parsing_tuple-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/tuple-0.visp" + +[] +module ``tests_parsing_strings-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/strings-0.visp" + +[] +module ``tests_parsing_lambda-shorthand-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/lambda-shorthand-0.visp" + +[] +module ``tests_parsing_strings-interpolation-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/strings-interpolation-1.visp" + +[] +module ``tests_parsing_ambiguous-tokens-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/ambiguous-tokens-0.visp" + +[] +module ``tests_parsing_props`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/props.visp" + +[] +module ``tests_parsing_operators-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/operators-0.visp" + +[] +module ``tests_parsing_call-tuple-args-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/call-tuple-args-0.visp" + +[] +module ``tests_parsing_span-to-int32-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/span-to-int32-0.visp" + +[] +module ``tests_parsing_let-values`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/let-values.visp" + +[] +module ``tests_parsing_match-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/match-1.visp" + +[] +module ``tests_parsing_seq-as-generic-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/parsing/seq-as-generic-0.visp" + +[] +module ``tests_arrays_array2d-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/arrays/array2d-0.visp" + +[] +module ``tests_arrays_array2d-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/arrays/array2d-1.visp" + +[] +module ``tests_arrays_array-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/arrays/array-0.visp" + +[] +module ``tests_atom_atom-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/atom/atom-0.visp" + +[] +module ``tests_vector_vector-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/vector/vector-0.visp" + +[] +module ``tests_numbers_int-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/numbers/int-0.visp" + +[] +module ``tests_collections_list-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/collections/list-0.visp" + +[] +module ``tests_chars_char-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/chars/char-1.visp" + +[] +module ``tests_chars_char-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/chars/char-0.visp" + +[] +module ``tests_chars_char-2`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/chars/char-2.visp" + +[] +module ``tests_hashmap_hashmap-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/hashmap/hashmap-0.visp" + +[] +module ``tests_cexpr_cexpr-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/cexpr/cexpr-0.visp" + +[] +module ``tests_cexpr_cexpr-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/cexpr/cexpr-1.visp" + +[] +module ``tests_for-in_for-in-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/for-in/for-in-0.visp" + +[] +module ``tests_for-in_for-in-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/for-in/for-in-1.visp" + +[] +module ``tests_for-in_for-in-2`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/for-in/for-in-2.visp" + +[] +module ``tests_for-in_for-in-4`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/for-in/for-in-4.visp" + +[] +module ``tests_for-in_for-in-3`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/for-in/for-in-3.visp" + +[] +module ``tests_attributes_attributes-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/attributes/attributes-0.visp" + +[] +module ``tests_if_if-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/if/if-0.visp" + +[] +module ``tests_quotation_quote-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/quotation/quote-0.visp" + +[] +module ``tests_builtin-macros_thread-first-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/builtin-macros/thread-first-1.visp" + +[] +module ``tests_builtin-macros_thread-first-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/builtin-macros/thread-first-0.visp" + +[] +module ``tests_builtin-macros_thread-last-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/builtin-macros/thread-last-0.visp" + +[] +module ``tests_builtin-macros_cond-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/builtin-macros/cond-0.visp" + +[] +module ``tests_macros_up-macro-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/up-macro-0.visp" + +[] +module ``tests_macros_nested-macro-expansion-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/nested-macro-expansion-0.visp" + +[] +module ``tests_macros_struct-example-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/struct-example-1.visp" + +[] +module ``tests_macros_bar-parens-in-macro-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/bar-parens-in-macro-0.visp" + +[] +module ``tests_macros_count-exprs-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/count-exprs-0.visp" + +[] +module ``tests_macros_syntax-macro-2`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/syntax-macro-2.visp" + +[] +module ``tests_macros_syntax-macro-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/syntax-macro-0.visp" + +[] +module ``tests_macros_nested-macro-expansion-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/nested-macro-expansion-1.visp" + +[] +module ``tests_macros_cond-macro-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/cond-macro-1.visp" + +[] +module ``tests_macros_struct-macro-2`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/struct-macro-2.visp" + +[] +module ``tests_macros_chars-in-macros-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/chars-in-macros-0.visp" + +[] +module ``tests_macros_when-unless-example-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/when-unless-example-0.visp" + +[] +module ``tests_macros_cond-macro-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/cond-macro-0.visp" + +[] +module ``tests_macros_struct-macro-3`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/struct-macro-3.visp" + +[] +module ``tests_macros_my-rinit-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/my-rinit-0.visp" + +[] +module ``tests_macros_macro-lambda-shorthand-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/macro-lambda-shorthand-0.visp" + +[] +module ``tests_macros_struct-macro-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/struct-macro-0.visp" + +[] +module ``tests_macros_and-example-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/and-example-0.visp" + +[] +module ``tests_macros_while-match-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/while-match-0.visp" + +[] +module ``tests_macros_or-example-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/macros/or-example-0.visp" + +[] +module ``tests_examples_example-4`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-4.visp" + +[] +module ``tests_examples_example-11`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-11.visp" + +[] +module ``tests_examples_example-3`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-3.visp" + +[] +module ``tests_examples_example-9`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-9.visp" + +[] +module ``tests_examples_example-10`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-10.visp" + +[] +module ``tests_examples_example-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-0.visp" + +[] +module ``tests_examples_example-15`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-15.visp" + +[] +module ``tests_examples_example-16`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-16.visp" + +[] +module ``tests_examples_example-1`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-1.visp" + +[] +module ``tests_examples_variables-0`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/variables-0.visp" + +[] +module ``tests_examples_example-7`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-7.visp" + +[] +module ``tests_examples_example-2`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-2.visp" + +[] +module ``tests_examples_example-13`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-13.visp" + +[] +module ``tests_examples_example-14`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-14.visp" + +[] +module ``tests_examples_example-6`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-6.visp" + +[] +module ``tests_examples_example-8`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-8.visp" + +[] +module ``tests_examples_example-12`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-12.visp" + +[] +module ``tests_examples_example-17`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-17.visp" + +[] +module ``tests_examples_example-5`` = + [] + let ``returns tokens`` () = TestUtils.runTokenTest "tests/examples/example-5.visp" + diff --git a/tests/Visp.Compiler.UnitTests/Visp.Compiler.UnitTests.fsproj b/tests/Visp.Compiler.UnitTests/Visp.Compiler.UnitTests.fsproj index ea43e2c..b5d1de0 100644 --- a/tests/Visp.Compiler.UnitTests/Visp.Compiler.UnitTests.fsproj +++ b/tests/Visp.Compiler.UnitTests/Visp.Compiler.UnitTests.fsproj @@ -9,6 +9,7 @@ + diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_arrays_array-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_arrays_array-0.returns tokens.verified.txt new file mode 100644 index 0000000..03e7b90 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_arrays_array-0.returns tokens.verified.txt @@ -0,0 +1,33 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "arr" Default 0 1 LParen +BRACKET_BAR Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +INT32 (2, false) Default 0 1 LParen +INT32 (3, false) Default 0 1 LParen +INT32 (4, false) Default 0 1 LParen +INT32 (5, false) Default 0 1 LParen +BAR_BRACKET Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("arr[0] %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("arr[1] %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +SYMBOL "arr" Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_arrays_array2d-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_arrays_array2d-0.returns tokens.verified.txt new file mode 100644 index 0000000..fdd8c0f --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_arrays_array2d-0.returns tokens.verified.txt @@ -0,0 +1,137 @@ +LPAREN Default 0 1 LParen +TYPEALIAS Default 0 1 LParen +SYMBOL "Grid" Default 0 1 LParen +SYMBOL "char" Default 0 1 LParen +LBRACKET Default 0 1 LParen +COMMA Default 0 1 LParen +RBRACKET Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "arr" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Array2D.create" Default 0 2 LParen +INT32 (5, false) Default 0 2 LParen +INT32 (5, false) Default 0 2 LParen +CHAR "#\." Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "y" Default 0 1 LParen +INT32 (4, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("arr[0,0]=%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +COMMA Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("arr[1,2]=%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +COMMA Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("arr[3,3]=%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Array2D.get" Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SET Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +COMMA Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +RPAREN Default 0 1 LParen +CHAR "#\#" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SET Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +COMMA Default 0 2 LParen +INT32 (4, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +RPAREN Default 0 1 LParen +CHAR "#\#" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SET Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (4, false) Default 0 2 LParen +COMMA Default 0 2 LParen +INT32 (4, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +RPAREN Default 0 1 LParen +CHAR "#\#" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("arr[3,4]=%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +THREAD_LAST Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +OP_MINUS Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +COMMA Default 0 2 LParen +LPAREN Default 0 3 LParen +OP_PLUS Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("arr[4,4]=%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +THREAD_LAST Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +SYMBOL "y" Default 0 2 LParen +COMMA Default 0 2 LParen +LPAREN Default 0 3 LParen +OP_PLUS Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +SYMBOL "arr" Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_arrays_array2d-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_arrays_array2d-1.returns tokens.verified.txt new file mode 100644 index 0000000..89472d5 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_arrays_array2d-1.returns tokens.verified.txt @@ -0,0 +1,44 @@ +LPAREN Default 0 1 LParen +TYPEALIAS Default 0 1 LParen +SYMBOL "Grid" Default 0 1 LParen +SYMBOL "char" Default 0 1 LParen +LBRACKET Default 0 1 LParen +COMMA Default 0 1 LParen +RBRACKET Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "arr" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Array2D.create" Default 0 2 LParen +INT32 (5, false) Default 0 2 LParen +INT32 (5, false) Default 0 2 LParen +CHAR "#\." Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("arr[*,0]=%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +OP_MULT Default 0 2 LParen +COMMA Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("arr[0,*]=%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +COMMA Default 0 2 LParen +OP_MULT Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "arr" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +SYMBOL "arr" Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_atom_atom-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_atom_atom-0.returns tokens.verified.txt new file mode 100644 index 0000000..4e1c452 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_atom_atom-0.returns tokens.verified.txt @@ -0,0 +1,50 @@ +HASH_IDENT "nowarn" Default 0 0 Default +STRING ("20", Regular, Token []) Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "inc" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "v" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "Value" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Value.from" Default 0 2 LParen +LPAREN Default 0 3 LParen +OP_PLUS Default 0 3 LParen +INT64 (1L, false) Default 0 3 LParen +LPAREN Default 0 4 LParen +SYMBOL "unwrapInt" Default 0 4 LParen +SYMBOL "v" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "count" Default 0 1 LParen +LPAREN Default 0 2 LParen +ATOM_KW Default 0 2 LParen +INT64 (0L, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("count is %O", Regular, Token []) Default 0 1 LParen +AT Default 0 1 LParen +SYMBOL "count" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "swap!" Default 0 1 LParen +SYMBOL "count" Default 0 1 LParen +SYMBOL "inc" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("count is %O", Regular, Token []) Default 0 1 LParen +AT Default 0 1 LParen +SYMBOL "count" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_attributes_attributes-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_attributes_attributes-0.returns tokens.verified.txt new file mode 100644 index 0000000..9a7150e --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_attributes_attributes-0.returns tokens.verified.txt @@ -0,0 +1,43 @@ +LPAREN Default 0 1 LParen +HASH_BRACKET Default 0 1 LParen +SYMBOL "Struct" Default 0 1 LParen +BAR Default 0 1 LParen +SYMBOL "NoEquality" Default 0 1 LParen +BAR Default 0 1 LParen +SYMBOL "NoComparison" Default 0 1 LParen +RBRACKET Default 0 1 LParen +TYPE Default 0 1 Type +SYMBOL "TestStruct" Default 0 1 Type +LPAREN Default 0 2 Type +LBRACKET Default 0 2 Type +SYMBOL "value" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "int" Default 0 2 Type +RBRACKET Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +SYMBOL "_.Value" Default 0 2 Member +SYMBOL "value" Default 0 2 Member +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "xx" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "TestStruct" Default 0 2 LParen +INT32 (99, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Value is %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +PROP_PLUS "+Value" Default 0 2 LParen +SYMBOL "xx" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_cond-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_cond-0.returns tokens.verified.txt new file mode 100644 index 0000000..3df7b03 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_cond-0.returns tokens.verified.txt @@ -0,0 +1,18 @@ +LPAREN Default 0 1 LParen +MACRO_NAME "cond" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL ">" TokenStream Macro 2 2 LParen +INT32 (0, false) TokenStream Macro 2 2 LParen +INT32 (0, false) TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +INT32 (1, false) TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "<" TokenStream Macro 2 2 LParen +INT32 (0, false) TokenStream Macro 2 2 LParen +INT32 (0, false) TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +INT32 (2, false) TokenStream Macro 1 1 LParen +KEYWORD ":else" TokenStream Macro 1 1 LParen +INT32 (3, false) TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_thread-first-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_thread-first-0.returns tokens.verified.txt new file mode 100644 index 0000000..1adf5ee --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_thread-first-0.returns tokens.verified.txt @@ -0,0 +1,12 @@ +LPAREN Default 0 1 LParen +THREAD_FIRST Default 0 1 LParen +STRING ("return me", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +FN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "arg" Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "arg" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_thread-first-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_thread-first-1.returns tokens.verified.txt new file mode 100644 index 0000000..e4f67b0 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_thread-first-1.returns tokens.verified.txt @@ -0,0 +1,35 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "identity" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "arg" Default 0 2 LParen +RPAREN Default 0 1 LParen +SYMBOL "arg" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +THREAD_FIRST Default 0 1 LParen +STRING ("return me", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "identity" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "arg" Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "arg" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "arg" Default 0 2 LParen +RBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "printfn" Default 0 3 LParen +STRING ("arg is %O", Regular, Token []) Default 0 3 LParen +SYMBOL "arg" Default 0 3 LParen +RPAREN Default 0 2 LParen +SYMBOL "arg" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_thread-last-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_thread-last-0.returns tokens.verified.txt new file mode 100644 index 0000000..f14bf85 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_builtin-macros_thread-last-0.returns tokens.verified.txt @@ -0,0 +1,67 @@ +LPAREN Default 0 1 LParen +OPEN Default 0 1 LParen +SYMBOL "System.Text.RegularExpressions" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "rx" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "Regex" Default 0 2 LParen +STRING ("Game (\d+):", Regular, Token []) Default 0 2 LParen +LPAREN Default 0 3 LParen +DOT_PLUS Default 0 3 LParen +SYMBOL "Compiled" Default 0 3 LParen +SYMBOL "RegexOptions" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "ms" Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_METHOD ".Match" Default 0 2 LParen +SYMBOL "rx" Default 0 2 LParen +STRING ("Game 1:", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Groups %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +PROP_PLUS "+Groups" Default 0 2 LParen +SYMBOL "ms" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "gamePrefix" Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +DOT_PLUS Default 0 3 LParen +SYMBOL "Groups" Default 0 3 LParen +SYMBOL "ms" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Game Prefix %A", Regular, Token []) Default 0 1 LParen +SYMBOL "gamePrefix" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Game Prefix %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +THREAD_LAST Default 0 2 LParen +SYMBOL "ms" Default 0 2 LParen +PROP_PLUS "+Groups" Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_cexpr_cexpr-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_cexpr_cexpr-0.returns tokens.verified.txt new file mode 100644 index 0000000..f8f0624 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_cexpr_cexpr-0.returns tokens.verified.txt @@ -0,0 +1,27 @@ +LPAREN Default 0 1 LParen +FOR_IN Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "x" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "seq->" Default 0 2 LParen +LPAREN Default 0 3 LParen +YIELD false Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +YIELD false Default 0 3 LParen +INT32 (2, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +YIELD false Default 0 3 LParen +INT32 (3, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("x is %i", Regular, Token []) Default 0 2 LParen +SYMBOL "x" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_cexpr_cexpr-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_cexpr_cexpr-1.returns tokens.verified.txt new file mode 100644 index 0000000..fe7995d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_cexpr_cexpr-1.returns tokens.verified.txt @@ -0,0 +1,47 @@ +LPAREN Default 0 1 LParen +OPEN Default 0 1 LParen +SYMBOL "System.Threading" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "SomeTaskCode" Default 0 1 LParen +LPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "cancellationToken" Default 0 3 LParen +COLON Default 0 3 LParen +SYMBOL "CancellationToken" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "task->" Default 0 2 LParen +LPAREN Default 0 3 LParen +DOT_METHOD ".ThrowIfCancellationRequested" Default 0 3 LParen +SYMBOL "cancellationToken" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "printfn" Default 0 3 LParen +STRING ("continuing...", Regular, Token []) Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +RETURN false Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +THREAD_LAST Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "SomeTaskCode" Default 0 2 LParen +LPAREN Default 0 3 LParen +PROP_PLUS "+None" Default 0 3 LParen +SYMBOL "CancellationToken" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Async.AwaitTask" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Async.RunSynchronously" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_chars_char-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_chars_char-0.returns tokens.verified.txt new file mode 100644 index 0000000..031c541 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_chars_char-0.returns tokens.verified.txt @@ -0,0 +1,31 @@ +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Char is %O", Regular, Token []) Default 0 1 LParen +CHAR "#\h" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Char is %O", Regular, Token []) Default 0 1 LParen +CHAR "#\u0061" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Char is %O", Regular, Token []) Default 0 1 LParen +CHAR "#\U0061" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Char is %O", Regular, Token []) Default 0 1 LParen +CHAR "#\:" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Char is %O", Regular, Token []) Default 0 1 LParen +CHAR "#\(" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Char is %O", Regular, Token []) Default 0 1 LParen +CHAR "#\)" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_chars_char-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_chars_char-1.returns tokens.verified.txt new file mode 100644 index 0000000..5e94244 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_chars_char-1.returns tokens.verified.txt @@ -0,0 +1,25 @@ +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Char is '%03o'", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "int" Default 0 2 LParen +CHAR "#\lf" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Char is '%03o'", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "int" Default 0 2 LParen +CHAR "#\cr" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Char is '%03o'", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "int" Default 0 2 LParen +CHAR "#\tab" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_chars_char-2.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_chars_char-2.returns tokens.verified.txt new file mode 100644 index 0000000..3703d61 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_chars_char-2.returns tokens.verified.txt @@ -0,0 +1,14 @@ +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Chars are %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +CHAR "#\=" Default 0 2 LParen +COMMA Default 0 2 LParen +CHAR "#\|" Default 0 2 LParen +COMMA Default 0 2 LParen +CHAR "#\<" Default 0 2 LParen +COMMA Default 0 2 LParen +CHAR "#\>" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_collections_list-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_collections_list-0.returns tokens.verified.txt new file mode 100644 index 0000000..e2ff54c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_collections_list-0.returns tokens.verified.txt @@ -0,0 +1,27 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "lst" Default 0 1 LParen +PAREN_BAR Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +INT32 (2, false) Default 0 1 LParen +INT32 (3, false) Default 0 1 LParen +BAR_PAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("List.head: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "List.head" Default 0 2 LParen +SYMBOL "lst" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("List.tail: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "List.tail" Default 0 2 LParen +SYMBOL "lst" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +SYMBOL "lst" Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_dot_dot-shorthands.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_dot_dot-shorthands.returns tokens.verified.txt new file mode 100644 index 0000000..26d3031 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_dot_dot-shorthands.returns tokens.verified.txt @@ -0,0 +1,71 @@ +LPAREN Default 0 1 LParen +MUT Default 0 1 LParen +SYMBOL "vec" Default 0 1 LParen +LBRACKET Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +INT32 (2, false) Default 0 1 LParen +INT32 (3, false) Default 0 1 LParen +INT32 (4, false) Default 0 1 LParen +INT32 (5, false) Default 0 1 LParen +INT32 (6, false) Default 0 1 LParen +RBRACKET Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SET Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "vec" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Value.int" Default 0 2 LParen +INT32 (-1, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%O", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "vec" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%O", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_PLUS Default 0 2 LParen +SYMBOL "MaxValue" Default 0 2 LParen +SYMBOL "System.Int64" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DOT_METHOD ".Add" Default 0 1 LParen +SYMBOL "vec" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Value.int" Default 0 2 LParen +INT32 (64, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%O", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +OP_MINUS Default 0 3 LParen +LPAREN Default 0 4 LParen +DOT_PLUS Default 0 4 LParen +SYMBOL "Count" Default 0 4 LParen +SYMBOL "vec" Default 0 4 LParen +RPAREN Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "vec" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-0.returns tokens.verified.txt new file mode 100644 index 0000000..1c74f92 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-0.returns tokens.verified.txt @@ -0,0 +1,21 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "hello" Default 0 1 LParen +LPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "name" Default 0 3 LParen +COLON Default 0 3 LParen +SYMBOL "string" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("hello %s", Regular, Token []) Default 0 2 LParen +SYMBOL "name" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "hello" Default 0 1 LParen +STRING ("world", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-1.returns tokens.verified.txt new file mode 100644 index 0000000..1d1e513 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-1.returns tokens.verified.txt @@ -0,0 +1,90 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "hello" Default 0 1 LParen +LPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "name" Default 0 3 LParen +COLON Default 0 3 LParen +SYMBOL "string" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("hello %s", Regular, Token []) Default 0 2 LParen +SYMBOL "name" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "hello-no-types" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "name" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("hello %s", Regular, Token []) Default 0 2 LParen +SYMBOL "name" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "hello-with-vector" Default 0 1 LParen +LBRACKET Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "name" Default 0 1 LParen +COLON Default 0 1 LParen +SYMBOL "string" Default 0 1 LParen +RBRACKET Default 0 1 LParen +RBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("hello %s", Regular, Token []) Default 0 2 LParen +SYMBOL "name" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "anon" Default 0 1 LParen +LPAREN Default 0 2 LParen +FN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "name" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "printfn" Default 0 3 LParen +STRING ("hello %s", Regular, Token []) Default 0 3 LParen +SYMBOL "name" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "hello" Default 0 1 LParen +STRING ("test", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "hello-no-types" Default 0 1 LParen +STRING ("no types", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "hello-with-vector" Default 0 1 LParen +STRING ("vector", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "anon" Default 0 1 LParen +STRING ("anon", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "name" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "printfn" Default 0 3 LParen +STRING ("hello %s", Regular, Token []) Default 0 3 LParen +SYMBOL "name" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +STRING ("lambda", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-10.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-10.returns tokens.verified.txt new file mode 100644 index 0000000..d0f6861 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-10.returns tokens.verified.txt @@ -0,0 +1,36 @@ +HASH_IDENT "nowarn" Default 0 0 Default +STRING ("20", Regular, Token []) Default 0 0 Default +LPAREN Default 0 1 LParen +OPEN Default 0 1 LParen +SYMBOL "System.Text" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "sb" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "StringBuilder" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DOT Default 0 1 LParen +SYMBOL "sb" Default 0 1 LParen +SYMBOL "Append" Default 0 1 LParen +STRING ("hello", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DOT Default 0 1 LParen +SYMBOL "sb" Default 0 1 LParen +SYMBOL "Append" Default 0 1 LParen +STRING ("world", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("sb contains: %s", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT Default 0 2 LParen +SYMBOL "sb" Default 0 2 LParen +SYMBOL "ToString" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-11.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-11.returns tokens.verified.txt new file mode 100644 index 0000000..571c917 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-11.returns tokens.verified.txt @@ -0,0 +1,30 @@ +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("this is in the default top-level module", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MODULE Default 0 1 LParen +SYMBOL "MyCustomModule" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("this is inside MyCustomModule", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FN Default 0 2 LParen +SYMBOL "hello" Default 0 2 LParen +LPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "printfn" Default 0 3 LParen +STRING ("hello world", Regular, Token []) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "hello" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("this is back in the top-level-module", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-12.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-12.returns tokens.verified.txt new file mode 100644 index 0000000..de716ce --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-12.returns tokens.verified.txt @@ -0,0 +1,42 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "quoted" Default 0 1 LParen +LPAREN Default 0 2 LParen +QUOTE_KW TokenStream Quote 1 2 LParen +LPAREN TokenStream Quote 2 3 LParen +SYMBOL "hello" TokenStream Quote 2 3 LParen +SYMBOL "world" TokenStream Quote 2 3 LParen +SYMBOL "in" TokenStream Quote 2 3 LParen +SYMBOL "quotes" TokenStream Quote 2 3 LParen +RPAREN TokenStream Quote 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("quoted is: %O", Regular, Token []) Default 0 1 LParen +SYMBOL "quoted" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "next_quoted" Default 0 1 LParen +LPAREN Default 0 2 LParen +QUOTE_KW TokenStream Quote 1 2 LParen +LPAREN TokenStream Quote 2 3 LParen +STRING ("constants", Regular, Token []) TokenStream Quote 2 3 LParen +KEYWORD ":keywords-work" TokenStream Quote 2 3 LParen +TRUE TokenStream Quote 2 3 LParen +INT32 (1, false) TokenStream Quote 2 3 LParen +IEEE64 1.5 TokenStream Quote 2 3 LParen +FALSE TokenStream Quote 2 3 LParen +SYMBOL "also" TokenStream Quote 2 3 LParen +STRING ("work", Regular, Token []) TokenStream Quote 2 3 LParen +NIL TokenStream Quote 2 3 LParen +RPAREN TokenStream Quote 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("next_quoted is: %O", Regular, Token []) Default 0 1 LParen +SYMBOL "next_quoted" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-13.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-13.returns tokens.verified.txt new file mode 100644 index 0000000..3f47070 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-13.returns tokens.verified.txt @@ -0,0 +1,42 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "quasiquoted" Default 0 1 LParen +LPAREN Default 0 2 LParen +QUASIQUOTE_KW TokenStream Quasiquote 1 2 LParen +LPAREN TokenStream Quasiquote 2 3 LParen +SYMBOL "hello" TokenStream Quasiquote 2 3 LParen +SYMBOL "world" TokenStream Quasiquote 2 3 LParen +SYMBOL "in" TokenStream Quasiquote 2 3 LParen +SYMBOL "quotes" TokenStream Quasiquote 2 3 LParen +RPAREN TokenStream Quasiquote 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("quasiquoted is: %O", Regular, Token []) Default 0 1 LParen +SYMBOL "quasiquoted" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "next_quasiquoted" Default 0 1 LParen +LPAREN Default 0 2 LParen +QUASIQUOTE_KW TokenStream Quasiquote 1 2 LParen +LPAREN TokenStream Quasiquote 2 3 LParen +STRING ("constants", Regular, Token []) TokenStream Quasiquote 2 3 LParen +KEYWORD ":keywords-work" TokenStream Quasiquote 2 3 LParen +TRUE TokenStream Quasiquote 2 3 LParen +INT32 (1, false) TokenStream Quasiquote 2 3 LParen +IEEE64 1.5 TokenStream Quasiquote 2 3 LParen +FALSE TokenStream Quasiquote 2 3 LParen +SYMBOL "also" TokenStream Quasiquote 2 3 LParen +STRING ("work", Regular, Token []) TokenStream Quasiquote 2 3 LParen +NIL TokenStream Quasiquote 2 3 LParen +RPAREN TokenStream Quasiquote 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("next_quasiquoted is: %O", Regular, Token []) Default 0 1 LParen +SYMBOL "next_quasiquoted" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-14.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-14.returns tokens.verified.txt new file mode 100644 index 0000000..5a8cc59 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-14.returns tokens.verified.txt @@ -0,0 +1,80 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +STRING ("hello", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "result" Default 0 1 LParen +LPAREN Default 0 2 LParen +QUASIQUOTE_KW TokenStream Quasiquote 1 2 LParen +LPAREN TokenStream Quasiquote 2 3 LParen +UNQUOTE_KW TokenStream Quasiquote 2 3 LParen +SYMBOL "value" TokenStream Quasiquote 2 3 LParen +RPAREN TokenStream Quasiquote 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("value is %O", Regular, Token []) Default 0 1 LParen +SYMBOL "result" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "items" Default 0 1 LParen +LPAREN Default 0 2 LParen +QUOTE_KW TokenStream Quote 1 2 LParen +LPAREN TokenStream Quote 2 3 LParen +INT32 (1, false) TokenStream Quote 2 3 LParen +INT32 (2, false) TokenStream Quote 2 3 LParen +INT32 (3, false) TokenStream Quote 2 3 LParen +INT32 (4, false) TokenStream Quote 2 3 LParen +INT32 (5, false) TokenStream Quote 2 3 LParen +RPAREN TokenStream Quote 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "result2" Default 0 1 LParen +LPAREN Default 0 2 LParen +QUASIQUOTE_KW TokenStream Quasiquote 1 2 LParen +LPAREN TokenStream Quasiquote 2 3 LParen +INT32 (1, false) TokenStream Quasiquote 2 3 LParen +INT32 (2, false) TokenStream Quasiquote 2 3 LParen +LPAREN TokenStream Quasiquote 3 4 LParen +UNQUOTE_KW TokenStream Quasiquote 3 4 LParen +LPAREN TokenStream Quasiquote 4 5 LParen +SYMBOL "+" TokenStream Quasiquote 4 5 LParen +INT32 (3, false) TokenStream Quasiquote 4 5 LParen +INT32 (4, false) TokenStream Quasiquote 4 5 LParen +RPAREN TokenStream Quasiquote 3 4 LParen +RPAREN TokenStream Quasiquote 2 3 LParen +RPAREN TokenStream Quasiquote 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("result2 is %O", Regular, Token []) Default 0 1 LParen +SYMBOL "result2" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "result3" Default 0 1 LParen +LPAREN Default 0 2 LParen +QUASIQUOTE_KW TokenStream Quasiquote 1 2 LParen +LPAREN TokenStream Quasiquote 2 3 LParen +INT32 (0, false) TokenStream Quasiquote 2 3 LParen +LPAREN TokenStream Quasiquote 3 4 LParen +SPLICE_UNQUOTE_KW TokenStream Quasiquote 3 4 LParen +SYMBOL "items" TokenStream Quasiquote 3 4 LParen +RPAREN TokenStream Quasiquote 2 3 LParen +INT32 (6, false) TokenStream Quasiquote 2 3 LParen +RPAREN TokenStream Quasiquote 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("result3 is %O", Regular, Token []) Default 0 1 LParen +SYMBOL "result3" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-15.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-15.returns tokens.verified.txt new file mode 100644 index 0000000..1a4220f --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-15.returns tokens.verified.txt @@ -0,0 +1,33 @@ +LPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FNSTAR Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "captured_arg" Default 0 2 LParen +RBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +LETSTAR Default 0 3 LParen +LBRACKET Default 0 3 LParen +SYMBOL "second_capture" Default 0 3 LParen +LPAREN Default 0 4 LParen +OP_PLUS Default 0 4 LParen +SYMBOL "captured_arg" Default 0 4 LParen +INT32 (1, false) Default 0 4 LParen +RPAREN Default 0 3 LParen +RBRACKET Default 0 3 LParen +LPAREN Default 0 4 LParen +LPAREN Default 0 5 LParen +FNSTAR Default 0 5 LParen +LBRACKET Default 0 5 LParen +RBRACKET Default 0 5 LParen +LPAREN Default 0 6 LParen +OP_PLUS Default 0 6 LParen +SYMBOL "captured_arg" Default 0 6 LParen +SYMBOL "second_capture" Default 0 6 LParen +RPAREN Default 0 5 LParen +RPAREN Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +INT32 (99, false) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-16.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-16.returns tokens.verified.txt new file mode 100644 index 0000000..f3ffd63 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-16.returns tokens.verified.txt @@ -0,0 +1,53 @@ +LPAREN Default 0 1 LParen +LETSTAR Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "captured_variable" Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +SYMBOL "first_fun" Default 0 1 LParen +LPAREN Default 0 2 LParen +FNSTAR Default 0 2 LParen +LBRACKET Default 0 2 LParen +RBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +LETSTAR Default 0 3 LParen +LBRACKET Default 0 3 LParen +SYMBOL "second_fun" Default 0 3 LParen +LPAREN Default 0 4 LParen +FNSTAR Default 0 4 LParen +LBRACKET Default 0 4 LParen +RBRACKET Default 0 4 LParen +LPAREN Default 0 5 LParen +LETSTAR Default 0 5 LParen +LBRACKET Default 0 5 LParen +SYMBOL "third_fun" Default 0 5 LParen +LPAREN Default 0 6 LParen +FNSTAR Default 0 6 LParen +LBRACKET Default 0 6 LParen +RBRACKET Default 0 6 LParen +LPAREN Default 0 7 LParen +OP_PLUS Default 0 7 LParen +SYMBOL "captured_variable" Default 0 7 LParen +INT32 (1, false) Default 0 7 LParen +RPAREN Default 0 6 LParen +RPAREN Default 0 5 LParen +RBRACKET Default 0 5 LParen +LPAREN Default 0 6 LParen +SYMBOL "third_fun" Default 0 6 LParen +RPAREN Default 0 5 LParen +RPAREN Default 0 4 LParen +RPAREN Default 0 3 LParen +RBRACKET Default 0 3 LParen +LPAREN Default 0 4 LParen +SYMBOL "second_fun" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "str" Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "first_fun" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-17.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-17.returns tokens.verified.txt new file mode 100644 index 0000000..db20bf7 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-17.returns tokens.verified.txt @@ -0,0 +1,19 @@ +LPAREN Default 0 1 LParen +LETSTAR Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "hello" Default 0 1 LParen +STRING ("hello", Regular, Token []) Default 0 1 LParen +SYMBOL "world" Default 0 1 LParen +STRING ("world", Regular, Token []) Default 0 1 LParen +SYMBOL "banaani" Default 0 1 LParen +STRING ("banaani", Regular, Token []) Default 0 1 LParen +RBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "sprintf" Default 0 2 LParen +STRING ("%s %s %s", Regular, Token []) Default 0 2 LParen +SYMBOL "hello" Default 0 2 LParen +SYMBOL "world" Default 0 2 LParen +SYMBOL "banaani" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-2.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-2.returns tokens.verified.txt new file mode 100644 index 0000000..e6fc24b --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-2.returns tokens.verified.txt @@ -0,0 +1,22 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "hello" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "argname" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LET Default 0 2 LParen +SYMBOL "name" Default 0 2 LParen +SYMBOL "argname" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("hello %s", Regular, Token []) Default 0 2 LParen +SYMBOL "name" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "hello" Default 0 1 LParen +STRING ("world", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-3.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-3.returns tokens.verified.txt new file mode 100644 index 0000000..fa577ab --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-3.returns tokens.verified.txt @@ -0,0 +1,21 @@ +LPAREN Default 0 1 LParen +MUT Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +STRING ("initial", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("value is %s", Regular, Token []) Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SET Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +STRING ("updated", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("value is %s", Regular, Token []) Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-4.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-4.returns tokens.verified.txt new file mode 100644 index 0000000..94b20a0 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-4.returns tokens.verified.txt @@ -0,0 +1,44 @@ +LPAREN Default 0 1 LParen +MUT Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +STRING ("initial", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("value is %s", Regular, Token []) Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "foo" Default 0 1 LParen +LPAREN Default 0 2 LParen +FN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "arg" Default 0 2 LParen +RBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SET Default 0 3 LParen +SYMBOL "value" Default 0 3 LParen +SYMBOL "arg" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "foo" Default 0 1 LParen +STRING ("hello", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("value is %s", Regular, Token []) Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "foo" Default 0 1 LParen +STRING ("world", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("value is %s", Regular, Token []) Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-5.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-5.returns tokens.verified.txt new file mode 100644 index 0000000..bd73537 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-5.returns tokens.verified.txt @@ -0,0 +1,149 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "a" Default 0 1 LParen +INT32 (5, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "b" Default 0 1 LParen +INT32 (4, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("+ is %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_PLUS Default 0 2 LParen +SYMBOL "a" Default 0 2 LParen +SYMBOL "b" Default 0 2 LParen +INT32 (52, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("+ is %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_PLUS Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("+ is %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_PLUS Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("* is %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_MULT Default 0 2 LParen +SYMBOL "a" Default 0 2 LParen +SYMBOL "b" Default 0 2 LParen +INT32 (52, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("* is %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_MULT Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("* is %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_MULT Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("* is %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_MULT Default 0 2 LParen +INT8 (2y, false) Default 0 2 LParen +INT8 (1y, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("- is %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_MINUS Default 0 2 LParen +SYMBOL "a" Default 0 2 LParen +SYMBOL "b" Default 0 2 LParen +INT32 (52, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("- is %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_MINUS Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("/ is %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_DIV Default 0 2 LParen +SYMBOL "a" Default 0 2 LParen +SYMBOL "b" Default 0 2 LParen +INT32 (52, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("/ is %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_DIV Default 0 2 LParen +INT64 (2L, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("/ is %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_DIV Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "decimal" Default 0 3 LParen +SYMBOL "a" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "decimal" Default 0 3 LParen +SYMBOL "b" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "decimal" Default 0 3 LParen +IEEE64 52.0 Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("/ is %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_DIV Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("/ is %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_DIV Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "decimal" Default 0 3 LParen +SYMBOL "a" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "decimal" Default 0 3 LParen +SYMBOL "b" Default 0 3 LParen +RPAREN Default 0 2 LParen +DECIMAL 52.0M Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-6.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-6.returns tokens.verified.txt new file mode 100644 index 0000000..64f0b56 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-6.returns tokens.verified.txt @@ -0,0 +1,16 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "values" Default 0 1 LParen +LBRACKET Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +INT32 (2, false) Default 0 1 LParen +STRING ("foo", Regular, Token []) Default 0 1 LParen +STRING ("bar", Regular, Token []) Default 0 1 LParen +RBRACKET Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("values are %O", Regular, Token []) Default 0 1 LParen +SYMBOL "values" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-7.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-7.returns tokens.verified.txt new file mode 100644 index 0000000..b27bae6 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-7.returns tokens.verified.txt @@ -0,0 +1,31 @@ +HASH_IDENT "nowarn" Default 0 0 Default +STRING ("20", Regular, Token []) Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "values" Default 0 1 LParen +LBRACKET Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +INT32 (2, false) Default 0 1 LParen +STRING ("foo", Regular, Token []) Default 0 1 LParen +STRING ("bar", Regular, Token []) Default 0 1 LParen +RBRACKET Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("values are %O", Regular, Token []) Default 0 1 LParen +SYMBOL "values" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "vector-push!" Default 0 1 LParen +SYMBOL "values" Default 0 1 LParen +INT32 (4, false) Default 0 1 LParen +INT32 (5, false) Default 0 1 LParen +INT32 (6, false) Default 0 1 LParen +INT32 (7, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("values after update are %O", Regular, Token []) Default 0 1 LParen +SYMBOL "values" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-8.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-8.returns tokens.verified.txt new file mode 100644 index 0000000..b0b030b --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-8.returns tokens.verified.txt @@ -0,0 +1,49 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "ints" Default 0 1 LParen +COLON Default 0 1 LParen +SYMBOL "ResizeArray" Default 0 1 LParen +OP_LESS Default 0 1 LParen +SYMBOL "int32" Default 0 1 LParen +OP_GREATER Default 0 1 LParen +RBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "ResizeArray" Default 0 2 LParen +OP_LESS Default 0 2 LParen +SYMBOL "_" Default 0 2 LParen +OP_GREATER Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DOT Default 0 1 LParen +SYMBOL "ints" Default 0 1 LParen +SYMBOL "Add" Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("number of ints: %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT Default 0 2 LParen +SYMBOL "ints" Default 0 2 LParen +PROP_PLUS "+Count" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DOT Default 0 1 LParen +SYMBOL "ints" Default 0 1 LParen +SYMBOL "Add" Default 0 1 LParen +INT32 (2, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("number of ints: %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT Default 0 2 LParen +SYMBOL "ints" Default 0 2 LParen +PROP_PLUS "+Count" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-9.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-9.returns tokens.verified.txt new file mode 100644 index 0000000..16416ac --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_example-9.returns tokens.verified.txt @@ -0,0 +1,75 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "decimals" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "ResizeArray" Default 0 2 LParen +OP_LESS Default 0 2 LParen +SYMBOL "_" Default 0 2 LParen +OP_GREATER Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DOT Default 0 1 LParen +SYMBOL "decimals" Default 0 1 LParen +SYMBOL "Add" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "decimal" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("number of decimals: %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT Default 0 2 LParen +SYMBOL "decimals" Default 0 2 LParen +PROP_PLUS "+Count" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DOT Default 0 1 LParen +SYMBOL "decimals" Default 0 1 LParen +SYMBOL "Add" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "decimal" Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("number of decimals: %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT Default 0 2 LParen +SYMBOL "decimals" Default 0 2 LParen +PROP_PLUS "+Count" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("decimals 0 is %f", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT Default 0 2 LParen +SYMBOL "decimals" Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "index" Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("decimals 1 is %f", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT Default 0 2 LParen +SYMBOL "decimals" Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +SYMBOL "index" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_variables-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_variables-0.returns tokens.verified.txt new file mode 100644 index 0000000..51ad847 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_examples_variables-0.returns tokens.verified.txt @@ -0,0 +1,35 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("value is %i", Regular, Token []) Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MUT Default 0 1 LParen +SYMBOL "valuemut" Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("valuemut is %i", Regular, Token []) Default 0 1 LParen +SYMBOL "valuemut" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SET Default 0 1 LParen +SYMBOL "valuemut" Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_PLUS Default 0 2 LParen +SYMBOL "valuemut" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("valuemut is %i", Regular, Token []) Default 0 1 LParen +SYMBOL "valuemut" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-0.returns tokens.verified.txt new file mode 100644 index 0000000..c11e82e --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-0.returns tokens.verified.txt @@ -0,0 +1,20 @@ +LPAREN Default 0 1 LParen +FOR_IN Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "var" Default 0 1 LParen +LPAREN Default 0 2 LParen +BANG_RANGE Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +DOTDOT Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +DOTDOT Default 0 2 LParen +INT32 (10, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("var is: %O", Regular, Token []) Default 0 2 LParen +SYMBOL "var" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-1.returns tokens.verified.txt new file mode 100644 index 0000000..be88052 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-1.returns tokens.verified.txt @@ -0,0 +1,21 @@ +LPAREN Default 0 1 LParen +FOR_IN Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "var" Default 0 1 LParen +LPAREN Default 0 2 LParen +BANG_LIST Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +INT32 (4, false) Default 0 2 LParen +INT32 (5, false) Default 0 2 LParen +INT32 (6, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("var is: %O", Regular, Token []) Default 0 2 LParen +SYMBOL "var" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-2.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-2.returns tokens.verified.txt new file mode 100644 index 0000000..2a8f0fa --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-2.returns tokens.verified.txt @@ -0,0 +1,21 @@ +LPAREN Default 0 1 LParen +FOR_IN Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "var" Default 0 1 LParen +LPAREN Default 0 2 LParen +BANG_ARRAY Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +INT32 (4, false) Default 0 2 LParen +INT32 (5, false) Default 0 2 LParen +INT32 (6, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("var is: %O", Regular, Token []) Default 0 2 LParen +SYMBOL "var" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-3.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-3.returns tokens.verified.txt new file mode 100644 index 0000000..06e3427 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-3.returns tokens.verified.txt @@ -0,0 +1,21 @@ +LPAREN Default 0 1 LParen +FOR_IN Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "var" Default 0 1 LParen +LPAREN Default 0 2 LParen +BANG_SET Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +INT32 (4, false) Default 0 2 LParen +INT32 (5, false) Default 0 2 LParen +INT32 (6, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("var is: %O", Regular, Token []) Default 0 2 LParen +SYMBOL "var" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-4.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-4.returns tokens.verified.txt new file mode 100644 index 0000000..6ea7c8c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-in_for-in-4.returns tokens.verified.txt @@ -0,0 +1,30 @@ +LPAREN Default 0 1 LParen +FOR_IN Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "var" Default 0 1 LParen +LPAREN Default 0 2 LParen +BANG_MAP Default 0 2 LParen +LPAREN Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +DOT Default 0 3 LParen +INT32 (2, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +INT32 (3, false) Default 0 3 LParen +DOT Default 0 3 LParen +INT32 (4, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +INT32 (5, false) Default 0 3 LParen +DOT Default 0 3 LParen +INT32 (6, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("var is: %O", Regular, Token []) Default 0 2 LParen +SYMBOL "var" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-to_for-to-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-to_for-to-0.returns tokens.verified.txt new file mode 100644 index 0000000..a4b0b4f --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_for-to_for-to-0.returns tokens.verified.txt @@ -0,0 +1,134 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "func1" Default 0 1 LParen +LPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FOR_TO Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "var" Default 0 2 LParen +LPAREN Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +SYMBOL "to" Default 0 3 LParen +INT32 (10, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "printf" Default 0 3 LParen +STRING ("%d ", Regular, Token []) Default 0 3 LParen +SYMBOL "var" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "func2" Default 0 1 LParen +LPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FOR_TO Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "var" Default 0 2 LParen +LPAREN Default 0 3 LParen +INT32 (10, false) Default 0 3 LParen +SYMBOL "downto" Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "printf" Default 0 3 LParen +STRING ("%d ", Regular, Token []) Default 0 3 LParen +SYMBOL "var" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "func1" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "func2" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "start" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "x" Default 0 2 LParen +SYMBOL "y" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_MINUS Default 0 2 LParen +SYMBOL "x" Default 0 2 LParen +LPAREN Default 0 3 LParen +OP_MULT Default 0 3 LParen +INT32 (2, false) Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "end" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "x" Default 0 2 LParen +SYMBOL "y" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_PLUS Default 0 2 LParen +SYMBOL "x" Default 0 2 LParen +LPAREN Default 0 3 LParen +OP_MULT Default 0 3 LParen +INT32 (2, false) Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "func3" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "x" Default 0 2 LParen +SYMBOL "y" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FOR_TO Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "var" Default 0 2 LParen +LPAREN Default 0 3 LParen +LPAREN Default 0 4 LParen +SYMBOL "start" Default 0 4 LParen +SYMBOL "x" Default 0 4 LParen +SYMBOL "y" Default 0 4 LParen +RPAREN Default 0 3 LParen +SYMBOL "to" Default 0 3 LParen +LPAREN Default 0 4 LParen +SYMBOL "end" Default 0 4 LParen +SYMBOL "x" Default 0 4 LParen +SYMBOL "y" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "printf" Default 0 3 LParen +STRING ("%d ", Regular, Token []) Default 0 3 LParen +SYMBOL "var" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "func3" Default 0 1 LParen +INT32 (10, false) Default 0 1 LParen +INT32 (4, false) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_functions_apply-method-args-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_functions_apply-method-args-0.returns tokens.verified.txt new file mode 100644 index 0000000..ebbc165 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_functions_apply-method-args-0.returns tokens.verified.txt @@ -0,0 +1,448 @@ +LPAREN Default 0 1 LParen +TYPEALIAS Default 0 1 LParen +SYMBOL "Grid" Default 0 1 LParen +SYMBOL "char" Default 0 1 LParen +LBRACKET Default 0 1 LParen +COMMA Default 0 1 LParen +RBRACKET Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "struct" TokenStream Macro 1 1 LParen +SYMBOL "Pos" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "x" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int32" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "y" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int32" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.X" TokenStream Macro 2 2 LParen +SYMBOL "x" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Y" TokenStream Macro 2 2 LParen +SYMBOL "y" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "override" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "_.ToString" TokenStream Macro 2 2 LParen +UNIT TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "sprintf" TokenStream Macro 3 3 LParen +STRING ("(y: %A, x: %A)", Regular, Token []) TokenStream Macro 3 3 LParen +SYMBOL "y" TokenStream Macro 3 3 LParen +SYMBOL "x" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +INLINE Default 0 1 LParen +SYMBOL "NorthOf" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "p" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "Pos" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "mkPos" Default 0 2 LParen +LPAREN Default 0 3 LParen +PROP_PLUS "+X" Default 0 3 LParen +SYMBOL "p" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "dec" Default 0 3 LParen +LPAREN Default 0 4 LParen +PROP_PLUS "+Y" Default 0 4 LParen +SYMBOL "p" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +TYPE Default 0 1 Type +SYMBOL "TileMap" Default 0 1 Type +LPAREN Default 0 2 Type +LBRACKET Default 0 2 Type +SYMBOL "grid" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "Grid" Default 0 2 Type +RBRACKET Default 0 2 Type +LBRACKET Default 0 2 Type +SYMBOL "rocks" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "array" Default 0 2 Type +OP_LESS Default 0 2 Type +SYMBOL "Pos" Default 0 2 Type +OP_GREATER Default 0 2 Type +RBRACKET Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +LET Default 0 2 Type +SYMBOL "grid" Default 0 2 Type +SYMBOL "grid" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +LET Default 0 2 Type +SYMBOL "height" Default 0 2 Type +LPAREN Default 0 3 Type +SYMBOL "Array2D.length1" Default 0 3 Type +SYMBOL "grid" Default 0 3 Type +RPAREN Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +LET Default 0 2 Type +SYMBOL "width" Default 0 2 Type +LPAREN Default 0 3 Type +SYMBOL "Array2D.length2" Default 0 3 Type +SYMBOL "grid" Default 0 3 Type +RPAREN Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +SYMBOL "_.Rocks" Default 0 2 Member +SYMBOL "rocks" Default 0 2 Member +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +OVERRIDE Default 0 2 Type +FN Default 0 2 Type +SYMBOL "_.ToString" Default 0 2 Type +LPAREN Default 0 3 Type +RPAREN Default 0 2 Type +LPAREN Default 0 3 Type +SYMBOL "sprintf" Default 0 3 Type +STRING ("TileMap\n%A", Regular, Token []) Default 0 3 Type +SYMBOL "grid" Default 0 3 Type +RPAREN Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +FN Default 0 2 Member +SYMBOL "t.MoveRock" Default 0 2 Member +LPAREN Default 0 3 Member +LBRACKET Default 0 3 Member +SYMBOL "from" Default 0 3 Member +COLON Default 0 3 Member +SYMBOL "Pos" Default 0 3 Member +RBRACKET Default 0 3 Member +LBRACKET Default 0 3 Member +SYMBOL "to" Default 0 3 Member +COLON Default 0 3 Member +SYMBOL "Pos" Default 0 3 Member +RBRACKET Default 0 3 Member +RPAREN Default 0 2 Member +LPAREN Default 0 3 Member +MATCH Default 0 3 Member +LPAREN Default 0 4 Member +DOT_BRACKET Default 0 4 Member +SYMBOL "from" Default 0 4 Member +RBRACKET Default 0 4 Member +SYMBOL "t" Default 0 4 Member +RPAREN Default 0 3 Member +LBRACKET Default 0 3 Member +LPAREN Default 0 4 Member +SYMBOL "Some" Default 0 4 Member +CHAR "#\O" Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +MATCH Default 0 4 Member +LPAREN Default 0 5 Member +DOT_BRACKET Default 0 5 Member +SYMBOL "to" Default 0 5 Member +RBRACKET Default 0 5 Member +SYMBOL "t" Default 0 5 Member +RPAREN Default 0 4 Member +LBRACKET Default 0 4 Member +LPAREN Default 0 5 Member +SYMBOL "Some" Default 0 5 Member +CHAR "#\." Default 0 5 Member +RPAREN Default 0 4 Member +LPAREN Default 0 5 Member +SET Default 0 5 Member +LPAREN Default 0 6 Member +DOT_BRACKET Default 0 6 Member +SYMBOL "from" Default 0 6 Member +RBRACKET Default 0 6 Member +SYMBOL "t" Default 0 6 Member +RPAREN Default 0 5 Member +CHAR "#\." Default 0 5 Member +RPAREN Default 0 4 Member +LPAREN Default 0 5 Member +SET Default 0 5 Member +LPAREN Default 0 6 Member +DOT_BRACKET Default 0 6 Member +SYMBOL "to" Default 0 6 Member +RBRACKET Default 0 6 Member +SYMBOL "t" Default 0 6 Member +RPAREN Default 0 5 Member +CHAR "#\O" Default 0 5 Member +RPAREN Default 0 4 Member +TRUE Default 0 4 Member +RBRACKET Default 0 4 Member +LBRACKET Default 0 4 Member +SYMBOL "_" Default 0 4 Member +FALSE Default 0 4 Member +RBRACKET Default 0 4 Member +RPAREN Default 0 3 Member +RBRACKET Default 0 3 Member +LBRACKET Default 0 3 Member +SYMBOL "_" Default 0 3 Member +FALSE Default 0 3 Member +RBRACKET Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +SYMBOL "_.Item" Default 0 2 Member +LPAREN Default 0 3 Member +MEMBER_GET Default 0 3 Member +LPAREN Default 0 4 Member +LBRACKET Default 0 4 Member +SYMBOL "pos" Default 0 4 Member +COLON Default 0 4 Member +SYMBOL "Pos" Default 0 4 Member +RBRACKET Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +LET Default 0 4 Member +SYMBOL "y" Default 0 4 Member +LPAREN Default 0 5 Member +PROP_PLUS "+Y" Default 0 5 Member +SYMBOL "pos" Default 0 5 Member +RPAREN Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +LET Default 0 4 Member +SYMBOL "x" Default 0 4 Member +LPAREN Default 0 5 Member +PROP_PLUS "+X" Default 0 5 Member +SYMBOL "pos" Default 0 5 Member +RPAREN Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +MACRO_NAME "cond_" TokenStream Macro 1 4 Member +LBRACKET TokenStream Macro 2 4 Member +LPAREN TokenStream Macro 3 5 Member +SYMBOL "and" TokenStream Macro 3 5 Member +LPAREN TokenStream Macro 4 6 Member +SYMBOL "and" TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL ">=" TokenStream Macro 5 7 Member +SYMBOL "y" TokenStream Macro 5 7 Member +INT32 (0, false) TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL "<" TokenStream Macro 5 7 Member +SYMBOL "y" TokenStream Macro 5 7 Member +SYMBOL "height" TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +RPAREN TokenStream Macro 3 5 Member +LPAREN TokenStream Macro 4 6 Member +SYMBOL "and" TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL ">=" TokenStream Macro 5 7 Member +SYMBOL "x" TokenStream Macro 5 7 Member +INT32 (0, false) TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL "<" TokenStream Macro 5 7 Member +SYMBOL "x" TokenStream Macro 5 7 Member +SYMBOL "width" TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +RPAREN TokenStream Macro 3 5 Member +RPAREN TokenStream Macro 2 4 Member +LPAREN TokenStream Macro 3 5 Member +SYMBOL "Some" TokenStream Macro 3 5 Member +LPAREN TokenStream Macro 4 6 Member +DOT_BRACKET TokenStream Macro 5 6 Member +SYMBOL "y" TokenStream Macro 5 6 Member +COMMA TokenStream Macro 5 6 Member +SYMBOL "x" TokenStream Macro 5 6 Member +RBRACKET TokenStream Macro 4 6 Member +SYMBOL "grid" TokenStream Macro 4 6 Member +RPAREN TokenStream Macro 3 5 Member +RPAREN TokenStream Macro 2 4 Member +RBRACKET TokenStream Macro 1 4 Member +LBRACKET TokenStream Macro 2 4 Member +SYMBOL "_" TokenStream Macro 2 4 Member +SYMBOL "None" TokenStream Macro 2 4 Member +RBRACKET TokenStream Macro 1 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Member +LPAREN Default 0 3 Member +MEMBER_SET Default 0 3 Member +LPAREN Default 0 4 Member +LBRACKET Default 0 4 Member +SYMBOL "pos" Default 0 4 Member +COLON Default 0 4 Member +SYMBOL "Pos" Default 0 4 Member +RBRACKET Default 0 4 Member +RPAREN Default 0 3 Member +SYMBOL "ch" Default 0 3 Member +LPAREN Default 0 4 Member +LET Default 0 4 Member +SYMBOL "y" Default 0 4 Member +LPAREN Default 0 5 Member +PROP_PLUS "+Y" Default 0 5 Member +SYMBOL "pos" Default 0 5 Member +RPAREN Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +LET Default 0 4 Member +SYMBOL "x" Default 0 4 Member +LPAREN Default 0 5 Member +PROP_PLUS "+X" Default 0 5 Member +SYMBOL "pos" Default 0 5 Member +RPAREN Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +MACRO_NAME "cond_" TokenStream Macro 1 4 Member +LBRACKET TokenStream Macro 2 4 Member +LPAREN TokenStream Macro 3 5 Member +SYMBOL "and" TokenStream Macro 3 5 Member +LPAREN TokenStream Macro 4 6 Member +SYMBOL "and" TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL ">=" TokenStream Macro 5 7 Member +SYMBOL "y" TokenStream Macro 5 7 Member +INT32 (0, false) TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL "<" TokenStream Macro 5 7 Member +SYMBOL "y" TokenStream Macro 5 7 Member +SYMBOL "height" TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +RPAREN TokenStream Macro 3 5 Member +LPAREN TokenStream Macro 4 6 Member +SYMBOL "and" TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL ">=" TokenStream Macro 5 7 Member +SYMBOL "x" TokenStream Macro 5 7 Member +INT32 (0, false) TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL "<" TokenStream Macro 5 7 Member +SYMBOL "x" TokenStream Macro 5 7 Member +SYMBOL "width" TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +RPAREN TokenStream Macro 3 5 Member +RPAREN TokenStream Macro 2 4 Member +LPAREN TokenStream Macro 3 5 Member +SYMBOL "set!" TokenStream Macro 3 5 Member +LPAREN TokenStream Macro 4 6 Member +DOT_BRACKET TokenStream Macro 5 6 Member +SYMBOL "y" TokenStream Macro 5 6 Member +COMMA TokenStream Macro 5 6 Member +SYMBOL "x" TokenStream Macro 5 6 Member +RBRACKET TokenStream Macro 4 6 Member +SYMBOL "grid" TokenStream Macro 4 6 Member +RPAREN TokenStream Macro 3 5 Member +SYMBOL "ch" TokenStream Macro 3 5 Member +RPAREN TokenStream Macro 2 4 Member +RBRACKET TokenStream Macro 1 4 Member +LBRACKET TokenStream Macro 2 4 Member +SYMBOL "_" TokenStream Macro 2 4 Member +UNIT TokenStream Macro 2 4 Member +RBRACKET TokenStream Macro 1 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "TiltNorth" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "tm" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "TileMap" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LET Default 0 2 LParen +SYMBOL "rocks" Default 0 2 LParen +LPAREN Default 0 3 LParen +PROP_PLUS "+Rocks" Default 0 3 LParen +SYMBOL "tm" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LET Default 0 2 LParen +SYMBOL "rocksToMove" Default 0 2 LParen +LPAREN Default 0 3 LParen +THREAD_LAST Default 0 3 LParen +SYMBOL "rocks" Default 0 3 LParen +LPAREN Default 0 4 LParen +SYMBOL "Array.filter" Default 0 4 LParen +HASH_PAREN Default 0 5 LParen +OP_GREATER Default 0 5 LParen +LPAREN Default 0 6 LParen +PROP_PLUS "+Y" Default 0 6 LParen +SYMBOL "%1" Default 0 6 LParen +RPAREN Default 0 5 LParen +INT32 (0, false) Default 0 5 LParen +RPAREN Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FOR_IN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "rock" Default 0 2 LParen +SYMBOL "rocksToMove" Default 0 2 LParen +RBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "printfn" Default 0 3 LParen +STRING ("%A", Regular, Token []) Default 0 3 LParen +SYMBOL "rock" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +MUT Default 0 3 LParen +SYMBOL "pos" Default 0 3 LParen +SYMBOL "rock" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +WHILE Default 0 3 LParen +LPAREN Default 0 4 LParen +APPLY_METHOD "-MoveRock" Default 0 4 LParen +SYMBOL "tm" Default 0 4 LParen +SYMBOL "pos" Default 0 4 LParen +LPAREN Default 0 5 LParen +SYMBOL "NorthOf" Default 0 5 LParen +SYMBOL "pos" Default 0 5 LParen +RPAREN Default 0 4 LParen +RPAREN Default 0 3 LParen +LPAREN Default 0 4 LParen +SET Default 0 4 LParen +SYMBOL "pos" Default 0 4 LParen +LPAREN Default 0 5 LParen +SYMBOL "NorthOf" Default 0 5 LParen +SYMBOL "pos" Default 0 5 LParen +RPAREN Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("%A", Regular, Token []) Default 0 2 LParen +SYMBOL "tm" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("OK", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_hashmap_hashmap-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_hashmap_hashmap-0.returns tokens.verified.txt new file mode 100644 index 0000000..3eb3a4b --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_hashmap_hashmap-0.returns tokens.verified.txt @@ -0,0 +1,38 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "map" Default 0 1 LParen +LBRACE Default 0 1 LParen +KEYWORD ":this-is-a-key" Default 0 1 LParen +STRING ("value", Regular, Token []) Default 0 1 LParen +STRING ("string as key", Regular, Token []) Default 0 1 LParen +STRING ("string value", Regular, Token []) Default 0 1 LParen +INT32 (0, false) Default 0 1 LParen +STRING ("int as key", Regular, Token []) Default 0 1 LParen +RBRACE Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%O", Regular, Token []) Default 0 1 LParen +SYMBOL "map" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%O", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "HashMap.find" Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "Value.string" Default 0 3 LParen +STRING ("string as key", Regular, Token []) Default 0 3 LParen +RPAREN Default 0 2 LParen +SYMBOL "map" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%O", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +KEYWORD ":this-is-a-key" Default 0 2 LParen +SYMBOL "map" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_hashset_hashset-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_hashset_hashset-0.returns tokens.verified.txt new file mode 100644 index 0000000..89b457b --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_hashset_hashset-0.returns tokens.verified.txt @@ -0,0 +1,18 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "set" Default 0 1 LParen +HASH_BRACE Default 0 1 LParen +KEYWORD ":this-is-a-key" Default 0 1 LParen +STRING ("value", Regular, Token []) Default 0 1 LParen +STRING ("string as key", Regular, Token []) Default 0 1 LParen +STRING ("string value", Regular, Token []) Default 0 1 LParen +INT32 (0, false) Default 0 1 LParen +STRING ("int as key", Regular, Token []) Default 0 1 LParen +RBRACE Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%O", Regular, Token []) Default 0 1 LParen +SYMBOL "set" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_if_if-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_if_if-0.returns tokens.verified.txt new file mode 100644 index 0000000..494420d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_if_if-0.returns tokens.verified.txt @@ -0,0 +1,34 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "condition" Default 0 1 LParen +LPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +FALSE Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "then" Default 0 1 LParen +LPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +STRING ("then", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "alt" Default 0 1 LParen +LPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +STRING ("alt", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +IF_KW Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "condition" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "then" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "alt" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_and-example-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_and-example-0.returns tokens.verified.txt new file mode 100644 index 0000000..4ef860b --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_and-example-0.returns tokens.verified.txt @@ -0,0 +1,97 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "my-and" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +TRUE TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "one" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +SYMBOL "one" TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "cond" TokenStream Macro 3 2 LParen +SYMBOL "exprs" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "if" TokenStream Macro 3 2 LParen +SYMBOL "cond" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "my-and" TokenStream Macro 4 3 LParen +SYMBOL "exprs" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +FALSE TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-and %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-and" TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-and %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-and" TokenStream Macro 1 2 LParen +FALSE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-and %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-and" TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-and %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-and" TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +FALSE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-and %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-and" TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-and %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-and" TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +FALSE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-and %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-and" TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_bar-parens-in-macro-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_bar-parens-in-macro-0.returns tokens.verified.txt new file mode 100644 index 0000000..04d8094 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_bar-parens-in-macro-0.returns tokens.verified.txt @@ -0,0 +1,25 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "MyBegin" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "exprs" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "begin" TokenStream Macro 3 2 LParen +SYMBOL "exprs" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "MyBegin" TokenStream Macro 1 1 LParen +PAREN_BAR TokenStream Macro 2 1 LParen +INT32 (1, false) TokenStream Macro 2 1 LParen +INT32 (2, false) TokenStream Macro 2 1 LParen +INT32 (3, false) TokenStream Macro 2 1 LParen +BAR_PAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_chars-in-macros-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_chars-in-macros-0.returns tokens.verified.txt new file mode 100644 index 0000000..da47961 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_chars-in-macros-0.returns tokens.verified.txt @@ -0,0 +1,57 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "PrintChars" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "printfn" TokenStream Macro 3 2 LParen +STRING ("Values: %A", Regular, Token []) TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "!list" TokenStream Macro 4 3 LParen +SYMBOL "body" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "PrintChars" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +CHAR "#\a" TokenStream Macro 2 2 LParen +DOT TokenStream Macro 2 2 LParen +CHAR "#\=" TokenStream Macro 2 2 LParen +DOT TokenStream Macro 2 2 LParen +CHAR "#\B" TokenStream Macro 2 2 LParen +DOT TokenStream Macro 2 2 LParen +CHAR "#\newline" TokenStream Macro 2 2 LParen +DOT TokenStream Macro 2 2 LParen +CHAR "#\space" TokenStream Macro 2 2 LParen +DOT TokenStream Macro 2 2 LParen +CHAR "#\tab" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +CHAR "#\a" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +CHAR "#\newline" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +CHAR "#\space" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +CHAR "#\tab" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_cond-macro-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_cond-macro-0.returns tokens.verified.txt new file mode 100644 index 0000000..0ce16a5 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_cond-macro-0.returns tokens.verified.txt @@ -0,0 +1,57 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "my-cond" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "failwith" TokenStream Macro 3 2 LParen +STRING ("unreachable cond", Regular, Token []) TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "one" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +SYMBOL "one" TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "var" TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +SYMBOL "exprs" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "if" TokenStream Macro 3 2 LParen +SYMBOL "var" TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "my-cond" TokenStream Macro 4 3 LParen +SYMBOL "exprs" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "my-cond" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL ">" TokenStream Macro 2 2 LParen +INT32 (0, false) TokenStream Macro 2 2 LParen +INT32 (0, false) TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +INT32 (1, false) TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "<" TokenStream Macro 2 2 LParen +INT32 (0, false) TokenStream Macro 2 2 LParen +INT32 (0, false) TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +INT32 (2, false) TokenStream Macro 1 1 LParen +KEYWORD ":else" TokenStream Macro 1 1 LParen +INT32 (3, false) TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_cond-macro-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_cond-macro-1.returns tokens.verified.txt new file mode 100644 index 0000000..34734ef --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_cond-macro-1.returns tokens.verified.txt @@ -0,0 +1,110 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "my-cond_" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "failwith" TokenStream Macro 3 2 LParen +STRING ("unbalanced cond", Regular, Token []) TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +LPAREN TokenStream Macro 5 4 LParen +SYMBOL "?discard" TokenStream Macro 5 4 LParen +RPAREN TokenStream Macro 4 3 LParen +SYMBOL "body" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "if" TokenStream Macro 3 2 LParen +TRUE TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "begin" TokenStream Macro 4 3 LParen +SYMBOL "body" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "failwith" TokenStream Macro 4 3 LParen +STRING ("unreachable", Regular, Token []) TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "test" TokenStream Macro 4 3 LParen +SYMBOL "body" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +SYMBOL "rest" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "if" TokenStream Macro 3 2 LParen +SYMBOL "test" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "begin" TokenStream Macro 4 3 LParen +SYMBOL "body" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "my-cond_" TokenStream Macro 4 3 LParen +SYMBOL "rest" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "my-cond_" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL ">" TokenStream Macro 3 2 LParen +INT32 (0, false) TokenStream Macro 3 2 LParen +INT32 (1, false) TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "printfn" TokenStream Macro 3 2 LParen +STRING ("body here1", Regular, Token []) TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "printfn" TokenStream Macro 3 2 LParen +STRING ("body here2", Regular, Token []) TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +UNIT TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "<" TokenStream Macro 3 2 LParen +INT32 (1, false) TokenStream Macro 3 2 LParen +INT32 (0, false) TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "printfn" TokenStream Macro 3 2 LParen +STRING ("here1", Regular, Token []) TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "printfn" TokenStream Macro 3 2 LParen +STRING ("here2", Regular, Token []) TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +SYMBOL "_" TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "printfn" TokenStream Macro 3 2 LParen +STRING ("default1", Regular, Token []) TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "printfn" TokenStream Macro 3 2 LParen +STRING ("default2", Regular, Token []) TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_count-exprs-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_count-exprs-0.returns tokens.verified.txt new file mode 100644 index 0000000..f2a051e --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_count-exprs-0.returns tokens.verified.txt @@ -0,0 +1,61 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "CountExprsExampleTest1" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +INT32 (0, false) TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +INT32 (1, false) TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "head" TokenStream Macro 3 2 LParen +SYMBOL "tail" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "+" TokenStream Macro 3 2 LParen +INT32 (1, false) TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "CountExprsExampleTest1" TokenStream Macro 4 3 LParen +SYMBOL "tail" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "exprCount" Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "CountExprsExampleTest1" TokenStream Macro 1 2 LParen +LBRACKET TokenStream Macro 2 2 LParen +RBRACKET TokenStream Macro 1 2 LParen +LBRACKET TokenStream Macro 2 2 LParen +RBRACKET TokenStream Macro 1 2 LParen +LBRACKET TokenStream Macro 2 2 LParen +RBRACKET TokenStream Macro 1 2 LParen +LBRACKET TokenStream Macro 2 2 LParen +RBRACKET TokenStream Macro 1 2 LParen +LBRACKET TokenStream Macro 2 2 LParen +RBRACKET TokenStream Macro 1 2 LParen +LBRACKET TokenStream Macro 2 2 LParen +RBRACKET TokenStream Macro 1 2 LParen +LBRACKET TokenStream Macro 2 2 LParen +RBRACKET TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("exprs: %A", Regular, Token []) Default 0 1 LParen +SYMBOL "exprCount" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_macro-lambda-shorthand-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_macro-lambda-shorthand-0.returns tokens.verified.txt new file mode 100644 index 0000000..955af0d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_macro-lambda-shorthand-0.returns tokens.verified.txt @@ -0,0 +1,47 @@ +LPAREN Default 0 1 LParen +THREAD_LAST Default 0 1 LParen +PAREN_BAR Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +INT32 (2, false) Default 0 1 LParen +INT32 (3, false) Default 0 1 LParen +INT32 (4, false) Default 0 1 LParen +INT32 (5, false) Default 0 1 LParen +INT32 (6, false) Default 0 1 LParen +INT32 (7, false) Default 0 1 LParen +INT32 (8, false) Default 0 1 LParen +INT32 (9, false) Default 0 1 LParen +INT32 (10, false) Default 0 1 LParen +BAR_PAREN Default 0 1 LParen +HASH_PAREN Default 0 2 LParen +BEGIN_KW Default 0 2 LParen +LPAREN Default 0 3 LParen +LET Default 0 3 LParen +SYMBOL "lst" Default 0 3 LParen +SYMBOL "%1" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +MACRO_NAME "cond_" TokenStream Macro 1 3 LParen +LBRACKET TokenStream Macro 2 3 LParen +SYMBOL "_" TokenStream Macro 2 3 LParen +LPAREN TokenStream Macro 3 4 LParen +SYMBOL "List.filter" TokenStream Macro 3 4 LParen +HASH_PAREN TokenStream Macro 4 5 LParen +SYMBOL "and" TokenStream Macro 4 5 LParen +LPAREN TokenStream Macro 5 6 LParen +SYMBOL ">" TokenStream Macro 5 6 LParen +SYMBOL "%1" TokenStream Macro 5 6 LParen +INT32 (1, false) TokenStream Macro 5 6 LParen +RPAREN TokenStream Macro 4 5 LParen +LPAREN TokenStream Macro 5 6 LParen +SYMBOL "<" TokenStream Macro 5 6 LParen +SYMBOL "%1" TokenStream Macro 5 6 LParen +INT32 (10, false) TokenStream Macro 5 6 LParen +RPAREN TokenStream Macro 4 5 LParen +RPAREN TokenStream Macro 3 4 LParen +SYMBOL "lst" TokenStream Macro 3 4 LParen +RPAREN TokenStream Macro 2 3 LParen +RBRACKET TokenStream Macro 1 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_my-rinit-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_my-rinit-0.returns tokens.verified.txt new file mode 100644 index 0000000..43524de --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_my-rinit-0.returns tokens.verified.txt @@ -0,0 +1,92 @@ +LPAREN Default 0 1 LParen +RECORD Default 0 1 Type +SYMBOL "Mapping" Default 0 1 Type +LPAREN Default 0 2 Type +SYMBOL "src" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "int64" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +SYMBOL "dest" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "int64" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +SYMBOL "range" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "int64" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +FN Default 0 2 Member +SYMBOL "this.Stuff" Default 0 2 Member +LPAREN Default 0 3 Member +RPAREN Default 0 2 Member +LPAREN Default 0 3 Member +SYMBOL "printfn" Default 0 3 Member +STRING ("doing stuff %A", Regular, Token []) Default 0 3 Member +LPAREN Default 0 4 Member +PROP_PLUS "+src" Default 0 4 Member +SYMBOL "this" Default 0 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "MyRinit" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "sym" TokenStream Macro 4 3 LParen +SYMBOL "val" TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "s" TokenStream Macro 4 3 LParen +SYMBOL "v" TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +BRACE_BAR TokenStream Macro 3 1 LParen +SYMBOL "sym" TokenStream Macro 3 1 LParen +SYMBOL "val" TokenStream Macro 3 1 LParen +LPAREN TokenStream Macro 4 2 LParen +SYMBOL "m-alternate" TokenStream Macro 4 2 LParen +SYMBOL "s" TokenStream Macro 4 2 LParen +SYMBOL "v" TokenStream Macro 4 2 LParen +RPAREN TokenStream Macro 3 1 LParen +BAR_BRACE TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "temp" Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "MyRinit" TokenStream Macro 1 2 LParen +LBRACKET TokenStream Macro 2 2 LParen +SYMBOL "src" TokenStream Macro 2 2 LParen +INT32 (1, false) TokenStream Macro 2 2 LParen +RBRACKET TokenStream Macro 1 2 LParen +LBRACKET TokenStream Macro 2 2 LParen +SYMBOL "Mapping.dest" TokenStream Macro 2 2 LParen +INT32 (2, false) TokenStream Macro 2 2 LParen +RBRACKET TokenStream Macro 1 2 LParen +LBRACKET TokenStream Macro 2 2 LParen +SYMBOL "range" TokenStream Macro 2 2 LParen +INT32 (3, false) TokenStream Macro 2 2 LParen +RBRACKET TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Record is %A", Regular, Token []) Default 0 1 LParen +SYMBOL "temp" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DOT_METHOD ".Stuff" Default 0 1 LParen +SYMBOL "temp" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_nested-macro-expansion-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_nested-macro-expansion-0.returns tokens.verified.txt new file mode 100644 index 0000000..02a6274 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_nested-macro-expansion-0.returns tokens.verified.txt @@ -0,0 +1,196 @@ +LPAREN Default 0 1 LParen +TYPEALIAS Default 0 1 LParen +SYMBOL "Grid" Default 0 1 LParen +SYMBOL "array" Default 0 1 LParen +OP_LESS Default 0 1 LParen +SYMBOL "array" Default 0 1 LParen +OP_LESS Default 0 1 LParen +SYMBOL "char" Default 0 1 LParen +OP_GREATER Default 0 1 LParen +OP_GREATER Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "struct" TokenStream Macro 1 1 LParen +SYMBOL "Pos" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "x" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int32" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "y" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int32" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.X" TokenStream Macro 2 2 LParen +SYMBOL "x" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Y" TokenStream Macro 2 2 LParen +SYMBOL "y" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "override" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "_.ToString" TokenStream Macro 2 2 LParen +UNIT TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "sprintf" TokenStream Macro 3 3 LParen +STRING ("Pos(x: %A, y: %A)", Regular, Token []) TokenStream Macro 3 3 LParen +SYMBOL "x" TokenStream Macro 3 3 LParen +SYMBOL "y" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +TYPE Default 0 1 Type +SYMBOL "TileMap" Default 0 1 Type +LPAREN Default 0 2 Type +LBRACKET Default 0 2 Type +SYMBOL "grid" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "Grid" Default 0 2 Type +RBRACKET Default 0 2 Type +LBRACKET Default 0 2 Type +SYMBOL "start" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "Pos" Default 0 2 Type +RBRACKET Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +LET Default 0 2 Type +SYMBOL "grid" Default 0 2 Type +SYMBOL "grid" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +LET Default 0 2 Type +SYMBOL "start" Default 0 2 Type +SYMBOL "start" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +OVERRIDE Default 0 2 Type +FN Default 0 2 Type +SYMBOL "_.ToString" Default 0 2 Type +LPAREN Default 0 3 Type +RPAREN Default 0 2 Type +LPAREN Default 0 3 Type +SYMBOL "sprintf" Default 0 3 Type +STRING ("TileMap(%A)\n%A", Regular, Token []) Default 0 3 Type +SYMBOL "start" Default 0 3 Type +SYMBOL "grid" Default 0 3 Type +RPAREN Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +SYMBOL "_.Start" Default 0 2 Member +SYMBOL "start" Default 0 2 Member +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +SYMBOL "_.Item" Default 0 2 Member +LPAREN Default 0 3 Member +MEMBER_GET Default 0 3 Member +LPAREN Default 0 4 Member +LBRACKET Default 0 4 Member +SYMBOL "pos" Default 0 4 Member +COLON Default 0 4 Member +SYMBOL "Pos" Default 0 4 Member +RBRACKET Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +LET Default 0 4 Member +SYMBOL "y" Default 0 4 Member +LPAREN Default 0 5 Member +PROP_PLUS "+Y" Default 0 5 Member +SYMBOL "pos" Default 0 5 Member +RPAREN Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +LET Default 0 4 Member +SYMBOL "x" Default 0 4 Member +LPAREN Default 0 5 Member +PROP_PLUS "+X" Default 0 5 Member +SYMBOL "pos" Default 0 5 Member +RPAREN Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +MACRO_NAME "cond_" TokenStream Macro 1 4 Member +LBRACKET TokenStream Macro 2 4 Member +LPAREN TokenStream Macro 3 5 Member +SYMBOL "and" TokenStream Macro 3 5 Member +LPAREN TokenStream Macro 4 6 Member +SYMBOL "and" TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL ">=" TokenStream Macro 5 7 Member +SYMBOL "y" TokenStream Macro 5 7 Member +INT32 (0, false) TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL "<" TokenStream Macro 5 7 Member +SYMBOL "y" TokenStream Macro 5 7 Member +LPAREN TokenStream Macro 6 8 Member +SYMBOL "+Length" TokenStream Macro 6 8 Member +SYMBOL "grid" TokenStream Macro 6 8 Member +RPAREN TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +RPAREN TokenStream Macro 3 5 Member +LPAREN TokenStream Macro 4 6 Member +SYMBOL "and" TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL ">=" TokenStream Macro 5 7 Member +SYMBOL "x" TokenStream Macro 5 7 Member +INT32 (0, false) TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +LPAREN TokenStream Macro 5 7 Member +SYMBOL "<" TokenStream Macro 5 7 Member +SYMBOL "x" TokenStream Macro 5 7 Member +LPAREN TokenStream Macro 6 8 Member +SYMBOL "+Length" TokenStream Macro 6 8 Member +LPAREN TokenStream Macro 7 9 Member +DOT_BRACKET TokenStream Macro 8 9 Member +INT32 (0, false) TokenStream Macro 8 9 Member +RBRACKET TokenStream Macro 7 9 Member +SYMBOL "grid" TokenStream Macro 7 9 Member +RPAREN TokenStream Macro 6 8 Member +RPAREN TokenStream Macro 5 7 Member +RPAREN TokenStream Macro 4 6 Member +RPAREN TokenStream Macro 3 5 Member +RPAREN TokenStream Macro 2 4 Member +LPAREN TokenStream Macro 3 5 Member +SYMBOL "let" TokenStream Macro 3 5 Member +SYMBOL "row" TokenStream Macro 3 5 Member +LPAREN TokenStream Macro 4 6 Member +DOT_BRACKET TokenStream Macro 5 6 Member +SYMBOL "y" TokenStream Macro 5 6 Member +RBRACKET TokenStream Macro 4 6 Member +SYMBOL "grid" TokenStream Macro 4 6 Member +RPAREN TokenStream Macro 3 5 Member +RPAREN TokenStream Macro 2 4 Member +LPAREN TokenStream Macro 3 5 Member +SYMBOL "Some" TokenStream Macro 3 5 Member +LPAREN TokenStream Macro 4 6 Member +DOT_BRACKET TokenStream Macro 5 6 Member +SYMBOL "x" TokenStream Macro 5 6 Member +RBRACKET TokenStream Macro 4 6 Member +SYMBOL "row" TokenStream Macro 4 6 Member +RPAREN TokenStream Macro 3 5 Member +RPAREN TokenStream Macro 2 4 Member +RBRACKET TokenStream Macro 1 4 Member +LBRACKET TokenStream Macro 2 4 Member +SYMBOL "_" TokenStream Macro 2 4 Member +SYMBOL "None" TokenStream Macro 2 4 Member +RBRACKET TokenStream Macro 1 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("OK", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_nested-macro-expansion-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_nested-macro-expansion-1.returns tokens.verified.txt new file mode 100644 index 0000000..d739c5d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_nested-macro-expansion-1.returns tokens.verified.txt @@ -0,0 +1,293 @@ +LPAREN Default 0 1 LParen +OPEN Default 0 1 LParen +SYMBOL "System" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "Something" Default 0 1 LParen +LPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LET Default 0 2 LParen +SYMBOL "work" Default 0 2 LParen +LPAREN Default 0 3 LParen +NEW Default 0 3 LParen +SYMBOL "ResizeArray" Default 0 3 LParen +OP_LESS Default 0 3 LParen +SYMBOL "int*int*int64" Default 0 3 LParen +OP_GREATER Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LET Default 0 2 LParen +SYMBOL "conditions" Default 0 2 LParen +LPAREN Default 0 3 LParen +BANG_ARRAY Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LET Default 0 2 LParen +SYMBOL "broken" Default 0 2 LParen +LPAREN Default 0 3 LParen +BANG_ARRAY Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LET Default 0 2 LParen +SYMBOL "possibleOffsets" Default 0 2 LParen +LPAREN Default 0 3 LParen +BANG_ARRAY Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FN Default 0 2 LParen +SYMBOL "PopWork" Default 0 2 LParen +LPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +LET Default 0 3 LParen +SYMBOL "r" Default 0 3 LParen +LPAREN Default 0 4 LParen +DOT_BRACKET Default 0 4 LParen +INT32 (0, false) Default 0 4 LParen +RBRACKET Default 0 4 LParen +SYMBOL "work" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +DOT_METHOD ".RemoveAt" Default 0 3 LParen +SYMBOL "work" Default 0 3 LParen +INT32 (0, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +SYMBOL "r" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FN Default 0 2 LParen +SYMBOL "EnqueueWork" Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "bi" Default 0 3 LParen +SYMBOL "offsetEnd" Default 0 3 LParen +SYMBOL "nextPos" Default 0 3 LParen +SYMBOL "count" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MUT Default 0 2 LParen +SYMBOL "result" Default 0 2 LParen +INT64 (0L, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +WHILE Default 0 2 LParen +LPAREN Default 0 3 LParen +OP_GREATER Default 0 3 LParen +LPAREN Default 0 4 LParen +PROP_PLUS "+Count" Default 0 4 LParen +SYMBOL "work" Default 0 4 LParen +RPAREN Default 0 3 LParen +INT32 (0, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +MATCH Default 0 3 Match +LPAREN Default 0 4 Match +SYMBOL "PopWork" Default 0 4 Match +RPAREN Default 0 3 Match +LBRACKET Default 0 3 Match +LPAREN Default 0 4 Match +SYMBOL "bi" Default 0 4 Match +DOT Default 0 4 Match +SYMBOL "off" Default 0 4 Match +DOT Default 0 4 Match +SYMBOL "count" Default 0 4 Match +RPAREN Default 0 3 Match +LPAREN Default 0 4 Match +SYMBOL "printfn" Default 0 4 Match +STRING ("(%A,%A,%A)", Regular, Token []) Default 0 4 Match +SYMBOL "bi" Default 0 4 Match +SYMBOL "off" Default 0 4 Match +SYMBOL "count" Default 0 4 Match +RPAREN Default 0 3 Match +LPAREN Default 0 4 Match +LET Default 0 4 Match +SYMBOL "brokenLength" Default 0 4 Match +LPAREN Default 0 5 Match +DOT_BRACKET Default 0 5 Match +SYMBOL "bi" Default 0 5 Match +RBRACKET Default 0 5 Match +SYMBOL "broken" Default 0 5 Match +RPAREN Default 0 4 Match +RPAREN Default 0 3 Match +LPAREN Default 0 4 Match +LET Default 0 4 Match +SYMBOL "offsetEnd" Default 0 4 Match +LPAREN Default 0 5 Match +OP_PLUS Default 0 5 Match +SYMBOL "off" Default 0 5 Match +SYMBOL "brokenLength" Default 0 5 Match +RPAREN Default 0 4 Match +RPAREN Default 0 3 Match +LPAREN Default 0 4 Match +MACRO_NAME "cond_" TokenStream Macro 1 4 Match +LBRACKET TokenStream Macro 2 4 Match +LPAREN TokenStream Macro 3 5 Match +SYMBOL "not" TokenStream Macro 3 5 Match +LPAREN TokenStream Macro 4 6 Match +SYMBOL "and" TokenStream Macro 4 6 Match +LPAREN TokenStream Macro 5 7 Match +SYMBOL "or" TokenStream Macro 5 7 Match +LPAREN TokenStream Macro 6 8 Match +SYMBOL "=" TokenStream Macro 6 8 Match +SYMBOL "off" TokenStream Macro 6 8 Match +INT32 (0, false) TokenStream Macro 6 8 Match +RPAREN TokenStream Macro 5 7 Match +LPAREN TokenStream Macro 6 8 Match +SYMBOL "!=" TokenStream Macro 6 8 Match +LPAREN TokenStream Macro 7 9 Match +DOT_BRACKET TokenStream Macro 8 9 Match +LPAREN TokenStream Macro 9 10 Match +SYMBOL "dec" TokenStream Macro 9 10 Match +SYMBOL "off" TokenStream Macro 9 10 Match +RPAREN TokenStream Macro 8 9 Match +RBRACKET TokenStream Macro 7 9 Match +SYMBOL "conditions" TokenStream Macro 7 9 Match +RPAREN TokenStream Macro 6 8 Match +CHAR "#\#" TokenStream Macro 6 8 Match +RPAREN TokenStream Macro 5 7 Match +RPAREN TokenStream Macro 4 6 Match +LPAREN TokenStream Macro 5 7 Match +SYMBOL "or" TokenStream Macro 5 7 Match +LPAREN TokenStream Macro 6 8 Match +SYMBOL "=" TokenStream Macro 6 8 Match +SYMBOL "offsetEnd" TokenStream Macro 6 8 Match +LPAREN TokenStream Macro 7 9 Match +SYMBOL "+Length" TokenStream Macro 7 9 Match +SYMBOL "conditions" TokenStream Macro 7 9 Match +RPAREN TokenStream Macro 6 8 Match +RPAREN TokenStream Macro 5 7 Match +LPAREN TokenStream Macro 6 8 Match +SYMBOL "and" TokenStream Macro 6 8 Match +LPAREN TokenStream Macro 7 9 Match +SYMBOL "<" TokenStream Macro 7 9 Match +SYMBOL "offsetEnd" TokenStream Macro 7 9 Match +LPAREN TokenStream Macro 8 10 Match +SYMBOL "+Length" TokenStream Macro 8 10 Match +SYMBOL "conditions" TokenStream Macro 8 10 Match +RPAREN TokenStream Macro 7 9 Match +RPAREN TokenStream Macro 6 8 Match +LPAREN TokenStream Macro 7 9 Match +SYMBOL "!=" TokenStream Macro 7 9 Match +LPAREN TokenStream Macro 8 10 Match +DOT_BRACKET TokenStream Macro 9 10 Match +SYMBOL "offsetEnd" TokenStream Macro 9 10 Match +RBRACKET TokenStream Macro 8 10 Match +SYMBOL "conditions" TokenStream Macro 8 10 Match +RPAREN TokenStream Macro 7 9 Match +CHAR "#\#" TokenStream Macro 7 9 Match +RPAREN TokenStream Macro 6 8 Match +RPAREN TokenStream Macro 5 7 Match +RPAREN TokenStream Macro 4 6 Match +LPAREN TokenStream Macro 5 7 Match +SYMBOL "not" TokenStream Macro 5 7 Match +LPAREN TokenStream Macro 6 8 Match +SYMBOL ".Contains" TokenStream Macro 6 8 Match +LPAREN TokenStream Macro 7 9 Match +SYMBOL ".AsSpan" TokenStream Macro 7 9 Match +SYMBOL "conditions" TokenStream Macro 7 9 Match +SYMBOL "off" TokenStream Macro 7 9 Match +SYMBOL "brokenLength" TokenStream Macro 7 9 Match +RPAREN TokenStream Macro 6 8 Match +CHAR "#\." TokenStream Macro 6 8 Match +RPAREN TokenStream Macro 5 7 Match +RPAREN TokenStream Macro 4 6 Match +RPAREN TokenStream Macro 3 5 Match +RPAREN TokenStream Macro 2 4 Match +UNIT TokenStream Macro 2 4 Match +RBRACKET TokenStream Macro 1 4 Match +LBRACKET TokenStream Macro 2 4 Match +LPAREN TokenStream Macro 3 5 Match +SYMBOL "=" TokenStream Macro 3 5 Match +SYMBOL "bi" TokenStream Macro 3 5 Match +LPAREN TokenStream Macro 4 6 Match +SYMBOL "dec" TokenStream Macro 4 6 Match +SYMBOL "brokenLength" TokenStream Macro 4 6 Match +RPAREN TokenStream Macro 3 5 Match +RPAREN TokenStream Macro 2 4 Match +LPAREN TokenStream Macro 3 5 Match +SYMBOL "unless" TokenStream Macro 3 5 Match +LPAREN TokenStream Macro 4 6 Match +SYMBOL ".Contains" TokenStream Macro 4 6 Match +LPAREN TokenStream Macro 5 7 Match +SYMBOL ".AsSpan" TokenStream Macro 5 7 Match +SYMBOL "conditions" TokenStream Macro 5 7 Match +SYMBOL "offsetEnd" TokenStream Macro 5 7 Match +RPAREN TokenStream Macro 4 6 Match +CHAR "#\#" TokenStream Macro 4 6 Match +RPAREN TokenStream Macro 3 5 Match +LPAREN TokenStream Macro 4 6 Match +SYMBOL "set!" TokenStream Macro 4 6 Match +SYMBOL "result" TokenStream Macro 4 6 Match +LPAREN TokenStream Macro 5 7 Match +SYMBOL "+" TokenStream Macro 5 7 Match +SYMBOL "result" TokenStream Macro 5 7 Match +SYMBOL "count" TokenStream Macro 5 7 Match +RPAREN TokenStream Macro 4 6 Match +RPAREN TokenStream Macro 3 5 Match +RPAREN TokenStream Macro 2 4 Match +RBRACKET TokenStream Macro 1 4 Match +LBRACKET TokenStream Macro 2 4 Match +KEYWORD ":else" TokenStream Macro 2 4 Match +LPAREN TokenStream Macro 3 5 Match +SYMBOL "mut" TokenStream Macro 3 5 Match +SYMBOL "nextPossibleIndex" TokenStream Macro 3 5 Match +LPAREN TokenStream Macro 4 6 Match +SYMBOL "System.Array.BinarySearch" TokenStream Macro 4 6 Match +LPAREN TokenStream Macro 5 7 Match +SYMBOL "possibleOffsets" TokenStream Macro 5 7 Match +DOT TokenStream Macro 5 7 Match +LPAREN TokenStream Macro 6 8 Match +SYMBOL "inc" TokenStream Macro 6 8 Match +SYMBOL "offsetEnd" TokenStream Macro 6 8 Match +RPAREN TokenStream Macro 5 7 Match +RPAREN TokenStream Macro 4 6 Match +RPAREN TokenStream Macro 3 5 Match +RPAREN TokenStream Macro 2 4 Match +LPAREN TokenStream Macro 3 5 Match +SYMBOL "when" TokenStream Macro 3 5 Match +LPAREN TokenStream Macro 4 6 Match +SYMBOL "<" TokenStream Macro 4 6 Match +SYMBOL "nextPossibleIndex" TokenStream Macro 4 6 Match +INT32 (0, false) TokenStream Macro 4 6 Match +RPAREN TokenStream Macro 3 5 Match +LPAREN TokenStream Macro 4 6 Match +SYMBOL "set!" TokenStream Macro 4 6 Match +SYMBOL "nextPossibleIndex" TokenStream Macro 4 6 Match +LPAREN TokenStream Macro 5 7 Match +SYMBOL "bcompl" TokenStream Macro 5 7 Match +SYMBOL "nextPossibleIndex" TokenStream Macro 5 7 Match +RPAREN TokenStream Macro 4 6 Match +RPAREN TokenStream Macro 3 5 Match +RPAREN TokenStream Macro 2 4 Match +LPAREN TokenStream Macro 3 5 Match +SYMBOL "EnqueueWork" TokenStream Macro 3 5 Match +LPAREN TokenStream Macro 4 6 Match +SYMBOL "inc" TokenStream Macro 4 6 Match +SYMBOL "bi" TokenStream Macro 4 6 Match +RPAREN TokenStream Macro 3 5 Match +SYMBOL "offsetEnd" TokenStream Macro 3 5 Match +SYMBOL "nextPossibleIndex" TokenStream Macro 3 5 Match +SYMBOL "count" TokenStream Macro 3 5 Match +RPAREN TokenStream Macro 2 4 Match +RBRACKET TokenStream Macro 1 4 Match +RPAREN Default 0 3 Match +LPAREN Default 0 4 Match +RPAREN Default 0 3 Match +RBRACKET Default 0 3 Match +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("OK", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_or-example-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_or-example-0.returns tokens.verified.txt new file mode 100644 index 0000000..e0d93af --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_or-example-0.returns tokens.verified.txt @@ -0,0 +1,150 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "my-or" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +FALSE TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "one" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +SYMBOL "one" TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "test" TokenStream Macro 3 2 LParen +SYMBOL "exprs" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "do" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "let" TokenStream Macro 4 3 LParen +SYMBOL "orTemp" TokenStream Macro 4 3 LParen +SYMBOL "test" TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "if" TokenStream Macro 4 3 LParen +SYMBOL "orTemp" TokenStream Macro 4 3 LParen +SYMBOL "orTemp" TokenStream Macro 4 3 LParen +LPAREN TokenStream Macro 5 4 LParen +SYMBOL "my-or" TokenStream Macro 5 4 LParen +SYMBOL "exprs" TokenStream Macro 5 4 LParen +SYMBOL "..." TokenStream Macro 5 4 LParen +RPAREN TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-or %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-or" TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-or %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-or" TokenStream Macro 1 2 LParen +FALSE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-or %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-or" TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-or %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-or" TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +FALSE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-or %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-or" TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-or %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-or" TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +FALSE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-or %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-or" TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +TRUE TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-or %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-or" TokenStream Macro 1 2 LParen +LPAREN TokenStream Macro 2 3 LParen +SYMBOL "Value.bool" TokenStream Macro 2 3 LParen +FALSE TokenStream Macro 2 3 LParen +RPAREN TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-or %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-or" TokenStream Macro 1 2 LParen +LPAREN TokenStream Macro 2 3 LParen +SYMBOL "Value.bool" TokenStream Macro 2 3 LParen +FALSE TokenStream Macro 2 3 LParen +RPAREN TokenStream Macro 1 2 LParen +LPAREN TokenStream Macro 2 3 LParen +SYMBOL "Value.string" TokenStream Macro 2 3 LParen +STRING ("this works, yay", Regular, Token []) TokenStream Macro 2 3 LParen +RPAREN TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("my-or %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "my-or" TokenStream Macro 1 2 LParen +LPAREN TokenStream Macro 2 3 LParen +SYMBOL "Value.bool" TokenStream Macro 2 3 LParen +FALSE TokenStream Macro 2 3 LParen +RPAREN TokenStream Macro 1 2 LParen +LPAREN TokenStream Macro 2 3 LParen +SYMBOL "Value.bool" TokenStream Macro 2 3 LParen +FALSE TokenStream Macro 2 3 LParen +RPAREN TokenStream Macro 1 2 LParen +LPAREN TokenStream Macro 2 3 LParen +SYMBOL "Value.string" TokenStream Macro 2 3 LParen +STRING ("this works, yay", Regular, Token []) TokenStream Macro 2 3 LParen +RPAREN TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-example-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-example-1.returns tokens.verified.txt new file mode 100644 index 0000000..3baa082 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-example-1.returns tokens.verified.txt @@ -0,0 +1,247 @@ +LPAREN Default 0 1 LParen +MACRO_NAME "struct" TokenStream Macro 1 1 LParen +SYMBOL "Range" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "start" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int64" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "len" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int64" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Start" TokenStream Macro 2 2 LParen +SYMBOL "start" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Len" TokenStream Macro 2 2 LParen +SYMBOL "len" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.End" TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "+" TokenStream Macro 3 3 LParen +SYMBOL "start" TokenStream Macro 3 3 LParen +SYMBOL "len" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "d.Offset" TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "v" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "-" TokenStream Macro 3 3 LParen +SYMBOL "v" TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Start" TokenStream Macro 4 4 LParen +SYMBOL "d" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "d.Contains" TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "v" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "and" TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL ">=" TokenStream Macro 4 4 LParen +SYMBOL "v" TokenStream Macro 4 4 LParen +LPAREN TokenStream Macro 5 5 LParen +SYMBOL "+Start" TokenStream Macro 5 5 LParen +SYMBOL "d" TokenStream Macro 5 5 LParen +RPAREN TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "<" TokenStream Macro 4 4 LParen +SYMBOL "v" TokenStream Macro 4 4 LParen +LPAREN TokenStream Macro 5 5 LParen +SYMBOL "+End" TokenStream Macro 5 5 LParen +SYMBOL "d" TokenStream Macro 5 5 LParen +RPAREN TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "override" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "t.ToString" TokenStream Macro 2 2 LParen +UNIT TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "sprintf" TokenStream Macro 3 3 LParen +STRING ("Range(%i, %i)", Regular, Token []) TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Start" TokenStream Macro 4 4 LParen +SYMBOL "t" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Len" TokenStream Macro 4 4 LParen +SYMBOL "t" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Range is: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "Range" Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +INT32 (5, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Range end is: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +THREAD_LAST Default 0 2 LParen +LPAREN Default 0 3 LParen +NEW Default 0 3 LParen +SYMBOL "Range" Default 0 3 LParen +INT32 (0, false) Default 0 3 LParen +INT32 (5, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +PROP_PLUS "+End" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "struct" TokenStream Macro 1 1 LParen +SYMBOL "SourceDestMap" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "dest" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int64" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "src" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int64" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "len" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int64" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Dest" TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "new" TokenStream Macro 3 3 LParen +SYMBOL "Range" TokenStream Macro 3 3 LParen +SYMBOL "dest" TokenStream Macro 3 3 LParen +SYMBOL "len" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Src" TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "new" TokenStream Macro 3 3 LParen +SYMBOL "Range" TokenStream Macro 3 3 LParen +SYMBOL "src" TokenStream Macro 3 3 LParen +SYMBOL "len" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Len" TokenStream Macro 2 2 LParen +SYMBOL "len" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "d.Contains" TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "v" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "->>" TokenStream Macro 3 3 LParen +SYMBOL "d" TokenStream Macro 3 3 LParen +SYMBOL "+Src" TokenStream Macro 3 3 LParen +HASH_PAREN TokenStream Macro 4 4 LParen +SYMBOL "-Contains" TokenStream Macro 4 4 LParen +SYMBOL "%1" TokenStream Macro 4 4 LParen +SYMBOL "v" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "d.Get" TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "src" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "cond" TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "-Contains" TokenStream Macro 4 4 LParen +LPAREN TokenStream Macro 5 5 LParen +SYMBOL "+Src" TokenStream Macro 5 5 LParen +SYMBOL "d" TokenStream Macro 5 5 LParen +RPAREN TokenStream Macro 4 4 LParen +SYMBOL "src" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+" TokenStream Macro 4 4 LParen +LPAREN TokenStream Macro 5 5 LParen +SYMBOL "->>" TokenStream Macro 5 5 LParen +SYMBOL "d" TokenStream Macro 5 5 LParen +SYMBOL "+Dest" TokenStream Macro 5 5 LParen +SYMBOL "+Start" TokenStream Macro 5 5 LParen +RPAREN TokenStream Macro 4 4 LParen +LPAREN TokenStream Macro 5 5 LParen +SYMBOL "-Offset" TokenStream Macro 5 5 LParen +LPAREN TokenStream Macro 6 6 LParen +SYMBOL "+Src" TokenStream Macro 6 6 LParen +SYMBOL "d" TokenStream Macro 6 6 LParen +RPAREN TokenStream Macro 5 5 LParen +SYMBOL "src" TokenStream Macro 5 5 LParen +RPAREN TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +KEYWORD ":else" TokenStream Macro 3 3 LParen +SYMBOL "src" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "override" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "t.ToString" TokenStream Macro 2 2 LParen +UNIT TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "sprintf" TokenStream Macro 3 3 LParen +STRING ("(%A, %A, %i)", Regular, Token []) TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Dest" TokenStream Macro 4 4 LParen +SYMBOL "t" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Src" TokenStream Macro 4 4 LParen +SYMBOL "t" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Len" TokenStream Macro 4 4 LParen +SYMBOL "t" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-macro-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-macro-0.returns tokens.verified.txt new file mode 100644 index 0000000..56c57d5 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-macro-0.returns tokens.verified.txt @@ -0,0 +1,108 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "MyStruct" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "typ" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "arg" TokenStream Macro 4 3 LParen +SYMBOL "ctor" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +HASH_BRACKET TokenStream Macro 4 2 LParen +SYMBOL "Struct" TokenStream Macro 4 2 LParen +RBRACKET TokenStream Macro 3 2 LParen +SYMBOL "type" TokenStream Macro 3 2 LParen +SYMBOL "typ" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "arg" TokenStream Macro 4 3 LParen +SYMBOL "ctor" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "MyStruct" TokenStream Macro 1 1 LParen +SYMBOL "Example" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "x" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "y" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.X" TokenStream Macro 2 2 LParen +SYMBOL "x" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Y" TokenStream Macro 2 2 LParen +SYMBOL "y" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "d.Sum" TokenStream Macro 2 2 LParen +UNIT TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "+" TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+X" TokenStream Macro 4 4 LParen +SYMBOL "d" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Y" TokenStream Macro 4 4 LParen +SYMBOL "d" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "instance" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "Example" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Example Struct is %A", Regular, Token []) Default 0 1 LParen +SYMBOL "instance" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Example IsValueType %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +THREAD_LAST Default 0 2 LParen +SYMBOL "instance" Default 0 2 LParen +DOT_METHOD ".GetType" Default 0 2 LParen +PROP_PLUS "+IsValueType" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Example Result is %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_METHOD ".Sum" Default 0 2 LParen +SYMBOL "instance" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-macro-2.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-macro-2.returns tokens.verified.txt new file mode 100644 index 0000000..59b24ac --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-macro-2.returns tokens.verified.txt @@ -0,0 +1,176 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "MyStruct2" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "typ" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +LPAREN TokenStream Macro 5 4 LParen +SYMBOL "arg1" TokenStream Macro 5 4 LParen +COLON TokenStream Macro 5 4 LParen +SYMBOL "argtyp1" TokenStream Macro 5 4 LParen +RPAREN TokenStream Macro 4 3 LParen +LPAREN TokenStream Macro 5 4 LParen +SYMBOL "argrest" TokenStream Macro 5 4 LParen +COLON TokenStream Macro 5 4 LParen +SYMBOL "argresttyp" TokenStream Macro 5 4 LParen +RPAREN TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "begin" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +HASH_BRACKET TokenStream Macro 5 3 LParen +SYMBOL "Struct" TokenStream Macro 5 3 LParen +RBRACKET TokenStream Macro 4 3 LParen +SYMBOL "type" TokenStream Macro 4 3 LParen +SYMBOL "typ" TokenStream Macro 4 3 LParen +LPAREN TokenStream Macro 5 4 LParen +LPAREN TokenStream Macro 6 5 LParen +SYMBOL "arg1" TokenStream Macro 6 5 LParen +COLON TokenStream Macro 6 5 LParen +SYMBOL "argtyp1" TokenStream Macro 6 5 LParen +RPAREN TokenStream Macro 5 4 LParen +LPAREN TokenStream Macro 6 5 LParen +SYMBOL "argrest" TokenStream Macro 6 5 LParen +COLON TokenStream Macro 6 5 LParen +SYMBOL "argresttyp" TokenStream Macro 6 5 LParen +RPAREN TokenStream Macro 5 4 LParen +SYMBOL "..." TokenStream Macro 5 4 LParen +RPAREN TokenStream Macro 4 3 LParen +SYMBOL "body" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "fn" TokenStream Macro 4 3 LParen +LPAREN TokenStream Macro 5 4 LParen +SYMBOL "m-concat-id" TokenStream Macro 5 4 LParen +SYMBOL "mk" TokenStream Macro 5 4 LParen +SYMBOL "typ" TokenStream Macro 5 4 LParen +RPAREN TokenStream Macro 4 3 LParen +LPAREN TokenStream Macro 5 4 LParen +SYMBOL "arg1" TokenStream Macro 5 4 LParen +SYMBOL "argrest" TokenStream Macro 5 4 LParen +SYMBOL "..." TokenStream Macro 5 4 LParen +RPAREN TokenStream Macro 4 3 LParen +LPAREN TokenStream Macro 5 4 LParen +SYMBOL "new" TokenStream Macro 5 4 LParen +SYMBOL "typ" TokenStream Macro 5 4 LParen +SYMBOL "arg1" TokenStream Macro 5 4 LParen +SYMBOL "argrest" TokenStream Macro 5 4 LParen +SYMBOL "..." TokenStream Macro 5 4 LParen +RPAREN TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "MyStruct2" TokenStream Macro 1 1 LParen +SYMBOL "Example" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "x" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "y" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "z" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "w" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.X" TokenStream Macro 2 2 LParen +SYMBOL "x" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Y" TokenStream Macro 2 2 LParen +SYMBOL "y" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Z" TokenStream Macro 2 2 LParen +SYMBOL "z" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.W" TokenStream Macro 2 2 LParen +SYMBOL "w" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "d.Sum" TokenStream Macro 2 2 LParen +UNIT TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "+" TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+X" TokenStream Macro 4 4 LParen +SYMBOL "d" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Y" TokenStream Macro 4 4 LParen +SYMBOL "d" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Z" TokenStream Macro 4 4 LParen +SYMBOL "d" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+W" TokenStream Macro 4 4 LParen +SYMBOL "d" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "instance" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "mkExample" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +INT32 (4, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Example Struct is %A", Regular, Token []) Default 0 1 LParen +SYMBOL "instance" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Example IsValueType %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +THREAD_LAST Default 0 2 LParen +SYMBOL "instance" Default 0 2 LParen +DOT_METHOD ".GetType" Default 0 2 LParen +PROP_PLUS "+IsValueType" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Example Result is %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_METHOD ".Sum" Default 0 2 LParen +SYMBOL "instance" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-macro-3.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-macro-3.returns tokens.verified.txt new file mode 100644 index 0000000..03be2e1 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_struct-macro-3.returns tokens.verified.txt @@ -0,0 +1,196 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "MyStruct3" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "typ" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "arg" TokenStream Macro 4 3 LParen +SYMBOL "ctor" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +HASH_BRACKET TokenStream Macro 4 2 LParen +SYMBOL "Struct" TokenStream Macro 4 2 LParen +RBRACKET TokenStream Macro 3 2 LParen +SYMBOL "type" TokenStream Macro 3 2 LParen +SYMBOL "typ" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "arg" TokenStream Macro 4 3 LParen +SYMBOL "ctor" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "my-and-3" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +TRUE TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "one" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +SYMBOL "one" TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "cond" TokenStream Macro 3 2 LParen +SYMBOL "exprs" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "if" TokenStream Macro 3 2 LParen +SYMBOL "cond" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "my-and-3" TokenStream Macro 4 3 LParen +SYMBOL "exprs" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +FALSE TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "MyStruct3" TokenStream Macro 1 1 LParen +SYMBOL "Range" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "start" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int64" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +LBRACKET TokenStream Macro 3 2 LParen +SYMBOL "len" TokenStream Macro 3 2 LParen +COLON TokenStream Macro 3 2 LParen +SYMBOL "int64" TokenStream Macro 3 2 LParen +RBRACKET TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Start" TokenStream Macro 2 2 LParen +SYMBOL "start" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.Len" TokenStream Macro 2 2 LParen +SYMBOL "len" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "_.End" TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "+" TokenStream Macro 3 3 LParen +SYMBOL "start" TokenStream Macro 3 3 LParen +SYMBOL "len" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "d.Offset" TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "v" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "-" TokenStream Macro 3 3 LParen +SYMBOL "v" TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Start" TokenStream Macro 4 4 LParen +SYMBOL "d" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "member" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "d.Contains" TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "v" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "my-and-3" TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL ">=" TokenStream Macro 4 4 LParen +SYMBOL "v" TokenStream Macro 4 4 LParen +LPAREN TokenStream Macro 5 5 LParen +SYMBOL "+Start" TokenStream Macro 5 5 LParen +SYMBOL "d" TokenStream Macro 5 5 LParen +RPAREN TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "<" TokenStream Macro 4 4 LParen +SYMBOL "v" TokenStream Macro 4 4 LParen +LPAREN TokenStream Macro 5 5 LParen +SYMBOL "+End" TokenStream Macro 5 5 LParen +SYMBOL "d" TokenStream Macro 5 5 LParen +RPAREN TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "override" TokenStream Macro 2 2 LParen +SYMBOL "fn" TokenStream Macro 2 2 LParen +SYMBOL "t.ToString" TokenStream Macro 2 2 LParen +UNIT TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "sprintf" TokenStream Macro 3 3 LParen +STRING ("Range(%i, %i)", Regular, Token []) TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Start" TokenStream Macro 4 4 LParen +SYMBOL "t" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +LPAREN TokenStream Macro 4 4 LParen +SYMBOL "+Len" TokenStream Macro 4 4 LParen +SYMBOL "t" TokenStream Macro 4 4 LParen +RPAREN TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "instance" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "Range" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Example Struct is %A", Regular, Token []) Default 0 1 LParen +SYMBOL "instance" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Example IsValueType %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +THREAD_LAST Default 0 2 LParen +SYMBOL "instance" Default 0 2 LParen +DOT_METHOD ".GetType" Default 0 2 LParen +PROP_PLUS "+IsValueType" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Example Result is %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_METHOD ".ToString" Default 0 2 LParen +SYMBOL "instance" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_syntax-macro-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_syntax-macro-0.returns tokens.verified.txt new file mode 100644 index 0000000..c5edd0f --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_syntax-macro-0.returns tokens.verified.txt @@ -0,0 +1,97 @@ +HASH_IDENT "nowarn" Default 0 0 Default +STRING ("0026", Regular, Token []) Default 0 0 Default +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "matchfnexample" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "sym" TokenStream Macro 3 2 LParen +SYMBOL "m" TokenStream Macro 3 2 LParen +SYMBOL "rest" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "fn" TokenStream Macro 3 2 LParen +SYMBOL "sym" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "arg" TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "match" TokenStream Macro 4 3 LParen +SYMBOL "arg" TokenStream Macro 4 3 LParen +SYMBOL "m" TokenStream Macro 4 3 LParen +SYMBOL "rest" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "matchfnexample" TokenStream Macro 1 1 LParen +SYMBOL "name" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "!tuple" TokenStream Macro 3 2 LParen +SYMBOL "a" TokenStream Macro 3 2 LParen +SYMBOL "b" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "+" TokenStream Macro 3 2 LParen +SYMBOL "a" TokenStream Macro 3 2 LParen +SYMBOL "b" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +SYMBOL "_" TokenStream Macro 2 1 LParen +INT32 (0, false) TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "name2" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "tup" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MATCH Default 0 2 Match +SYMBOL "tup" Default 0 2 Match +LBRACKET Default 0 2 Match +LPAREN Default 0 3 Match +BANG_TUPLE Default 0 3 Match +SYMBOL "a" Default 0 3 Match +SYMBOL "b" Default 0 3 Match +RPAREN Default 0 2 Match +LPAREN Default 0 3 Match +OP_PLUS Default 0 3 Match +SYMBOL "a" Default 0 3 Match +SYMBOL "b" Default 0 3 Match +RPAREN Default 0 2 Match +RBRACKET Default 0 2 Match +LBRACKET Default 0 2 Match +SYMBOL "_" Default 0 2 Match +INT32 (0, false) Default 0 2 Match +RBRACKET Default 0 2 Match +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A & %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "name" Default 0 2 LParen +LPAREN Default 0 3 LParen +BANG_TUPLE Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +INT32 (2, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "name2" Default 0 2 LParen +LPAREN Default 0 3 LParen +BANG_TUPLE Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +INT32 (2, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_syntax-macro-2.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_syntax-macro-2.returns tokens.verified.txt new file mode 100644 index 0000000..d87214f --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_syntax-macro-2.returns tokens.verified.txt @@ -0,0 +1,116 @@ +HASH_IDENT "nowarn" Default 0 0 Default +STRING ("0026", Regular, Token []) Default 0 0 Default +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "custom-match-fn" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "c" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +SYMBOL "rest" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "fn" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "arg" TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "match" TokenStream Macro 4 3 LParen +SYMBOL "arg" TokenStream Macro 4 3 LParen +LBRACKET TokenStream Macro 5 3 LParen +SYMBOL "c" TokenStream Macro 5 3 LParen +SYMBOL "..." TokenStream Macro 5 3 LParen +RBRACKET TokenStream Macro 4 3 LParen +SYMBOL "rest" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "sym" TokenStream Macro 3 2 LParen +SYMBOL "m" TokenStream Macro 3 2 LParen +SYMBOL "rest" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "fn" TokenStream Macro 3 2 LParen +SYMBOL "sym" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "arg" TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "match" TokenStream Macro 4 3 LParen +SYMBOL "arg" TokenStream Macro 4 3 LParen +SYMBOL "m" TokenStream Macro 4 3 LParen +SYMBOL "rest" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "lambda" Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "custom-match-fn" TokenStream Macro 1 2 LParen +LBRACKET TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "a" TokenStream Macro 3 3 LParen +DOT TokenStream Macro 3 3 LParen +SYMBOL "b" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "+" TokenStream Macro 3 3 LParen +SYMBOL "a" TokenStream Macro 3 3 LParen +SYMBOL "b" TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RBRACKET TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "custom-match-fn" TokenStream Macro 1 1 LParen +SYMBOL "named" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "a" TokenStream Macro 3 2 LParen +DOT TokenStream Macro 3 2 LParen +SYMBOL "b" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "+" TokenStream Macro 3 2 LParen +SYMBOL "a" TokenStream Macro 3 2 LParen +SYMBOL "b" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("lambda: %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "lambda" Default 0 2 LParen +LPAREN Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +DOT Default 0 3 LParen +INT32 (2, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("named: %i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "named" Default 0 2 LParen +LPAREN Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +DOT Default 0 3 LParen +INT32 (2, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_up-macro-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_up-macro-0.returns tokens.verified.txt new file mode 100644 index 0000000..8779dfd --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_up-macro-0.returns tokens.verified.txt @@ -0,0 +1,41 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "DoingThings" Default 0 1 LParen +LPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MUT Default 0 2 LParen +SYMBOL "items" Default 0 2 LParen +LPAREN Default 0 3 LParen +BANG_SET Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +FOR_TO Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "i" Default 0 2 LParen +LPAREN Default 0 3 LParen +INT32 (0, false) Default 0 3 LParen +SYMBOL "to" Default 0 3 LParen +INT32 (5, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +MACRO_NAME "up!" TokenStream Macro 1 3 LParen +SYMBOL "items" TokenStream Macro 1 3 LParen +LPAREN TokenStream Macro 2 4 LParen +SYMBOL "Set.add" TokenStream Macro 2 4 LParen +SYMBOL "i" TokenStream Macro 2 4 LParen +RPAREN TokenStream Macro 1 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +SYMBOL "items" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "DoingThings" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_when-unless-example-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_when-unless-example-0.returns tokens.verified.txt new file mode 100644 index 0000000..c02efbc --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_when-unless-example-0.returns tokens.verified.txt @@ -0,0 +1,70 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "MyWhen1" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "test" TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "if" TokenStream Macro 3 2 LParen +SYMBOL "test" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "begin" TokenStream Macro 4 3 LParen +SYMBOL "body" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "MyUnless1" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "test" TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "if" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "not" TokenStream Macro 4 3 LParen +SYMBOL "test" TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "begin" TokenStream Macro 4 3 LParen +SYMBOL "body" TokenStream Macro 4 3 LParen +SYMBOL "..." TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "MyWhen1" TokenStream Macro 1 1 LParen +TRUE TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "printfn" TokenStream Macro 2 2 LParen +STRING ("inside when 1", Regular, Token []) TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "printfn" TokenStream Macro 2 2 LParen +STRING ("inside when 2", Regular, Token []) TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "MyUnless1" TokenStream Macro 1 1 LParen +FALSE TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "printfn" TokenStream Macro 2 2 LParen +STRING ("inside unless 3", Regular, Token []) TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "printfn" TokenStream Macro 2 2 LParen +STRING ("inside unless 4", Regular, Token []) TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_while-match-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_while-match-0.returns tokens.verified.txt new file mode 100644 index 0000000..db32d4a --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_macros_while-match-0.returns tokens.verified.txt @@ -0,0 +1,82 @@ +LPAREN Default 0 1 LParen +TYPE Default 0 1 Type +SYMBOL "Counter" Default 0 1 Type +LPAREN Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MUT Default 0 2 Type +SYMBOL "count" Default 0 2 Type +INT32 (0, false) Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +FN Default 0 2 Member +SYMBOL "_.DoStuff" Default 0 2 Member +LPAREN Default 0 3 Member +RPAREN Default 0 2 Member +LPAREN Default 0 3 Member +IF_KW Default 0 3 Member +LPAREN Default 0 4 Member +OP_GREATER Default 0 4 Member +SYMBOL "count" Default 0 4 Member +INT32 (6, false) Default 0 4 Member +RPAREN Default 0 3 Member +SYMBOL "None" Default 0 3 Member +LPAREN Default 0 4 Member +DO_KW Default 0 4 Member +LPAREN Default 0 5 Member +SET Default 0 5 Member +SYMBOL "count" Default 0 5 Member +LPAREN Default 0 6 Member +SYMBOL "inc" Default 0 6 Member +SYMBOL "count" Default 0 6 Member +RPAREN Default 0 5 Member +RPAREN Default 0 4 Member +LPAREN Default 0 5 Member +SYMBOL "Some" Default 0 5 Member +SYMBOL "count" Default 0 5 Member +RPAREN Default 0 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "counter" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "Counter" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "while-match" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL ".DoStuff" TokenStream Macro 2 2 LParen +SYMBOL "counter" TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +SYMBOL "None" TokenStream Macro 2 1 LParen +FALSE TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "Some" TokenStream Macro 3 2 LParen +SYMBOL "c" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "printfn" TokenStream Macro 3 2 LParen +STRING ("Count is: %i", Regular, Token []) TokenStream Macro 3 2 LParen +SYMBOL "c" TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "let" TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL ".DoStuff" TokenStream Macro 4 3 LParen +SYMBOL "counter" TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +TRUE TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_numbers_int-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_numbers_int-0.returns tokens.verified.txt new file mode 100644 index 0000000..5d1a2c0 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_numbers_int-0.returns tokens.verified.txt @@ -0,0 +1,16 @@ +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("int32 is %A", Regular, Token []) Default 0 1 LParen +INT32 (99, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("int32 is %A", Regular, Token []) Default 0 1 LParen +INT32 (99, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("int64 is %A", Regular, Token []) Default 0 1 LParen +INT64 (99L, false) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_ambiguous-tokens-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_ambiguous-tokens-0.returns tokens.verified.txt new file mode 100644 index 0000000..ca882b9 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_ambiguous-tokens-0.returns tokens.verified.txt @@ -0,0 +1,134 @@ +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "NoopMacroExample" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "begin" TokenStream Macro 3 2 LParen +SYMBOL "body" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("non macro: %A", Regular, Token []) Default 0 1 LParen +PAREN_BAR Default 0 1 LParen +BAR_PAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("non macro: %A", Regular, Token []) Default 0 1 LParen +PAREN_BAR Default 0 1 LParen +PAREN_BAR Default 0 1 LParen +BAR_PAREN Default 0 1 LParen +PAREN_BAR Default 0 1 LParen +BAR_PAREN Default 0 1 LParen +BAR_PAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("non macro: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +BAR_BAR Default 0 2 LParen +TRUE Default 0 2 LParen +FALSE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("non macro: %A", Regular, Token []) Default 0 1 LParen +PAREN_BAR Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +INT32 (2, false) Default 0 1 LParen +BAR_PAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("non macro: %A", Regular, Token []) Default 0 1 LParen +PAREN_BAR Default 0 1 LParen +LPAREN Default 0 2 LParen +BAR_BAR Default 0 2 LParen +TRUE Default 0 2 LParen +TRUE Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +BAR_BAR Default 0 2 LParen +FALSE Default 0 2 LParen +FALSE Default 0 2 LParen +RPAREN Default 0 1 LParen +BAR_PAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "NoopMacroExample" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "printfn" TokenStream Macro 2 2 LParen +STRING ("in macro: %A", Regular, Token []) TokenStream Macro 2 2 LParen +PAREN_BAR TokenStream Macro 3 2 LParen +BAR_PAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "NoopMacroExample" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "printfn" TokenStream Macro 2 2 LParen +STRING ("non macro: %A", Regular, Token []) TokenStream Macro 2 2 LParen +PAREN_BAR TokenStream Macro 3 2 LParen +PAREN_BAR TokenStream Macro 4 2 LParen +BAR_PAREN TokenStream Macro 3 2 LParen +PAREN_BAR TokenStream Macro 4 2 LParen +BAR_PAREN TokenStream Macro 3 2 LParen +BAR_PAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "NoopMacroExample" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "printfn" TokenStream Macro 2 2 LParen +STRING ("in macro: %A", Regular, Token []) TokenStream Macro 2 2 LParen +LPAREN TokenStream Macro 3 3 LParen +SYMBOL "||" TokenStream Macro 3 3 LParen +TRUE TokenStream Macro 3 3 LParen +FALSE TokenStream Macro 3 3 LParen +RPAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "NoopMacroExample" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "printfn" TokenStream Macro 2 2 LParen +STRING ("in macro: %A", Regular, Token []) TokenStream Macro 2 2 LParen +PAREN_BAR TokenStream Macro 3 2 LParen +INT32 (1, false) TokenStream Macro 3 2 LParen +INT32 (2, false) TokenStream Macro 3 2 LParen +BAR_PAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MACRO_NAME "NoopMacroExample" TokenStream Macro 1 1 LParen +LPAREN TokenStream Macro 2 2 LParen +SYMBOL "printfn" TokenStream Macro 2 2 LParen +STRING ("in macro: %A", Regular, Token []) TokenStream Macro 2 2 LParen +PAREN_BAR TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "||" TokenStream Macro 4 3 LParen +TRUE TokenStream Macro 4 3 LParen +TRUE TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +LPAREN TokenStream Macro 4 3 LParen +SYMBOL "||" TokenStream Macro 4 3 LParen +FALSE TokenStream Macro 4 3 LParen +FALSE TokenStream Macro 4 3 LParen +RPAREN TokenStream Macro 3 2 LParen +BAR_PAREN TokenStream Macro 2 2 LParen +RPAREN TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("OK", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_call-tuple-args-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_call-tuple-args-0.returns tokens.verified.txt new file mode 100644 index 0000000..e4b6586 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_call-tuple-args-0.returns tokens.verified.txt @@ -0,0 +1,30 @@ +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("result is is %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +APPLY_METHOD "-Concat" Default 0 2 LParen +SYMBOL "System.String" Default 0 2 LParen +LPAREN Default 0 3 LParen +STRING ("first", Regular, Token []) Default 0 3 LParen +COMMA Default 0 3 LParen +STRING ("second", Regular, Token []) Default 0 3 LParen +COMMA Default 0 3 LParen +STRING ("third", Regular, Token []) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("result is is %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "System.String.Concat" Default 0 2 LParen +LPAREN Default 0 3 LParen +STRING ("first", Regular, Token []) Default 0 3 LParen +COMMA Default 0 3 LParen +STRING ("second", Regular, Token []) Default 0 3 LParen +COMMA Default 0 3 LParen +STRING ("third", Regular, Token []) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_lambda-shorthand-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_lambda-shorthand-0.returns tokens.verified.txt new file mode 100644 index 0000000..db788a1 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_lambda-shorthand-0.returns tokens.verified.txt @@ -0,0 +1,15 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "temp" Default 0 1 LParen +HASH_PAREN Default 0 2 LParen +OP_PLUS Default 0 2 LParen +SYMBOL "%1" Default 0 2 LParen +SYMBOL "%2" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "temp" Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +INT32 (2, false) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_let-values.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_let-values.returns tokens.verified.txt new file mode 100644 index 0000000..429ef0e --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_let-values.returns tokens.verified.txt @@ -0,0 +1,27 @@ +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "add" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%i", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "List.reduce" Default 0 2 LParen +SYMBOL "add" Default 0 2 LParen +LPAREN Default 0 3 LParen +BANG_LIST Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +INT32 (2, false) Default 0 3 LParen +INT32 (3, false) Default 0 3 LParen +INT32 (4, false) Default 0 3 LParen +INT32 (5, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +STRING ("let-value support?", Regular, Token []) Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_match-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_match-0.returns tokens.verified.txt new file mode 100644 index 0000000..bf6263e --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_match-0.returns tokens.verified.txt @@ -0,0 +1,211 @@ +HASH_IDENT "nowarn" Default 0 0 Default +STRING ("26", Regular, Token []) Default 0 0 Default +LPAREN Default 0 1 LParen +MATCH Default 0 1 Match +STRING ("hello", Regular, Token []) Default 0 1 Match +LBRACKET Default 0 1 Match +STRING ("hello", Regular, Token []) Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("was hello", Regular, Token []) Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +LBRACKET Default 0 1 Match +SYMBOL "_" Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("default", Regular, Token []) Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MATCH Default 0 1 Match +LPAREN Default 0 2 Match +BANG_TUPLE Default 0 2 Match +INT32 (1, false) Default 0 2 Match +INT32 (2, false) Default 0 2 Match +RPAREN Default 0 1 Match +LBRACKET Default 0 1 Match +LPAREN Default 0 2 Match +BANG_TUPLE Default 0 2 Match +SYMBOL "a" Default 0 2 Match +INT32 (2, false) Default 0 2 Match +RPAREN Default 0 1 Match +LPAREN Default 0 2 Match +WHEN Default 0 2 Match +LPAREN Default 0 3 Match +GREATER_EQUALS Default 0 3 Match +SYMBOL "a" Default 0 3 Match +INT32 (0, false) Default 0 3 Match +RPAREN Default 0 2 Match +RPAREN Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("a is %A", Regular, Token []) Default 0 2 Match +SYMBOL "a" Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +LBRACKET Default 0 1 Match +SYMBOL "_" Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("default", Regular, Token []) Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MATCH Default 0 1 Match +LPAREN Default 0 2 Match +BANG_TUPLE Default 0 2 Match +INT32 (1, false) Default 0 2 Match +INT32 (2, false) Default 0 2 Match +RPAREN Default 0 1 Match +LBRACKET Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "a" Default 0 2 Match +COMMA Default 0 2 Match +INT32 (2, false) Default 0 2 Match +RPAREN Default 0 1 Match +LPAREN Default 0 2 Match +WHEN Default 0 2 Match +LPAREN Default 0 3 Match +GREATER_EQUALS Default 0 3 Match +SYMBOL "a" Default 0 3 Match +INT32 (0, false) Default 0 3 Match +RPAREN Default 0 2 Match +RPAREN Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("a is %A", Regular, Token []) Default 0 2 Match +SYMBOL "a" Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +LBRACKET Default 0 1 Match +SYMBOL "_" Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("default", Regular, Token []) Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MATCH Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "Some" Default 0 2 Match +INT32 (1, false) Default 0 2 Match +RPAREN Default 0 1 Match +LBRACKET Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "Some" Default 0 2 Match +SYMBOL "a" Default 0 2 Match +RPAREN Default 0 1 Match +LPAREN Default 0 2 Match +WHEN Default 0 2 Match +LPAREN Default 0 3 Match +GREATER_EQUALS Default 0 3 Match +SYMBOL "a" Default 0 3 Match +INT32 (0, false) Default 0 3 Match +RPAREN Default 0 2 Match +RPAREN Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("a is %A", Regular, Token []) Default 0 2 Match +SYMBOL "a" Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +LBRACKET Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "Some" Default 0 2 Match +SYMBOL "_" Default 0 2 Match +RPAREN Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("some other", Regular, Token []) Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +LBRACKET Default 0 1 Match +SYMBOL "_" Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("default", Regular, Token []) Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +MATCH Default 0 1 Match +LPAREN Default 0 2 Match +INT32 (1, false) Default 0 2 Match +COLON_COLON Default 0 2 Match +INT32 (2, false) Default 0 2 Match +COLON_COLON Default 0 2 Match +INT32 (3, false) Default 0 2 Match +COLON_COLON Default 0 2 Match +INT32 (4, false) Default 0 2 Match +COLON_COLON Default 0 2 Match +LPAREN Default 0 3 Match +RPAREN Default 0 2 Match +RPAREN Default 0 1 Match +LBRACKET Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "x" Default 0 2 Match +COLON_COLON Default 0 2 Match +SYMBOL "y" Default 0 2 Match +COLON_COLON Default 0 2 Match +SYMBOL "rest" Default 0 2 Match +RPAREN Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("x is %A y is %A rest is %A", Regular, Token []) Default 0 2 Match +SYMBOL "x" Default 0 2 Match +SYMBOL "y" Default 0 2 Match +SYMBOL "rest" Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +LBRACKET Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "x" Default 0 2 Match +COLON_COLON Default 0 2 Match +SYMBOL "rest" Default 0 2 Match +RPAREN Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("x is %A rest is %A", Regular, Token []) Default 0 2 Match +SYMBOL "x" Default 0 2 Match +SYMBOL "rest" Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +LBRACKET Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "x" Default 0 2 Match +COLON_COLON Default 0 2 Match +LBRACKET Default 0 2 Match +RBRACKET Default 0 2 Match +RPAREN Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("x is %A rest is empty", Regular, Token []) Default 0 2 Match +SYMBOL "x" Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +LBRACKET Default 0 1 Match +LPAREN Default 0 2 Match +LBRACKET Default 0 2 Match +RBRACKET Default 0 2 Match +RPAREN Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("empty", Regular, Token []) Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +LBRACKET Default 0 1 Match +LBRACKET Default 0 1 Match +RBRACKET Default 0 1 Match +LPAREN Default 0 2 Match +SYMBOL "printfn" Default 0 2 Match +STRING ("empty", Regular, Token []) Default 0 2 Match +RPAREN Default 0 1 Match +RBRACKET Default 0 1 Match +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_match-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_match-1.returns tokens.verified.txt new file mode 100644 index 0000000..f54a477 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_match-1.returns tokens.verified.txt @@ -0,0 +1,127 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "IsString" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "lhs" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "obj" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MATCH Default 0 2 Match +SYMBOL "lhs" Default 0 2 Match +LBRACKET Default 0 2 Match +LPAREN Default 0 3 Match +COLON_QMARK Default 0 3 Match +SYMBOL "string" Default 0 3 Match +RPAREN Default 0 2 Match +TRUE Default 0 2 Match +RBRACKET Default 0 2 Match +LBRACKET Default 0 2 Match +SYMBOL "_" Default 0 2 Match +FALSE Default 0 2 Match +RBRACKET Default 0 2 Match +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "AreEqualStrings" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "lhs" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "obj" Default 0 2 LParen +RBRACKET Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "rhs" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "obj" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MATCH Default 0 2 Match +LPAREN Default 0 3 Match +SYMBOL "lhs" Default 0 3 Match +COMMA Default 0 3 Match +SYMBOL "rhs" Default 0 3 Match +RPAREN Default 0 2 Match +LBRACKET Default 0 2 Match +LPAREN Default 0 3 Match +LPAREN Default 0 4 Match +COLON_QMARK Default 0 4 Match +SYMBOL "string" Default 0 4 Match +SYMBOL "lhss" Default 0 4 Match +RPAREN Default 0 3 Match +DOT Default 0 3 Match +LPAREN Default 0 4 Match +COLON_QMARK Default 0 4 Match +SYMBOL "string" Default 0 4 Match +SYMBOL "rhss" Default 0 4 Match +RPAREN Default 0 3 Match +RPAREN Default 0 2 Match +LPAREN Default 0 3 Match +EQUALS Default 0 3 Match +SYMBOL "lhss" Default 0 3 Match +SYMBOL "rhss" Default 0 3 Match +RPAREN Default 0 2 Match +RBRACKET Default 0 2 Match +LBRACKET Default 0 2 Match +SYMBOL "_" Default 0 2 Match +FALSE Default 0 2 Match +RBRACKET Default 0 2 Match +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("IsString: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "IsString" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("IsString: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "IsString" Default 0 2 LParen +STRING ("foo", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("AreEqualStrings: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "AreEqualStrings" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("AreEqualStrings: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "AreEqualStrings" Default 0 2 LParen +STRING ("foo", Regular, Token []) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("AreEqualStrings: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "AreEqualStrings" Default 0 2 LParen +STRING ("foo", Regular, Token []) Default 0 2 LParen +STRING ("foo", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("AreEqualStrings: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "AreEqualStrings" Default 0 2 LParen +STRING ("foo", Regular, Token []) Default 0 2 LParen +STRING ("bar", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_operators-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_operators-0.returns tokens.verified.txt new file mode 100644 index 0000000..7207ae0 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_operators-0.returns tokens.verified.txt @@ -0,0 +1,99 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "OrTest" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "a" Default 0 2 LParen +SYMBOL "b" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +BAR_BAR Default 0 2 LParen +SYMBOL "a" Default 0 2 LParen +SYMBOL "b" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "AndTest" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "a" Default 0 2 LParen +SYMBOL "b" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +AMP_AMP Default 0 2 LParen +SYMBOL "a" Default 0 2 LParen +SYMBOL "b" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("OrTest %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "OrTest" Default 0 2 LParen +FALSE Default 0 2 LParen +FALSE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("OrTest %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "OrTest" Default 0 2 LParen +FALSE Default 0 2 LParen +TRUE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("OrTest %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "OrTest" Default 0 2 LParen +TRUE Default 0 2 LParen +FALSE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("OrTest %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "OrTest" Default 0 2 LParen +TRUE Default 0 2 LParen +TRUE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("AndTest %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "AndTest" Default 0 2 LParen +FALSE Default 0 2 LParen +FALSE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("AndTest %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "AndTest" Default 0 2 LParen +FALSE Default 0 2 LParen +TRUE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("AndTest %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "AndTest" Default 0 2 LParen +TRUE Default 0 2 LParen +FALSE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("AndTest %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "AndTest" Default 0 2 LParen +TRUE Default 0 2 LParen +TRUE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_props.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_props.returns tokens.verified.txt new file mode 100644 index 0000000..90f2a76 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_props.returns tokens.verified.txt @@ -0,0 +1,10 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "hello" Default 0 1 LParen +STRING ("world", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +PROP_PLUS "+Length" Default 0 1 LParen +SYMBOL "hello" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_seq-as-generic-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_seq-as-generic-0.returns tokens.verified.txt new file mode 100644 index 0000000..61ae00c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_seq-as-generic-0.returns tokens.verified.txt @@ -0,0 +1,109 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "SeqAsArg" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "items" Default 0 2 LParen +COLON Default 0 2 LParen +SEQ Default 0 2 LParen +OP_LESS Default 0 2 LParen +SYMBOL "^T" Default 0 2 LParen +OP_GREATER Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Seq.length" Default 0 2 LParen +SYMBOL "items" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "SeqAsArg" Default 0 2 LParen +PAREN_BAR Default 0 2 LParen +BAR_PAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "SeqAsArg" Default 0 2 LParen +PAREN_BAR Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +BAR_PAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "SeqAsArg" Default 0 2 LParen +PAREN_BAR Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +BAR_PAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "SeqAsArg" Default 0 2 LParen +BRACKET_BAR Default 0 2 LParen +BAR_BRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "SeqAsArg" Default 0 2 LParen +BRACKET_BAR Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +BAR_BRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "SeqAsArg" Default 0 2 LParen +BRACKET_BAR Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +BAR_BRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "SeqAsArg" Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "seq->" Default 0 3 LParen +LPAREN Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "SeqAsArg" Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "seq->" Default 0 3 LParen +LPAREN Default 0 4 LParen +YIELD false Default 0 4 LParen +INT32 (1, false) Default 0 4 LParen +RPAREN Default 0 3 LParen +LPAREN Default 0 4 LParen +YIELD false Default 0 4 LParen +INT32 (2, false) Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_span-to-int32-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_span-to-int32-0.returns tokens.verified.txt new file mode 100644 index 0000000..3dad336 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_span-to-int32-0.returns tokens.verified.txt @@ -0,0 +1,52 @@ +LPAREN Default 0 1 LParen +OPEN Default 0 1 LParen +SYMBOL "System" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "Test" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "text" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "string" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LET Default 0 2 LParen +SYMBOL "span1" Default 0 2 LParen +LPAREN Default 0 3 LParen +DOT_METHOD ".AsSpan" Default 0 3 LParen +SYMBOL "text" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "span->int32" Default 0 2 LParen +SYMBOL "span1" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Test" Default 0 2 LParen +STRING ("99", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Test" Default 0 2 LParen +STRING ("0", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Test" Default 0 2 LParen +STRING ("1", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-0.returns tokens.verified.txt new file mode 100644 index 0000000..03621a6 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-0.returns tokens.verified.txt @@ -0,0 +1,49 @@ +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("string is: '%s'", Regular, Token []) Default 0 1 LParen +STRING (" + this is + a multiline + string +", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("string is: '%s'", Regular, Token []) Default 0 1 LParen +STRING (" + this is + a multiline + string +", TripleQuote, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "generate-test" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "path" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LET Default 0 2 LParen +SYMBOL "template" Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "sprintf" Default 0 3 LParen +STRING (" +let ``can parse %s`` = + TestUtils.runTest %s + |> Async.AwaitTask + ", TripleQuote, Token []) Default 0 3 LParen +SYMBOL "path" Default 0 3 LParen +SYMBOL "path" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +SYMBOL "template" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("test is: '%s'", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "generate-test" Default 0 2 LParen +STRING ("hello", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-1.returns tokens.verified.txt new file mode 100644 index 0000000..e2ba099 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-1.returns tokens.verified.txt @@ -0,0 +1,182 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +STRING ("r:\rt:\tn:\na:\a\"", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("string is '%s'", Regular, Token []) Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("string is '%s'", Regular, Token []) Default 0 1 LParen +STRING ("r:\rt:\tn:\na:\a", TripleQuote, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("string is '%s'", Regular, Token []) Default 0 1 LParen +STRING ("r:\rt:\tn:\na:\a", TripleQuote, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("string is '%s'", Regular, Token []) Default 0 1 LParen +STRING (" + multiple lines are okay? +", TripleQuote, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DO_KW Default 0 1 LParen +LPAREN Default 0 2 LParen +DO_KW Default 0 2 LParen +LPAREN Default 0 3 LParen +DO_KW Default 0 3 LParen +LPAREN Default 0 4 LParen +SYMBOL "printfn" Default 0 4 LParen +STRING ("string is '%s'", Regular, Token []) Default 0 4 LParen +STRING (" + multiple lines are okay? + ", TripleQuote, Token []) Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "genTestHeader" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "moduleName" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +THREAD_LAST Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "sprintf" Default 0 3 LParen +STRING (" + // AUTO GENERATED + // DO NOT MODIFY BY HAND + + namespace %s + + open Xunit + + module %s + ", TripleQuote, Token []) Default 0 3 LParen +SYMBOL "moduleName" Default 0 3 LParen +SYMBOL "moduleName" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "lf" Default 0 1 LParen +SYMBOL "System.Environment.NewLine" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "genTestTemplate" Default 0 1 LParen +LPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "prefix" Default 0 3 LParen +COLON Default 0 3 LParen +SYMBOL "string" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "path" Default 0 3 LParen +COLON Default 0 3 LParen +SYMBOL "string" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LET Default 0 2 LParen +SYMBOL "path" Default 0 2 LParen +LPAREN Default 0 3 LParen +DOT_METHOD ".Replace" Default 0 3 LParen +SYMBOL "path" Default 0 3 LParen +STRING ("\\", Regular, Token []) Default 0 3 LParen +STRING ("/", Regular, Token []) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LET Default 0 2 LParen +SYMBOL "testname" Default 0 2 LParen +LPAREN Default 0 3 LParen +THREAD_LAST Default 0 3 LParen +SYMBOL "path" Default 0 3 LParen +HASH_PAREN Default 0 4 LParen +DOT_METHOD ".Replace" Default 0 4 LParen +SYMBOL "%1" Default 0 4 LParen +STRING ("/", Regular, Token []) Default 0 4 LParen +STRING ("_", Regular, Token []) Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +DO_KW Default 0 2 LParen +LPAREN Default 0 3 LParen +DO_KW Default 0 3 LParen +LPAREN Default 0 4 LParen +LET Default 0 4 LParen +SYMBOL "template" Default 0 4 LParen +LPAREN Default 0 5 LParen +SYMBOL "sprintf" Default 0 5 LParen +STRING (" + [] + let ``%s %s`` () = TestUtils.runTest "%s" + ", TripleQuote, Token []) Default 0 5 LParen +SYMBOL "prefix" Default 0 5 LParen +SYMBOL "testname" Default 0 5 LParen +SYMBOL "path" Default 0 5 LParen +RPAREN Default 0 4 LParen +RPAREN Default 0 3 LParen +LPAREN Default 0 4 LParen +LET Default 0 4 LParen +SYMBOL "template2" Default 0 4 LParen +STRING (" + [] + let ``interpolated {prefix} {testname}`` () = TestUtils.runTest "{path}" + ", InterpolatedTripleQuote 1, Token []) Default 0 4 LParen +RPAREN Default 0 3 LParen +LPAREN Default 0 4 LParen +LET Default 0 4 LParen +SYMBOL "template3" Default 0 4 LParen +STRING (" + [] + let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{path}} {path}" + ", InterpolatedTripleQuote 2, Token []) Default 0 4 LParen +RPAREN Default 0 3 LParen +LPAREN Default 0 4 LParen +LET Default 0 4 LParen +SYMBOL "template4" Default 0 4 LParen +STRING (" + [] + let ``interpolated {{prefix}} {{testname}}`` () = TestUtils.runTest "{{(+ 1 2 3)}} {{(+ 1 2 3)}} {(+ 1 2 3)}" + ", InterpolatedTripleQuote 2, Token []) Default 0 4 LParen +RPAREN Default 0 3 LParen +LPAREN Default 0 4 LParen +OP_PLUS Default 0 4 LParen +SYMBOL "template" Default 0 4 LParen +SYMBOL "lf" Default 0 4 LParen +SYMBOL "template2" Default 0 4 LParen +SYMBOL "lf" Default 0 4 LParen +SYMBOL "template3" Default 0 4 LParen +SYMBOL "lf" Default 0 4 LParen +SYMBOL "template4" Default 0 4 LParen +SYMBOL "lf" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +OP_PLUS Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "genTestHeader" Default 0 2 LParen +STRING ("Temp", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +SYMBOL "System.Environment.NewLine" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "genTestTemplate" Default 0 2 LParen +STRING ("example", Regular, Token []) Default 0 2 LParen +STRING ("example", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-interpolation-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-interpolation-0.returns tokens.verified.txt new file mode 100644 index 0000000..c7e982e --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-interpolation-0.returns tokens.verified.txt @@ -0,0 +1,26 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +STRING ("hello world", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("string is '%s'", Regular, Token []) Default 0 1 LParen +STRING ("interpolated: {value} {value.Length}", Interpolated 1, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("string is '%s'", Regular, Token []) Default 0 1 LParen +STRING ("interpolated: {value} {value.Length}", InterpolatedTripleQuote 1, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("string is '%s'", Regular, Token []) Default 0 1 LParen +STRING ("interpolated: {value} {{ value }} {{ value.Length }}", InterpolatedTripleQuote 2, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("string is '%s'", Regular, Token []) Default 0 1 LParen +STRING ("interpolated: {value} {{ value }} {{{ value }}} {{{ value.Length }}}", InterpolatedTripleQuote 3, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-interpolation-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-interpolation-1.returns tokens.verified.txt new file mode 100644 index 0000000..7f7ccae --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_strings-interpolation-1.returns tokens.verified.txt @@ -0,0 +1,11 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +STRING ("hello world", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("string is '%s'", Regular, Token []) Default 0 1 LParen +STRING ("interpolated: {value} {value} {value}", Interpolated 1, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_sym-with-arrow-in-macro-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_sym-with-arrow-in-macro-0.returns tokens.verified.txt new file mode 100644 index 0000000..3d2231c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_sym-with-arrow-in-macro-0.returns tokens.verified.txt @@ -0,0 +1,61 @@ +LPAREN Default 0 1 LParen +OPEN Default 0 1 LParen +SYMBOL "System" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYNTAX_MACRO TokenStream SyntaxMacroStart 1 1 LParen +SYMBOL "noop-macro-1" TokenStream Macro 1 1 LParen +LBRACKET TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "_" TokenStream Macro 3 2 LParen +SYMBOL "ids" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +LPAREN TokenStream Macro 3 2 LParen +SYMBOL "begin" TokenStream Macro 3 2 LParen +SYMBOL "ids" TokenStream Macro 3 2 LParen +SYMBOL "..." TokenStream Macro 3 2 LParen +RPAREN TokenStream Macro 2 1 LParen +RBRACKET TokenStream Macro 1 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +INLINE Default 0 1 LParen +SYMBOL "something->nothing" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "i" Default 0 2 LParen +RPAREN Default 0 1 LParen +SYMBOL "i" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +INLINE Default 0 1 LParen +SYMBOL "Test" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "i" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MACRO_NAME "noop-macro-1" TokenStream Macro 1 2 LParen +LPAREN TokenStream Macro 2 3 LParen +SYMBOL "something->nothing" TokenStream Macro 2 3 LParen +SYMBOL "i" TokenStream Macro 2 3 LParen +RPAREN TokenStream Macro 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Test" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Test" Default 0 2 LParen +STRING ("hello", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_tuple-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_tuple-0.returns tokens.verified.txt new file mode 100644 index 0000000..e044d53 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_parsing_tuple-0.returns tokens.verified.txt @@ -0,0 +1,31 @@ +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +BANG_TUPLE Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +BANG_TUPLE Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +BANG_TUPLE Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +INT32 (4, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_pats_fn-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_pats_fn-0.returns tokens.verified.txt new file mode 100644 index 0000000..4cf2f8a --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_pats_fn-0.returns tokens.verified.txt @@ -0,0 +1,191 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "no-type" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "s" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("no-type %A", Regular, Token []) Default 0 2 LParen +SYMBOL "s" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "no-type" Default 0 1 LParen +STRING ("hello", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "with-type" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "s" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "string" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("with-type %A", Regular, Token []) Default 0 2 LParen +SYMBOL "s" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "with-type" Default 0 1 LParen +STRING ("hello", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "with-type-multiple" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "s" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "string" Default 0 2 LParen +RBRACKET Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "b" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "int" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("with-type-multiple %A", Regular, Token []) Default 0 2 LParen +SYMBOL "s" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("with-type-multiple %A", Regular, Token []) Default 0 2 LParen +SYMBOL "b" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "with-type-multiple" Default 0 1 LParen +STRING ("hello", Regular, Token []) Default 0 1 LParen +INT32 (99, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "with-tuple" Default 0 1 LParen +LPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +COMMA Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("with-tuple %A", Regular, Token []) Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +DOT Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "with-tuple" Default 0 1 LParen +LPAREN Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +DOT Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "with-tuple-type" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +COMMA Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "int" Default 0 2 LParen +OP_MULT Default 0 2 LParen +SYMBOL "int" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("with-tuple-type %A", Regular, Token []) Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +DOT Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "with-tuple-type" Default 0 1 LParen +LPAREN Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +DOT Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "with-tuple-multiple" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +COMMA Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "int" Default 0 2 LParen +OP_MULT Default 0 2 LParen +SYMBOL "int" Default 0 2 LParen +RBRACKET Default 0 2 LParen +LBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x2" Default 0 3 LParen +COMMA Default 0 3 LParen +SYMBOL "y2" Default 0 3 LParen +RPAREN Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "int" Default 0 2 LParen +OP_MULT Default 0 2 LParen +SYMBOL "int" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("with-tuple-multiple %A", Regular, Token []) Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +DOT Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("with-tuple-multiple %A", Regular, Token []) Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x2" Default 0 3 LParen +DOT Default 0 3 LParen +SYMBOL "y2" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "with-tuple-multiple" Default 0 1 LParen +LPAREN Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +DOT Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +DOT Default 0 2 LParen +INT32 (4, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_pats_fn-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_pats_fn-1.returns tokens.verified.txt new file mode 100644 index 0000000..43c2153 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_pats_fn-1.returns tokens.verified.txt @@ -0,0 +1,49 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "WithPred" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "pred" Default 0 2 LParen +COLON Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "^T" Default 0 3 LParen +THREAD_FIRST Default 0 3 LParen +SYMBOL "bool" Default 0 3 LParen +RPAREN Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "t" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "pred" Default 0 2 LParen +SYMBOL "t" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("WithPred: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "WithPred" Default 0 2 LParen +HASH_PAREN Default 0 3 LParen +EQUALS Default 0 3 LParen +SYMBOL "%1" Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("WithPred: %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "WithPred" Default 0 2 LParen +HASH_PAREN Default 0 3 LParen +EQUALS Default 0 3 LParen +SYMBOL "%1" Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_pats_let-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_pats_let-0.returns tokens.verified.txt new file mode 100644 index 0000000..bfe51e6 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_pats_let-0.returns tokens.verified.txt @@ -0,0 +1,107 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "n" Default 0 1 LParen +COLON Default 0 1 LParen +SYMBOL "string" Default 0 1 LParen +RBRACKET Default 0 1 LParen +STRING ("hello", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("n is: %s", Regular, Token []) Default 0 1 LParen +SYMBOL "n" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +LBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "x" Default 0 2 LParen +COMMA Default 0 2 LParen +SYMBOL "y" Default 0 2 LParen +RPAREN Default 0 1 LParen +COLON Default 0 1 LParen +SYMBOL "int" Default 0 1 LParen +OP_MULT Default 0 1 LParen +SYMBOL "int" Default 0 1 LParen +RBRACKET Default 0 1 LParen +LPAREN Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +COMMA Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("x is: %i", Regular, Token []) Default 0 1 LParen +SYMBOL "x" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("y is: %i", Regular, Token []) Default 0 1 LParen +SYMBOL "y" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "x2" Default 0 2 LParen +COMMA Default 0 2 LParen +SYMBOL "y2" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +COMMA Default 0 2 LParen +INT32 (4, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("x2 is: %i", Regular, Token []) Default 0 1 LParen +SYMBOL "x2" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("y2 is: %i", Regular, Token []) Default 0 1 LParen +SYMBOL "y2" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "x3" Default 0 2 LParen +COMMA Default 0 2 LParen +SYMBOL "_" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +INT32 (5, false) Default 0 2 LParen +COMMA Default 0 2 LParen +INT32 (6, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("x3 is: %i", Regular, Token []) Default 0 1 LParen +SYMBOL "x3" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "x4" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "int" Default 0 2 LParen +RBRACKET Default 0 2 LParen +COMMA Default 0 2 LParen +SYMBOL "_" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +INT32 (7, false) Default 0 2 LParen +COMMA Default 0 2 LParen +INT32 (8, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("x4 is: %i", Regular, Token []) Default 0 1 LParen +SYMBOL "x4" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_quotation_quote-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_quotation_quote-0.returns tokens.verified.txt new file mode 100644 index 0000000..509f4ad --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_quotation_quote-0.returns tokens.verified.txt @@ -0,0 +1,101 @@ +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "items" Default 0 1 LParen +QUOTE_SYM TokenStream QuoteSym 0 1 LParen +LPAREN TokenStream QuoteSym 1 2 LParen +INT32 (1, false) TokenStream QuoteSym 1 2 LParen +INT32 (2, false) TokenStream QuoteSym 1 2 LParen +INT32 (3, false) TokenStream QuoteSym 1 2 LParen +INT32 (4, false) TokenStream QuoteSym 1 2 LParen +INT32 (5, false) TokenStream QuoteSym 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "sym" Default 0 1 LParen +QUOTE_SYM TokenStream QuoteSym 0 1 LParen +SYMBOL "symbol" TokenStream QuoteSym 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "something" Default 0 1 LParen +QUOTE_SYM TokenStream QuoteSym 0 1 LParen +LPAREN TokenStream QuoteSym 1 2 LParen +SYMBOL "fn" TokenStream QuoteSym 1 2 LParen +LBRACKET TokenStream QuoteSym 2 2 LParen +SYMBOL "a" TokenStream QuoteSym 2 2 LParen +RBRACKET TokenStream QuoteSym 1 2 LParen +LPAREN TokenStream QuoteSym 2 3 LParen +SYMBOL "+" TokenStream QuoteSym 2 3 LParen +SYMBOL "a" TokenStream QuoteSym 2 3 LParen +SYMBOL "b" TokenStream QuoteSym 2 3 LParen +INT32 (1, false) TokenStream QuoteSym 2 3 LParen +LPAREN TokenStream QuoteSym 3 4 LParen +SYMBOL "call" TokenStream QuoteSym 3 4 LParen +SYMBOL "+" TokenStream QuoteSym 3 4 LParen +INT32 (1, false) TokenStream QuoteSym 3 4 LParen +INT32 (2, false) TokenStream QuoteSym 3 4 LParen +RPAREN TokenStream QuoteSym 2 3 LParen +RPAREN TokenStream QuoteSym 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("items: %O", Regular, Token []) Default 0 1 LParen +SYMBOL "items" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("sym: %O", Regular, Token []) Default 0 1 LParen +SYMBOL "sym" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("something: %O", Regular, Token []) Default 0 1 LParen +SYMBOL "something" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("nested: %O", Regular, Token []) Default 0 1 LParen +QUOTE_SYM TokenStream QuoteSym 0 1 LParen +LPAREN TokenStream QuoteSym 1 2 LParen +SYMBOL "nested1" TokenStream QuoteSym 1 2 LParen +LPAREN TokenStream QuoteSym 2 3 LParen +SYMBOL "nested2" TokenStream QuoteSym 2 3 LParen +LPAREN TokenStream QuoteSym 3 4 LParen +SYMBOL "nested3" TokenStream QuoteSym 3 4 LParen +LPAREN TokenStream QuoteSym 4 5 LParen +SYMBOL "nested4" TokenStream QuoteSym 4 5 LParen +SYMBOL "and" TokenStream QuoteSym 4 5 LParen +SYMBOL "on" TokenStream QuoteSym 4 5 LParen +SYMBOL "and" TokenStream QuoteSym 4 5 LParen +SYMBOL "on" TokenStream QuoteSym 4 5 LParen +KEYWORD ":keyword" TokenStream QuoteSym 4 5 LParen +RPAREN TokenStream QuoteSym 3 4 LParen +RPAREN TokenStream QuoteSym 2 3 LParen +RPAREN TokenStream QuoteSym 1 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("nested vec: %O", Regular, Token []) Default 0 1 LParen +QUOTE_SYM TokenStream QuoteSym 0 1 LParen +LBRACKET TokenStream QuoteSym 1 1 LParen +SYMBOL "nested1" TokenStream QuoteSym 1 1 LParen +LPAREN TokenStream QuoteSym 2 2 LParen +SYMBOL "nested2" TokenStream QuoteSym 2 2 LParen +LBRACKET TokenStream QuoteSym 3 2 LParen +SYMBOL "nested3" TokenStream QuoteSym 3 2 LParen +LPAREN TokenStream QuoteSym 4 3 LParen +SYMBOL "nested4" TokenStream QuoteSym 4 3 LParen +SYMBOL "and" TokenStream QuoteSym 4 3 LParen +SYMBOL "on" TokenStream QuoteSym 4 3 LParen +SYMBOL "and" TokenStream QuoteSym 4 3 LParen +SYMBOL "on" TokenStream QuoteSym 4 3 LParen +KEYWORD ":keyword" TokenStream QuoteSym 4 3 LParen +RPAREN TokenStream QuoteSym 3 2 LParen +RBRACKET TokenStream QuoteSym 2 2 LParen +RPAREN TokenStream QuoteSym 1 1 LParen +RBRACKET Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_custom-comparison-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_custom-comparison-0.returns tokens.verified.txt new file mode 100644 index 0000000..096ac28 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_custom-comparison-0.returns tokens.verified.txt @@ -0,0 +1,297 @@ +LPAREN Default 0 1 LParen +OPEN Default 0 1 LParen +SYMBOL "System" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +HASH_BRACKET Default 0 1 LParen +SYMBOL "CustomEquality" Default 0 1 LParen +BAR Default 0 1 LParen +SYMBOL "CustomComparison" Default 0 1 LParen +BAR Default 0 1 LParen +SYMBOL "RequireQualifiedAccess" Default 0 1 LParen +RBRACKET Default 0 1 LParen +UNION Default 0 1 Type +SYMBOL "MyCustomValue" Default 0 1 Type +SYMBOL "Nil" Default 0 1 Type +LBRACKET Default 0 1 Type +SYMBOL "String" Default 0 1 Type +SYMBOL "string" Default 0 1 Type +RBRACKET Default 0 1 Type +LPAREN Default 0 2 Type +OVERRIDE Default 0 2 Type +FN Default 0 2 Type +SYMBOL "t.GetHashCode" Default 0 2 Type +LPAREN Default 0 3 Type +RPAREN Default 0 2 Type +LPAREN Default 0 3 Type +MATCH Default 0 3 Type +SYMBOL "t" Default 0 3 Type +LBRACKET Default 0 3 Type +SYMBOL "Nil" Default 0 3 Type +INT32 (919321, false) Default 0 3 Type +RBRACKET Default 0 3 Type +LBRACKET Default 0 3 Type +LPAREN Default 0 4 Type +SYMBOL "String" Default 0 4 Type +SYMBOL "s" Default 0 4 Type +RPAREN Default 0 3 Type +LPAREN Default 0 4 Type +SYMBOL "System.HashCode.Combine" Default 0 4 Type +LPAREN Default 0 5 Type +STRING ("string", Regular, Token []) Default 0 5 Type +COMMA Default 0 5 Type +SYMBOL "s" Default 0 5 Type +RPAREN Default 0 4 Type +RPAREN Default 0 3 Type +RBRACKET Default 0 3 Type +RPAREN Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +OVERRIDE Default 0 2 Type +FN Default 0 2 Type +SYMBOL "t.Equals" Default 0 2 Type +LPAREN Default 0 3 Type +SYMBOL "other" Default 0 3 Type +RPAREN Default 0 2 Type +LPAREN Default 0 3 Type +MATCH Default 0 3 Type +SYMBOL "other" Default 0 3 Type +LBRACKET Default 0 3 Type +LPAREN Default 0 4 Type +COLON_QMARK Default 0 4 Type +SYMBOL "MyCustomValue" Default 0 4 Type +SYMBOL "v" Default 0 4 Type +RPAREN Default 0 3 Type +LPAREN Default 0 4 Type +DOT_METHOD ".Equals" Default 0 4 Type +LPAREN Default 0 5 Type +COLON_GREATER Default 0 5 Type +SYMBOL "t" Default 0 5 Type +SYMBOL "IEquatable" Default 0 5 Type +OP_LESS Default 0 5 Type +SYMBOL "_" Default 0 5 Type +OP_GREATER Default 0 5 Type +RPAREN Default 0 4 Type +SYMBOL "v" Default 0 4 Type +RPAREN Default 0 3 Type +RBRACKET Default 0 3 Type +LBRACKET Default 0 3 Type +SYMBOL "_" Default 0 3 Type +FALSE Default 0 3 Type +RBRACKET Default 0 3 Type +RPAREN Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +INTERFACE Default 0 2 Type +SYMBOL "IEquatable" Default 0 2 Type +OP_LESS Default 0 2 Type +SYMBOL "MyCustomValue" Default 0 2 Type +OP_GREATER Default 0 2 Type +LPAREN Default 0 3 Type +MEMBER Default 0 3 Member +FN Default 0 3 Member +SYMBOL "t.Equals" Default 0 3 Member +LPAREN Default 0 4 Member +SYMBOL "other" Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +MATCH Default 0 4 Member +LPAREN Default 0 5 Member +SYMBOL "t" Default 0 5 Member +COMMA Default 0 5 Member +SYMBOL "other" Default 0 5 Member +RPAREN Default 0 4 Member +LBRACKET Default 0 4 Member +LPAREN Default 0 5 Member +SYMBOL "Nil" Default 0 5 Member +DOT Default 0 5 Member +SYMBOL "Nil" Default 0 5 Member +RPAREN Default 0 4 Member +TRUE Default 0 4 Member +RBRACKET Default 0 4 Member +LBRACKET Default 0 4 Member +LPAREN Default 0 5 Member +LPAREN Default 0 6 Member +SYMBOL "String" Default 0 6 Member +SYMBOL "lhs" Default 0 6 Member +RPAREN Default 0 5 Member +DOT Default 0 5 Member +LPAREN Default 0 6 Member +SYMBOL "String" Default 0 6 Member +SYMBOL "rhs" Default 0 6 Member +RPAREN Default 0 5 Member +RPAREN Default 0 4 Member +LPAREN Default 0 5 Member +EQUALS Default 0 5 Member +SYMBOL "lhs" Default 0 5 Member +SYMBOL "rhs" Default 0 5 Member +RPAREN Default 0 4 Member +RBRACKET Default 0 4 Member +LBRACKET Default 0 4 Member +LPAREN Default 0 5 Member +SYMBOL "_" Default 0 5 Member +DOT Default 0 5 Member +SYMBOL "_" Default 0 5 Member +RPAREN Default 0 4 Member +FALSE Default 0 4 Member +RBRACKET Default 0 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +INTERFACE Default 0 2 Type +SYMBOL "IComparable" Default 0 2 Type +LPAREN Default 0 3 Type +MEMBER Default 0 3 Member +FN Default 0 3 Member +SYMBOL "t.CompareTo" Default 0 3 Member +LPAREN Default 0 4 Member +SYMBOL "other" Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +MATCH Default 0 4 Member +SYMBOL "other" Default 0 4 Member +LBRACKET Default 0 4 Member +LPAREN Default 0 5 Member +COLON_QMARK Default 0 5 Member +SYMBOL "MyCustomValue" Default 0 5 Member +SYMBOL "v" Default 0 5 Member +RPAREN Default 0 4 Member +LPAREN Default 0 5 Member +DOT_METHOD ".CompareTo" Default 0 5 Member +LPAREN Default 0 6 Member +COLON_GREATER Default 0 6 Member +SYMBOL "t" Default 0 6 Member +SYMBOL "IComparable" Default 0 6 Member +OP_LESS Default 0 6 Member +SYMBOL "_" Default 0 6 Member +OP_GREATER Default 0 6 Member +RPAREN Default 0 5 Member +SYMBOL "v" Default 0 5 Member +RPAREN Default 0 4 Member +RBRACKET Default 0 4 Member +LBRACKET Default 0 4 Member +SYMBOL "null" Default 0 4 Member +INT32 (1, false) Default 0 4 Member +RBRACKET Default 0 4 Member +LBRACKET Default 0 4 Member +SYMBOL "_" Default 0 4 Member +INT32 (-1, false) Default 0 4 Member +RBRACKET Default 0 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +INTERFACE Default 0 2 Type +SYMBOL "IComparable" Default 0 2 Type +OP_LESS Default 0 2 Type +SYMBOL "MyCustomValue" Default 0 2 Type +OP_GREATER Default 0 2 Type +LPAREN Default 0 3 Type +MEMBER Default 0 3 Member +FN Default 0 3 Member +SYMBOL "t.CompareTo" Default 0 3 Member +LPAREN Default 0 4 Member +SYMBOL "other" Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +MATCH Default 0 4 Member +LPAREN Default 0 5 Member +SYMBOL "t" Default 0 5 Member +COMMA Default 0 5 Member +SYMBOL "other" Default 0 5 Member +RPAREN Default 0 4 Member +LBRACKET Default 0 4 Member +LPAREN Default 0 5 Member +SYMBOL "Nil" Default 0 5 Member +COMMA Default 0 5 Member +SYMBOL "Nil" Default 0 5 Member +RPAREN Default 0 4 Member +INT32 (0, false) Default 0 4 Member +RBRACKET Default 0 4 Member +LBRACKET Default 0 4 Member +LPAREN Default 0 5 Member +SYMBOL "Nil" Default 0 5 Member +COMMA Default 0 5 Member +LPAREN Default 0 6 Member +SYMBOL "String" Default 0 6 Member +SYMBOL "_" Default 0 6 Member +RPAREN Default 0 5 Member +RPAREN Default 0 4 Member +INT32 (-1, false) Default 0 4 Member +RBRACKET Default 0 4 Member +LBRACKET Default 0 4 Member +LPAREN Default 0 5 Member +LPAREN Default 0 6 Member +SYMBOL "String" Default 0 6 Member +SYMBOL "_" Default 0 6 Member +RPAREN Default 0 5 Member +COMMA Default 0 5 Member +SYMBOL "Nil" Default 0 5 Member +RPAREN Default 0 4 Member +INT32 (1, false) Default 0 4 Member +RBRACKET Default 0 4 Member +LBRACKET Default 0 4 Member +LPAREN Default 0 5 Member +LPAREN Default 0 6 Member +SYMBOL "String" Default 0 6 Member +SYMBOL "lhs" Default 0 6 Member +RPAREN Default 0 5 Member +COMMA Default 0 5 Member +LPAREN Default 0 6 Member +SYMBOL "String" Default 0 6 Member +SYMBOL "rhs" Default 0 6 Member +RPAREN Default 0 5 Member +RPAREN Default 0 4 Member +LPAREN Default 0 5 Member +DOT_METHOD ".CompareTo" Default 0 5 Member +SYMBOL "lhs" Default 0 5 Member +SYMBOL "rhs" Default 0 5 Member +RPAREN Default 0 4 Member +RBRACKET Default 0 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Type +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Nil < String %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_LESS Default 0 2 LParen +SYMBOL "MyCustomValue.Nil" Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "MyCustomValue.String" Default 0 3 LParen +STRING ("hello", Regular, Token []) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Nil > String %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_GREATER Default 0 2 LParen +SYMBOL "MyCustomValue.Nil" Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "MyCustomValue.String" Default 0 3 LParen +STRING ("hello", Regular, Token []) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("String = String %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +EQUALS Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "MyCustomValue.String" Default 0 3 LParen +STRING ("hello", Regular, Token []) Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "MyCustomValue.String" Default 0 3 LParen +STRING ("hello", Regular, Token []) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_member-fn-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_member-fn-0.returns tokens.verified.txt new file mode 100644 index 0000000..227f951 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_member-fn-0.returns tokens.verified.txt @@ -0,0 +1,77 @@ +LPAREN Default 0 1 LParen +OPEN Default 0 1 LParen +SYMBOL "System.Collections.Generic" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +TYPE Default 0 1 Type +SYMBOL "Mapping" Default 0 1 Type +LPAREN Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +LET Default 0 2 Type +SYMBOL "src_to_dest" Default 0 2 Type +LPAREN Default 0 3 Type +NEW Default 0 3 Type +SYMBOL "Dictionary" Default 0 3 Type +OP_LESS Default 0 3 Type +SYMBOL "int" Default 0 3 Type +COMMA Default 0 3 Type +SYMBOL "int" Default 0 3 Type +OP_GREATER Default 0 3 Type +RPAREN Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +FN Default 0 2 Member +SYMBOL "_.AddRange" Default 0 2 Member +LPAREN Default 0 3 Member +SYMBOL "dest" Default 0 3 Member +SYMBOL "src" Default 0 3 Member +SYMBOL "len" Default 0 3 Member +RPAREN Default 0 2 Member +LPAREN Default 0 3 Member +FOR_IN Default 0 3 Member +LBRACKET Default 0 3 Member +SYMBOL "src_range" Default 0 3 Member +LPAREN Default 0 4 Member +BANG_RANGE Default 0 4 Member +SYMBOL "src" Default 0 4 Member +DOTDOT Default 0 4 Member +LPAREN Default 0 5 Member +OP_PLUS Default 0 5 Member +SYMBOL "src" Default 0 5 Member +LPAREN Default 0 6 Member +SYMBOL "dec" Default 0 6 Member +SYMBOL "len" Default 0 6 Member +RPAREN Default 0 5 Member +RPAREN Default 0 4 Member +RPAREN Default 0 3 Member +RBRACKET Default 0 3 Member +LPAREN Default 0 4 Member +SYMBOL "printfn" Default 0 4 Member +STRING ("src %i", Regular, Token []) Default 0 4 Member +SYMBOL "src_range" Default 0 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Member +LPAREN Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "mapping" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "Mapping" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +APPLY_METHOD "-AddRange" Default 0 1 LParen +SYMBOL "mapping" Default 0 1 LParen +INT32 (0, false) Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +INT32 (5, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_member-get-set-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_member-get-set-0.returns tokens.verified.txt new file mode 100644 index 0000000..68a40d2 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_member-get-set-0.returns tokens.verified.txt @@ -0,0 +1,251 @@ +LPAREN Default 0 1 LParen +TYPE Default 0 1 Type +SYMBOL "GetOnly" Default 0 1 Type +OP_LESS Default 0 1 Type +SYMBOL "^T" Default 0 1 Type +OP_GREATER Default 0 1 Type +LPAREN Default 0 2 Type +LBRACKET Default 0 2 Type +SYMBOL "items" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "array" Default 0 2 Type +OP_LESS Default 0 2 Type +SYMBOL "^T" Default 0 2 Type +OP_GREATER Default 0 2 Type +RBRACKET Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +LET Default 0 2 Type +SYMBOL "items" Default 0 2 Type +SYMBOL "items" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +SYMBOL "_.Item" Default 0 2 Member +LPAREN Default 0 3 Member +MEMBER_GET Default 0 3 Member +LPAREN Default 0 4 Member +LBRACKET Default 0 4 Member +SYMBOL "i" Default 0 4 Member +COLON Default 0 4 Member +SYMBOL "int" Default 0 4 Member +RBRACKET Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +DOT_BRACKET Default 0 4 Member +SYMBOL "i" Default 0 4 Member +RBRACKET Default 0 4 Member +SYMBOL "items" Default 0 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +TYPE Default 0 1 Type +SYMBOL "SetOnly" Default 0 1 Type +OP_LESS Default 0 1 Type +SYMBOL "^T" Default 0 1 Type +OP_GREATER Default 0 1 Type +LPAREN Default 0 2 Type +LBRACKET Default 0 2 Type +SYMBOL "items" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "array" Default 0 2 Type +OP_LESS Default 0 2 Type +SYMBOL "^T" Default 0 2 Type +OP_GREATER Default 0 2 Type +RBRACKET Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +LET Default 0 2 Type +SYMBOL "items" Default 0 2 Type +SYMBOL "items" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +SYMBOL "_.Item" Default 0 2 Member +LPAREN Default 0 3 Member +MEMBER_SET Default 0 3 Member +LPAREN Default 0 4 Member +LBRACKET Default 0 4 Member +SYMBOL "i" Default 0 4 Member +COLON Default 0 4 Member +SYMBOL "int" Default 0 4 Member +RBRACKET Default 0 4 Member +RPAREN Default 0 3 Member +SYMBOL "v" Default 0 3 Member +LPAREN Default 0 4 Member +SET Default 0 4 Member +LPAREN Default 0 5 Member +DOT_BRACKET Default 0 5 Member +SYMBOL "i" Default 0 5 Member +RBRACKET Default 0 5 Member +SYMBOL "items" Default 0 5 Member +RPAREN Default 0 4 Member +SYMBOL "v" Default 0 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +TYPE Default 0 1 Type +SYMBOL "GetAndSet" Default 0 1 Type +OP_LESS Default 0 1 Type +SYMBOL "^T" Default 0 1 Type +OP_GREATER Default 0 1 Type +LPAREN Default 0 2 Type +LBRACKET Default 0 2 Type +SYMBOL "items" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "array" Default 0 2 Type +OP_LESS Default 0 2 Type +SYMBOL "^T" Default 0 2 Type +OP_GREATER Default 0 2 Type +RBRACKET Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +LET Default 0 2 Type +SYMBOL "items" Default 0 2 Type +SYMBOL "items" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +SYMBOL "_.Item" Default 0 2 Member +LPAREN Default 0 3 Member +MEMBER_GET Default 0 3 Member +LPAREN Default 0 4 Member +LBRACKET Default 0 4 Member +SYMBOL "i" Default 0 4 Member +COLON Default 0 4 Member +SYMBOL "int" Default 0 4 Member +RBRACKET Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +DOT_BRACKET Default 0 4 Member +SYMBOL "i" Default 0 4 Member +RBRACKET Default 0 4 Member +SYMBOL "items" Default 0 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Member +LPAREN Default 0 3 Member +MEMBER_SET Default 0 3 Member +LPAREN Default 0 4 Member +LBRACKET Default 0 4 Member +SYMBOL "i" Default 0 4 Member +COLON Default 0 4 Member +SYMBOL "int" Default 0 4 Member +RBRACKET Default 0 4 Member +RPAREN Default 0 3 Member +SYMBOL "v" Default 0 3 Member +LPAREN Default 0 4 Member +SET Default 0 4 Member +LPAREN Default 0 5 Member +DOT_BRACKET Default 0 5 Member +SYMBOL "i" Default 0 5 Member +RBRACKET Default 0 5 Member +SYMBOL "items" Default 0 5 Member +RPAREN Default 0 4 Member +SYMBOL "v" Default 0 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "array" Default 0 1 LParen +LPAREN Default 0 2 LParen +BANG_ARRAY Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +INT32 (4, false) Default 0 2 LParen +INT32 (5, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "getOnly" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "GetOnly" Default 0 2 LParen +OP_LESS Default 0 2 LParen +SYMBOL "_" Default 0 2 LParen +OP_GREATER Default 0 2 LParen +SYMBOL "array" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "setOnly" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "SetOnly" Default 0 2 LParen +OP_LESS Default 0 2 LParen +SYMBOL "_" Default 0 2 LParen +OP_GREATER Default 0 2 LParen +SYMBOL "array" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "getAndSet" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "GetAndSet" Default 0 2 LParen +OP_LESS Default 0 2 LParen +SYMBOL "_" Default 0 2 LParen +OP_GREATER Default 0 2 LParen +SYMBOL "array" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "getOnly" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SET Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "setOnly" Default 0 2 LParen +RPAREN Default 0 1 LParen +INT32 (99, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +SYMBOL "array" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SET Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "getAndSet" Default 0 2 LParen +RPAREN Default 0 1 LParen +INT32 (99, false) Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "getAndSet" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +SYMBOL "array" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-0.returns tokens.verified.txt new file mode 100644 index 0000000..155cff8 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-0.returns tokens.verified.txt @@ -0,0 +1,86 @@ +LPAREN Default 0 1 LParen +RECORD Default 0 1 Type +SYMBOL "Mapping" Default 0 1 Type +LPAREN Default 0 2 Type +SYMBOL "src" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "int64" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +SYMBOL "dest" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "int64" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +SYMBOL "range" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "int64" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +FN Default 0 2 Member +SYMBOL "this.Stuff" Default 0 2 Member +LPAREN Default 0 3 Member +RPAREN Default 0 2 Member +LPAREN Default 0 3 Member +SYMBOL "printfn" Default 0 3 Member +STRING ("doing stuff %A", Regular, Token []) Default 0 3 Member +LPAREN Default 0 4 Member +PROP_PLUS "+src" Default 0 4 Member +SYMBOL "this" Default 0 4 Member +RPAREN Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "temp" Default 0 1 LParen +LPAREN Default 0 2 LParen +RINIT Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "src" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "Mapping.dest" Default 0 2 LParen +INT32 (2, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "range" Default 0 2 LParen +INT32 (3, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Record is %A", Regular, Token []) Default 0 1 LParen +SYMBOL "temp" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DOT_METHOD ".Stuff" Default 0 1 LParen +SYMBOL "temp" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "temp2" Default 0 1 LParen +BRACE_BAR Default 0 1 LParen +SYMBOL "src" Default 0 1 LParen +INT32 (3, false) Default 0 1 LParen +SYMBOL "Mapping.dest" Default 0 1 LParen +INT32 (5, false) Default 0 1 LParen +SYMBOL "range" Default 0 1 LParen +INT32 (8, false) Default 0 1 LParen +BAR_BRACE Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Record is %A", Regular, Token []) Default 0 1 LParen +SYMBOL "temp2" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DOT_METHOD ".Stuff" Default 0 1 LParen +SYMBOL "temp2" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-1.returns tokens.verified.txt new file mode 100644 index 0000000..ca36133 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-1.returns tokens.verified.txt @@ -0,0 +1,211 @@ +LPAREN Default 0 1 LParen +UNION Default 0 1 Type +SYMBOL "Dir" Default 0 1 Type +SYMBOL "Up" Default 0 1 Type +SYMBOL "Left" Default 0 1 Type +SYMBOL "Down" Default 0 1 Type +SYMBOL "Right" Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +TYPEALIAS Default 0 1 LParen +SYMBOL "Pos" Default 0 1 LParen +SYMBOL "int" Default 0 1 LParen +OP_MULT Default 0 1 LParen +SYMBOL "int" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +RECORD Default 0 1 Type +SYMBOL "Node" Default 0 1 Type +LBRACKET Default 0 1 Type +SYMBOL "pos" Default 0 1 Type +COLON Default 0 1 Type +SYMBOL "Pos" Default 0 1 Type +RBRACKET Default 0 1 Type +LBRACKET Default 0 1 Type +SYMBOL "dir" Default 0 1 Type +COLON Default 0 1 Type +SYMBOL "Dir" Default 0 1 Type +RBRACKET Default 0 1 Type +LBRACKET Default 0 1 Type +SYMBOL "steps" Default 0 1 Type +COLON Default 0 1 Type +SYMBOL "int" Default 0 1 Type +RBRACKET Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +INLINE Default 0 1 LParen +SYMBOL "LeftOf" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +COMMA Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "Pos" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "dec" Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +RPAREN Default 0 2 LParen +COMMA Default 0 2 LParen +SYMBOL "y" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +INLINE Default 0 1 LParen +SYMBOL "RightOf" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +COMMA Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "Pos" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "inc" Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +RPAREN Default 0 2 LParen +COMMA Default 0 2 LParen +SYMBOL "y" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +INLINE Default 0 1 LParen +SYMBOL "UpOf" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +COMMA Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "Pos" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "x" Default 0 2 LParen +COMMA Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "dec" Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +INLINE Default 0 1 LParen +SYMBOL "DownOf" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "x" Default 0 3 LParen +COMMA Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "Pos" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "x" Default 0 2 LParen +COMMA Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "inc" Default 0 3 LParen +SYMBOL "y" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +INLINE Default 0 1 LParen +SYMBOL "GetDirFun" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "d" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "Dir" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MATCH Default 0 2 Match +SYMBOL "d" Default 0 2 Match +LBRACKET Default 0 2 Match +SYMBOL "Up" Default 0 2 Match +SYMBOL "UpOf" Default 0 2 Match +RBRACKET Default 0 2 Match +LBRACKET Default 0 2 Match +SYMBOL "Down" Default 0 2 Match +SYMBOL "DownOf" Default 0 2 Match +RBRACKET Default 0 2 Match +LBRACKET Default 0 2 Match +SYMBOL "Left" Default 0 2 Match +SYMBOL "LeftOf" Default 0 2 Match +RBRACKET Default 0 2 Match +LBRACKET Default 0 2 Match +SYMBOL "Right" Default 0 2 Match +SYMBOL "RightOf" Default 0 2 Match +RBRACKET Default 0 2 Match +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "MoveNode" Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "v" Default 0 1 LParen +SYMBOL "dir" Default 0 1 LParen +RBRACKET Default 0 1 LParen +BRACE_BAR Default 0 1 LParen +SYMBOL "dir" Default 0 1 LParen +SYMBOL "dir" Default 0 1 LParen +SYMBOL "pos" Default 0 1 LParen +LPAREN Default 0 2 LParen +THREAD_LAST Default 0 2 LParen +LPAREN Default 0 3 LParen +PROP_PLUS "+pos" Default 0 3 LParen +SYMBOL "v" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "GetDirFun" Default 0 3 LParen +SYMBOL "dir" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +SYMBOL "steps" Default 0 1 LParen +LPAREN Default 0 2 LParen +IF_KW Default 0 2 LParen +LPAREN Default 0 3 LParen +EQUALS Default 0 3 LParen +SYMBOL "dir" Default 0 3 LParen +LPAREN Default 0 4 LParen +PROP_PLUS "+dir" Default 0 4 LParen +SYMBOL "v" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "inc" Default 0 3 LParen +LPAREN Default 0 4 LParen +PROP_PLUS "+steps" Default 0 4 LParen +SYMBOL "v" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +BAR_BRACE Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("OK", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-2.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-2.returns tokens.verified.txt new file mode 100644 index 0000000..d375bce --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-2.returns tokens.verified.txt @@ -0,0 +1,87 @@ +LPAREN Default 0 1 LParen +RECORD Default 0 1 Type +SYMBOL "Mapping" Default 0 1 Type +LPAREN Default 0 2 Type +SYMBOL "src" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "int64" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +SYMBOL "dest" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "int64" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +SYMBOL "range" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "int64" Default 0 2 Type +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "initial" Default 0 1 LParen +BRACE_BAR Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "src" Default 0 1 LParen +INT32 (3, false) Default 0 1 LParen +RBRACKET Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "Mapping.dest" Default 0 1 LParen +INT32 (5, false) Default 0 1 LParen +RBRACKET Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "range" Default 0 1 LParen +INT32 (8, false) Default 0 1 LParen +RBRACKET Default 0 1 LParen +BAR_BRACE Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("initial is %A", Regular, Token []) Default 0 1 LParen +SYMBOL "initial" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "updated1" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "with" Default 0 2 LParen +SYMBOL "initial" Default 0 2 LParen +BRACE_BAR Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "src" Default 0 2 LParen +INT32 (5, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +BAR_BRACE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("updated1 is %A", Regular, Token []) Default 0 1 LParen +SYMBOL "updated1" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "updated2" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "with" Default 0 2 LParen +SYMBOL "initial" Default 0 2 LParen +BRACE_BAR Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "src" Default 0 2 LParen +INT32 (99, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "Mapping.dest" Default 0 2 LParen +INT32 (12, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +BAR_BRACE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("updated2 is %A", Regular, Token []) Default 0 1 LParen +SYMBOL "updated2" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-3.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-3.returns tokens.verified.txt new file mode 100644 index 0000000..89b7b93 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-3.returns tokens.verified.txt @@ -0,0 +1,78 @@ +LPAREN Default 0 1 LParen +RECORD Default 0 1 Type +SYMBOL "TestRec" Default 0 1 Type +LBRACKET Default 0 1 Type +SYMBOL "value" Default 0 1 Type +COLON Default 0 1 Type +SYMBOL "int" Default 0 1 Type +RBRACKET Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "SomeFun" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "r" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "TestRec" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MUT Default 0 2 LParen +SYMBOL "counter" Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MUT Default 0 2 LParen +SYMBOL "value" Default 0 2 LParen +SYMBOL "r" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +WHILE Default 0 2 LParen +LPAREN Default 0 3 LParen +OP_LESS Default 0 3 LParen +SYMBOL "counter" Default 0 3 LParen +INT32 (10, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SET Default 0 3 LParen +SYMBOL "value" Default 0 3 LParen +LPAREN Default 0 4 LParen +SYMBOL "with" Default 0 4 LParen +SYMBOL "value" Default 0 4 LParen +BRACE_BAR Default 0 4 LParen +LBRACKET Default 0 4 LParen +SYMBOL "value" Default 0 4 LParen +LPAREN Default 0 5 LParen +SYMBOL "inc" Default 0 5 LParen +LPAREN Default 0 6 LParen +PROP_PLUS "+value" Default 0 6 LParen +SYMBOL "value" Default 0 6 LParen +RPAREN Default 0 5 LParen +RPAREN Default 0 4 LParen +RBRACKET Default 0 4 LParen +BAR_BRACE Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +MACRO_NAME "up!" TokenStream Macro 1 3 LParen +SYMBOL "counter" TokenStream Macro 1 3 LParen +SYMBOL "inc" TokenStream Macro 1 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "SomeFun" Default 0 2 LParen +BRACE_BAR Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "value" Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +BAR_BRACE Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-4.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-4.returns tokens.verified.txt new file mode 100644 index 0000000..2fcaa7c --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_record-4.returns tokens.verified.txt @@ -0,0 +1,59 @@ +LPAREN Default 0 1 LParen +HASH_BRACKET Default 0 1 LParen +SYMBOL "StructuredFormatDisplay" Default 0 1 LParen +LPAREN Default 0 2 LParen +STRING ("{Structuredtext}", Regular, Token []) Default 0 2 LParen +RPAREN Default 0 1 LParen +RBRACKET Default 0 1 LParen +RECORD Default 0 1 Type +SYMBOL "TestRec" Default 0 1 Type +LBRACKET Default 0 1 Type +SYMBOL "value" Default 0 1 Type +COLON Default 0 1 Type +SYMBOL "int" Default 0 1 Type +RBRACKET Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +SYMBOL "t.Structuredtext" Default 0 2 Member +LPAREN Default 0 3 Member +DOT_METHOD ".ToString" Default 0 3 Member +SYMBOL "t" Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +OVERRIDE Default 0 2 Type +FN Default 0 2 Type +SYMBOL "t.ToString" Default 0 2 Type +LPAREN Default 0 3 Type +RPAREN Default 0 2 Type +LPAREN Default 0 3 Type +SYMBOL "sprintf" Default 0 3 Type +STRING ("TestRec(%i)", Regular, Token []) Default 0 3 Type +LPAREN Default 0 4 Type +PROP_PLUS "+value" Default 0 4 Type +SYMBOL "t" Default 0 4 Type +RPAREN Default 0 3 Type +RPAREN Default 0 2 Type +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +BRACE_BAR Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +INT32 (99, false) Default 0 1 LParen +RBRACKET Default 0 1 LParen +BAR_BRACE Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%A", Regular, Token []) Default 0 1 LParen +BRACE_BAR Default 0 1 LParen +LBRACKET Default 0 1 LParen +SYMBOL "value" Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +RBRACKET Default 0 1 LParen +BAR_BRACE Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_type-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_type-0.returns tokens.verified.txt new file mode 100644 index 0000000..37cc02f --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_type-0.returns tokens.verified.txt @@ -0,0 +1,52 @@ +LPAREN Default 0 1 LParen +TYPE Default 0 1 Type +SYMBOL "MyType" Default 0 1 Type +LPAREN Default 0 2 Type +LBRACKET Default 0 2 Type +SYMBOL "value" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "int32" Default 0 2 Type +RBRACKET Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +LET Default 0 2 Type +SYMBOL "field" Default 0 2 Type +SYMBOL "value" Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +SYMBOL "this.Foo" Default 0 2 Member +SYMBOL "value" Default 0 2 Member +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBERFN Default 0 2 Type +SYMBOL "this.Thing" Default 0 2 Type +LPAREN Default 0 3 Type +RPAREN Default 0 2 Type +STRING ("hello", Regular, Token []) Default 0 2 Type +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "myObject" Default 0 1 LParen +LPAREN Default 0 2 LParen +NEW Default 0 2 LParen +SYMBOL "MyType" Default 0 2 LParen +INT32 (99, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%O", Regular, Token []) Default 0 1 LParen +SYMBOL "myObject" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%O", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_PLUS Default 0 2 LParen +SYMBOL "Foo" Default 0 2 LParen +SYMBOL "myObject" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_type-alias-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_type-alias-0.returns tokens.verified.txt new file mode 100644 index 0000000..aa93a5d --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_type-alias-0.returns tokens.verified.txt @@ -0,0 +1,44 @@ +LPAREN Default 0 1 LParen +TYPEALIAS Default 0 1 LParen +SYMBOL "range" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "int64" Default 0 2 LParen +OP_MULT Default 0 2 LParen +SYMBOL "int64" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "things" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "r" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "range" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_PLUS Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "fst" Default 0 3 LParen +SYMBOL "r" Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "snd" Default 0 3 LParen +SYMBOL "r" Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("Result is %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "things" Default 0 2 LParen +LPAREN Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +DOT Default 0 3 LParen +INT32 (2, false) Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_union-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_union-0.returns tokens.verified.txt new file mode 100644 index 0000000..a80abd9 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_type_union-0.returns tokens.verified.txt @@ -0,0 +1,150 @@ +LPAREN Default 0 1 LParen +UNION Default 0 1 Type +SYMBOL "MyList" Default 0 1 Type +OP_LESS Default 0 1 Type +SYMBOL "^a" Default 0 1 Type +OP_GREATER Default 0 1 Type +SYMBOL "Empty" Default 0 1 Type +LPAREN Default 0 2 Type +SYMBOL "Cons" Default 0 2 Type +SYMBOL "^a" Default 0 2 Type +LBRACKET Default 0 2 Type +SYMBOL "tail" Default 0 2 Type +COLON Default 0 2 Type +SYMBOL "MyList" Default 0 2 Type +OP_LESS Default 0 2 Type +SYMBOL "^a" Default 0 2 Type +OP_GREATER Default 0 2 Type +RBRACKET Default 0 2 Type +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +SYMBOL "t.TIsEmpty" Default 0 2 Member +LPAREN Default 0 3 Member +MATCH Default 0 3 Member +SYMBOL "t" Default 0 3 Member +LBRACKET Default 0 3 Member +SYMBOL "Empty" Default 0 3 Member +TRUE Default 0 3 Member +RBRACKET Default 0 3 Member +LBRACKET Default 0 3 Member +SYMBOL "_" Default 0 3 Member +FALSE Default 0 3 Member +RBRACKET Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +LPAREN Default 0 2 Type +MEMBER Default 0 2 Member +FN Default 0 2 Member +SYMBOL "t.Length" Default 0 2 Member +LPAREN Default 0 3 Member +RPAREN Default 0 2 Member +LPAREN Default 0 3 Member +MATCH Default 0 3 Member +SYMBOL "t" Default 0 3 Member +LBRACKET Default 0 3 Member +SYMBOL "Empty" Default 0 3 Member +INT32 (0, false) Default 0 3 Member +RBRACKET Default 0 3 Member +LBRACKET Default 0 3 Member +LPAREN Default 0 4 Member +SYMBOL "Cons" Default 0 4 Member +LPAREN Default 0 5 Member +SYMBOL "_" Default 0 5 Member +COMMA Default 0 5 Member +SYMBOL "rest" Default 0 5 Member +RPAREN Default 0 4 Member +RPAREN Default 0 3 Member +LPAREN Default 0 4 Member +OP_PLUS Default 0 4 Member +INT32 (1, false) Default 0 4 Member +LPAREN Default 0 5 Member +SYMBOL "rest.Length" Default 0 5 Member +RPAREN Default 0 4 Member +RPAREN Default 0 3 Member +RBRACKET Default 0 3 Member +RPAREN Default 0 2 Member +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "linkedList" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Cons" Default 0 2 LParen +LPAREN Default 0 3 LParen +INT32 (1, false) Default 0 3 LParen +COMMA Default 0 3 LParen +LPAREN Default 0 4 LParen +SYMBOL "Cons" Default 0 4 LParen +LPAREN Default 0 5 LParen +INT32 (2, false) Default 0 5 LParen +COMMA Default 0 5 LParen +LPAREN Default 0 6 LParen +SYMBOL "Cons" Default 0 6 LParen +LPAREN Default 0 7 LParen +INT32 (3, false) Default 0 7 LParen +COMMA Default 0 7 LParen +SYMBOL "Empty" Default 0 7 LParen +RPAREN Default 0 6 LParen +RPAREN Default 0 5 LParen +RPAREN Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("List is %A", Regular, Token []) Default 0 1 LParen +SYMBOL "linkedList" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("List length %A", Regular, Token []) Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "linkedList.Length" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("List isEmpty %A", Regular, Token []) Default 0 1 LParen +SYMBOL "linkedList.TIsEmpty" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +HASH_BRACKET Default 0 1 LParen +SYMBOL "RequireQualifiedAccess" Default 0 1 LParen +RBRACKET Default 0 1 LParen +UNION Default 0 1 Type +SYMBOL "MyOption" Default 0 1 Type +OP_LESS Default 0 1 Type +SYMBOL "^T" Default 0 1 Type +OP_GREATER Default 0 1 Type +SYMBOL "None" Default 0 1 Type +LPAREN Default 0 2 Type +SYMBOL "Some" Default 0 2 Type +SYMBOL "^T" Default 0 2 Type +RPAREN Default 0 1 Type +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "myOptNone" Default 0 1 LParen +SYMBOL "MyOption.None" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "myOptSome" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "MyOption.Some" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("myOptNone %A", Regular, Token []) Default 0 1 LParen +SYMBOL "myOptNone" Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("myOptSome %A", Regular, Token []) Default 0 1 LParen +SYMBOL "myOptSome" Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_vector_vector-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_vector_vector-0.returns tokens.verified.txt new file mode 100644 index 0000000..08ce7d8 --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_vector_vector-0.returns tokens.verified.txt @@ -0,0 +1,46 @@ +LPAREN Default 0 1 LParen +MUT Default 0 1 LParen +SYMBOL "vec" Default 0 1 LParen +LBRACKET Default 0 1 LParen +INT32 (1, false) Default 0 1 LParen +INT32 (2, false) Default 0 1 LParen +INT32 (3, false) Default 0 1 LParen +INT32 (4, false) Default 0 1 LParen +INT32 (5, false) Default 0 1 LParen +INT32 (6, false) Default 0 1 LParen +RBRACKET Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "empty" Default 0 1 LParen +LBRACKET Default 0 1 LParen +RBRACKET Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SET Default 0 1 LParen +LPAREN Default 0 2 LParen +DOT_BRACKET Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RBRACKET Default 0 2 LParen +SYMBOL "vec" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Value.int" Default 0 2 LParen +INT32 (-1, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +DOT_METHOD ".Add" Default 0 1 LParen +SYMBOL "empty" Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Value.int" Default 0 2 LParen +INT32 (99, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("%O", Regular, Token []) Default 0 1 LParen +SYMBOL "empty" Default 0 1 LParen +RPAREN Default 0 0 Default +SYMBOL "vec" Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_while_while-0.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_while_while-0.returns tokens.verified.txt new file mode 100644 index 0000000..441f89f --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_while_while-0.returns tokens.verified.txt @@ -0,0 +1,56 @@ +HASH_IDENT "nowarn" Default 0 0 Default +STRING ("20", Regular, Token []) Default 0 0 Default +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +SYMBOL "inc" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "v" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "Value" Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "Value.from" Default 0 2 LParen +LPAREN Default 0 3 LParen +OP_PLUS Default 0 3 LParen +INT64 (1L, false) Default 0 3 LParen +LPAREN Default 0 4 LParen +SYMBOL "unwrapInt" Default 0 4 LParen +SYMBOL "v" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +LET Default 0 1 LParen +SYMBOL "count" Default 0 1 LParen +LPAREN Default 0 2 LParen +ATOM_KW Default 0 2 LParen +INT64 (0L, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +WHILE Default 0 1 LParen +LPAREN Default 0 2 LParen +OP_LESS Default 0 2 LParen +LPAREN Default 0 3 LParen +SYMBOL "unwrapInt" Default 0 3 LParen +AT Default 0 3 LParen +SYMBOL "count" Default 0 3 LParen +RPAREN Default 0 2 LParen +INT64 (5L, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "printfn" Default 0 2 LParen +STRING ("in loop %O", Regular, Token []) Default 0 2 LParen +AT Default 0 2 LParen +SYMBOL "count" Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +SYMBOL "swap!" Default 0 2 LParen +SYMBOL "count" Default 0 2 LParen +SYMBOL "inc" Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/tests/Visp.Compiler.UnitTests/token-snapshots/tests_while_while-1.returns tokens.verified.txt b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_while_while-1.returns tokens.verified.txt new file mode 100644 index 0000000..13c664a --- /dev/null +++ b/tests/Visp.Compiler.UnitTests/token-snapshots/tests_while_while-1.returns tokens.verified.txt @@ -0,0 +1,120 @@ +LPAREN Default 0 1 LParen +FN Default 0 1 LParen +INLINE Default 0 1 LParen +SYMBOL "DiffByOne" Default 0 1 LParen +LPAREN Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "lhs" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "array" Default 0 2 LParen +OP_LESS Default 0 2 LParen +SYMBOL "^T" Default 0 2 LParen +OP_GREATER Default 0 2 LParen +RBRACKET Default 0 2 LParen +LBRACKET Default 0 2 LParen +SYMBOL "rhs" Default 0 2 LParen +COLON Default 0 2 LParen +SYMBOL "array" Default 0 2 LParen +OP_LESS Default 0 2 LParen +SYMBOL "^T" Default 0 2 LParen +OP_GREATER Default 0 2 LParen +RBRACKET Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MUT Default 0 2 LParen +SYMBOL "index" Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MUT Default 0 2 LParen +SYMBOL "loop" Default 0 2 LParen +TRUE Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +MUT Default 0 2 LParen +SYMBOL "diff" Default 0 2 LParen +INT32 (0, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +WHILE Default 0 2 LParen +LPAREN Default 0 3 LParen +MACRO_NAME "and" TokenStream Macro 1 3 LParen +SYMBOL "loop" TokenStream Macro 1 3 LParen +LPAREN TokenStream Macro 2 4 LParen +SYMBOL "<" TokenStream Macro 2 4 LParen +SYMBOL "index" TokenStream Macro 2 4 LParen +LPAREN TokenStream Macro 3 5 LParen +SYMBOL "+Length" TokenStream Macro 3 5 LParen +SYMBOL "lhs" TokenStream Macro 3 5 LParen +RPAREN TokenStream Macro 2 4 LParen +RPAREN TokenStream Macro 1 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +LET Default 0 3 LParen +SYMBOL "lhs" Default 0 3 LParen +LPAREN Default 0 4 LParen +DOT_BRACKET Default 0 4 LParen +SYMBOL "index" Default 0 4 LParen +RBRACKET Default 0 4 LParen +SYMBOL "lhs" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +LET Default 0 3 LParen +SYMBOL "rhs" Default 0 3 LParen +LPAREN Default 0 4 LParen +DOT_BRACKET Default 0 4 LParen +SYMBOL "index" Default 0 4 LParen +RBRACKET Default 0 4 LParen +SYMBOL "rhs" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +MACRO_NAME "unless" TokenStream Macro 1 3 LParen +LPAREN TokenStream Macro 2 4 LParen +SYMBOL "=" TokenStream Macro 2 4 LParen +SYMBOL "lhs" TokenStream Macro 2 4 LParen +SYMBOL "rhs" TokenStream Macro 2 4 LParen +RPAREN TokenStream Macro 1 3 LParen +LPAREN TokenStream Macro 2 4 LParen +SYMBOL "set!" TokenStream Macro 2 4 LParen +SYMBOL "diff" TokenStream Macro 2 4 LParen +LPAREN TokenStream Macro 3 5 LParen +SYMBOL "inc" TokenStream Macro 3 5 LParen +SYMBOL "diff" TokenStream Macro 3 5 LParen +RPAREN TokenStream Macro 2 4 LParen +RPAREN TokenStream Macro 1 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +MACRO_NAME "when" TokenStream Macro 1 3 LParen +LPAREN TokenStream Macro 2 4 LParen +SYMBOL ">" TokenStream Macro 2 4 LParen +SYMBOL "diff" TokenStream Macro 2 4 LParen +INT32 (1, false) TokenStream Macro 2 4 LParen +RPAREN TokenStream Macro 1 3 LParen +LPAREN TokenStream Macro 2 4 LParen +SYMBOL "set!" TokenStream Macro 2 4 LParen +SYMBOL "loop" TokenStream Macro 2 4 LParen +FALSE TokenStream Macro 2 4 LParen +RPAREN TokenStream Macro 1 3 LParen +RPAREN Default 0 2 LParen +LPAREN Default 0 3 LParen +SET Default 0 3 LParen +SYMBOL "index" Default 0 3 LParen +LPAREN Default 0 4 LParen +SYMBOL "inc" Default 0 4 LParen +SYMBOL "index" Default 0 4 LParen +RPAREN Default 0 3 LParen +RPAREN Default 0 2 LParen +RPAREN Default 0 1 LParen +LPAREN Default 0 2 LParen +EQUALS Default 0 2 LParen +SYMBOL "diff" Default 0 2 LParen +INT32 (1, false) Default 0 2 LParen +RPAREN Default 0 1 LParen +RPAREN Default 0 0 Default +LPAREN Default 0 1 LParen +SYMBOL "printfn" Default 0 1 LParen +STRING ("OK", Regular, Token []) Default 0 1 LParen +RPAREN Default 0 0 Default +EOF Default 0 0 Default \ No newline at end of file diff --git a/visp/utils/test-generator.visp b/visp/utils/test-generator.visp index f3adf20..a0e97cf 100644 --- a/visp/utils/test-generator.visp +++ b/visp/utils/test-generator.visp @@ -208,6 +208,18 @@ let ``%s %s`` () = TestUtils.runTest "%s" vispRoot files ) + + (WriteTests + {| + [project "Visp.Compiler.UnitTests"] + [header "TokenOutputTests"] + [prefix "returns tokens"] + [method "TestUtils.runTokenTest"] + |} + projectRoot + vispRoot + files + ) ) (fn WriteExecutionTests (projectRoot vispRoot files)