The closing string delimiter on the first line does not terminate the string properly. Also occurs for a string containing only any even number of escape characters.
This is probably a result of the following:
;; Look for the end of string delimiter, depending on rawp and
;; string-delimiter
(when (or (looking-at string-delimiter)
;; Unless rawp, ensure an even number of backslashes
(re-search-forward (concat (if rawp "" (rx (not (any ?\\)) (zero-or-more ?\\ ?\\)))
string-delimiter)
end t))
Just as we had to add the looking-at for very short strings like '', we also need to allow for short strings like '\\', that is, the issue is probably the assumed non escape character in (not (any ?\\)).
When we fix this, we should also consider stylistically replacing (if rawp "" with (unless rawp, since concat works fine with a nil argument.
This issue was encountered while reading petitparser_test.dart.
dart-mode fails for an edge case.
In a file with the following,
The closing string delimiter on the first line does not terminate the string properly. Also occurs for a string containing only any even number of escape characters.
This is probably a result of the following:
Just as we had to add the
looking-at
for very short strings like''
, we also need to allow for short strings like'\\'
, that is, the issue is probably the assumed non escape character in(not (any ?\\))
.When we fix this, we should also consider stylistically replacing
(if rawp ""
with(unless rawp
, sinceconcat
works fine with anil
argument.This issue was encountered while reading
petitparser_test.dart
.