* 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>
92 lines
2.6 KiB
Text
92 lines
2.6 KiB
Text
---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
|