Edit

kc3-lang/libxkbcommon/changes/api/+replace-include.feature.md

Branch :

  • Show log

    Commit

  • Author : Pierre Le Marre
    Date : 2025-03-25 22:52:06
    Hash : 23598fa1
    Message : Enable merge mode “replace” in include statements Previously only the merge modes “override” and “augment” were available in include statements, using the prefix ‘+’ and ‘|’ respectively. While on one hand `replace` include statement can be used in keymap files, on the other hand *rules* files have no way to express the *replace* mode. This commit enables the merge mode “replace” using the prefix `^`. This prefix was chosen due to its similarity with the `XOR` bit operator, which convey *mutual exclusion*. Other candidates: - `!` conveys some kind of higher precedence, akin to CSS `!important`. But it conflicts with the section header `!`, which is a token in the current parser. It would require special handling, not worth it. It also convey the meaning of negation, which is confusing. - `&` has the advantage of not corresponding to a token in the rules parser. `^` seems however to stand out more and it is less likely to trigger erroneous comparison with `|` and `&` bit operators.

  • changes/api/+replace-include.feature.md
  • Enable using the merge mode *replace* in include statements using the prefix `^`,
    such as: `include "a^b"`. The main motivation is to enable this new syntax in
    *rules*, which previously could not handle this merge mode.