develooper Front page | perl.perl5.porters | Postings from April 2016

[perl #127993] Version control conflict markers

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
April 27, 2016 00:53
Subject:
[perl #127993] Version control conflict markers
Message ID:
rt-4.0.18-31856-1461718416-1713.127993-15-0@perl.org
On Tue Apr 26 02:01:25 2016, kentfredric@gmail.com wrote:
> A CPAN Grep says there's not a lot of risk for a mistake here, a
> non-anchored result turns up a few entries, mostly, other code
> checking for conflict markers.
> 
> <{5,90}.{0,500}={5,90}
> 
> http://grep.cpan.me/?q=%3C{5%2C90}.{0%2C500}%3D{5%2C90}
> 
> An Anchored CPAN Grep returns no results, suggesting its probably safe:
> 
> 
> ^<{5,90}.{0,500}^={5,90}
> 
> http://grep.cpan.me/?q=^%3C{5%2C90}.{0%2C500}^%3D{5%2C90}
> 
> Obviously, C has the Luxury that it doesn't have heredocs.
> 
> But fortunately for us,
> 
>  <<<<<<
> 
> Is parsed as
> 
> <<"" <<"" <<""

Actually <<"" << <<"".  That’s a bitshift in the middle.

> 
> Not
> 
> <<"<<<<"
> 
> So there's no risk of it being some weird heredoc side-effect either,
> and we deprecated <<"" already :D  ( See attached hereconflict.pl )
> 
> The only thing I'd want to make sure of is how we handled embedded git
> conflict markers /inside string literals/ are handled right, because
> you never know, there's probably some legitimate usecase for embedding
> a conflict inside a heredoc. ( See attached hereconflict2.pl )

The best thing would be to handle this in yyerror, just the way we do ‘(Missing semicolon?)’.  That way, it would never have false positives.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=127993

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About