summaryrefslogtreecommitdiff
path: root/tests/snippets/mcfunction/multiline.txt
blob: 15879101c768dde64fb7e4d79cae0cb5e3c9d473 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---input---
execute
    as @a                               # For each "player",
    at @s                               # start at their feet.
    anchored eyes                       # Looking through their eyes,
    facing 0 0 0                        # face perfectly at the target
    anchored feet                       # (go back to the feet)
    positioned ^ ^ ^1                   # and move one block forward.
    rotated as @s                       # Face the direction the player
                                           # is actually facing,
    positioned ^ ^ ^-1                  # and move one block back.
    if entity @s[distance=..0.6]        # Check if we're close to the
                                           # player's feet.
    run 
        say "I'm facing the target!"

---tokens---
'execute'     Name.Builtin
'\n    '      Text.Whitespace
'as'          Keyword.Constant
' '           Text.Whitespace
'@a'          Name.Variable
'                               ' Text.Whitespace
'# For each "player",' Comment.Single
'\n    '      Text.Whitespace
'at'          Keyword.Constant
' '           Text.Whitespace
'@s'          Name.Variable
'                               ' Text.Whitespace
'# start at their feet.' Comment.Single
'\n    '      Text.Whitespace
'anchored'    Keyword.Constant
' '           Text.Whitespace
'eyes'        Keyword.Constant
'                       ' Text.Whitespace
'# Looking through their eyes,' Comment.Single
'\n    '      Text.Whitespace
'facing'      Keyword.Constant
' '           Text.Whitespace
'0'           Literal.Number.Float
' '           Text.Whitespace
'0'           Literal.Number.Float
' '           Text.Whitespace
'0'           Literal.Number.Float
'                        ' Text.Whitespace
'# face perfectly at the target' Comment.Single
'\n    '      Text.Whitespace
'anchored'    Keyword.Constant
' '           Text.Whitespace
'feet'        Keyword.Constant
'                       ' Text.Whitespace
'# (go back to the feet)' Comment.Single
'\n    '      Text.Whitespace
'positioned'  Keyword.Constant
' '           Text.Whitespace
'^'           Operator
' '           Text.Whitespace
'^'           Operator
' '           Text.Whitespace
'^'           Operator
'1'           Literal.Number.Float
'                   ' Text.Whitespace
'# and move one block forward.' Comment.Single
'\n    '      Text.Whitespace
'rotated'     Keyword.Constant
' '           Text.Whitespace
'as'          Keyword.Constant
' '           Text.Whitespace
'@s'          Name.Variable
'                       ' Text.Whitespace
'# Face the direction the player' Comment.Single
'\n                                           ' Text.Whitespace
'# is actually facing,' Comment.Single
'\n    '      Text.Whitespace
'positioned'  Keyword.Constant
' '           Text.Whitespace
'^'           Operator
' '           Text.Whitespace
'^'           Operator
' '           Text.Whitespace
'^'           Operator
'-1'          Literal.Number.Float
'                  ' Text.Whitespace
'# and move one block back.' Comment.Single
'\n    '      Text.Whitespace
'if'          Keyword.Constant
' '           Text.Whitespace
'entity'      Keyword.Constant
' '           Text.Whitespace
'@s'          Name.Variable
'['           Punctuation
'distance'    Name.Attribute
'='           Punctuation
'..'          Literal
'0.6'         Literal.Number.Float
']'           Punctuation
'        '    Text.Whitespace
"# Check if we're close to the" Comment.Single
'\n                                           ' Text.Whitespace
"# player's feet." Comment.Single
'\n    '      Text.Whitespace
'run'         Keyword.Constant
' \n        say' Name.Builtin
' '           Text.Whitespace
'"'           Literal.String.Double
"I'm facing the target!" Literal.String.Double
'"'           Literal.String.Double
'\n'          Text.Whitespace