[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug: long strings with REALLY long delimiters…
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 14 Dec 2018 14:32:25 -0200
> Finding longest "=" sequence is arguably simplest and not optimal. I prefer
> finding shortest long closing quote: min(N): ("]" "=" ^ N "]") not in string.
>
> This algorithm have no worst cases.
>
> Sample implementation at
> https://github.com/martin-eden/workshop/blob/master/formats/lua/quote_string/intact.lua#L16
It doesn't seem to work for "]]a]=". (Result is "[=[]]a]=]=]"...)
-- Roberto