diff options
Diffstat (limited to 'tests/snippets')
51 files changed, 885 insertions, 494 deletions
diff --git a/tests/snippets/coffeescript/test_beware_infinite_loop.txt b/tests/snippets/coffeescript/test_beware_infinite_loop.txt index 6ae9b753..886b7062 100644 --- a/tests/snippets/coffeescript/test_beware_infinite_loop.txt +++ b/tests/snippets/coffeescript/test_beware_infinite_loop.txt @@ -11,4 +11,4 @@ '/' Operator 'x' Name.Other ';' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/coffeescript/test_mixed_slashes.txt b/tests/snippets/coffeescript/test_mixed_slashes.txt index 7577b665..8701fad2 100644 --- a/tests/snippets/coffeescript/test_mixed_slashes.txt +++ b/tests/snippets/coffeescript/test_mixed_slashes.txt @@ -10,4 +10,4 @@ a?/foo/:1/2; '/' Operator '2' Literal.Number.Integer ';' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/conftest.py b/tests/snippets/conftest.py index b5ee33c6..02e62555 100644 --- a/tests/snippets/conftest.py +++ b/tests/snippets/conftest.py @@ -16,6 +16,7 @@ :license: BSD, see LICENSE for details. """ +import pathlib import pytest from tests.conftest import LexerInlineTestItem @@ -23,7 +24,7 @@ from tests.conftest import LexerInlineTestItem def pytest_collect_file(parent, path): if path.ext == '.txt': - return LexerTestFile.from_parent(parent, fspath=path) + return LexerTestFile.from_parent(parent, path=pathlib.Path(path)) class LexerTestFile(pytest.File): diff --git a/tests/snippets/elpi/test_catastrophic_backtracking.txt b/tests/snippets/elpi/test_catastrophic_backtracking.txt new file mode 100644 index 00000000..a14a0549 --- /dev/null +++ b/tests/snippets/elpi/test_catastrophic_backtracking.txt @@ -0,0 +1,6 @@ +---input--- +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +---tokens--- +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' Text +'\n' Text.Whitespace diff --git a/tests/snippets/j/test_deal_operator.txt b/tests/snippets/j/test_deal_operator.txt index 34253c93..0156b6df 100644 --- a/tests/snippets/j/test_deal_operator.txt +++ b/tests/snippets/j/test_deal_operator.txt @@ -5,4 +5,4 @@ '3' Literal.Number.Integer '?' Operator '10' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/j/test_deal_operator_fixed_seed.txt b/tests/snippets/j/test_deal_operator_fixed_seed.txt index c291720d..0a0bd77c 100644 --- a/tests/snippets/j/test_deal_operator_fixed_seed.txt +++ b/tests/snippets/j/test_deal_operator_fixed_seed.txt @@ -6,4 +6,4 @@ '?' Operator '.' Operator '10' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/java/test_default.txt b/tests/snippets/java/test_default.txt index 5fec9746..f24fa420 100644 --- a/tests/snippets/java/test_default.txt +++ b/tests/snippets/java/test_default.txt @@ -6,31 +6,31 @@ switch (x) { ---tokens--- 'switch' Keyword -' ' Text +' ' Text.Whitespace '(' Punctuation 'x' Name ')' Punctuation -' ' Text +' ' Text.Whitespace '{' Punctuation -'\n' Text +'\n' Text.Whitespace -' ' Text +' ' Text.Whitespace 'case' Keyword -' ' Text +' ' Text.Whitespace '1' Literal.Number.Integer ':' Punctuation -' ' Text +' ' Text.Whitespace 'break' Keyword ';' Punctuation -'\n' Text +'\n' Text.Whitespace -' ' Text +' ' Text.Whitespace 'default' Keyword ':' Punctuation -' ' Text +' ' Text.Whitespace 'break' Keyword ';' Punctuation -'\n' Text +'\n' Text.Whitespace '}' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/java/test_enhanced_for.txt b/tests/snippets/java/test_enhanced_for.txt index 34713b99..d2a80916 100644 --- a/tests/snippets/java/test_enhanced_for.txt +++ b/tests/snippets/java/test_enhanced_for.txt @@ -5,18 +5,18 @@ for(String var2: var1) {} ---tokens--- 'label' Name.Label ':' Punctuation -'\n' Text +'\n' Text.Whitespace 'for' Keyword '(' Punctuation 'String' Name -' ' Text +' ' Text.Whitespace 'var2' Name ':' Punctuation -' ' Text +' ' Text.Whitespace 'var1' Name ')' Punctuation -' ' Text +' ' Text.Whitespace '{' Punctuation '}' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/java/test_numeric_literals.txt b/tests/snippets/java/test_numeric_literals.txt index 5295bd8d..1dc933d3 100644 --- a/tests/snippets/java/test_numeric_literals.txt +++ b/tests/snippets/java/test_numeric_literals.txt @@ -3,32 +3,32 @@ ---tokens--- '0' Literal.Number.Integer -' ' Text +' ' Text.Whitespace '5L' Literal.Number.Integer -' ' Text +' ' Text.Whitespace '9__542_72l' Literal.Number.Integer -' ' Text +' ' Text.Whitespace '0xbEEf' Literal.Number.Hex -' ' Text +' ' Text.Whitespace '0X9_A' Literal.Number.Hex -' ' Text +' ' Text.Whitespace '0_35' Literal.Number.Oct -' ' Text +' ' Text.Whitespace '01' Literal.Number.Oct -' ' Text +' ' Text.Whitespace '0b0___101_0' Literal.Number.Bin -' ' Text +' ' Text.Whitespace '0.' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.7_17F' Literal.Number.Float -' ' Text +' ' Text.Whitespace '3e-1_3d' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1f' Literal.Number.Float -' ' Text +' ' Text.Whitespace '6_01.9e+3' Literal.Number.Float -' ' Text +' ' Text.Whitespace '0x.1Fp3' Literal.Number.Float -' ' Text +' ' Text.Whitespace '0XEP8D' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/java/test_record.txt b/tests/snippets/java/test_record.txt index ddae1ddc..f4ca08b1 100644 --- a/tests/snippets/java/test_record.txt +++ b/tests/snippets/java/test_record.txt @@ -7,61 +7,61 @@ String[] record = csvReader.getValues(); ---tokens--- 'public' Keyword.Declaration -' ' Text +' ' Text.Whitespace 'record' Keyword.Declaration ' ' Text 'RecordTest' Name.Class '(' Punctuation ')' Punctuation -' ' Text +' ' Text.Whitespace '{' Punctuation '}' Punctuation -'\n' Text +'\n' Text.Whitespace 'public' Keyword.Declaration -' ' Text +' ' Text.Whitespace 'static' Keyword.Declaration -' ' Text +' ' Text.Whitespace 'record' Keyword.Declaration ' ' Text 'RecordTest' Name.Class '(' Punctuation ')' Punctuation -' ' Text +' ' Text.Whitespace '{' Punctuation '}' Punctuation -'\n' Text +'\n' Text.Whitespace 'record' Keyword.Declaration ' ' Text 'Person' Name.Class '(' Punctuation 'String' Name -' ' Text +' ' Text.Whitespace 'firstName' Name ',' Punctuation -' ' Text +' ' Text.Whitespace 'String' Name -' ' Text +' ' Text.Whitespace 'lastName' Name ')' Punctuation -' ' Text +' ' Text.Whitespace '{' Punctuation '}' Punctuation -'\n' Text +'\n' Text.Whitespace 'String' Name '[' Operator ']' Operator -' ' Text +' ' Text.Whitespace 'record' Name -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace 'csvReader' Name '.' Punctuation 'getValues' Name.Attribute '(' Punctuation ')' Punctuation ';' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/js/super.txt b/tests/snippets/js/super.txt new file mode 100644 index 00000000..1af2ad28 --- /dev/null +++ b/tests/snippets/js/super.txt @@ -0,0 +1,72 @@ +---input--- +super(member1, member2) + +super(member1,member2) + +super(member1, +member2) + +super (member1, member2) + +super (member1,member2) + +super (member1, +member2) + +---tokens--- +'super' Keyword +'(' Punctuation +'member1' Name.Other +',' Punctuation +' ' Text.Whitespace +'member2' Name.Other +')' Punctuation +'\n\n' Text.Whitespace + +'super' Keyword +'(' Punctuation +'member1' Name.Other +',' Punctuation +'member2' Name.Other +')' Punctuation +'\n\n' Text.Whitespace + +'super' Keyword +'(' Punctuation +'member1' Name.Other +',' Punctuation +'\n' Text.Whitespace + +'member2' Name.Other +')' Punctuation +'\n\n' Text.Whitespace + +'super' Keyword +' ' Text.Whitespace +'(' Punctuation +'member1' Name.Other +',' Punctuation +' ' Text.Whitespace +'member2' Name.Other +')' Punctuation +'\n\n' Text.Whitespace + +'super' Keyword +' ' Text.Whitespace +'(' Punctuation +'member1' Name.Other +',' Punctuation +'member2' Name.Other +')' Punctuation +'\n\n' Text.Whitespace + +'super' Keyword +' ' Text.Whitespace +'(' Punctuation +'member1' Name.Other +',' Punctuation +'\n' Text.Whitespace + +'member2' Name.Other +')' Punctuation +'\n' Text.Whitespace diff --git a/tests/snippets/julia-repl/test_repl.txt b/tests/snippets/julia-repl/test_repl.txt index 798f0047..183de178 100644 --- a/tests/snippets/julia-repl/test_repl.txt +++ b/tests/snippets/julia-repl/test_repl.txt @@ -11,14 +11,14 @@ julia> @. f(1:2) ---tokens--- 'julia>' Generic.Prompt -' ' Text +' ' Text.Whitespace 'f' Name '(' Punctuation 'x' Name ')' Punctuation -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace 'sin' Name '(' Punctuation 'π' Name.Builtin @@ -26,23 +26,23 @@ julia> @. f(1:2) '2' Literal.Number.Integer 'x' Name ')' Punctuation -'\n' Text +'\n' Text.Whitespace 'f (generic function with 1 method)\n' Generic.Output '\n' Generic.Output 'julia>' Generic.Prompt -' ' Text +' ' Text.Whitespace '@.' Name.Decorator -' ' Text +' ' Text.Whitespace 'f' Name '(' Punctuation '1' Literal.Number.Integer ':' Operator '2' Literal.Number.Integer ')' Punctuation -'\n' Text +'\n' Text.Whitespace '2-element Vector{Float64}:\n' Generic.Output diff --git a/tests/snippets/julia/test_keywords.txt b/tests/snippets/julia/test_keywords.txt index 235c411c..10166d67 100644 --- a/tests/snippets/julia/test_keywords.txt +++ b/tests/snippets/julia/test_keywords.txt @@ -12,78 +12,90 @@ primitive type MyPrimitive 32 end mutable struct MutableType end ---tokens--- -'mutable struct' Keyword +'mutable' Keyword +' ' Text.Whitespace +'struct' Keyword ' ' Text 'MutableType' Keyword.Type -' ' Text +' ' Text.Whitespace 'end' Keyword -'\n' Text +'\n' Text.Whitespace 'struct' Keyword ' ' Text 'ImmutableType' Keyword.Type -' ' Text +' ' Text.Whitespace 'end' Keyword -'\n' Text +'\n' Text.Whitespace -'abstract type' Keyword +'abstract' Keyword +' ' Text.Whitespace +'type' Keyword ' ' Text 'AbstractMyType' Keyword.Type -' ' Text +' ' Text.Whitespace 'end' Keyword -'\n' Text +'\n' Text.Whitespace -'primitive type' Keyword +'primitive' Keyword +' ' Text.Whitespace +'type' Keyword ' ' Text 'MyPrimitive' Keyword.Type -' ' Text +' ' Text.Whitespace '32' Literal.Number.Integer -' ' Text +' ' Text.Whitespace 'end' Keyword -'\n' Text +'\n' Text.Whitespace '(' Punctuation 'abstract' Name ',' Punctuation -' ' Text +' ' Text.Whitespace 'mutable' Name ',' Punctuation -' ' Text +' ' Text.Whitespace 'type' Name ')' Punctuation -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace 'true' Name.Builtin ',' Punctuation -' ' Text +' ' Text.Whitespace 'π' Name.Builtin ',' Punctuation -' ' Text +' ' Text.Whitespace 'missing' Name.Builtin -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace -'abstract type' Keyword +'abstract' Keyword +' ' Text.Whitespace +'type' Keyword ' ' Text 'AbstractMyType' Keyword.Type -' ' Text +' ' Text.Whitespace 'end' Keyword -'\n' Text +'\n' Text.Whitespace -'primitive \ttype' Keyword +'primitive' Keyword +' \t' Text.Whitespace +'type' Keyword ' ' Text 'MyPrimitive' Keyword.Type -' ' Text +' ' Text.Whitespace '32' Literal.Number.Integer -' ' Text +' ' Text.Whitespace 'end' Keyword -'\n' Text +'\n' Text.Whitespace -'mutable struct' Keyword +'mutable' Keyword +' ' Text.Whitespace +'struct' Keyword ' ' Text 'MutableType' Keyword.Type -' ' Text +' ' Text.Whitespace 'end' Keyword -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/julia/test_macros.txt b/tests/snippets/julia/test_macros.txt index 8dc27187..43d67e0f 100644 --- a/tests/snippets/julia/test_macros.txt +++ b/tests/snippets/julia/test_macros.txt @@ -10,47 +10,47 @@ ---tokens--- '@generated' Name.Decorator -' ' Text +' ' Text.Whitespace 'function' Keyword -'\n' Text +'\n' Text.Whitespace '@.' Name.Decorator -' ' Text +' ' Text.Whitespace 'a' Name -' ' Text +' ' Text.Whitespace '+' Operator -' ' Text +' ' Text.Whitespace 'b' Name -'\n' Text +'\n' Text.Whitespace '@~' Name.Decorator -' ' Text +' ' Text.Whitespace 'a' Name -' ' Text +' ' Text.Whitespace '+' Operator -' ' Text +' ' Text.Whitespace 'b' Name -'\n' Text +'\n' Text.Whitespace '@±' Name.Decorator -' ' Text +' ' Text.Whitespace 'a' Name -' ' Text +' ' Text.Whitespace '+' Operator -' ' Text +' ' Text.Whitespace 'b' Name -'\n' Text +'\n' Text.Whitespace '@mymacro' Name.Decorator '(' Punctuation 'a' Name ',' Punctuation -' ' Text +' ' Text.Whitespace 'b' Name ')' Punctuation -'\n' Text +'\n' Text.Whitespace '@+¹ᵀ' Name.Decorator -' ' Text +' ' Text.Whitespace 'a' Name -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/julia/test_names.txt b/tests/snippets/julia/test_names.txt index 338f483f..62c0b55d 100644 --- a/tests/snippets/julia/test_names.txt +++ b/tests/snippets/julia/test_names.txt @@ -33,116 +33,116 @@ A² # category No ---tokens--- 'a' Name -' ' Text +' ' Text.Whitespace '# single character variable' Comment -'\n' Text +'\n' Text.Whitespace 'a_simple_name' Name -'\n' Text +'\n' Text.Whitespace '_leading_underscore' Name -'\n' Text +'\n' Text.Whitespace '5' Literal.Number.Integer 'implicit_mul' Name -'\n' Text +'\n' Text.Whitespace '6' Literal.Number.Integer '_more_mul' Name -'\n' Text +'\n' Text.Whitespace 'nums1' Name -'\n' Text +'\n' Text.Whitespace 'nums_2' Name -'\n' Text +'\n' Text.Whitespace 'nameswith!' Name -'\n' Text +'\n' Text.Whitespace 'multiple!!' Name -'\n' Text +'\n' Text.Whitespace 'embedded!_inthemiddle' Name -'\n' Text +'\n' Text.Whitespace 'embed!1' Name -'\n' Text +'\n' Text.Whitespace 'prime_suffix′' Name -'\n' Text +'\n' Text.Whitespace 'for_each' Name -' ' Text +' ' Text.Whitespace '# starts with keyword substring' Comment -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace '# variables with characters > \\u00A1' Comment -'\n' Text +'\n' Text.Whitespace 'ð' Name -' ' Text +' ' Text.Whitespace '# category Ll' Comment -'\n' Text +'\n' Text.Whitespace 'Aʺ' Name -' ' Text +' ' Text.Whitespace '# category Lm -- \\U02BA (MODIFIER LETTER DOUBLE PRIME), not \\U2033 (DOUBLE PRIME)' Comment -'\n' Text +'\n' Text.Whitespace 'א' Name -' ' Text +' ' Text.Whitespace '# category Lo' Comment -'\n' Text +'\n' Text.Whitespace 'Ð' Name -' ' Text +' ' Text.Whitespace '# category Lu' Comment -'\n' Text +'\n' Text.Whitespace 'A̅' Name -' ' Text +' ' Text.Whitespace '# category Mn -- \\U0305 (COMBINING OVERLINE)' Comment -'\n' Text +'\n' Text.Whitespace 'ⅿ' Name -' ' Text +' ' Text.Whitespace '# category Nl -- \\U217F (SMALL ROMAN NUMERAL ONE THOUSAND)' Comment -'\n' Text +'\n' Text.Whitespace 'A₁' Name -' ' Text +' ' Text.Whitespace '# category No' Comment -'\n' Text +'\n' Text.Whitespace 'A²' Name -' ' Text +' ' Text.Whitespace '# category No' Comment -'\n' Text +'\n' Text.Whitespace '€' Name -' ' Text +' ' Text.Whitespace '# category Sc' Comment -'\n' Text +'\n' Text.Whitespace '©' Name -' ' Text +' ' Text.Whitespace '# category So' Comment -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace '# number-like names' Comment -'\n' Text +'\n' Text.Whitespace '𝟙' Name -' ' Text +' ' Text.Whitespace '# category Nd' Comment -'\n' Text +'\n' Text.Whitespace '𝟏' Name -' ' Text +' ' Text.Whitespace '# category Nd' Comment -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/julia/test_numbers.txt b/tests/snippets/julia/test_numbers.txt index 5c572438..66f1fd0f 100644 --- a/tests/snippets/julia/test_numbers.txt +++ b/tests/snippets/julia/test_numbers.txt @@ -33,229 +33,229 @@ ---tokens--- '# floats' Comment -'\n' Text +'\n' Text.Whitespace -' ' Text +' ' Text.Whitespace '1e1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1e+1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1e-1' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace '1.1e1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1e+1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1e-1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.1e1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.1_1e1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1_1.1e1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1_1e1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1_11e1' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace '1.1E1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1E+1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1E-1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.1E1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.1_1E1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1_1.1E1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1_1E1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1_11E1' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace '1.1f1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1f+1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1f-1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.1f1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.1_1f1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1_1.1f1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1_1f1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1_11f1' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace '1E1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1E+1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1E-1' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace '1f1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1f+1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1f-1' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace '.1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1_1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1.1_11' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.1_1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.1_11' Literal.Number.Float -' ' Text +' ' Text.Whitespace '1_1.1_1' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace '# hex floats' Comment -'\n' Text +'\n' Text.Whitespace '0x1p1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '0xa_bp10' Literal.Number.Float -' ' Text +' ' Text.Whitespace '0x01_ap11' Literal.Number.Float -' ' Text +' ' Text.Whitespace '0x01_abp1' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace '0x1.1p1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '0xA.Bp10' Literal.Number.Float -' ' Text +' ' Text.Whitespace '0x0.1_Ap9' Literal.Number.Float -' ' Text +' ' Text.Whitespace '0x0_1.Ap1' Literal.Number.Float -' ' Text +' ' Text.Whitespace '0x0_1.A_Bp9' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace '# integers' Comment -'\n' Text +'\n' Text.Whitespace '1' Literal.Number.Integer -' ' Text +' ' Text.Whitespace '01' Literal.Number.Integer -' ' Text +' ' Text.Whitespace '10_1' Literal.Number.Integer -' ' Text +' ' Text.Whitespace '10_11' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace '# non-decimal' Comment -'\n' Text +'\n' Text.Whitespace '0xf' Literal.Number.Hex -' ' Text +' ' Text.Whitespace '0xf_0' Literal.Number.Hex -' ' Text +' ' Text.Whitespace '0xfff_000' Literal.Number.Hex -'\n' Text +'\n' Text.Whitespace '0o7' Literal.Number.Oct -' ' Text +' ' Text.Whitespace '0o7_0' Literal.Number.Oct -' ' Text +' ' Text.Whitespace '0o777_000' Literal.Number.Oct -'\n' Text +'\n' Text.Whitespace '0b1' Literal.Number.Bin -' ' Text +' ' Text.Whitespace '0b1_0' Literal.Number.Bin -' ' Text +' ' Text.Whitespace '0b111_000' Literal.Number.Bin -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace '# invalid in Julia - out of range values' Comment -'\n' Text +'\n' Text.Whitespace '0' Literal.Number.Integer 'xg' Name -' ' Text +' ' Text.Whitespace '0' Literal.Number.Integer 'o8' Name -' ' Text +' ' Text.Whitespace '0' Literal.Number.Integer 'b2' Name -' ' Text +' ' Text.Whitespace '0x1' Literal.Number.Hex 'pA' Name -'\n' Text +'\n' Text.Whitespace '# invalid in Julia - no trailing underscores' Comment -'\n' Text +'\n' Text.Whitespace '1' Literal.Number.Integer '_' Name -' ' Text +' ' Text.Whitespace '1.1' Literal.Number.Float '_' Name -' ' Text +' ' Text.Whitespace '0xf' Literal.Number.Hex '_' Name -' ' Text +' ' Text.Whitespace '0o7' Literal.Number.Oct '_' Name -' ' Text +' ' Text.Whitespace '0b1' Literal.Number.Bin '_' Name -' ' Text +' ' Text.Whitespace '0xF' Literal.Number.Hex '_p1' Name -'\n' Text +'\n' Text.Whitespace '# parsed as juxtaposed numeral + variable in Julia (no underscores in exponents)' Comment -'\n' Text +'\n' Text.Whitespace '1e1' Literal.Number.Float '_1' Name -' ' Text +' ' Text.Whitespace '1E1' Literal.Number.Float '_1' Name -' ' Text +' ' Text.Whitespace '1f1' Literal.Number.Float '_1' Name -' ' Text +' ' Text.Whitespace '0xfp1' Literal.Number.Float '_1' Name -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace '# not floats -- range-like expression parts' Comment -'\n' Text +'\n' Text.Whitespace '1' Literal.Number.Integer '..' Operator '1' Literal.Number.Integer -' ' Text +' ' Text.Whitespace '..' Operator '1' Literal.Number.Integer -' ' Text +' ' Text.Whitespace '1' Literal.Number.Integer '..' Operator -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/julia/test_operators.txt b/tests/snippets/julia/test_operators.txt index 017a48e9..c3c0f9f6 100644 --- a/tests/snippets/julia/test_operators.txt +++ b/tests/snippets/julia/test_operators.txt @@ -22,151 +22,151 @@ suffixed +¹²³ operator ---tokens--- 'a' Name -' ' Text +' ' Text.Whitespace '+=' Operator -' ' Text +' ' Text.Whitespace 'b' Name '.' Operator 'c' Name -'\n' Text +'\n' Text.Whitespace 'a' Name -' ' Text +' ' Text.Whitespace '.÷=' Operator -' ' Text +' ' Text.Whitespace '.~' Operator 'b' Name '.' Operator 'c' Name -'\n' Text +'\n' Text.Whitespace 'a' Name -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '!' Operator 'b' Name -' ' Text +' ' Text.Whitespace '⋆' Operator -' ' Text +' ' Text.Whitespace 'c!' Name -'\n' Text +'\n' Text.Whitespace 'a' Name -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace 'b' Name -' ' Text +' ' Text.Whitespace '?' Operator -' ' Text +' ' Text.Whitespace 'c' Name -' ' Text +' ' Text.Whitespace ':' Operator -' ' Text +' ' Text.Whitespace 'd' Name -' ' Text +' ' Text.Whitespace '⊕' Operator -' ' Text +' ' Text.Whitespace 'e' Name -'\n' Text +'\n' Text.Whitespace 'a' Name -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '√' Operator '(' Punctuation '5' Literal.Number.Integer ')' Punctuation -'\n' Text +'\n' Text.Whitespace 'a' Name -' ' Text +' ' Text.Whitespace '->' Operator -' ' Text +' ' Text.Whitespace '(' Punctuation 'a' Name '...' Operator ')' Punctuation -' ' Text +' ' Text.Whitespace '.+' Operator -' ' Text +' ' Text.Whitespace '1' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace 'a' Name -' ' Text +' ' Text.Whitespace '\\' Operator -' ' Text +' ' Text.Whitespace 'b' Name -'\n' Text +'\n' Text.Whitespace '1' Literal.Number.Integer '..' Operator '2' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace 'a' Name -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace 'a' Name -' ' Text +' ' Text.Whitespace '===' Operator -' ' Text +' ' Text.Whitespace 'b' Name -'\n' Text +'\n' Text.Whitespace 'a' Keyword.Type -' ' Text +' ' Text.Whitespace '<:' Operator -' ' Text +' ' Text.Whitespace 'T' Keyword.Type -'\n' Text +'\n' Text.Whitespace 'a' Keyword.Type -' ' Text +' ' Text.Whitespace '>:' Operator -' ' Text +' ' Text.Whitespace 'T' Keyword.Type -'\n' Text +'\n' Text.Whitespace 'a' Name '::' Operator 'T' Keyword.Type -'\n' Text +'\n' Text.Whitespace '[' Punctuation 'adjoint' Name ']' Punctuation "'" Operator -'\n' Text +'\n' Text.Whitespace '(' Punctuation 'identity' Name ')' Punctuation "''" Operator -'\n' Text +'\n' Text.Whitespace 'adjoint' Name "'''" Operator -'\n' Text +'\n' Text.Whitespace 'transpose' Name "'ᵀ" Operator -'\n' Text +'\n' Text.Whitespace 'suffixed' Name -' ' Text +' ' Text.Whitespace '+¹' Operator -' ' Text +' ' Text.Whitespace 'operator' Name -'\n' Text +'\n' Text.Whitespace 'suffixed' Name -' ' Text +' ' Text.Whitespace '+¹²³' Operator -' ' Text +' ' Text.Whitespace 'operator' Name -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/julia/test_strings.txt b/tests/snippets/julia/test_strings.txt index 436bfe3c..d5f91bff 100644 --- a/tests/snippets/julia/test_strings.txt +++ b/tests/snippets/julia/test_strings.txt @@ -44,33 +44,33 @@ arbi`trary`1234 '"' Literal.String 'global function' Literal.String '"' Literal.String -'\n' Text +'\n' Text.Whitespace '"' Literal.String 'An ' Literal.String '$interpolated' Literal.String.Interpol ' variable' Literal.String '"' Literal.String -'\n' Text +'\n' Text.Whitespace '"' Literal.String 'An ' Literal.String '$' Literal.String.Interpol '(' Punctuation 'a' Name -' ' Text +' ' Text.Whitespace '+' Operator -' ' Text +' ' Text.Whitespace '1' Literal.Number.Integer ')' Punctuation ' expression' Literal.String '"' Literal.String -'\n' Text +'\n' Text.Whitespace '"""' Literal.String 'a' Literal.String '"""' Literal.String -'\n' Text +'\n' Text.Whitespace '"""' Literal.String '\nglobal function\nde e f\n' Literal.String @@ -81,7 +81,7 @@ arbi`trary`1234 '\n' Literal.String '"""' Literal.String -'\n' Text +'\n' Text.Whitespace 'raw' Literal.String.Affix '"' Literal.String @@ -90,70 +90,70 @@ arbi`trary`1234 ' $interp $(1 + 1) ' Literal.String '\\"' Literal.String.Escape '"' Literal.String -'\n' Text +'\n' Text.Whitespace 'raw' Literal.String.Affix '"""' Literal.String '\n"inner string"\n$interp\n$(1 + 1)\n' Literal.String '"""' Literal.String -'\n' Text +'\n' Text.Whitespace '# commented "string"' Comment -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace '@sprintf' Name.Decorator -' ' Text +' ' Text.Whitespace '"' Literal.String '%0.2f' Literal.String.Interpol '"' Literal.String -' ' Text +' ' Text.Whitespace 'var' Name -'\n' Text +'\n' Text.Whitespace 'v' Literal.String.Affix '"' Literal.String '1.0' Literal.String '"' Literal.String -'\n' Text +'\n' Text.Whitespace 'var' Literal.String.Affix '"' Literal.String '#nonstandard#' Literal.String '"' Literal.String -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'r' Literal.String.Affix '"' Literal.String.Regex '^[abs]+$' Literal.String.Regex '"' Literal.String.Regex 'm' Literal.String.Affix -'\n' Text +'\n' Text.Whitespace 'arbi' Literal.String.Affix '"' Literal.String 'trary' Literal.String '"' Literal.String 'suff' Literal.String.Affix -'\n' Text +'\n' Text.Whitespace 'arbi' Literal.String.Affix '"' Literal.String 'trary' Literal.String '"' Literal.String '1234' Literal.String.Affix -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace '`' Literal.String.Backtick 'global function' Literal.String.Backtick '`' Literal.String.Backtick -'\n' Text +'\n' Text.Whitespace '`' Literal.String.Backtick 'abc ' Literal.String.Backtick @@ -163,25 +163,25 @@ arbi`trary`1234 ' ' Literal.String.Backtick '$interpolated' Literal.String.Interpol '`' Literal.String.Backtick -'\n' Text +'\n' Text.Whitespace '`' Literal.String.Backtick 'abc ' Literal.String.Backtick '$' Literal.String.Interpol '(' Punctuation 'a' Name -' ' Text +' ' Text.Whitespace '+' Operator -' ' Text +' ' Text.Whitespace '1' Literal.Number.Integer ')' Punctuation '`' Literal.String.Backtick -'\n' Text +'\n' Text.Whitespace '```' Literal.String.Backtick 'a' Literal.String.Backtick '```' Literal.String.Backtick -'\n' Text +'\n' Text.Whitespace '```' Literal.String.Backtick '\nglobal function\n"thing" ' Literal.String.Backtick @@ -203,23 +203,23 @@ arbi`trary`1234 '\n' Literal.String.Backtick '```' Literal.String.Backtick -'\n' Text +'\n' Text.Whitespace '# commented `command`' Comment -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'arbi' Literal.String.Affix '`' Literal.String.Backtick 'trary' Literal.String.Backtick '`' Literal.String.Backtick 'suff' Literal.String.Affix -'\n' Text +'\n' Text.Whitespace 'arbi' Literal.String.Affix '`' Literal.String.Backtick 'trary' Literal.String.Backtick '`' Literal.String.Backtick '1234' Literal.String.Affix -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/julia/test_symbols.txt b/tests/snippets/julia/test_symbols.txt index 8b85a8e1..37b4f830 100644 --- a/tests/snippets/julia/test_symbols.txt +++ b/tests/snippets/julia/test_symbols.txt @@ -17,54 +17,54 @@ UInt(1):UInt(2) ---tokens--- ':abc_123' Literal.String.Symbol -'\n' Text +'\n' Text.Whitespace ':abc_def' Literal.String.Symbol -'\n' Text +'\n' Text.Whitespace ':α' Literal.String.Symbol -'\n' Text +'\n' Text.Whitespace 'Val' Keyword.Type '{' Punctuation ':mysymbol' Literal.String.Symbol '}' Punctuation -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace '# non-symbols' Comment -'\n' Text +'\n' Text.Whitespace 'a' Name ':' Operator 'b' Name -'\n' Text +'\n' Text.Whitespace '1' Literal.Number.Integer ':' Operator 'b' Name -'\n' Text +'\n' Text.Whitespace '1.' Literal.Number.Float ':' Operator 'b' Name -'\n' Text +'\n' Text.Whitespace 'a' Name '::' Operator 'T' Keyword.Type -'\n' Text +'\n' Text.Whitespace 'a' Keyword.Type '<:' Operator 'T' Keyword.Type -'\n' Text +'\n' Text.Whitespace 'a' Keyword.Type '>:' Operator 'T' Keyword.Type -'\n' Text +'\n' Text.Whitespace 'UInt' Keyword.Type '(' Punctuation @@ -75,4 +75,4 @@ UInt(1):UInt(2) '(' Punctuation '2' Literal.Number.Integer ')' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/julia/test_types.txt b/tests/snippets/julia/test_types.txt index dc475349..16267fd8 100644 --- a/tests/snippets/julia/test_types.txt +++ b/tests/snippets/julia/test_types.txt @@ -20,16 +20,16 @@ g(C) <: T 'Union' Keyword.Type '{' Punctuation '}' Punctuation -'\n' Text +'\n' Text.Whitespace 'MyType' Keyword.Type '{' Punctuation 'Nothing' Keyword.Type ',' Punctuation -' ' Text +' ' Text.Whitespace 'Any' Keyword.Type '}' Punctuation -'\n' Text +'\n' Text.Whitespace 'f' Name '(' Punctuation @@ -41,36 +41,36 @@ g(C) <: T 'S' Keyword.Type '}' Punctuation ')' Punctuation -' ' Text +' ' Text.Whitespace 'where' Keyword -' ' Text +' ' Text.Whitespace 'S' Keyword.Type -' ' Text +' ' Text.Whitespace 'where' Keyword -' ' Text +' ' Text.Whitespace 'T' Keyword.Type -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '1' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace 'f' Name '(' Punctuation '::' Operator 'T' Keyword.Type ')' Punctuation -' ' Text +' ' Text.Whitespace 'where' Keyword -' ' Text +' ' Text.Whitespace '{' Punctuation 'T' Keyword.Type '}' Punctuation -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '1' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace 'f' Name '(' Punctuation @@ -81,35 +81,35 @@ g(C) <: T 'T' Keyword.Type '}' Punctuation ')' Punctuation -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '1' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace 'f' Name '(' Punctuation '::' Operator 'AT' Keyword.Type ')' Punctuation -' ' Text +' ' Text.Whitespace 'where' Keyword -' ' Text +' ' Text.Whitespace 'AT' Keyword.Type -' ' Text +' ' Text.Whitespace '<:' Operator -' ' Text +' ' Text.Whitespace 'AbstractArray' Keyword.Type '{' Punctuation 'MyType' Keyword.Type ',' Punctuation '1' Literal.Number.Integer '}' Punctuation -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '1' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace 'f' Name '(' Punctuation @@ -119,11 +119,11 @@ g(C) <: T ':named' Literal.String.Symbol '}' Punctuation ')' Punctuation -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '1' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace 'f' Name '(' Punctuation @@ -133,25 +133,25 @@ g(C) <: T 'sin' Name ')' Punctuation ')' Punctuation -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '1' Literal.Number.Integer -'\n' Text +'\n' Text.Whitespace 'MyInt' Keyword.Type -' ' Text +' ' Text.Whitespace '<:' Operator -' ' Text +' ' Text.Whitespace 'Integer' Keyword.Type -'\n' Text +'\n' Text.Whitespace 'Number' Keyword.Type -' ' Text +' ' Text.Whitespace '>:' Operator -' ' Text +' ' Text.Whitespace 'MyInt' Keyword.Type -'\n' Text +'\n' Text.Whitespace 'AT' Keyword.Type '{' Punctuation @@ -159,11 +159,11 @@ g(C) <: T ',' Punctuation '1' Literal.Number.Integer '}' Punctuation -' ' Text +' ' Text.Whitespace '<:' Operator -' ' Text +' ' Text.Whitespace 'B' Keyword.Type -'\n' Text +'\n' Text.Whitespace 'B' Keyword.Type '>:' Operator @@ -173,24 +173,24 @@ g(C) <: T ',' Punctuation '1' Literal.Number.Integer '}' Punctuation -'\n' Text +'\n' Text.Whitespace 'A' Keyword.Type -' ' Text +' ' Text.Whitespace '<:' Operator -' ' Text +' ' Text.Whitespace 'f' Name '(' Punctuation 'B' Name ')' Punctuation -'\n' Text +'\n' Text.Whitespace 'g' Name '(' Punctuation 'C' Name ')' Punctuation -' ' Text +' ' Text.Whitespace '<:' Operator -' ' Text +' ' Text.Whitespace 'T' Keyword.Type -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/julia/test_unicode.txt b/tests/snippets/julia/test_unicode.txt index 36f3577d..6b2508a5 100644 --- a/tests/snippets/julia/test_unicode.txt +++ b/tests/snippets/julia/test_unicode.txt @@ -5,9 +5,9 @@ s = √((1/n) * sum(count .^ 2) - mu .^2) ---tokens--- 's' Name -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '√' Operator '(' Punctuation '(' Punctuation @@ -15,23 +15,23 @@ s = √((1/n) * sum(count .^ 2) - mu .^2) '/' Operator 'n' Name ')' Punctuation -' ' Text +' ' Text.Whitespace '*' Operator -' ' Text +' ' Text.Whitespace 'sum' Name '(' Punctuation 'count' Name -' ' Text +' ' Text.Whitespace '.^' Operator -' ' Text +' ' Text.Whitespace '2' Literal.Number.Integer ')' Punctuation -' ' Text +' ' Text.Whitespace '-' Operator -' ' Text +' ' Text.Whitespace 'mu' Name -' ' Text +' ' Text.Whitespace '.^' Operator '2' Literal.Number.Integer ')' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_can_cope_generics_in_destructuring.txt b/tests/snippets/kotlin/test_can_cope_generics_in_destructuring.txt index 8a880a55..8fc7f3d7 100644 --- a/tests/snippets/kotlin/test_can_cope_generics_in_destructuring.txt +++ b/tests/snippets/kotlin/test_can_cope_generics_in_destructuring.txt @@ -3,25 +3,25 @@ val (a: List<Something>, b: Set<Wobble>) = ---tokens--- 'val' Keyword.Declaration -' ' Text +' ' Text.Whitespace '(' Punctuation 'a' Name.Variable ':' Punctuation -' ' Text +' ' Text.Whitespace 'List' Name '<' Operator 'Something' Name '>' Operator ',' Punctuation -' ' Text +' ' Text.Whitespace 'b' Name.Variable ':' Punctuation -' ' Text +' ' Text.Whitespace 'Set' Name '<' Operator 'Wobble' Name '>' Operator ')' Punctuation -' ' Text +' ' Text.Whitespace '=' Operator -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_can_cope_with_backtick_names_in_functions.txt b/tests/snippets/kotlin/test_can_cope_with_backtick_names_in_functions.txt index ab2ef6d8..c89c0ef4 100644 --- a/tests/snippets/kotlin/test_can_cope_with_backtick_names_in_functions.txt +++ b/tests/snippets/kotlin/test_can_cope_with_backtick_names_in_functions.txt @@ -3,6 +3,6 @@ fun `wo bble` ---tokens--- 'fun' Keyword.Declaration -' ' Text +' ' Text.Whitespace '`wo bble`' Name.Function -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_can_cope_with_commas_and_dashes_in_backtick_Names.txt b/tests/snippets/kotlin/test_can_cope_with_commas_and_dashes_in_backtick_Names.txt index 6d3c4ec3..7b2aed77 100644 --- a/tests/snippets/kotlin/test_can_cope_with_commas_and_dashes_in_backtick_Names.txt +++ b/tests/snippets/kotlin/test_can_cope_with_commas_and_dashes_in_backtick_Names.txt @@ -3,6 +3,6 @@ fun `wo,-bble` ---tokens--- 'fun' Keyword.Declaration -' ' Text +' ' Text.Whitespace '`wo,-bble`' Name.Function -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_can_cope_with_destructuring.txt b/tests/snippets/kotlin/test_can_cope_with_destructuring.txt index b51c1e04..3db6ed98 100644 --- a/tests/snippets/kotlin/test_can_cope_with_destructuring.txt +++ b/tests/snippets/kotlin/test_can_cope_with_destructuring.txt @@ -3,14 +3,14 @@ val (a, b) = ---tokens--- 'val' Keyword.Declaration -' ' Text +' ' Text.Whitespace '(' Punctuation 'a' Name.Variable ',' Punctuation -' ' Text +' ' Text.Whitespace 'b' Name.Variable ')' Punctuation -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text -'\n' Text +' ' Text.Whitespace +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_can_cope_with_generics.txt b/tests/snippets/kotlin/test_can_cope_with_generics.txt index ed616ec3..09eb61f9 100644 --- a/tests/snippets/kotlin/test_can_cope_with_generics.txt +++ b/tests/snippets/kotlin/test_can_cope_with_generics.txt @@ -3,32 +3,32 @@ inline fun <reified T : ContractState> VaultService.queryBy(): Vault.Page<T> { ---tokens--- 'inline' Keyword.Declaration -' ' Text +' ' Text.Whitespace 'fun' Keyword.Declaration -' ' Text +' ' Text.Whitespace '<' Operator 'reified' Keyword -' ' Text +' ' Text.Whitespace 'T' Name -' ' Text +' ' Text.Whitespace ':' Punctuation -' ' Text +' ' Text.Whitespace 'ContractState' Name '>' Operator -' ' Text +' ' Text.Whitespace 'VaultService' Name '.' Punctuation 'queryBy' Name.Function '(' Punctuation ')' Punctuation ':' Punctuation -' ' Text +' ' Text.Whitespace 'Vault' Name '.' Punctuation 'Page' Name.Attribute '<' Operator 'T' Name '>' Operator -' ' Text +' ' Text.Whitespace '{' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_modifier_keyword.txt b/tests/snippets/kotlin/test_modifier_keyword.txt index b30f65b9..730c0a5c 100644 --- a/tests/snippets/kotlin/test_modifier_keyword.txt +++ b/tests/snippets/kotlin/test_modifier_keyword.txt @@ -3,16 +3,16 @@ data class A(val data: String) ---tokens--- 'data' Keyword.Declaration -' ' Text +' ' Text.Whitespace 'class' Keyword.Declaration -' ' Text +' ' Text.Whitespace 'A' Name.Class '(' Punctuation 'val' Keyword.Declaration -' ' Text +' ' Text.Whitespace 'data' Name.Variable ':' Punctuation -' ' Text +' ' Text.Whitespace 'String' Keyword.Type ')' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_should_cope_with_multiline_comments.txt b/tests/snippets/kotlin/test_should_cope_with_multiline_comments.txt index ee7c3275..33ec2046 100644 --- a/tests/snippets/kotlin/test_should_cope_with_multiline_comments.txt +++ b/tests/snippets/kotlin/test_should_cope_with_multiline_comments.txt @@ -9,4 +9,4 @@ comment""" '"""' Literal.String '\nthis\nis\na\ncomment' Literal.String '"""' Literal.String -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_string_interpolation.txt b/tests/snippets/kotlin/test_string_interpolation.txt index c254f112..04ea2540 100644 --- a/tests/snippets/kotlin/test_string_interpolation.txt +++ b/tests/snippets/kotlin/test_string_interpolation.txt @@ -5,22 +5,22 @@ val something = "something" ---tokens--- 'val' Keyword.Declaration -' ' Text +' ' Text.Whitespace 'something' Name.Variable -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '"' Literal.String 'something' Literal.String '"' Literal.String -'\n' Text +'\n' Text.Whitespace '"' Literal.String 'Here is ' Literal.String '$' Literal.String.Interpol 'something' Name '"' Literal.String -'\n' Text +'\n' Text.Whitespace '"' Literal.String 'Here is ' Literal.String @@ -32,4 +32,4 @@ val something = "something" ')' Punctuation '}' Literal.String.Interpol '"' Literal.String -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_colon_colon_function_name.txt b/tests/snippets/scala/test_colon_colon_function_name.txt index eeebed2e..8840fff2 100644 --- a/tests/snippets/scala/test_colon_colon_function_name.txt +++ b/tests/snippets/scala/test_colon_colon_function_name.txt @@ -3,31 +3,31 @@ def ::(xs: List[T]): List[T] = ::(x, xs) ---tokens--- 'def' Keyword -' ' Text +' ' Text.Whitespace '::' Name.Function '(' Punctuation 'xs' Name ':' Punctuation -' ' Text +' ' Text.Whitespace 'List' Name.Class '[' Punctuation 'T' Name.Class ']' Punctuation ')' Punctuation ':' Punctuation -' ' Text +' ' Text.Whitespace 'List' Name.Class '[' Punctuation 'T' Name.Class ']' Punctuation -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '::' Name '(' Punctuation 'x' Name ',' Punctuation -' ' Text +' ' Text.Whitespace 'xs' Name ')' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_default_parameter.txt b/tests/snippets/scala/test_default_parameter.txt index a82e5a06..16ce948e 100644 --- a/tests/snippets/scala/test_default_parameter.txt +++ b/tests/snippets/scala/test_default_parameter.txt @@ -3,35 +3,35 @@ def f(using y: Char = if true then 'a' else 2): Int = ??? ---tokens--- 'def' Keyword -' ' Text +' ' Text.Whitespace 'f' Name.Function '(' Punctuation 'using' Keyword -' ' Text +' ' Text.Whitespace 'y' Name ':' Punctuation -' ' Text +' ' Text.Whitespace 'Char' Name.Class -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace 'if' Keyword -' ' Text +' ' Text.Whitespace 'true' Keyword.Constant -' ' Text +' ' Text.Whitespace 'then' Keyword -' ' Text +' ' Text.Whitespace "'a'" Literal.String.Char -' ' Text +' ' Text.Whitespace 'else' Keyword -' ' Text +' ' Text.Whitespace '2' Literal.Number.Integer ')' Punctuation ':' Punctuation -' ' Text +' ' Text.Whitespace 'Int' Name.Class -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '???' Operator -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_end_val.txt b/tests/snippets/scala/test_end_val.txt index 112cfafa..43ac172c 100644 --- a/tests/snippets/scala/test_end_val.txt +++ b/tests/snippets/scala/test_end_val.txt @@ -3,6 +3,6 @@ end val ---tokens--- 'end' Keyword -' ' Text +' ' Text.Whitespace 'val' Keyword -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_end_valx.txt b/tests/snippets/scala/test_end_valx.txt index e72c4041..e1d17d71 100644 --- a/tests/snippets/scala/test_end_valx.txt +++ b/tests/snippets/scala/test_end_valx.txt @@ -3,6 +3,6 @@ end valx ---tokens--- 'end' Keyword -' ' Text +' ' Text.Whitespace 'valx' Name.Namespace -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_float_with_exponents.txt b/tests/snippets/scala/test_float_with_exponents.txt index 9a702431..d64ee633 100644 --- a/tests/snippets/scala/test_float_with_exponents.txt +++ b/tests/snippets/scala/test_float_with_exponents.txt @@ -3,10 +3,10 @@ ---tokens--- '.1e12' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.1e+34' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.1e-56' Literal.Number.Float -' ' Text +' ' Text.Whitespace '.1e12f' Literal.Number.Float -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_function_operator_name.txt b/tests/snippets/scala/test_function_operator_name.txt index a1823f03..72c375d4 100644 --- a/tests/snippets/scala/test_function_operator_name.txt +++ b/tests/snippets/scala/test_function_operator_name.txt @@ -3,16 +3,16 @@ def < (y: String): Boolean ---tokens--- 'def' Keyword -' ' Text +' ' Text.Whitespace '<' Name.Function -' ' Text +' ' Text.Whitespace '(' Punctuation 'y' Name ':' Punctuation -' ' Text +' ' Text.Whitespace 'String' Name.Class ')' Punctuation ':' Punctuation -' ' Text +' ' Text.Whitespace 'Boolean' Name.Class -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_import_path.txt b/tests/snippets/scala/test_import_path.txt index fc8e5a2c..3e06d1fa 100644 --- a/tests/snippets/scala/test_import_path.txt +++ b/tests/snippets/scala/test_import_path.txt @@ -3,7 +3,7 @@ import a.b.c ---tokens--- 'import' Keyword -' ' Text +' ' Text.Whitespace 'a' Name.Namespace '.' Punctuation 'b' Name.Namespace diff --git a/tests/snippets/scala/test_invalid_symbol_and_invalid_char.txt b/tests/snippets/scala/test_invalid_symbol_and_invalid_char.txt index 9af24e53..ccaae59c 100644 --- a/tests/snippets/scala/test_invalid_symbol_and_invalid_char.txt +++ b/tests/snippets/scala/test_invalid_symbol_and_invalid_char.txt @@ -4,5 +4,5 @@ ---tokens--- "'" Error '1' Literal.Number.Integer -' ' Text +' ' Text.Whitespace "//'\n" Comment.Single diff --git a/tests/snippets/scala/test_open_soft_keyword.txt b/tests/snippets/scala/test_open_soft_keyword.txt index 800880ee..903be71d 100644 --- a/tests/snippets/scala/test_open_soft_keyword.txt +++ b/tests/snippets/scala/test_open_soft_keyword.txt @@ -3,10 +3,10 @@ val open = true ---tokens--- 'val' Keyword.Declaration -' ' Text +' ' Text.Whitespace 'open' Name -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace 'true' Keyword.Constant -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_package_name.txt b/tests/snippets/scala/test_package_name.txt index 6b1f3482..53633e2c 100644 --- a/tests/snippets/scala/test_package_name.txt +++ b/tests/snippets/scala/test_package_name.txt @@ -3,9 +3,9 @@ package p1.p2: ---tokens--- 'package' Keyword -' ' Text +' ' Text.Whitespace 'p1' Name.Namespace '.' Punctuation 'p2' Name ':' Punctuation -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_prepend_operator.txt b/tests/snippets/scala/test_prepend_operator.txt index db850479..cf7b2f97 100644 --- a/tests/snippets/scala/test_prepend_operator.txt +++ b/tests/snippets/scala/test_prepend_operator.txt @@ -3,8 +3,8 @@ a +: b ---tokens--- 'a' Name -' ' Text +' ' Text.Whitespace '+:' Operator -' ' Text +' ' Text.Whitespace 'b' Name -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_qualified_name.txt b/tests/snippets/scala/test_qualified_name.txt index 8a1f06ff..a004410c 100644 --- a/tests/snippets/scala/test_qualified_name.txt +++ b/tests/snippets/scala/test_qualified_name.txt @@ -7,4 +7,4 @@ a.b.c 'b' Name '.' Punctuation 'c' Name -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_qualified_name_class.txt b/tests/snippets/scala/test_qualified_name_class.txt index b9d47c94..7345092a 100644 --- a/tests/snippets/scala/test_qualified_name_class.txt +++ b/tests/snippets/scala/test_qualified_name_class.txt @@ -7,4 +7,4 @@ a.b.C 'b' Name '.' Punctuation 'C' Name.Class -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_script_header.txt b/tests/snippets/scala/test_script_header.txt index f15ded80..6d96fd69 100644 --- a/tests/snippets/scala/test_script_header.txt +++ b/tests/snippets/scala/test_script_header.txt @@ -3,4 +3,4 @@ ---tokens--- '#!/usr/bin/scala' Comment.Hashbang -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_symbol_followed_by_op.txt b/tests/snippets/scala/test_symbol_followed_by_op.txt index 5d8a14f5..518abce2 100644 --- a/tests/snippets/scala/test_symbol_followed_by_op.txt +++ b/tests/snippets/scala/test_symbol_followed_by_op.txt @@ -4,4 +4,4 @@ symbol* ---tokens--- 'symbol' Name '*' Operator -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_symbol_name_ending_with_star.txt b/tests/snippets/scala/test_symbol_name_ending_with_star.txt index bb1d987f..25e5dc63 100644 --- a/tests/snippets/scala/test_symbol_name_ending_with_star.txt +++ b/tests/snippets/scala/test_symbol_name_ending_with_star.txt @@ -3,4 +3,4 @@ symbol_* ---tokens--- 'symbol_*' Name -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scala/test_underscore_name.txt b/tests/snippets/scala/test_underscore_name.txt index f27754fd..f7a24af1 100644 --- a/tests/snippets/scala/test_underscore_name.txt +++ b/tests/snippets/scala/test_underscore_name.txt @@ -3,10 +3,10 @@ val head = _head ---tokens--- 'val' Keyword.Declaration -' ' Text +' ' Text.Whitespace 'head' Name -' ' Text +' ' Text.Whitespace '=' Operator -' ' Text +' ' Text.Whitespace '_head' Name -'\n' Text +'\n' Text.Whitespace diff --git a/tests/snippets/scheme/keywords.txt b/tests/snippets/scheme/keywords.txt new file mode 100644 index 00000000..046a4443 --- /dev/null +++ b/tests/snippets/scheme/keywords.txt @@ -0,0 +1,43 @@ +---input--- +(define* (foo #:key (bar123? 'baz)) + (display bar123?) + (newline)) + +(foo #:bar123? 'xyz) + +---tokens--- +'(' Punctuation +'define*' Keyword +' ' Text.Whitespace +'(' Punctuation +'foo' Name.Function +' ' Text.Whitespace +'#:key' Keyword.Declaration +' ' Text.Whitespace +'(' Punctuation +'bar123?' Name.Function +' ' Text.Whitespace +"'baz" Literal.String.Symbol +')' Punctuation +')' Punctuation +'\n ' Text.Whitespace +'(' Punctuation +'display' Name.Builtin +' ' Text.Whitespace +'bar123?' Name.Variable +')' Punctuation +'\n ' Text.Whitespace +'(' Punctuation +'newline' Name.Builtin +')' Punctuation +')' Punctuation +'\n\n' Text.Whitespace + +'(' Punctuation +'foo' Name.Function +' ' Text.Whitespace +'#:bar123?' Keyword.Declaration +' ' Text.Whitespace +"'xyz" Literal.String.Symbol +')' Punctuation +'\n' Text.Whitespace diff --git a/tests/snippets/scheme/numbers.txt b/tests/snippets/scheme/numbers.txt new file mode 100644 index 00000000..f03b3a7a --- /dev/null +++ b/tests/snippets/scheme/numbers.txt @@ -0,0 +1,169 @@ +---input--- +;; All sorts of numbers, common and less common. + +0 +142 +-142 ++142 +-0.5 ++0.5 +-0.5e-10 ++0.5e10 +0.5e+10 +.5F+10 +.123 +123. +123.L-25|54 ++inf.0 +-inf.0 +#b+nan.0-inf.0i +1-2i +1-i ++i +-5f24@3.14159 +4/5 +5.4e5@4 +#i5 +#o5 +#i#o5 +#o#i5 +#b01/10 +#x0f42a +#E#b01/10 +#d#I01/10 +#i-324@3.14159 +#o#I01/1022-inf.0i + +;; These are not numbers but plain symbols. + +1+ +1- +i +inf +-inf +nan +-nan + +---tokens--- +';; All sorts of numbers, common and less common.' Comment.Single +'\n\n' Text.Whitespace + +'0' Literal.Number.Integer +'\n' Text.Whitespace + +'142' Literal.Number.Integer +'\n' Text.Whitespace + +'-142' Literal.Number.Integer +'\n' Text.Whitespace + +'+142' Literal.Number.Integer +'\n' Text.Whitespace + +'-0.5' Literal.Number.Float +'\n' Text.Whitespace + +'+0.5' Literal.Number.Float +'\n' Text.Whitespace + +'-0.5e-10' Literal.Number.Float +'\n' Text.Whitespace + +'+0.5e10' Literal.Number.Float +'\n' Text.Whitespace + +'0.5e+10' Literal.Number.Float +'\n' Text.Whitespace + +'.5F+10' Literal.Number.Float +'\n' Text.Whitespace + +'.123' Literal.Number.Float +'\n' Text.Whitespace + +'123.' Literal.Number.Float +'\n' Text.Whitespace + +'123.L-25|54' Literal.Number.Float +'\n' Text.Whitespace + +'+inf.0' Literal.Number.Float +'\n' Text.Whitespace + +'-inf.0' Literal.Number.Float +'\n' Text.Whitespace + +'#b+nan.0-inf.0i' Literal.Number.Bin +'\n' Text.Whitespace + +'1-2i' Literal.Number.Integer +'\n' Text.Whitespace + +'1-i' Literal.Number.Integer +'\n' Text.Whitespace + +'+i' Literal.Number.Integer +'\n' Text.Whitespace + +'-5f24@3.14159' Literal.Number.Float +'\n' Text.Whitespace + +'4/5' Literal.Number.Integer +'\n' Text.Whitespace + +'5.4e5@4' Literal.Number.Float +'\n' Text.Whitespace + +'#i5' Literal.Number.Integer +'\n' Text.Whitespace + +'#o5' Literal.Number.Oct +'\n' Text.Whitespace + +'#i#o5' Literal.Number.Oct +'\n' Text.Whitespace + +'#o#i5' Literal.Number.Oct +'\n' Text.Whitespace + +'#b01/10' Literal.Number.Bin +'\n' Text.Whitespace + +'#x0f42a' Literal.Number.Hex +'\n' Text.Whitespace + +'#E#b01/10' Literal.Number.Bin +'\n' Text.Whitespace + +'#d#I01/10' Literal.Number.Integer +'\n' Text.Whitespace + +'#i-324@3.14159' Literal.Number.Float +'\n' Text.Whitespace + +'#o#I01/1022-inf.0i' Literal.Number.Oct +'\n\n' Text.Whitespace + +';; These are not numbers but plain symbols.' Comment.Single +'\n\n' Text.Whitespace + +'1+' Name.Builtin +'\n' Text.Whitespace + +'1-' Name.Builtin +'\n' Text.Whitespace + +'i' Name.Variable +'\n' Text.Whitespace + +'inf' Name.Builtin +'\n' Text.Whitespace + +'-inf' Name.Variable +'\n' Text.Whitespace + +'nan' Name.Builtin +'\n' Text.Whitespace + +'-nan' Name.Variable +'\n' Text.Whitespace diff --git a/tests/snippets/scheme/strings.txt b/tests/snippets/scheme/strings.txt new file mode 100644 index 00000000..9d033510 --- /dev/null +++ b/tests/snippets/scheme/strings.txt @@ -0,0 +1,85 @@ +---input--- +;; Test string escapes + +"basic string" + +"Strings can + span several + + lines. + " + +"Escapes: + \" + \\ + \| + \a + \f + \n + \r + \t + \v + \b + \0 + \( + \ + \x125612; (R6RS-style) + \x13 (Guile-style) + \u1234 + \U123456 +" + +---tokens--- +';; Test string escapes' Comment.Single +'\n\n' Text.Whitespace + +'"' Literal.String +'basic string' Literal.String +'"' Literal.String +'\n\n' Text.Whitespace + +'"' Literal.String +'Strings can\n span several\n\n lines.\n ' Literal.String +'"' Literal.String +'\n\n' Text.Whitespace + +'"' Literal.String +'Escapes:\n ' Literal.String +'\\"' Literal.String.Escape +'\n ' Literal.String +'\\\\' Literal.String.Escape +'\n ' Literal.String +'\\|' Literal.String.Escape +'\n ' Literal.String +'\\a' Literal.String.Escape +'\n ' Literal.String +'\\f' Literal.String.Escape +'\n ' Literal.String +'\\n' Literal.String.Escape +'\n ' Literal.String +'\\r' Literal.String.Escape +'\n ' Literal.String +'\\t' Literal.String.Escape +'\n ' Literal.String +'\\v' Literal.String.Escape +'\n ' Literal.String +'\\b' Literal.String.Escape +'\n ' Literal.String +'\\0' Literal.String.Escape +'\n ' Literal.String +'\\(' Literal.String.Escape +'\n ' Literal.String +'\\\n' Literal.String.Escape + +' ' Literal.String +'\\x125612;' Literal.String.Escape +' (R6RS-style)\n ' Literal.String +'\\x13' Literal.String.Escape +' (Guile-style)\n ' Literal.String +'\\u1234' Literal.String.Escape +'\n ' Literal.String +'\\U123456' Literal.String.Escape +'\n' Literal.String + +'"' Literal.String +'\n' Text.Whitespace diff --git a/tests/snippets/terraform/test_comment.txt b/tests/snippets/terraform/test_comment.txt index 933225ca..77bc33ad 100644 --- a/tests/snippets/terraform/test_comment.txt +++ b/tests/snippets/terraform/test_comment.txt @@ -1,5 +1,6 @@ ---input--- # Single line comment +// Non-idiomatic single line comment /* multiline comment @@ -9,6 +10,8 @@ ---tokens--- '# Single line comment\n' Comment.Single +'// Non-idiomatic single line comment\n' Comment.Single + '/*' Comment.Multiline ' ' Comment.Multiline 'm' Comment.Multiline diff --git a/tests/snippets/typescript/test_function_definition.txt b/tests/snippets/typescript/test_function_definition.txt index a2e10a8b..925c380b 100644 --- a/tests/snippets/typescript/test_function_definition.txt +++ b/tests/snippets/typescript/test_function_definition.txt @@ -4,15 +4,15 @@ async function main() { ---tokens--- 'async' Keyword -' ' Text +' ' Text.Whitespace 'function' Keyword.Declaration -' ' Text +' ' Text.Whitespace 'main' Name.Other '(' Punctuation ')' Punctuation -' ' Text +' ' Text.Whitespace '{' Punctuation -'\n' Text +'\n' Text.Whitespace '}' Punctuation -'\n' Text +'\n' Text.Whitespace |