Debian Codegraph @

tests/snippets/nix/control_structures.txt

raw
1 ---input---
2 if 1 + 1 == 2 then "yes!" else "no!"
3
4 assert 1 + 1 == 2; "yes!"
5
6 let x = "foo"; y = "bar"; in x + y
7
8 with builtins; head [ 1 2 3 ]
9
10 ---tokens---
11 'if' Keyword
12 ' ' Text
13 '1' Literal.Number.Integer
14 ' ' Text
15 '+' Operator
16 ' ' Text
17 '1' Literal.Number.Integer
18 ' ' Text
19 '==' Operator
20 ' ' Text
21 '2' Literal.Number.Integer
22 ' ' Text
23 'then' Keyword
24 ' ' Text
25 '"' Literal.String.Double
26 'yes!' Literal.String.Double
27 '"' Literal.String.Double
28 ' ' Text
29 'else' Keyword
30 ' ' Text
31 '"' Literal.String.Double
32 'no!' Literal.String.Double
33 '"' Literal.String.Double
34 '\n\n' Text
35
36 'assert' Keyword
37 ' ' Text
38 '1' Literal.Number.Integer
39 ' ' Text
40 '+' Operator
41 ' ' Text
42 '1' Literal.Number.Integer
43 ' ' Text
44 '==' Operator
45 ' ' Text
46 '2' Literal.Number.Integer
47 ';' Punctuation
48 ' ' Text
49 '"' Literal.String.Double
50 'yes!' Literal.String.Double
51 '"' Literal.String.Double
52 '\n\n' Text
53
54 'let' Keyword
55 ' ' Text
56 'x' Literal.String.Symbol
57 ' ' Text
58 '=' Operator
59 ' ' Text
60 '"' Literal.String.Double
61 'foo' Literal.String.Double
62 '"' Literal.String.Double
63 ';' Punctuation
64 ' ' Text
65 'y' Literal.String.Symbol
66 ' ' Text
67 '=' Operator
68 ' ' Text
69 '"' Literal.String.Double
70 'bar' Literal.String.Double
71 '"' Literal.String.Double
72 ';' Punctuation
73 ' ' Text
74 'in' Keyword
75 ' ' Text
76 'x' Text
77 ' ' Text
78 '+' Operator
79 ' ' Text
80 'y' Text
81 '\n\n' Text
82
83 'with' Keyword
84 ' ' Text
85 'builtins' Name.Builtin
86 ';' Punctuation
87 ' ' Text
88 'head' Text
89 ' ' Text
90 '[' Punctuation
91 ' ' Text
92 '1' Literal.Number.Integer
93 ' ' Text
94 '2' Literal.Number.Integer
95 ' ' Text
96 '3' Literal.Number.Integer
97 ' ' Text
98 ']' Punctuation
99 '\n' Text