smashwilson / merge-conflicts

Resolve git merge conflicts in Atom
https://atom.io/packages/merge-conflicts
MIT License
432 stars 42 forks source link

Refactor the Conflict parser. #229

Closed smashwilson closed 8 years ago

smashwilson commented 8 years ago

The ConflictParser has outgrown its initial implementation. Because diff3-style conflicts can recursively contain sub-merge conflicts, matching with a single regular expression and advancing through its match groups won't be enough: we need something that can recurse with it.

What I'm attempting instead is to use a simpler regexp to scan for lines that look like the beginning of a conflict, then invoking a stateful parser that advances row-by-row and descends into a recursive call if the BASE side looks like a conflict itself.