From 8077bbfa1f8a932f952028724ebae5639cdd5302 Mon Sep 17 00:00:00 2001 From: zontreck Date: Tue, 2 Jul 2024 19:23:14 -0700 Subject: [PATCH] Patch quoted strings in snbt --- lib/nbt/Stream.dart | 4 ++++ pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/nbt/Stream.dart b/lib/nbt/Stream.dart index d315c1a..41cdfcd 100644 --- a/lib/nbt/Stream.dart +++ b/lib/nbt/Stream.dart @@ -413,6 +413,7 @@ class StringReader { final String _buffer; int _position = 0; int _lastPostion = 0; + bool _quotedString = false; StringReader(this._buffer); @@ -444,6 +445,7 @@ class StringReader { // Skip any whitespace characters void skipWhitespace() { + if (_quotedString) return; // We need whitespace for strings while (canRead && isWhitespace(_buffer[_position])) { _position++; } @@ -465,6 +467,7 @@ class StringReader { // Read a string enclosed in double quotes String readQuotedString() { + _quotedString = true; if (next() != '"') { throw Exception('Expected double quotes at the start of a string'); } @@ -476,6 +479,7 @@ class StringReader { } result.write(char); } + _quotedString = false; return result.toString(); } diff --git a/pubspec.yaml b/pubspec.yaml index f352ac0..7488d5f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: libac_dart description: "Aria's Creations code library" -version: 1.0.33 +version: 1.0.35 homepage: "https://zontreck.com"