Currently, if a string doesn't have a closing quote, doesn't create any errors. sjlevine/atom-slime#81 uses paredit errors to detect when a line is incomplete, so this would allow it to behave correctly when a user is typing just a string (its a corner case, since most of the time there will be a missing closing paren as the string goes until eof). The fix checks whether the next character is an double quote (instead of assuming it is and discarding it) and, if it isn't, an error is created instead of a string.
For example calling parse with just the string ", paredit produces (when output in chromimum dev tools)
This PR modifies paredit to provide an error instead:
I couldn't get the tests running on my machine, so there isn't any change to the test suite. If you want a test in the suite, the following should work:
it("unmatched string quote", function() {
var actual = readSeq('"a'),
expected = [
"a",
{error: "Expected '\"' but reached end of input at line 1 column 2"}]
console.log(diff(actual,expected));
expect(actual).to.containSubset(expected);
});
Currently, if a string doesn't have a closing quote, doesn't create any errors. sjlevine/atom-slime#81 uses paredit errors to detect when a line is incomplete, so this would allow it to behave correctly when a user is typing just a string (its a corner case, since most of the time there will be a missing closing paren as the string goes until eof). The fix checks whether the next character is an double quote (instead of assuming it is and discarding it) and, if it isn't, an error is created instead of a string.
For example calling
parse
with just the string"
, paredit produces (when output in chromimum dev tools) This PR modifies paredit to provide an error instead:I couldn't get the tests running on my machine, so there isn't any change to the test suite. If you want a test in the suite, the following should work: