<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/128100>128100</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [FR] Teach the clang lexer about jujutsu (jj) conflict markers
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          algmyr
      </td>
    </tr>
</table>

<pre>
    Context: [jujutsu (jj)](https://github.com/jj-vcs/jj) is a version control system that is becoming increasingly popular. Clang has some existing logic in the lexer for some conflict marker formats, but not the (new) format that jj uses.

For reference [Jujutsu conflict markers](https://jj-vcs.github.io/jj/latest/conflicts/#conflict-markers) have a form like
```
<<<<<<<
+++++++
some plain representation
of one side
%%%%%%%
 and here
-some plain representation
+some diff representation
 of one side
>>>>>>>
```

Not sure about if the diff part of it can be handled well, but adding logic to skip long sequences of `+` and `%` much like exists for `=` and `|` would be a good start.

One place where it's very obvious this handling is not done is wrt autoformatting, where clang-format mangles the `+++++++` and `%%%%%%%` parts (among some other issues).
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8VM2u6jYQfhqzGYEchwBZZBE4ZdFFK1V9AceZJOY6NvXYcHj7yg7otuegK40E1nyZn2--GUmkR4vYsOrIqo-VjGFyvpFmnB9-1bn-0ZycDfgZWNkCq46XeImBIjBxuFyYqFn1wcRhCuFKrGyZODNxHnWYYrdRbmbifLmsb4ryHyZq0AQSbuhJOwvK2eCdAXpQwBnCJEMCdKjcrO0I2iqPkrQdzQOu7hqN9Bs4GWlHmCQBuRkBPzWFhDZu1Aq0hTAhGPxED4PzC0g5OxitAszS_1gcswzExAm6GMC6kL9i4mDxnupcAEtJlwtEQtow3jLenp0HjwN6tAoTJb8_KfmSg95Rs7CxeTKk3ZOXs5EBKTBxfgWhjC9fz_UrpqhhkjcEmSsEo39gKmvHn8ZbVp7eGG-ZOL4x3mZ-rkZqCx6vHgltkEE7y3jrBnAWgXSfs4jqjfEWpO1hQp8w61-FY-KY3b0ehu9e-JKt_O2NfemVt3-4ABQ9guxcDKCHPMic4Sp9SEF1ACUtdAiTtL3BHu5ozGv2su9_qic4oB_6CsbZEQj_iWnIlIKkhOLIdjx3m19Ves1RTXkMixApay65y4__gven9Lq7aPpUiITRuR4oSB-euvrTZt4Uwj1xCTowsae0Kw9w3U27SBAmTUsTeT0oC7dPpGmCuw8gY3CLdNNKpBaXYCrtzPop6lna0SAtil_a-m7_b_S77Xjml9LOyDnTlUbrwoQeNFHEJNbNqm_Kvi5rucKm2G85r-t9vV1NzVCroai6fcGVKBTnSgxS7XCPQ8lxuz-sdCO4qLgQBS94WWw3fTlgobrtoRLDrpI123KcpTYbY27zxvlxldM2hTgUnK-M7NDQ67D5JqHWXRyJbblJk_r5XdDB5BN4_otVH_A3SjVldjJtz1uy6Ovr_fu29avoTfOLe5iSPn_WV-8uqNLavwg7P4u_NeLfAAAA__8ohcir">