From 77f13d5fbcfffdee42b2b91827d769b8e2ec28c3 Mon Sep 17 00:00:00 2001 From: SPGoding Date: Sat, 25 Apr 2020 18:48:18 -0500 Subject: [PATCH] :bug: Fix suspend for unclosed NBT array tags Fix #415. --- src/parsers/NbtArgumentParser.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/parsers/NbtArgumentParser.ts b/src/parsers/NbtArgumentParser.ts index ce017329a..19320a2db 100644 --- a/src/parsers/NbtArgumentParser.ts +++ b/src/parsers/NbtArgumentParser.ts @@ -410,11 +410,6 @@ export default class NbtArgumentParser extends ArgumentParser { const result = this.parsePrimitiveTag(reader, superNode, helper) combineArgumentParserResult(ans, result) reader.skipWhiteSpace() - if (reader.peek() === ',') { - reader - .skip() - .skipWhiteSpace() - } if (ans.data[NbtNodeType] === 'ByteArray') { ans.data.push(result.data as NbtByteNode) if (!isNbtByteNode(result.data)) { @@ -455,6 +450,13 @@ export default class NbtArgumentParser extends ArgumentParser { ) } } + if (reader.peek() === ',') { + reader + .skip() + .skipWhiteSpace() + continue + } + break } reader .expect(']')