Closed jgm closed 5 years ago
Reproducible on command line
% skylighting -s erlang
"\"aaaaaaaaaaaaaaaaaaaaa
skylighting: RegexException "Error in Text.Regex.PCRE.Wrap: ReturnCode (-8)"
With trace:
DetectChar MATCHED Just (StringTok,"\"")
CONTEXT STACK ["stringquote","Normal Text"]
Trying rule Rule {rMatcher = RegExpr (RE {reString = "(?:(?:\\\\\")?[^\"]*)*\"", reCaseSensitive = True}), rAttribute = StringTok, rIncludeAttribute = False, rDynamic = False, rCaseSensitive = True, rChildren = [], rLookahead = False, rFirstNonspace = False, rColumn = Nothing, rContextSwitch = [Pop]}
skylighting: RegexException "Error in Text.Regex.PCRE.Wrap: ReturnCode (-8)"
This diff seems to help:
diff --git a/skylighting-core/xml/erlang.xml b/skylighting-core/xml/erlang.xml
index 7bbcbc9..b631afd 100644
--- a/skylighting-core/xml/erlang.xml
+++ b/skylighting-core/xml/erlang.xml
@@ -213,7 +213,7 @@
<!-- finish off the atom in quoted string (allow for escaped single quotes -->
<context name="stringquote" attribute="String" lineEndContext="#pop">
- <RegExpr attribute="String" context="#pop" String="(?:(?:\\")?[^"]*)*"" />
+ <RegExpr attribute="String" context="#pop" String="(?:\\"|[^"])*"" />
</context>
<!-- finish off the comment (allows for alerts) -->
I'm not sure why the original wasn't working - some pcre issue?
https://travis-ci.org/jgm/skylighting/jobs/490256029
Use
--quickcheck-replay=401761
to reproduce.