Board Thread:Code Review/@comment-24757753-20180805110740/@comment-11733175-20180806070826

@Fngplg you can't do that otherwise there's no base case for the recursion. If the message called is incorrect, it'll never return. But you could do: if (lang === 'en' || lang === 'qqx') { ... }

@OneTwoThreeFall I'm not convinced that string regex does what it's meant to and it's only going to get more complicated. What about swapping to a basic parser: var prev = null, next = null, cur = null, inString = false, res = '';

for (i = 0; i < json.length; i++) { cur = json[i]; next = ((i + 1) < json length) ? json[i] : null; prev = (i > 0) ? (i - 1) : null;

// Loop over the string checking for comments, strings, etc.   // Copying the bits to keep into res }