diff options
| author | Rit <RitikShah@users.noreply.github.com> | 2022-04-24 05:59:41 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-24 14:59:41 +0200 |
| commit | 8ad1bea2a285b33778aa38eb274ddea9a6afc0b9 (patch) | |
| tree | 66a52e90346a88ade27f6ab59a8c556f9aa794b9 | |
| parent | 323a7056a7df342e2e4e9986204f5d80487fae56 (diff) | |
| download | pygments-git-8ad1bea2a285b33778aa38eb274ddea9a6afc0b9.tar.gz | |
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>
| -rw-r--r-- | pygments/lexers/_mapping.py | 2 | ||||
| -rw-r--r-- | pygments/lexers/mcfunction.py | 324 | ||||
| -rw-r--r-- | tests/examplefiles/mcfunction/main.mcfunction | 180 | ||||
| -rw-r--r-- | tests/examplefiles/mcfunction/main.mcfunction.output | 2052 | ||||
| -rw-r--r-- | tests/examplefiles/snbt/main.snbt | 23 | ||||
| -rw-r--r-- | tests/examplefiles/snbt/main.snbt.output | 151 | ||||
| -rw-r--r-- | tests/snippets/mcfunction/commenting.txt | 173 | ||||
| -rw-r--r-- | tests/snippets/mcfunction/coordinates.txt | 188 | ||||
| -rw-r--r-- | tests/snippets/mcfunction/data.txt | 120 | ||||
| -rw-r--r-- | tests/snippets/mcfunction/difficult_1.txt | 56 | ||||
| -rw-r--r-- | tests/snippets/mcfunction/multiline.txt | 108 | ||||
| -rw-r--r-- | tests/snippets/mcfunction/selectors.txt | 73 | ||||
| -rw-r--r-- | tests/snippets/mcfunction/simple.txt | 92 | ||||
| -rw-r--r-- | tests/snippets/snbt/json.txt | 43 | ||||
| -rw-r--r-- | tests/snippets/snbt/literals.txt | 41 | ||||
| -rw-r--r-- | tests/snippets/snbt/multiline.txt | 56 | ||||
| -rw-r--r-- | tests/snippets/snbt/nesting.txt | 39 | ||||
| -rw-r--r-- | tests/snippets/snbt/quoted_keys.txt | 29 |
18 files changed, 3750 insertions, 0 deletions
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py index 6ee187e6..b9da25f9 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -279,6 +279,7 @@ LEXERS = { 'LogosLexer': ('pygments.lexers.objective', 'Logos', ('logos',), ('*.x', '*.xi', '*.xm', '*.xmi'), ('text/x-logos',)), 'LogtalkLexer': ('pygments.lexers.prolog', 'Logtalk', ('logtalk',), ('*.lgt', '*.logtalk'), ('text/x-logtalk',)), 'LuaLexer': ('pygments.lexers.scripting', 'Lua', ('lua',), ('*.lua', '*.wlua'), ('text/x-lua', 'application/x-lua')), + 'MCFunctionLexer': ('pygments.lexers.mcfunction', 'MCFunction', ('mcfunction', 'mcf'), ('*.mcfunction',), ('text/mcfunction',)), 'MIMELexer': ('pygments.lexers.mime', 'MIME', ('mime',), (), ('multipart/mixed', 'multipart/related', 'multipart/alternative')), 'MOOCodeLexer': ('pygments.lexers.scripting', 'MOOCode', ('moocode', 'moo'), ('*.moo',), ('text/x-moocode',)), 'MSDOSSessionLexer': ('pygments.lexers.shell', 'MSDOS Session', ('doscon',), (), ()), @@ -429,6 +430,7 @@ LEXERS = { 'SASLexer': ('pygments.lexers.sas', 'SAS', ('sas',), ('*.SAS', '*.sas'), ('text/x-sas', 'text/sas', 'application/x-sas')), 'SLexer': ('pygments.lexers.r', 'S', ('splus', 's', 'r'), ('*.S', '*.R', '.Rhistory', '.Rprofile', '.Renviron'), ('text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r', 'text/x-R', 'text/x-r-history', 'text/x-r-profile')), 'SMLLexer': ('pygments.lexers.ml', 'Standard ML', ('sml',), ('*.sml', '*.sig', '*.fun'), ('text/x-standardml', 'application/x-standardml')), + 'SNBTLexer': ('pygments.lexers.mcfunction', 'SNBT', ('snbt',), ('*.snbt',), ('text/snbt',)), 'SarlLexer': ('pygments.lexers.jvm', 'SARL', ('sarl',), ('*.sarl',), ('text/x-sarl',)), 'SassLexer': ('pygments.lexers.css', 'Sass', ('sass',), ('*.sass',), ('text/x-sass',)), 'SaviLexer': ('pygments.lexers.savi', 'Savi', ('savi',), ('*.savi',), ()), diff --git a/pygments/lexers/mcfunction.py b/pygments/lexers/mcfunction.py new file mode 100644 index 00000000..b05e21d4 --- /dev/null +++ b/pygments/lexers/mcfunction.py @@ -0,0 +1,324 @@ +""" + pygments.lexers.mcfunction + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lexers for MCFunction and related languages. + + :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.lexer import RegexLexer, default, include, bygroups +from pygments.token import (Comment, Keyword, Literal, Name, Number, + Operator, Punctuation, String, Text, Token, + Whitespace) + + +__all__ = ['SNBTLexer', 'MCFunctionLexer'] + + +class SNBTLexer(RegexLexer): + """Lexer for stringified NBT, a data format used in Minecraft + + .. versionadded:: 2.12.0 + """ + + name = "SNBT" + url = "https://minecraft.fandom.com/wiki/NBT_format" + aliases = ["snbt"] + filenames = ["*.snbt"] + mimetypes = ["text/snbt"] + + tokens = { + "root": [ + # We only look for the open bracket here since square bracket + # is only valid in NBT pathing (which is a mcfunction idea). + (r"\{", Punctuation, "compound"), + (r"[^\{]+", Text), + ], + + "whitespace": [ + (r"\s+", Whitespace), + ], + + "operators": [ + (r"[,:;]", Punctuation), + ], + + "literals": [ + (r"(true|false)", Keyword.Constant), + (r"-?\d+[eE]-?\d+", Number.Float), + (r"-?\d*\.\d+[fFdD]?", Number.Float), + (r"-?\d+[bBsSlLfFdD]?", Number.Integer), + + # Separate states for both types of strings so they don't entangle + (r'"', String.Double, "literals.string_double"), + (r"'", String.Single, "literals.string_single"), + ], + "literals.string_double": [ + (r"\\.", String.Escape), + (r'[^\\"\n]+', String.Double), + (r'"', String.Double, "#pop"), + ], + "literals.string_single": [ + (r"\\.", String.Escape), + (r"[^\\'\n]+", String.Single), + (r"'", String.Single, "#pop"), + ], + + "compound": [ + # this handles the unquoted snbt keys + # note: stringified keys still work + (r"[A-Z_a-z]+", Name.Attribute), + include("operators"), + include("whitespace"), + include("literals"), + (r"\{", Punctuation, "#push"), + (r"\[", Punctuation, "list"), + (r"\}", Punctuation, "#pop"), + ], + + "list": [ + (r"[A-Z_a-z]+", Name.Attribute), + include("literals"), + include("operators"), + include("whitespace"), + (r"\[", Punctuation, "#push"), + (r"\{", Punctuation, "compound"), + (r"\]", Punctuation, "#pop"), + ], + } + + +class MCFunctionLexer(RegexLexer): + """Lexer for the mcfunction scripting language used in Minecraft + Modelled somewhat after the `GitHub mcfunction grammar <https://github.com/Arcensoth/language-mcfunction>`_. + + .. versionadded:: 2.12.0 + """ + + name = "MCFunction" + url = "https://minecraft.fandom.com/wiki/Commands" + aliases = ["mcfunction", "mcf"] + filenames = ["*.mcfunction"] + mimetypes = ["text/mcfunction"] + + # Used to denotate the start of a block comment, borrowed from Github's mcfunction + _block_comment_prefix = "[>!]" + + tokens = { + "root": [ + include("names"), + include("comments"), + include("literals"), + include("whitespace"), + include("property"), + include("operators"), + include("selectors"), + ], + + "names": [ + # The start of a command (either beginning of line OR after the run keyword) + # We don't encode a list of keywords since mods, plugins, or even pre-processors + # may add new commands, so we have a 'close-enough' regex which catches them. + (r"^(\s*)([a-z_]+)", bygroups(Whitespace, Name.Builtin)), + (r"(?<=run)\s+[a-z_]+", Name.Builtin), + + # UUID + ( + r"\b[0-9a-fA-F]+(?:-[0-9a-fA-F]+){4}\b", + Name.Variable, + ), + include("resource-name"), + # normal command names and scoreboards + # there's no way to know the differences unfortuntely + (r"[A-Za-z_][A-Za-z0-9_.#%$]+", Keyword.Constant), + (r"[#%$][A-Za-z0-9_.#%$]+", Name.Variable.Magic), + ], + + "resource-name": [ + ( + # resource names have to be lowercase + r"#?[a-z_][a-z_.-]*:[a-z0-9_./-]+", + Name.Function, + ), + ( + # similar to above except optional `:`` + # a `/` must be present "somewhere" + r"#?[a-z0-9_\.\-]+\/[a-z0-9_\.\-\/]+", + Name.Function, + ) + ], + + "whitespace": [ + (r"\s+", Whitespace), + ], + + "comments": [ + ( + rf"^\s*(#{_block_comment_prefix})", + Comment.Multiline, + ( + "comments.block", + "comments.block.emphasized", + ), + ), + (r"#.*$", Comment.Single), + ], + "comments.block": [ + (rf"^\s*#{_block_comment_prefix}", Comment.Multiline, "comments.block.emphasized"), + (r"^\s*#", Comment.Multiline, "comments.block.normal"), + default("#pop"), + ], + "comments.block.normal": [ + include("comments.block.special"), + (r"\S+", Comment.Multiline), + (r"\n", Text, "#pop"), + include("whitespace"), + ], + "comments.block.emphasized": [ + include("comments.block.special"), + (r"\S+", String.Doc), + (r"\n", Text, "#pop"), + include("whitespace"), + ], + "comments.block.special": [ + # Params + (r"@\S+", Name.Decorator), + + include("resource-name"), + + # Scoreboard player names + (r"[#%$][A-Za-z0-9_.#%$]+", Name.Variable.Magic), + ], + + "operators": [ + (r"[\-~%^?!+*<>\\/|&=.]", Operator), + ], + + "literals": [ + (r"\.\.", Literal), + (r"(true|false)", Keyword.Pseudo), + + # these are like unquoted strings and appear in many places + (r"[A-Za-z_]+", Name.Variable.Class), + + (r"[0-7]b", Number.Byte), + (r"[+-]?\d*\.?\d+([eE]?[+-]?\d+)?[df]?\b", Number.Float), + (r"[+-]?\d+\b", Number.Integer), + (r'"', String.Double, "literals.string-double"), + (r"'", String.Single, "literals.string-single"), + ], + "literals.string-double": [ + (r"\\.", String.Escape), + (r'[^\\"\n]+', String.Double), + (r'"', String.Double, "#pop"), + ], + "literals.string-single": [ + (r"\\.", String.Escape), + (r"[^\\'\n]+", String.Single), + (r"'", String.Single, "#pop"), + ], + + "selectors": [ + (r"@[a-z]", Name.Variable), + ], + + + ## Generic Property Container + # There are several, differing instances where the language accepts + # specific contained keys or contained key, value pairings. + # + # Property Maps: + # - Starts with either `[` or `{` + # - Key separated by `:` or `=` + # - Deliminated by `,` + # + # Property Lists: + # - Starts with `[` + # - Deliminated by `,` + # + # For simplicity, these patterns match a generic, nestable structure + # which follow a key, value pattern. For normal lists, there's only keys. + # This allow some "illegal" structures, but we'll accept those for + # sake of simplicity + # + # Examples: + # - `[facing=up, powered=true]` (blockstate) + # - `[name="hello world", nbt={key: 1b}]` (selector + nbt) + # - `[{"text": "value"}, "literal"]` (json) + ## + "property": [ + # This state gets included in root and also several substates + # We do this to shortcut the starting of new properties + # within other properties. Lists can have sublists and compounds + # and values can start a new property (see the `difficult_1.txt` + # snippet). + (r"\{", Punctuation, ("property.curly", "property.key")), + (r"\[", Punctuation, ("property.square", "property.key")), + ], + "property.curly": [ + include("whitespace"), + include("property"), + (r"\}", Punctuation, "#pop"), + ], + "property.square": [ + include("whitespace"), + include("property"), + (r"\]", Punctuation, "#pop"), + + # lists can have sequences of items + (r",", Punctuation), + ], + "property.key": [ + include("whitespace"), + + # resource names (for advancements) + # can omit `:` to default `minecraft:` + # must check if there is a future equals sign if `:` is in the name + (r"#?[a-z_][a-z_\.\-]*\:[a-z0-9_\.\-/]+(?=\s*\=)", Name.Attribute, "property.delimiter"), + (r"#?[a-z_][a-z0-9_\.\-/]+", Name.Attribute, "property.delimiter"), + + # unquoted NBT key + (r"[A-Za-z_\-\+]+", Name.Attribute, "property.delimiter"), + + # quoted JSON or NBT key + (r'"', Name.Attribute, "property.delimiter", "literals.string-double"), + (r"'", Name.Attribute, "property.delimiter", "literals.string-single"), + + # index for a list + (r"-?\d+", Number.Integer, "property.delimiter"), + + default("#pop"), + ], + "property.key.string-double": [ + (r"\\.", String.Escape), + (r'[^\\"\n]+', Name.Attribute), + (r'"', Name.Attribute, "#pop"), + ], + "property.key.string-single": [ + (r"\\.", String.Escape), + (r"[^\\'\n]+", Name.Attribute), + (r"'", Name.Attribute, "#pop"), + ], + "property.delimiter": [ + include("whitespace"), + + (r"[:=]!?", Punctuation, "property.value"), + (r",", Punctuation), + + default("#pop"), + ], + "property.value": [ + include("whitespace"), + + # unquoted resource names are valid literals here + (r"#?[a-z_][a-z_\.\-]*\:[a-z0-9_\.\-/]+", Name.Tag), + (r"#?[a-z_][a-z0-9_\.\-/]+", Name.Tag), + + include("literals"), + include("property"), + + default("#pop"), + ], + } diff --git a/tests/examplefiles/mcfunction/main.mcfunction b/tests/examplefiles/mcfunction/main.mcfunction new file mode 100644 index 00000000..47109ff0 --- /dev/null +++ b/tests/examplefiles/mcfunction/main.mcfunction @@ -0,0 +1,180 @@ +# This example file is borrowed from https://github.com/Arcensoth/language-mcfunction/blob/main/tests/everything.mcfunction + +#> Raycasting +# +# Casts a ray from starting position along a configurable number +# of blocks with a confugrable accuracy, counting the number of +# entities hit by the ray along the way. +# +# @params +# $mypack.raycast.distance param +# The number of blocks to cast forward. +# $mypack.raycast.precision param +# The ratio of block precision to a full block. +# +# @returns +# $mypack.raycast.result return +# The number of entities hit by the ray. + +function #mypack:hooks/raycast/begin + +function mypack:raycast/loop + +function #mypack:hooks/raycast/end + +# this is a comment +say hello world + + # indented comment + say hello indent + +effect give @s minecraft:night_vision 999999 1 true +effect give @s minecraft:night_vision 999999 1 false + +teleport 1 2 3 +teleport 100.5 80 -100.5 + +execute if score @a temp matches 10.. run +execute if score @a temp matches ..20 run +execute if score @a temp matches 10..20 run + +execute positioned 10 ~ -10 run +execute positioned 10 ~10 -10 run +execute positioned 10 ~0.5 -10 run +execute positioned 10 ~.5 -10 run +execute positioned 10 ~-10 -10 run +execute positioned 10 ~-0.5 -10 run +execute positioned 10 ~-.5 -10 run + +execute positioned 10 ^ -10 run +execute positioned 10 ^10 -10 run +execute positioned 10 ^0.5 -10 run +execute positioned 10 ^.5 -10 run +execute positioned 10 ^-10 -10 run +execute positioned 10 ^-0.5 -10 run +execute positioned 10 ^-.5 -10 run + +function mypack:foo +function mypack:foo/bar +function mypack:foo/bar/baz +function #mypack:foo +function #mypack:foo/bar +function #mypack:foo/bar/baz + +execute if block ~ ~ ~ minecraft:oak_log[axis=x] run +execute if block ~ ~ ~ minecraft:oak_leaves[distance=5] run +execute if block ~ ~ ~ minecraft:oak_leaves[persistent=true] run +execute if block ~ ~ ~ minecraft:oak_leaves[persistent=false] run +execute if block ~ ~ ~ minecraft:oak_leaves[distance=5,persistent=true] run +execute if block ~ ~ ~ #minecraft:leaves[distance=5] run +execute if block ~ ~ ~ #minecraft:leaves[distance=5,persistent=true] run +setblock ~ ~ ~ mypack:foo{foo:bar} destroy +setblock ~ ~ ~ mypack:foo{foo: bar} destroy +setblock ~ ~ ~ mypack:foo[facing=up]{foo: bar} destroy +setblock ~ ~ ~ mypack:foo[facing = up]{foo: bar} destroy +setblock ~ ~ ~ minecraft:dispenser[facing=up]{Items: [{id: "minecraft:diamond", Count: 1}]} + +tag @s add my.tag + +datapack enable "hello world" +datapack enable "escape \" me" +datapack enable 'hello world' +datapack enable 'escape \' me' + +execute as f7a39418-72ca-4bf2-bc7e-ba9df67a4707 run +execute as 0-0-0-0-0 run + +execute store result score #fakeplayer +execute store result score #fake.player +execute store result score #fake_player +execute store result score $fakeplayer +execute store result score %fakeplayer + +execute as @b +execute as @a + +execute as @a[tag=foo] +execute as @a[tag=!foo] + +execute as @a[sort=nearest] run +execute as @a[gamemode=survival] run +execute as @a[gamemode=!creative] run +execute as @a[tag=foo,tag=bar,tag=!baz] run + +execute as @a[distance=15] +execute as @a[distance=1.5] +execute as @a[distance=.5] +execute as @a[distance=-.25] + +execute as @a[distance=100] +execute as @a[distance=..10] +execute as @a[distance=11..19] +execute as @a[distance=20..] +execute as @a[distance=0.5] +execute as @a[distance=..0.1] +execute as @a[distance=0.2..0.8] +execute as @a[distance=0.9..] + +execute as @a[type=minecraft:bat] run +execute as @a[type=!minecraft:cow,type=!minecraft:pig] run +execute as @a[type=#minecraft:skeletons] run +execute as @a[type=!#minecraft:skeletons,type=!minecraft:zombie] run + +execute as @a[tag=my.tag] run + +execute as @a[name="hello world"] as @s run +execute as @a[name="escape \" me"] as @s run +execute as @a[name="how, about, commas ?"] as @s run +execute as @a[name="and [braces] ?"] as @s run + +execute as @e[nbt={ PortalCooldown: 0 }] run +execute as @e[nbt={ Item: {id: "minecraft:diamond", Count: 64 } }] run + +execute if score @s foo < @s bar run +execute if score @s foo <= @s bar run +execute if score @s foo = @s bar run +execute if score @s foo > @s bar run +execute if score @s foo >= @s bar run + +data get entity @s SelectedItem.tag.display.Name +data get entity @s Inventory[0] +data get entity @s Inventory[{id: "minecraft:diamond"}].Count +data get entity @s Inventory[].tag{custom: true}.display.Name + +data merge entity @s { foo: true, bar: 1234 } +data modify block ~ ~ ~ RecordItem.tag set value { messages: [hi, bye] } +data modify block ~ ~ ~ RecordItem.tag.messages append value [ { message: "hello world" } ] + +tellraw @a {"text": "hello world", "color": "blue"} +tellraw @a [{"text": "hello", "color": "blue"}, {"text": "world", "color": "blue"}] + +execute as @a[scores={myscore=10}] run +execute as @a[scores={myscore=10..12}] run +execute as @a[scores={foo=10, bar=1..5, baz=..0}] run + +execute as @a[advancements={minecraft:story/form_obsidian=true}] run +execute as @a[advancements={minecraft:story/obtain_armor={iron_helmet=true}}] run +execute as @a[advancements={minecraft:story/obtain_armor={iron_helmet=true, gold_helmet=false}}] run +execute as @a[advancements={minecraft:story/form_obsidian=true, minecraft:story/follow_ender_eye=true}] run +execute as @a[advancements={minecraft:story/form_obsidian={foo=true, bar=false},minecraft:story/follow_ender_eye={foo=false, bar=true}}] run + +give @s diamond_sword{display: {Name: '"My Custom Sword"'}} +give @s minecraft:diamond_sword{display: {Name: '"My Custom Sword"'}} + +execute if score @s foo < @s bar run say execute if score @s foo < @s bar run say +execute if score @s foo < @s bar run say hello @e[tag=baz, sort=nearest, limit=1] how are you? + +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!" diff --git a/tests/examplefiles/mcfunction/main.mcfunction.output b/tests/examplefiles/mcfunction/main.mcfunction.output new file mode 100644 index 00000000..5b5b8c40 --- /dev/null +++ b/tests/examplefiles/mcfunction/main.mcfunction.output @@ -0,0 +1,2052 @@ +'# This example file is borrowed from https://github.com/Arcensoth/language-mcfunction/blob/main/tests/everything.mcfunction' Comment.Single +'\n\n' Text.Whitespace + +'#>' Comment.Multiline +' ' Text.Whitespace +'Raycasting' Literal.String.Doc +'\n' Text + +'#' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'Casts' Comment.Multiline +' ' Text.Whitespace +'a' Comment.Multiline +' ' Text.Whitespace +'ray' Comment.Multiline +' ' Text.Whitespace +'from' Comment.Multiline +' ' Text.Whitespace +'starting' Comment.Multiline +' ' Text.Whitespace +'position' Comment.Multiline +' ' Text.Whitespace +'along' Comment.Multiline +' ' Text.Whitespace +'a' Comment.Multiline +' ' Text.Whitespace +'configurable' Comment.Multiline +' ' Text.Whitespace +'number' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'of' Comment.Multiline +' ' Text.Whitespace +'blocks' Comment.Multiline +' ' Text.Whitespace +'with' Comment.Multiline +' ' Text.Whitespace +'a' Comment.Multiline +' ' Text.Whitespace +'confugrable' Comment.Multiline +' ' Text.Whitespace +'accuracy,' Comment.Multiline +' ' Text.Whitespace +'counting' Comment.Multiline +' ' Text.Whitespace +'the' Comment.Multiline +' ' Text.Whitespace +'number' Comment.Multiline +' ' Text.Whitespace +'of' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'entities' Comment.Multiline +' ' Text.Whitespace +'hit' Comment.Multiline +' ' Text.Whitespace +'by' Comment.Multiline +' ' Text.Whitespace +'the' Comment.Multiline +' ' Text.Whitespace +'ray' Comment.Multiline +' ' Text.Whitespace +'along' Comment.Multiline +' ' Text.Whitespace +'the' Comment.Multiline +' ' Text.Whitespace +'way.' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'@params' Name.Decorator +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'$mypack.raycast.distance' Name.Variable.Magic +' ' Text.Whitespace +'param' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'The' Comment.Multiline +' ' Text.Whitespace +'number' Comment.Multiline +' ' Text.Whitespace +'of' Comment.Multiline +' ' Text.Whitespace +'blocks' Comment.Multiline +' ' Text.Whitespace +'to' Comment.Multiline +' ' Text.Whitespace +'cast' Comment.Multiline +' ' Text.Whitespace +'forward.' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'$mypack.raycast.precision' Name.Variable.Magic +' ' Text.Whitespace +'param' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'The' Comment.Multiline +' ' Text.Whitespace +'ratio' Comment.Multiline +' ' Text.Whitespace +'of' Comment.Multiline +' ' Text.Whitespace +'block' Comment.Multiline +' ' Text.Whitespace +'precision' Comment.Multiline +' ' Text.Whitespace +'to' Comment.Multiline +' ' Text.Whitespace +'a' Comment.Multiline +' ' Text.Whitespace +'full' Comment.Multiline +' ' Text.Whitespace +'block.' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'@returns' Name.Decorator +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'$mypack.raycast.result' Name.Variable.Magic +' ' Text.Whitespace +'return' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'The' Comment.Multiline +' ' Text.Whitespace +'number' Comment.Multiline +' ' Text.Whitespace +'of' Comment.Multiline +' ' Text.Whitespace +'entities' Comment.Multiline +' ' Text.Whitespace +'hit' Comment.Multiline +' ' Text.Whitespace +'by' Comment.Multiline +' ' Text.Whitespace +'the' Comment.Multiline +' ' Text.Whitespace +'ray.' Comment.Multiline +'\n' Text + +'\n' Text.Whitespace + +'function' Name.Builtin +' ' Text.Whitespace +'#mypack:hooks/raycast/begin' Name.Function +'\n\n' Text.Whitespace + +'function' Name.Builtin +' ' Text.Whitespace +'mypack:raycast/loop' Name.Function +'\n\n' Text.Whitespace + +'function' Name.Builtin +' ' Text.Whitespace +'#mypack:hooks/raycast/end' Name.Function +'\n\n' Text.Whitespace + +'# this is a comment' Comment.Single +'\n' Text.Whitespace + +'say' Name.Builtin +' ' Text.Whitespace +'hello' Keyword.Constant +' ' Text.Whitespace +'world' Keyword.Constant +'\n\n ' Text.Whitespace +'# indented comment' Comment.Single +'\n ' Text.Whitespace +'say' Keyword.Constant +' ' Text.Whitespace +'hello' Keyword.Constant +' ' Text.Whitespace +'indent' Keyword.Constant +'\n\n' Text.Whitespace + +'effect' Name.Builtin +' ' Text.Whitespace +'give' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'minecraft:night_vision' Name.Function +' ' Text.Whitespace +'999999' Literal.Number.Float +' ' Text.Whitespace +'1' Literal.Number.Float +' ' Text.Whitespace +'true' Keyword.Constant +'\n' Text.Whitespace + +'effect' Name.Builtin +' ' Text.Whitespace +'give' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'minecraft:night_vision' Name.Function +' ' Text.Whitespace +'999999' Literal.Number.Float +' ' Text.Whitespace +'1' Literal.Number.Float +' ' Text.Whitespace +'false' Keyword.Constant +'\n\n' Text.Whitespace + +'teleport' Name.Builtin +' ' Text.Whitespace +'1' Literal.Number.Float +' ' Text.Whitespace +'2' Literal.Number.Float +' ' Text.Whitespace +'3' Literal.Number.Float +'\n' Text.Whitespace + +'teleport' Name.Builtin +' ' Text.Whitespace +'100.5' Literal.Number.Float +' ' Text.Whitespace +'80' Literal.Number.Float +' ' Text.Whitespace +'-100.5' Literal.Number.Float +'\n\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +' ' Text.Whitespace +'temp' Keyword.Constant +' ' Text.Whitespace +'matches' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +'..' Literal +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +' ' Text.Whitespace +'temp' Keyword.Constant +' ' Text.Whitespace +'matches' Keyword.Constant +' ' Text.Whitespace +'..' Literal +'20' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +' ' Text.Whitespace +'temp' Keyword.Constant +' ' Text.Whitespace +'matches' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +'..' Literal +'20' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\n\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'10' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'0.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'-10' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'-0.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'-.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\n\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'10' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'0.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'-10' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'-0.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'positioned' Keyword.Constant +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'-.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +' ' Text.Whitespace +'run' Keyword.Constant +'\n\nfunction' Name.Builtin +' ' Text.Whitespace +'mypack:foo' Name.Function +'\n' Text.Whitespace + +'function' Name.Builtin +' ' Text.Whitespace +'mypack:foo/bar' Name.Function +'\n' Text.Whitespace + +'function' Name.Builtin +' ' Text.Whitespace +'mypack:foo/bar/baz' Name.Function +'\n' Text.Whitespace + +'function' Name.Builtin +' ' Text.Whitespace +'#mypack:foo' Name.Function +'\n' Text.Whitespace + +'function' Name.Builtin +' ' Text.Whitespace +'#mypack:foo/bar' Name.Function +'\n' Text.Whitespace + +'function' Name.Builtin +' ' Text.Whitespace +'#mypack:foo/bar/baz' Name.Function +'\n\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'block' Keyword.Constant +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'minecraft:oak_log' Name.Function +'[' Punctuation +'axis' Name.Attribute +'=' Punctuation +'x' Name.Variable.Class +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'block' Keyword.Constant +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'minecraft:oak_leaves' Name.Function +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'5' Literal.Number.Float +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'block' Keyword.Constant +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'minecraft:oak_leaves' Name.Function +'[' Punctuation +'persistent' Name.Attribute +'=' Punctuation +'true' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'block' Keyword.Constant +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'minecraft:oak_leaves' Name.Function +'[' Punctuation +'persistent' Name.Attribute +'=' Punctuation +'false' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'block' Keyword.Constant +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'minecraft:oak_leaves' Name.Function +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'5' Literal.Number.Float +',' Punctuation +'persistent' Name.Attribute +'=' Punctuation +'true' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'block' Keyword.Constant +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'#minecraft:leaves' Name.Function +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'5' Literal.Number.Float +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'block' Keyword.Constant +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'#minecraft:leaves' Name.Function +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'5' Literal.Number.Float +',' Punctuation +'persistent' Name.Attribute +'=' Punctuation +'true' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nsetblock' Name.Builtin +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'mypack:foo' Name.Function +'{' Punctuation +'foo' Name.Attribute +':' Punctuation +'bar' Name.Tag +'}' Punctuation +' ' Text.Whitespace +'destroy' Keyword.Constant +'\n' Text.Whitespace + +'setblock' Name.Builtin +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'mypack:foo' Name.Function +'{' Punctuation +'foo' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'bar' Name.Tag +'}' Punctuation +' ' Text.Whitespace +'destroy' Keyword.Constant +'\n' Text.Whitespace + +'setblock' Name.Builtin +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'mypack:foo' Name.Function +'[' Punctuation +'facing' Name.Attribute +'=' Punctuation +'up' Name.Tag +']' Punctuation +'{' Punctuation +'foo' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'bar' Name.Tag +'}' Punctuation +' ' Text.Whitespace +'destroy' Keyword.Constant +'\n' Text.Whitespace + +'setblock' Name.Builtin +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'mypack:foo' Name.Function +'[' Punctuation +'facing' Name.Attribute +' ' Text.Whitespace +'=' Punctuation +' ' Text.Whitespace +'up' Name.Tag +']' Punctuation +'{' Punctuation +'foo' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'bar' Name.Tag +'}' Punctuation +' ' Text.Whitespace +'destroy' Keyword.Constant +'\n' Text.Whitespace + +'setblock' Name.Builtin +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'minecraft:dispenser' Name.Function +'[' Punctuation +'facing' Name.Attribute +'=' Punctuation +'up' Name.Tag +']' Punctuation +'{' Punctuation +'Items' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'{' Punctuation +'id' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'minecraft:diamond' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +' ' Text.Whitespace +'Count' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'1' Literal.Number.Float +'}' Punctuation +']' Punctuation +'}' Punctuation +'\n\n' Text.Whitespace + +'tag' Name.Builtin +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'add' Keyword.Constant +' ' Text.Whitespace +'my.tag' Keyword.Constant +'\n\n' Text.Whitespace + +'datapack' Name.Builtin +' ' Text.Whitespace +'enable' Keyword.Constant +' ' Text.Whitespace +'"' Literal.String.Double +'hello world' Literal.String.Double +'"' Literal.String.Double +'\n' Text.Whitespace + +'datapack' Name.Builtin +' ' Text.Whitespace +'enable' Keyword.Constant +' ' Text.Whitespace +'"' Literal.String.Double +'escape ' Literal.String.Double +'\\"' Literal.String.Escape +' me' Literal.String.Double +'"' Literal.String.Double +'\n' Text.Whitespace + +'datapack' Name.Builtin +' ' Text.Whitespace +'enable' Keyword.Constant +' ' Text.Whitespace +"'" Literal.String.Single +'hello world' Literal.String.Single +"'" Literal.String.Single +'\n' Text.Whitespace + +'datapack' Name.Builtin +' ' Text.Whitespace +'enable' Keyword.Constant +' ' Text.Whitespace +"'" Literal.String.Single +'escape ' Literal.String.Single +"\\'" Literal.String.Escape +' me' Literal.String.Single +"'" Literal.String.Single +'\n\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'f7a39418-72ca-4bf2-bc7e-ba9df67a4707' Name.Variable +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'0-0-0-0-0' Name.Variable +' ' Text.Whitespace +'run' Keyword.Constant +'\n\nexecute' Name.Builtin +' ' Text.Whitespace +'store' Keyword.Constant +' ' Text.Whitespace +'result' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'#fakeplayer' Name.Variable.Magic +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'store' Keyword.Constant +' ' Text.Whitespace +'result' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'#fake.player' Name.Variable.Magic +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'store' Keyword.Constant +' ' Text.Whitespace +'result' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'#fake_player' Name.Variable.Magic +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'store' Keyword.Constant +' ' Text.Whitespace +'result' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'$fakeplayer' Name.Variable.Magic +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'store' Keyword.Constant +' ' Text.Whitespace +'result' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'%fakeplayer' Name.Variable.Magic +'\n\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@b' Name.Variable +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'\n\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'tag' Name.Attribute +'=' Punctuation +'foo' Name.Tag +']' Punctuation +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'tag' Name.Attribute +'=!' Punctuation +'foo' Name.Tag +']' Punctuation +'\n\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'sort' Name.Attribute +'=' Punctuation +'nearest' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'gamemode' Name.Attribute +'=' Punctuation +'survival' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'gamemode' Name.Attribute +'=!' Punctuation +'creative' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'tag' Name.Attribute +'=' Punctuation +'foo' Name.Tag +',' Punctuation +'tag' Name.Attribute +'=' Punctuation +'bar' Name.Tag +',' Punctuation +'tag' Name.Attribute +'=!' Punctuation +'baz' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\n\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'15' Literal.Number.Float +']' Punctuation +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'1.5' Literal.Number.Float +']' Punctuation +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'.5' Literal.Number.Float +']' Punctuation +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'-.25' Literal.Number.Float +']' Punctuation +'\n\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'100' Literal.Number.Float +']' Punctuation +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'..' Literal +'10' Literal.Number.Float +']' Punctuation +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'11' Literal.Number.Float +'..' Literal +'19' Literal.Number.Float +']' Punctuation +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'20' Literal.Number.Float +'..' Literal +']' Punctuation +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'0.5' Literal.Number.Float +']' Punctuation +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'..' Literal +'0.1' Literal.Number.Float +']' Punctuation +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'0.2' Literal.Number.Float +'..' Literal +'0.8' Literal.Number.Float +']' Punctuation +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'distance' Name.Attribute +'=' Punctuation +'0.9' Literal.Number.Float +'..' Literal +']' Punctuation +'\n\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'type' Name.Attribute +'=' Punctuation +'minecraft:bat' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'type' Name.Attribute +'=!' Punctuation +'minecraft:cow' Name.Tag +',' Punctuation +'type' Name.Attribute +'=!' Punctuation +'minecraft:pig' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'type' Name.Attribute +'=' Punctuation +'#minecraft:skeletons' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'type' Name.Attribute +'=!' Punctuation +'#minecraft:skeletons' Name.Tag +',' Punctuation +'type' Name.Attribute +'=!' Punctuation +'minecraft:zombie' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\n\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'tag' Name.Attribute +'=' Punctuation +'my.tag' Name.Tag +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\n\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'name' Name.Attribute +'=' Punctuation +'"' Literal.String.Double +'hello world' Literal.String.Double +'"' Literal.String.Double +']' Punctuation +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'name' Name.Attribute +'=' Punctuation +'"' Literal.String.Double +'escape ' Literal.String.Double +'\\"' Literal.String.Escape +' me' Literal.String.Double +'"' Literal.String.Double +']' Punctuation +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'name' Name.Attribute +'=' Punctuation +'"' Literal.String.Double +'how, about, commas ?' Literal.String.Double +'"' Literal.String.Double +']' Punctuation +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'name' Name.Attribute +'=' Punctuation +'"' Literal.String.Double +'and [braces] ?' Literal.String.Double +'"' Literal.String.Double +']' Punctuation +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'run' Keyword.Constant +'\n\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@e' Name.Variable +'[' Punctuation +'nbt' Name.Attribute +'=' Punctuation +'{' Punctuation +' ' Text.Whitespace +'PortalCooldown' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'0' Literal.Number.Float +' ' Text.Whitespace +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@e' Name.Variable +'[' Punctuation +'nbt' Name.Attribute +'=' Punctuation +'{' Punctuation +' ' Text.Whitespace +'Item' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'{' Punctuation +'id' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'minecraft:diamond' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +' ' Text.Whitespace +'Count' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'64' Literal.Number.Float +' ' Text.Whitespace +'}' Punctuation +' ' Text.Whitespace +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\n\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'foo' Keyword.Constant +' ' Text.Whitespace +'<' Operator +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'bar' Keyword.Constant +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'foo' Keyword.Constant +' ' Text.Whitespace +'<' Operator +'=' Operator +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'bar' Keyword.Constant +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'foo' Keyword.Constant +' ' Text.Whitespace +'=' Operator +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'bar' Keyword.Constant +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'foo' Keyword.Constant +' ' Text.Whitespace +'>' Operator +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'bar' Keyword.Constant +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'foo' Keyword.Constant +' ' Text.Whitespace +'>' Operator +'=' Operator +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'bar' Keyword.Constant +' ' Text.Whitespace +'run' Keyword.Constant +'\n\ndata' Name.Builtin +' ' Text.Whitespace +'get' Keyword.Constant +' ' Text.Whitespace +'entity' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'SelectedItem.tag.display.Name' Keyword.Constant +'\n' Text.Whitespace + +'data' Name.Builtin +' ' Text.Whitespace +'get' Keyword.Constant +' ' Text.Whitespace +'entity' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'Inventory' Keyword.Constant +'[' Punctuation +'0' Literal.Number.Integer +']' Punctuation +'\n' Text.Whitespace + +'data' Name.Builtin +' ' Text.Whitespace +'get' Keyword.Constant +' ' Text.Whitespace +'entity' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'Inventory' Keyword.Constant +'[' Punctuation +'{' Punctuation +'id' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'minecraft:diamond' Literal.String.Double +'"' Literal.String.Double +'}' Punctuation +']' Punctuation +'.' Operator +'Count' Keyword.Constant +'\n' Text.Whitespace + +'data' Name.Builtin +' ' Text.Whitespace +'get' Keyword.Constant +' ' Text.Whitespace +'entity' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'Inventory' Keyword.Constant +'[' Punctuation +']' Punctuation +'.' Operator +'tag' Keyword.Constant +'{' Punctuation +'custom' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'true' Name.Tag +'}' Punctuation +'.' Operator +'display.Name' Keyword.Constant +'\n\n' Text.Whitespace + +'data' Name.Builtin +' ' Text.Whitespace +'merge' Keyword.Constant +' ' Text.Whitespace +'entity' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'{' Punctuation +' ' Text.Whitespace +'foo' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'true' Name.Tag +',' Punctuation +' ' Text.Whitespace +'bar' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'1234' Literal.Number.Float +' ' Text.Whitespace +'}' Punctuation +'\n' Text.Whitespace + +'data' Name.Builtin +' ' Text.Whitespace +'modify' Keyword.Constant +' ' Text.Whitespace +'block' Keyword.Constant +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'RecordItem.tag' Keyword.Constant +' ' Text.Whitespace +'set' Keyword.Constant +' ' Text.Whitespace +'value' Keyword.Constant +' ' Text.Whitespace +'{' Punctuation +' ' Text.Whitespace +'messages' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'hi' Name.Attribute +',' Punctuation +' ' Text.Whitespace +'bye' Name.Attribute +']' Punctuation +' ' Text.Whitespace +'}' Punctuation +'\n' Text.Whitespace + +'data' Name.Builtin +' ' Text.Whitespace +'modify' Keyword.Constant +' ' Text.Whitespace +'block' Keyword.Constant +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'RecordItem.tag.messages' Keyword.Constant +' ' Text.Whitespace +'append' Keyword.Constant +' ' Text.Whitespace +'value' Keyword.Constant +' ' Text.Whitespace +'[' Punctuation +' ' Text.Whitespace +'{' Punctuation +' ' Text.Whitespace +'message' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'hello world' Literal.String.Double +'"' Literal.String.Double +' ' Text.Whitespace +'}' Punctuation +' ' Text.Whitespace +']' Punctuation +'\n\n' Text.Whitespace + +'tellraw' Name.Builtin +' ' Text.Whitespace +'@a' Name.Variable +' ' Text.Whitespace +'{' Punctuation +'"' Name.Attribute +'text' Name.Attribute +'"' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'hello world' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +' ' Text.Whitespace +'"' Name.Attribute +'color' Name.Attribute +'"' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'blue' Literal.String.Double +'"' Literal.String.Double +'}' Punctuation +'\n' Text.Whitespace + +'tellraw' Name.Builtin +' ' Text.Whitespace +'@a' Name.Variable +' ' Text.Whitespace +'[' Punctuation +'{' Punctuation +'"' Name.Attribute +'text' Name.Attribute +'"' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'hello' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +' ' Text.Whitespace +'"' Name.Attribute +'color' Name.Attribute +'"' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'blue' Literal.String.Double +'"' Literal.String.Double +'}' Punctuation +',' Punctuation +' ' Text.Whitespace +'{' Punctuation +'"' Name.Attribute +'text' Name.Attribute +'"' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'world' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +' ' Text.Whitespace +'"' Name.Attribute +'color' Name.Attribute +'"' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'blue' Literal.String.Double +'"' Literal.String.Double +'}' Punctuation +']' Punctuation +'\n\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'scores' Name.Attribute +'=' Punctuation +'{' Punctuation +'myscore' Name.Attribute +'=' Punctuation +'10' Literal.Number.Float +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'scores' Name.Attribute +'=' Punctuation +'{' Punctuation +'myscore' Name.Attribute +'=' Punctuation +'10' Literal.Number.Float +'..' Literal +'12' Literal.Number.Float +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'scores' Name.Attribute +'=' Punctuation +'{' Punctuation +'foo' Name.Attribute +'=' Punctuation +'10' Literal.Number.Float +',' Punctuation +' ' Text.Whitespace +'bar' Name.Attribute +'=' Punctuation +'1' Literal.Number.Float +'..' Literal +'5' Literal.Number.Float +',' Punctuation +' ' Text.Whitespace +'baz' Name.Attribute +'=' Punctuation +'..' Literal +'0' Literal.Number.Float +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\n\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'advancements' Name.Attribute +'=' Punctuation +'{' Punctuation +'minecraft:story/form_obsidian' Name.Attribute +'=' Punctuation +'true' Name.Tag +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'advancements' Name.Attribute +'=' Punctuation +'{' Punctuation +'minecraft:story/obtain_armor' Name.Attribute +'=' Punctuation +'{' Punctuation +'iron_helmet' Name.Attribute +'=' Punctuation +'true' Name.Tag +'}' Punctuation +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'advancements' Name.Attribute +'=' Punctuation +'{' Punctuation +'minecraft:story/obtain_armor' Name.Attribute +'=' Punctuation +'{' Punctuation +'iron_helmet' Name.Attribute +'=' Punctuation +'true' Name.Tag +',' Punctuation +' ' Text.Whitespace +'gold_helmet' Name.Attribute +'=' Punctuation +'false' Name.Tag +'}' Punctuation +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'advancements' Name.Attribute +'=' Punctuation +'{' Punctuation +'minecraft:story/form_obsidian' Name.Attribute +'=' Punctuation +'true' Name.Tag +',' Punctuation +' ' Text.Whitespace +'minecraft:story/follow_ender_eye' Name.Attribute +'=' Punctuation +'true' Name.Tag +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\nexecute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'advancements' Name.Attribute +'=' Punctuation +'{' Punctuation +'minecraft:story/form_obsidian' Name.Attribute +'=' Punctuation +'{' Punctuation +'foo' Name.Attribute +'=' Punctuation +'true' Name.Tag +',' Punctuation +' ' Text.Whitespace +'bar' Name.Attribute +'=' Punctuation +'false' Name.Tag +'}' Punctuation +',' Punctuation +'minecraft:story/follow_ender_eye' Name.Attribute +'=' Punctuation +'{' Punctuation +'foo' Name.Attribute +'=' Punctuation +'false' Name.Tag +',' Punctuation +' ' Text.Whitespace +'bar' Name.Attribute +'=' Punctuation +'true' Name.Tag +'}' Punctuation +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\n\ngive' Name.Builtin +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'diamond_sword' Keyword.Constant +'{' Punctuation +'display' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'{' Punctuation +'Name' Name.Attribute +':' Punctuation +' ' Text.Whitespace +"'" Literal.String.Single +'"My Custom Sword"' Literal.String.Single +"'" Literal.String.Single +'}' Punctuation +'}' Punctuation +'\n' Text.Whitespace + +'give' Name.Builtin +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'minecraft:diamond_sword' Name.Function +'{' Punctuation +'display' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'{' Punctuation +'Name' Name.Attribute +':' Punctuation +' ' Text.Whitespace +"'" Literal.String.Single +'"My Custom Sword"' Literal.String.Single +"'" Literal.String.Single +'}' Punctuation +'}' Punctuation +'\n\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'foo' Keyword.Constant +' ' Text.Whitespace +'<' Operator +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'bar' Keyword.Constant +' ' Text.Whitespace +'run' Keyword.Constant +' say' Name.Builtin +' ' Text.Whitespace +'execute' Keyword.Constant +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'foo' Keyword.Constant +' ' Text.Whitespace +'<' Operator +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'bar' Keyword.Constant +' ' Text.Whitespace +'run' Keyword.Constant +' say' Name.Builtin +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'if' Keyword.Constant +' ' Text.Whitespace +'score' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'foo' Keyword.Constant +' ' Text.Whitespace +'<' Operator +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'bar' Keyword.Constant +' ' Text.Whitespace +'run' Keyword.Constant +' say' Name.Builtin +' ' Text.Whitespace +'hello' Keyword.Constant +' ' Text.Whitespace +'@e' Name.Variable +'[' Punctuation +'tag' Name.Attribute +'=' Punctuation +'baz' Name.Tag +',' Punctuation +' ' Text.Whitespace +'sort' Name.Attribute +'=' Punctuation +'nearest' Name.Tag +',' Punctuation +' ' Text.Whitespace +'limit' Name.Attribute +'=' Punctuation +'1' Literal.Number.Float +']' Punctuation +' ' Text.Whitespace +'how' Keyword.Constant +' ' Text.Whitespace +'are' Keyword.Constant +' ' Text.Whitespace +'you' Keyword.Constant +'?' Operator +'\n\n' Text.Whitespace + +'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 diff --git a/tests/examplefiles/snbt/main.snbt b/tests/examplefiles/snbt/main.snbt new file mode 100644 index 00000000..760122d8 --- /dev/null +++ b/tests/examplefiles/snbt/main.snbt @@ -0,0 +1,23 @@ +{ + display: { + Name:'{"text":"My Epic Sword","color":"#8AA9FF","bold":true}', + Lore:['{"text":"Yep"}'] + }, + Unbreakable: true, + Damage: 20, + Enchantments: [ + {id: "minecraft:sharpness", lvl:1s}, + {id: "minecraft:sweeping", lvl:20s} + ], + custom: { + UUID: [I;459130179,987513928,-1425663264,-175461800], + LongArray: [L; 112233L, 445566L], + ByteArray: [B; 1b, 2b, 3b] + Health: 10.0f, + Pos: [ + 1.2d, + 3.4d, + 5.6d + ] + } +}
\ No newline at end of file diff --git a/tests/examplefiles/snbt/main.snbt.output b/tests/examplefiles/snbt/main.snbt.output new file mode 100644 index 00000000..4eda631a --- /dev/null +++ b/tests/examplefiles/snbt/main.snbt.output @@ -0,0 +1,151 @@ +'{' Punctuation +'\n ' Text.Whitespace +'display' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'{' Punctuation +'\n ' Text.Whitespace +'Name' Name.Attribute +':' Punctuation +"'" Literal.String.Single +'{"text":"My Epic Sword","color":"#8AA9FF","bold":true}' Literal.String.Single +"'" Literal.String.Single +',' Punctuation +'\n ' Text.Whitespace +'Lore' Name.Attribute +':' Punctuation +'[' Punctuation +"'" Literal.String.Single +'{"text":"Yep"}' Literal.String.Single +"'" Literal.String.Single +']' Punctuation +'\n ' Text.Whitespace +'}' Punctuation +',' Punctuation +'\n ' Text.Whitespace +'Unbreakable' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'true' Name.Attribute +',' Punctuation +'\n ' Text.Whitespace +'Damage' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'20' Literal.Number.Integer +',' Punctuation +'\n ' Text.Whitespace +'Enchantments' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'\n ' Text.Whitespace +'{' Punctuation +'id' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'minecraft:sharpness' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +' ' Text.Whitespace +'lvl' Name.Attribute +':' Punctuation +'1s' Literal.Number.Integer +'}' Punctuation +',' Punctuation +'\n ' Text.Whitespace +'{' Punctuation +'id' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'minecraft:sweeping' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +' ' Text.Whitespace +'lvl' Name.Attribute +':' Punctuation +'20s' Literal.Number.Integer +'}' Punctuation +'\n ' Text.Whitespace +']' Punctuation +',' Punctuation +'\n ' Text.Whitespace +'custom' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'{' Punctuation +'\n ' Text.Whitespace +'UUID' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'I' Name.Attribute +';' Punctuation +'459130179' Literal.Number.Integer +',' Punctuation +'987513928' Literal.Number.Integer +',' Punctuation +'-1425663264' Literal.Number.Integer +',' Punctuation +'-175461800' Literal.Number.Integer +']' Punctuation +',' Punctuation +'\n ' Text.Whitespace +'LongArray' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'L' Name.Attribute +';' Punctuation +' ' Text.Whitespace +'112233L' Literal.Number.Integer +',' Punctuation +' ' Text.Whitespace +'445566L' Literal.Number.Integer +']' Punctuation +',' Punctuation +'\n ' Text.Whitespace +'ByteArray' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'B' Name.Attribute +';' Punctuation +' ' Text.Whitespace +'1b' Literal.Number.Integer +',' Punctuation +' ' Text.Whitespace +'2b' Literal.Number.Integer +',' Punctuation +' ' Text.Whitespace +'3b' Literal.Number.Integer +']' Punctuation +'\n ' Text.Whitespace +'Health' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'10.0f' Literal.Number.Float +',' Punctuation +'\n ' Text.Whitespace +'Pos' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'\n ' Text.Whitespace +'1.2d' Literal.Number.Float +',' Punctuation +'\n ' Text.Whitespace +'3.4d' Literal.Number.Float +',' Punctuation +'\n ' Text.Whitespace +'5.6d' Literal.Number.Float +'\n ' Text.Whitespace +']' Punctuation +'\n ' Text.Whitespace +'}' Punctuation +'\n' Text.Whitespace + +'}' Punctuation +'\n' Text diff --git a/tests/snippets/mcfunction/commenting.txt b/tests/snippets/mcfunction/commenting.txt new file mode 100644 index 00000000..7a5a37d5 --- /dev/null +++ b/tests/snippets/mcfunction/commenting.txt @@ -0,0 +1,173 @@ +---input--- +#> Get: #rx.playerdb:api/v2/get +#> +#> @input +#> $in.uid rx.io +#> +#> @output +#> rx.playerdb:io player +# +# Selects data inside the database and copies to rx.playerdb:io player +# See #api/v2/select for more info.. +# +#* Note: something, something, this is important.. + +# Normal Comment + +# This **shouldn't** be a comment.. +scoreboard players operation @s obj = #fakeplayer obj + +#> single line block comment +tellraw @a "This string # has # hashtags o_O" + +---tokens--- +'#>' Comment.Multiline +' ' Text.Whitespace +'Get:' Literal.String.Doc +' ' Text.Whitespace +'#rx.playerdb:api/v2/get' Name.Function +'\n' Text + +'#>' Comment.Multiline +'\n' Text + +'#>' Comment.Multiline +' ' Text.Whitespace +'@input' Name.Decorator +'\n' Text + +'#>' Comment.Multiline +' ' Text.Whitespace +'$in.uid' Name.Variable.Magic +' ' Text.Whitespace +'rx.io' Literal.String.Doc +'\n' Text + +'#>' Comment.Multiline +'\n' Text + +'#>' Comment.Multiline +' ' Text.Whitespace +'@output' Name.Decorator +'\n' Text + +'#>' Comment.Multiline +' ' Text.Whitespace +'rx.playerdb:io' Name.Function +' ' Text.Whitespace +'player' Literal.String.Doc +'\n' Text + +'#' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'Selects' Comment.Multiline +' ' Text.Whitespace +'data' Comment.Multiline +' ' Text.Whitespace +'inside' Comment.Multiline +' ' Text.Whitespace +'the' Comment.Multiline +' ' Text.Whitespace +'database' Comment.Multiline +' ' Text.Whitespace +'and' Comment.Multiline +' ' Text.Whitespace +'copies' Comment.Multiline +' ' Text.Whitespace +'to' Comment.Multiline +' ' Text.Whitespace +'rx.playerdb:io' Name.Function +' ' Text.Whitespace +'player' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'See' Comment.Multiline +' ' Text.Whitespace +'#api/v2/select' Name.Function +' ' Text.Whitespace +'for' Comment.Multiline +' ' Text.Whitespace +'more' Comment.Multiline +' ' Text.Whitespace +'info..' Comment.Multiline +'\n' Text + +'#' Comment.Multiline +' \n' Text.Whitespace + +'#*' Comment.Multiline +' ' Text.Whitespace +'Note:' Comment.Multiline +' ' Text.Whitespace +'something,' Comment.Multiline +' ' Text.Whitespace +'something,' Comment.Multiline +' ' Text.Whitespace +'this' Comment.Multiline +' ' Text.Whitespace +'is' Comment.Multiline +' ' Text.Whitespace +'important..' Comment.Multiline +'\n' Text + +'\n#' Comment.Multiline +' ' Text.Whitespace +'Normal' Comment.Multiline +' ' Text.Whitespace +'Comment' Comment.Multiline +'\n' Text + +'\n#' Comment.Multiline +' ' Text.Whitespace +'This' Comment.Multiline +' ' Text.Whitespace +"**shouldn't**" Comment.Multiline +' ' Text.Whitespace +'be' Comment.Multiline +' ' Text.Whitespace +'a' Comment.Multiline +' ' Text.Whitespace +'comment..' Comment.Multiline +'\n' Text + +'scoreboard' Name.Builtin +' ' Text.Whitespace +'players' Keyword.Constant +' ' Text.Whitespace +'operation' Keyword.Constant +' ' Text.Whitespace +'@s' Name.Variable +' ' Text.Whitespace +'obj' Keyword.Constant +' ' Text.Whitespace +'=' Operator +' ' Text.Whitespace +'#fakeplayer' Name.Variable.Magic +' ' Text.Whitespace +'obj' Keyword.Constant +'\n\n' Text.Whitespace + +'#>' Comment.Multiline +' ' Text.Whitespace +'single' Literal.String.Doc +' ' Text.Whitespace +'line' Literal.String.Doc +' ' Text.Whitespace +'block' Literal.String.Doc +' ' Text.Whitespace +'comment' Literal.String.Doc +'\n' Text + +'tellraw' Name.Builtin +' ' Text.Whitespace +'@a' Name.Variable +' ' Text.Whitespace +'"' Literal.String.Double +'This string # has # hashtags o_O' Literal.String.Double +'"' Literal.String.Double +'\n' Text.Whitespace diff --git a/tests/snippets/mcfunction/coordinates.txt b/tests/snippets/mcfunction/coordinates.txt new file mode 100644 index 00000000..d5398bc8 --- /dev/null +++ b/tests/snippets/mcfunction/coordinates.txt @@ -0,0 +1,188 @@ +---input--- +# normal +tp 1 2 3 +tp 100.5 80 -100.5 + +# relative +tp 10 ~ -10 +tp 10 ~10 -10 +tp 10 ~0.5 -10 +tp 10 ~.5 -10 +tp 10 ~-10 -10 +tp 10 ~-0.5 -10 +tp 10 ~-.5 -10 + +# carrot +tp 10 ^ -10 +tp 10 ^10 -10 +tp 10 ^0.5 -10 +tp 10 ^.5 -10 +tp 10 ^-10 -10 +tp 10 ^-0.5 -10 +tp 10 ^-.5 -10 + +---tokens--- +'# normal' Comment.Single +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'1' Literal.Number.Float +' ' Text.Whitespace +'2' Literal.Number.Float +' ' Text.Whitespace +'3' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'100.5' Literal.Number.Float +' ' Text.Whitespace +'80' Literal.Number.Float +' ' Text.Whitespace +'-100.5' Literal.Number.Float +'\n\n' Text.Whitespace + +'# relative' Comment.Single +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'10' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'0.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'-10' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'-0.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'~' Operator +'-.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n\n' Text.Whitespace + +'# carrot' Comment.Single +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'10' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'0.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'-10' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'-0.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace + +'tp' Name.Builtin +' ' Text.Whitespace +'10' Literal.Number.Float +' ' Text.Whitespace +'^' Operator +'-.5' Literal.Number.Float +' ' Text.Whitespace +'-10' Literal.Number.Float +'\n' Text.Whitespace diff --git a/tests/snippets/mcfunction/data.txt b/tests/snippets/mcfunction/data.txt new file mode 100644 index 00000000..440d6686 --- /dev/null +++ b/tests/snippets/mcfunction/data.txt @@ -0,0 +1,120 @@ +---input--- +data modify storage my:storage root set value { + key: "This NBT Compound is multiple lines", + Count: 10b, + tags: [ + 0, + 1, + ], + UUID +} + +tellraw @a { + "text": "how ever", + "color": "blue", + "extra": [ + "this is json o_O" + ] +} + +---tokens--- +'data' Name.Builtin +' ' Text.Whitespace +'modify' Keyword.Constant +' ' Text.Whitespace +'storage' Keyword.Constant +' ' Text.Whitespace +'my:storage' Name.Function +' ' Text.Whitespace +'root' Keyword.Constant +' ' Text.Whitespace +'set' Keyword.Constant +' ' Text.Whitespace +'value' Keyword.Constant +' ' Text.Whitespace +'{' Punctuation +'\n ' Text.Whitespace +'key' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'This NBT Compound is multiple lines' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +'\n ' Text.Whitespace +'Count' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'10' Literal.Number.Integer +'b' Name.Attribute +',' Punctuation +'\n ' Text.Whitespace +'tags' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'\n ' Text.Whitespace +'0' Literal.Number.Integer +',' Punctuation +'\n ' Text.Whitespace +'1' Literal.Number.Integer +',' Punctuation +'\n ' Text.Whitespace +']' Punctuation +',' Punctuation +'\n ' Text.Whitespace +'UUID' Name.Attribute +'\n' Text.Whitespace + +'}' Punctuation +'\n\n' Text.Whitespace + +'tellraw' Name.Builtin +' ' Text.Whitespace +'@a' Name.Variable +' ' Text.Whitespace +'{' Punctuation +'\n ' Text.Whitespace +'"' Name.Attribute +'text' Name.Attribute +'"' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'how ever' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +'\n ' Text.Whitespace +'"' Name.Attribute +'color' Name.Attribute +'"' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'blue' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +'\n ' Text.Whitespace +'"' Name.Attribute +'extra' Name.Attribute +'"' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'\n ' Text.Whitespace +'"' Name.Attribute +'this' Name.Attribute +' ' Text.Whitespace +'is' Name.Attribute +' ' Text.Whitespace +'json' Name.Attribute +' ' Text.Whitespace +'o_' Name.Attribute +'O' Name.Attribute +'"' Name.Attribute +'\n ' Text.Whitespace +']' Punctuation +'\n' Text.Whitespace + +'}' Punctuation +'\n' Text.Whitespace diff --git a/tests/snippets/mcfunction/difficult_1.txt b/tests/snippets/mcfunction/difficult_1.txt new file mode 100644 index 00000000..f9ad1bcf --- /dev/null +++ b/tests/snippets/mcfunction/difficult_1.txt @@ -0,0 +1,56 @@ +---input--- +# execute as @e[nbt={ Item: {id: "minecraft:diamond", Count: 64 } }] run +# setblock ~ ~ ~ minecraft:dispenser[facing=up]{Items: [{id: "minecraft:diamond", Count: 1}]} +# tellraw @a [{"text": "hello", "color": "blue"}, {"text": "world", "color": "blue"}] + +execute as @a[advancements={minecraft:story/form_obsidian={foo=true, bar=false},minecraft:story/follow_ender_eye={foo=false, bar=true}}] run + +---tokens--- +'# execute as @e[nbt={ Item: {id: "minecraft:diamond", Count: 64 } }] run' Comment.Single +'\n' Text.Whitespace + +'# setblock ~ ~ ~ minecraft:dispenser[facing=up]{Items: [{id: "minecraft:diamond", Count: 1}]}' Comment.Single +'\n' Text.Whitespace + +'# tellraw @a [{"text": "hello", "color": "blue"}, {"text": "world", "color": "blue"}]' Comment.Single +'\n\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'advancements' Name.Attribute +'=' Punctuation +'{' Punctuation +'minecraft:story/form_obsidian' Name.Attribute +'=' Punctuation +'{' Punctuation +'foo' Name.Attribute +'=' Punctuation +'true' Name.Tag +',' Punctuation +' ' Text.Whitespace +'bar' Name.Attribute +'=' Punctuation +'false' Name.Tag +'}' Punctuation +',' Punctuation +'minecraft:story/follow_ender_eye' Name.Attribute +'=' Punctuation +'{' Punctuation +'foo' Name.Attribute +'=' Punctuation +'false' Name.Tag +',' Punctuation +' ' Text.Whitespace +'bar' Name.Attribute +'=' Punctuation +'true' Name.Tag +'}' Punctuation +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\n' Text.Whitespace diff --git a/tests/snippets/mcfunction/multiline.txt b/tests/snippets/mcfunction/multiline.txt new file mode 100644 index 00000000..15879101 --- /dev/null +++ b/tests/snippets/mcfunction/multiline.txt @@ -0,0 +1,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 diff --git a/tests/snippets/mcfunction/selectors.txt b/tests/snippets/mcfunction/selectors.txt new file mode 100644 index 00000000..ea69c787 --- /dev/null +++ b/tests/snippets/mcfunction/selectors.txt @@ -0,0 +1,73 @@ +---input--- +execute + as @a[ + advancements={ + minecraft:story/form_obsidian={ + foo=true, + bar=false + }, + minecraft:story/follow_ender_eye={ + foo=false, bar=true + } + } + ] run + say this command is nuts + +---tokens--- +'execute' Name.Builtin +'\n ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'\n ' Text.Whitespace +'advancements' Name.Attribute +'=' Punctuation +'{' Punctuation +'\n ' Text.Whitespace +'minecraft:story/form_obsidian' Name.Attribute +'=' Punctuation +'{' Punctuation +'\n ' Text.Whitespace +'foo' Name.Attribute +'=' Punctuation +'true' Name.Tag +',' Punctuation +'\n ' Text.Whitespace +'bar' Name.Attribute +'=' Punctuation +'false' Name.Tag +'\n ' Text.Whitespace +'}' Punctuation +',' Punctuation +'\n ' Text.Whitespace +'minecraft:story/follow_ender_eye' Name.Attribute +'=' Punctuation +'{' Punctuation +'\n ' Text.Whitespace +'foo' Name.Attribute +'=' Punctuation +'false' Name.Tag +',' Punctuation +' ' Text.Whitespace +'bar' Name.Attribute +'=' Punctuation +'true' Name.Tag +'\n ' Text.Whitespace +'}' Punctuation +'\n ' Text.Whitespace +'}' Punctuation +'\n ' Text.Whitespace +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +'\n say' Name.Builtin +' ' Text.Whitespace +'this' Keyword.Constant +' ' Text.Whitespace +'command' Keyword.Constant +' ' Text.Whitespace +'is' Keyword.Constant +' ' Text.Whitespace +'nuts' Keyword.Constant +'\n' Text.Whitespace diff --git a/tests/snippets/mcfunction/simple.txt b/tests/snippets/mcfunction/simple.txt new file mode 100644 index 00000000..664c91c7 --- /dev/null +++ b/tests/snippets/mcfunction/simple.txt @@ -0,0 +1,92 @@ +---input--- +#> This command looks for a player with 10 hp and prints a message +# @param - @s = player + +execute as @a[name="rx", nbt={Health: 10.0f}] run tellraw @a {"text": "this is my cool command"} # epic + +---tokens--- +'#>' Comment.Multiline +' ' Text.Whitespace +'This' Literal.String.Doc +' ' Text.Whitespace +'command' Literal.String.Doc +' ' Text.Whitespace +'looks' Literal.String.Doc +' ' Text.Whitespace +'for' Literal.String.Doc +' ' Text.Whitespace +'a' Literal.String.Doc +' ' Text.Whitespace +'player' Literal.String.Doc +' ' Text.Whitespace +'with' Literal.String.Doc +' ' Text.Whitespace +'10' Literal.String.Doc +' ' Text.Whitespace +'hp' Literal.String.Doc +' ' Text.Whitespace +'and' Literal.String.Doc +' ' Text.Whitespace +'prints' Literal.String.Doc +' ' Text.Whitespace +'a' Literal.String.Doc +' ' Text.Whitespace +'message' Literal.String.Doc +'\n' Text + +'#' Comment.Multiline +' ' Text.Whitespace +'@param' Name.Decorator +' ' Text.Whitespace +'-' Comment.Multiline +' ' Text.Whitespace +'@s' Name.Decorator +' ' Text.Whitespace +'=' Comment.Multiline +' ' Text.Whitespace +'player' Comment.Multiline +'\n' Text + +'\n' Text.Whitespace + +'execute' Name.Builtin +' ' Text.Whitespace +'as' Keyword.Constant +' ' Text.Whitespace +'@a' Name.Variable +'[' Punctuation +'name' Name.Attribute +'=' Punctuation +'"' Literal.String.Double +'rx' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +' ' Text.Whitespace +'nbt' Name.Attribute +'=' Punctuation +'{' Punctuation +'Health' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'10.0f' Literal.Number.Float +'}' Punctuation +']' Punctuation +' ' Text.Whitespace +'run' Keyword.Constant +' tellraw' Name.Builtin +' ' Text.Whitespace +'@a' Name.Variable +' ' Text.Whitespace +'{' Punctuation +'"' Name.Attribute +'text' Name.Attribute +'"' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'this is my cool command' Literal.String.Double +'"' Literal.String.Double +'}' Punctuation +' ' Text.Whitespace +'# epic' Comment.Single +'\n' Text.Whitespace diff --git a/tests/snippets/snbt/json.txt b/tests/snippets/snbt/json.txt new file mode 100644 index 00000000..7b021342 --- /dev/null +++ b/tests/snippets/snbt/json.txt @@ -0,0 +1,43 @@ +---input--- +{ + "text": "This is JSON", + "extra": [ + "however", + "it's also technically valid SNBT.." + ] +} + +---tokens--- +'{' Punctuation +'\n ' Text.Whitespace +'"' Literal.String.Double +'text' Literal.String.Double +'"' Literal.String.Double +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'This is JSON' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +'\n ' Text.Whitespace +'"' Literal.String.Double +'extra' Literal.String.Double +'"' Literal.String.Double +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'\n ' Text.Whitespace +'"' Literal.String.Double +'however' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +'\n ' Text.Whitespace +'"' Literal.String.Double +"it's also technically valid SNBT.." Literal.String.Double +'"' Literal.String.Double +'\n ' Text.Whitespace +']' Punctuation +'\n' Text.Whitespace + +'}' Punctuation +'\n' Text diff --git a/tests/snippets/snbt/literals.txt b/tests/snippets/snbt/literals.txt new file mode 100644 index 00000000..cc852b86 --- /dev/null +++ b/tests/snippets/snbt/literals.txt @@ -0,0 +1,41 @@ +---input--- +{int: 1, byte: 0b, short: 1s, long: 10000L, float: 10.0f, double: 20.0} + +---tokens--- +'{' Punctuation +'int' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'1' Literal.Number.Integer +',' Punctuation +' ' Text.Whitespace +'byte' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'0b' Literal.Number.Integer +',' Punctuation +' ' Text.Whitespace +'short' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'1s' Literal.Number.Integer +',' Punctuation +' ' Text.Whitespace +'long' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'10000L' Literal.Number.Integer +',' Punctuation +' ' Text.Whitespace +'float' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'10.0f' Literal.Number.Float +',' Punctuation +' ' Text.Whitespace +'double' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'20.0' Literal.Number.Float +'}' Punctuation +'\n' Text diff --git a/tests/snippets/snbt/multiline.txt b/tests/snippets/snbt/multiline.txt new file mode 100644 index 00000000..35a6a53e --- /dev/null +++ b/tests/snippets/snbt/multiline.txt @@ -0,0 +1,56 @@ +---input--- +{ + key: "cool compound", + UUID: [I;459130179,987513928,-1425663264,-175461800], + list: [ + 0, + 1, + 3 + ] +} + +---tokens--- +'{' Punctuation +'\n ' Text.Whitespace +'key' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'cool compound' Literal.String.Double +'"' Literal.String.Double +',' Punctuation +'\n ' Text.Whitespace +'UUID' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'I' Name.Attribute +';' Punctuation +'459130179' Literal.Number.Integer +',' Punctuation +'987513928' Literal.Number.Integer +',' Punctuation +'-1425663264' Literal.Number.Integer +',' Punctuation +'-175461800' Literal.Number.Integer +']' Punctuation +',' Punctuation +'\n ' Text.Whitespace +'list' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'\n ' Text.Whitespace +'0' Literal.Number.Integer +',' Punctuation +'\n ' Text.Whitespace +'1' Literal.Number.Integer +',' Punctuation +'\n ' Text.Whitespace +'3' Literal.Number.Integer +'\n ' Text.Whitespace +']' Punctuation +'\n' Text.Whitespace + +'}' Punctuation +'\n' Text diff --git a/tests/snippets/snbt/nesting.txt b/tests/snippets/snbt/nesting.txt new file mode 100644 index 00000000..317a9c8f --- /dev/null +++ b/tests/snippets/snbt/nesting.txt @@ -0,0 +1,39 @@ +---input--- +{root: [{compound: 1b}, {compound: 2b, tag: {key: "value"}}]} + +---tokens--- +'{' Punctuation +'root' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'[' Punctuation +'{' Punctuation +'compound' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'1b' Literal.Number.Integer +'}' Punctuation +',' Punctuation +' ' Text.Whitespace +'{' Punctuation +'compound' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'2b' Literal.Number.Integer +',' Punctuation +' ' Text.Whitespace +'tag' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'{' Punctuation +'key' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'value' Literal.String.Double +'"' Literal.String.Double +'}' Punctuation +'}' Punctuation +']' Punctuation +'}' Punctuation +'\n' Text diff --git a/tests/snippets/snbt/quoted_keys.txt b/tests/snippets/snbt/quoted_keys.txt new file mode 100644 index 00000000..8e54f5fd --- /dev/null +++ b/tests/snippets/snbt/quoted_keys.txt @@ -0,0 +1,29 @@ +---input--- +{"special--key": 10b, normal_key: false, "json..///_type_key": "yup"} + +---tokens--- +'{' Punctuation +'"' Literal.String.Double +'special--key' Literal.String.Double +'"' Literal.String.Double +':' Punctuation +' ' Text.Whitespace +'10b' Literal.Number.Integer +',' Punctuation +' ' Text.Whitespace +'normal_key' Name.Attribute +':' Punctuation +' ' Text.Whitespace +'false' Name.Attribute +',' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'json..///_type_key' Literal.String.Double +'"' Literal.String.Double +':' Punctuation +' ' Text.Whitespace +'"' Literal.String.Double +'yup' Literal.String.Double +'"' Literal.String.Double +'}' Punctuation +'\n' Text |
