This content originally appeared on DEV Community and was authored by Calin Baenen
A new commit was made to the ParseJS repository, it contains an update that will prevent smaller tokens from potentially wrongfully being placed.
This is the bug in question:
parse_string("Hello, world!", ["Hell", "Hello"]);
// Produces: [Symbol(Hell), 'o', ',', ' ', 'w', ...]
// But, this--
parse_string("Hello, world!", ["Hello", "Hell"]);
// -- produces: [Symbol(Hello), ',', ' ', 'w', 'o', 'r', ...]
Now, in this update, the order won't matter, the longer token is always chosen if it can be.
This content originally appeared on DEV Community and was authored by Calin Baenen

Calin Baenen | Sciencx (2021-12-11T21:58:07+00:00) ParseJS update: Tokens are now sorted by length and dictionary order.. Retrieved from https://www.scien.cx/2021/12/11/parsejs-update-tokens-are-now-sorted-by-length-and-dictionary-order/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.