Skip to content

Commit

Permalink
Fix ungron bug when a line's ending token is a substring of the follo…
Browse files Browse the repository at this point in the history
…wing ending token
  • Loading branch information
adamritter committed Dec 6, 2023
1 parent fd3a34a commit d01be71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/fastgron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,11 @@ int main(int argc, char *argv[])
{
common++;
}
// if it's not a token ending, make sure we don't use the last token
if (common < line.size() && line[common] != ' ' && line[common] != '=' && line[common] != '.' && line[common] != '[')
{
common--;
}
int index = 0;
while (index < parse_gron_builder_offsets.size() && parse_gron_builder_offsets[index] <= common)
{
Expand Down
1 change: 0 additions & 1 deletion src/parse_gron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "jsonutils.hpp"
#include <stdexcept>


// BUG: ["..."] is not handled
void parse_gron(string_view line, Builder &builder, int offset,
vector<Builder *> &parse_gron_builders,
Expand Down

0 comments on commit d01be71

Please sign in to comment.