This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tests/snippets/mcfunction/multiline.txt
Rit 8ad1bea2a2
Initial commit for MCFunction Lexer + tests (#2107)
* Initial commit for MCFunction Lexer + tests

* Apply suggestions from code review

Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr>

* added docstring info + fix for run ... command

* remove string ending Error tokens

* not working - refactor in-progress

* fixed: generic property

* Update pygments/lexers/mcfunction.py

Co-authored-by: Georg Brandl <georg@python.org>

* apply some fixes from comments

* Update pygments/lexers/mcfunction.py

Co-authored-by: Georg Brandl <georg@python.org>

* spacing

* updated tests and applied more suggestions

* fixed comment regex, passes tests

Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr>
Co-authored-by: Georg Brandl <georg@python.org>
2022-04-24 14:59:41 +02:00

108 lines
3.8 KiB
Text

---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