withGetopt: replace \\>

This commit is contained in:
tv 2017-11-15 16:41:29 +01:00
parent 1f50c4e068
commit 2f183f41ca
2 changed files with 7 additions and 3 deletions

View File

@ -20,7 +20,7 @@ opt-spec: cmd-spec: let
# true if b requires a to define its default value
opts-before = a: b:
test ".*[$]${stringAsChars (c: "[${c}]") a.varname}\\>.*" (b.default or "");
test ".*[$]${stringAsChars (c: "[${c}]") a.varname}([^0-9A-Za-z_].*)?" (b.default or "");
opts-list = let
sort-out = toposort opts-before (attrValues opts);

View File

@ -173,9 +173,13 @@ let {
syn cluster nix_ind_strings contains=NixIND_STRING
syn cluster nix_strings contains=NixSTRING
${concatStringsSep "\n" (mapAttrsToList (lang: { extraStart ? null }: let
${concatStringsSep "\n" (mapAttrsToList (name: {
extraStart ? null,
lang ? name
}:
let
startAlts = filter isString [
''/\* ${lang} \*/''
''/\* ${name} \*/''
extraStart
];
sigil = ''\(${concatStringsSep ''\|'' startAlts}\)[ \t\r\n]*'';