mirror of
https://github.com/kucherenko/jscpd.git
synced 2026-09-19 08:11:03 +08:00
e0d129e129
Replace the nested-quantifier string pattern /"(?:[^"\\]*|\\.)*"/ with /"(?:[^"\\]|\\[\s\S])*"/ in the Lisp/Elisp grammar. The original pattern could catastrophically backtrack (O(2^n)) when a string contained a backslash-newline line continuation, because JS dot does not match newlines, leaving both alternatives unable to advance. The fixed pattern eliminates nested quantifiers and uses [\s\S] so line continuations are consumed correctly. Adds a regression test with a 5s timeout guard and populates the previously-empty fixtures/commonlisp/*.el fixture files with realistic Elisp code that includes the backslash-newline pattern.