Add the command parse differential harness
A Java oracle builds vanilla's real Brigadier command tree with the loaded registries and data-pack tags, exports the tree, and parses a corpus of command strings. The corpus is generated by walking that tree with valid and invalid samples for every argument type plus hand-written edge cases. A Rust example parses the same corpus with Horizon's dispatcher and the Python driver compares success, exact error text and cursor, and end-of-input completion suggestions, with tree-diff and mismatch summary helpers. Currently 79 percent of 39685 inputs match at permission level 4. Entity selector errors now rewind to the start of the input like vanilla. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1487,8 +1487,9 @@ impl ArgType {
|
||||
}
|
||||
ArgType::Entity { single, players } => {
|
||||
let s = parse_selector(reader, reg)?;
|
||||
// Vanilla rewinds to the very start of the input for these.
|
||||
if s.limit > 1 && *single {
|
||||
reader.cursor = start;
|
||||
reader.cursor = 0;
|
||||
let key = if *players {
|
||||
"argument.player.toomany"
|
||||
} else {
|
||||
@@ -1497,7 +1498,7 @@ impl ArgType {
|
||||
return Err(CommandError::tr_at(key, &[], reader));
|
||||
}
|
||||
if s.include_entities && *players && !s.is_self() {
|
||||
reader.cursor = start;
|
||||
reader.cursor = 0;
|
||||
return Err(CommandError::tr_at("argument.player.entities", &[], reader));
|
||||
}
|
||||
Arg::Entity(s)
|
||||
|
||||
Reference in New Issue
Block a user