diff --git a/mecha/ast.py b/mecha/ast.py index 3c5ca34..cbc3e9c 100644 --- a/mecha/ast.py +++ b/mecha/ast.py @@ -478,7 +478,7 @@ class AstPlayerName(AstLiteral): """Ast player name node.""" parser = "player_name" - regex = re.compile(r"(?!@)[^*\[\]\(\)\{\}\s]+") + regex = re.compile(r"(?![@*[({])\S+") @dataclass(frozen=True, slots=True) diff --git a/tests/resources/argument_examples.json b/tests/resources/argument_examples.json index 33b43bd..24b7ba3 100644 --- a/tests/resources/argument_examples.json +++ b/tests/resources/argument_examples.json @@ -211,7 +211,7 @@ }, { "properties": { "type": "players", "amount": "single" }, - "examples": ["#foo", "$foo", "%foo"] + "examples": ["#foo", "$foo", "%foo", "#exp(-0.1)*65536"] } ], "minecraft:entity_anchor": [ diff --git a/tests/snapshots/parse__argument_examples_minecraft_entity_5_3__0.txt b/tests/snapshots/parse__argument_examples_minecraft_entity_5_3__0.txt new file mode 100644 index 0000000..a8d72d9 --- /dev/null +++ b/tests/snapshots/parse__argument_examples_minecraft_entity_5_3__0.txt @@ -0,0 +1,12 @@ +minecraft:entity 5 3 +--- +{'type': 'players', 'amount': 'single'} +--- +#exp(-0.1)*65536 +--- +#exp(-0.1)*65536 +--- + + location: SourceLocation(pos=0, lineno=1, colno=1) + end_location: SourceLocation(pos=16, lineno=1, colno=17) + value: '#exp(-0.1)*65536' \ No newline at end of file