Skip to content

Commit

Permalink
Fix value delimiter failure when encountered after object and after a…
Browse files Browse the repository at this point in the history
…rray
  • Loading branch information
grasshopper47 committed Nov 28, 2023
1 parent a741874 commit 570688e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/parse.nr
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ impl<N> ByteArrayParser for [u8; N]

arrays += 1;
array = true;
value_delimiter = false;
}
else if (object | array)
{
Expand All @@ -237,8 +238,9 @@ impl<N> ByteArrayParser for [u8; N]
else
{
object = true;
value = false;
has_key = false;
value = false;
value_delimiter = false;
}
}
else if ((byte == END_OBJECT) | (byte == END_ARRAY))
Expand Down Expand Up @@ -291,7 +293,7 @@ impl<N> ByteArrayParser for [u8; N]
}
else if (byte == VALUE_DELIMITER)
{
OK = ((object | array) & array_value);
OK = (((object | array) & array_value) | (object & !array));

key_delimiter = false;
value_delimiter = true;
Expand Down

0 comments on commit 570688e

Please sign in to comment.