1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-02-09 13:23:51 +02:00

Update mcfunction lexer to support newer spec of commands

This commit is contained in:
Koki Fukuda 2022-08-19 17:08:11 +09:00 committed by Alec Thomas
parent 6538430570
commit cde381803a
3 changed files with 31 additions and 4 deletions

View File

@ -92,7 +92,7 @@
<rule pattern="#.*?\n">
<token type="CommentSingle"/>
</rule>
<rule pattern="/?(geteduclientinfo|clearspawnpoint|defaultgamemode|transferserver|toggledownfall|immutableworld|detectredstone|setidletimeout|playanimation|classroommode|spreadplayers|testforblocks|setmaxplayers|setworldspawn|testforblock|worldbuilder|createagent|worldborder|camerashake|advancement|raytracefog|locatebiome|tickingarea|replaceitem|attributes|spawnpoint|difficulty|experience|scoreboard|whitelist|structure|playsound|stopsound|forceload|spectate|gamerule|function|schedule|wsserver|teleport|position|save-off|particle|setblock|datapack|mobevent|transfer|gamemode|save-all|bossbar|enchant|trigger|collect|execute|weather|teammsg|tpagent|banlist|dropall|publish|tellraw|testfor|save-on|destroy|ability|locate|summon|remove|effect|reload|ban-ip|recipe|pardon|detect|music|clear|clone|event|mixer|debug|title|ride|stop|list|turn|data|team|kick|loot|tell|help|give|flog|fill|move|time|seed|kill|save|item|deop|code|tag|ban|msg|say|tp|me|op|xp|w)\b">
<rule pattern="/?(geteduclientinfo|clearspawnpoint|defaultgamemode|transferserver|toggledownfall|immutableworld|detectredstone|setidletimeout|playanimation|classroommode|spreadplayers|testforblocks|setmaxplayers|setworldspawn|testforblock|worldbuilder|createagent|worldborder|camerashake|advancement|raytracefog|locatebiome|tickingarea|replaceitem|attributes|spawnpoint|difficulty|experience|scoreboard|whitelist|structure|playsound|stopsound|forceload|spectate|gamerule|function|schedule|wsserver|teleport|position|save-off|particle|setblock|datapack|mobevent|transfer|gamemode|save-all|bossbar|enchant|trigger|collect|execute|weather|teammsg|tpagent|banlist|dropall|publish|tellraw|testfor|save-on|destroy|ability|locate|summon|remove|effect|reload|ban-ip|recipe|pardon|detect|music|clear|clone|event|mixer|debug|title|ride|stop|list|turn|data|team|kick|loot|tell|help|give|flog|fill|move|time|seed|kill|save|item|deop|code|tag|ban|msg|say|tp|me|op|xp|w|place)\b">
<token type="KeywordReserved"/>
</rule>
<rule pattern="(@p|@r|@a|@e|@s|@c|@v)">
@ -179,4 +179,4 @@
</rule>
</state>
</rules>
</lexer>
</lexer>

View File

@ -9,5 +9,9 @@ gamemode creative @a
# With argument
kill @e[type=chicken,nested={a0=0,a1=1}]
# Ragne
# Range
kill @e[y_rotation=0..180]
# Legacy and new style
placefeature minecraft:bonus_chest ~ ~ ~
place feature minecraft:bonus_chest ~ ~ ~

View File

@ -63,7 +63,7 @@
{"type":"LiteralNumberInteger","value":"1"},
{"type":"Punctuation","value":"}]"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"CommentSingle","value":"# Ragne\n"},
{"type":"CommentSingle","value":"# Range\n"},
{"type":"KeywordReserved","value":"kill"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordConstant","value":"@e"},
@ -74,5 +74,28 @@
{"type":"Punctuation","value":".."},
{"type":"LiteralNumberInteger","value":"180"},
{"type":"Punctuation","value":"]"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"CommentSingle","value":"# Legacy and new style\n"},
{"type":"Text","value":"placefeature"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"minecraft:bonus_chest"},
{"type":"TextWhitespace","value":" "},
{"type":"NameBuiltin","value":"~"},
{"type":"TextWhitespace","value":" "},
{"type":"NameBuiltin","value":"~"},
{"type":"TextWhitespace","value":" "},
{"type":"NameBuiltin","value":"~"},
{"type":"TextWhitespace","value":"\n"},
{"type":"KeywordReserved","value":"place"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"feature"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"minecraft:bonus_chest"},
{"type":"TextWhitespace","value":" "},
{"type":"NameBuiltin","value":"~"},
{"type":"TextWhitespace","value":" "},
{"type":"NameBuiltin","value":"~"},
{"type":"TextWhitespace","value":" "},
{"type":"NameBuiltin","value":"~"},
{"type":"TextWhitespace","value":"\n"}
]