summaryrefslogtreecommitdiffstats
path: root/tests/snippets/jslt/test_sample.txt
blob: 73ad3fda83e18beae2cbbd4690a0883b42d824ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---input---
import "transforms/yellow.jslt" as yellow

// Known valid types
let valid-types = [ "SomeType" ]

def foobar(arg) $arg.foobar

{
  "foobar": foobar(.),
  "is-valid": contains(.type, $valid-types),
  *: .
}

---tokens---
'import'      Keyword.Namespace
' '           Text.Whitespace
'"transforms/yellow.jslt"' Literal.String.Symbol
' '           Text.Whitespace
'as'          Keyword.Namespace
' '           Text.Whitespace
'yellow'      Name.Namespace
'\n\n'        Text.Whitespace

'// Known valid types\n' Comment.Single

'let'         Keyword.Declaration
' '           Text.Whitespace
'valid-types' Name.Variable
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'['           Punctuation
' '           Text.Whitespace
'"SomeType"'  Literal.String.Double
' '           Text.Whitespace
']'           Punctuation
'\n\n'        Text.Whitespace

'def'         Keyword.Declaration
' '           Text.Whitespace
'foobar'      Name.Function
'('           Punctuation
'arg'         Name.Variable
')'           Punctuation
' '           Text.Whitespace
'$arg'        Name.Variable
'.'           Operator
'foobar'      Name
'\n\n'        Text.Whitespace

'{'           Punctuation
'\n  '        Text.Whitespace
'"foobar"'    Literal.String.Double
':'           Punctuation
' '           Text.Whitespace
'foobar'      Name
'('           Punctuation
'.'           Operator
')'           Punctuation
','           Punctuation
'\n  '        Text.Whitespace
'"is-valid"'  Literal.String.Double
':'           Punctuation
' '           Text.Whitespace
'contains'    Name.Builtin
'('           Punctuation
'.'           Operator
'type'        Name
','           Punctuation
' '           Text.Whitespace
'$valid-types' Name.Variable
')'           Punctuation
','           Punctuation
'\n  '        Text.Whitespace
'*'           Operator
':'           Punctuation
' '           Text.Whitespace
'.'           Operator
'\n'          Text.Whitespace

'}'           Punctuation
'\n'          Text.Whitespace