diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-09-19 17:42:39 -0300 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-09-19 17:42:39 -0300 |
| commit | 7e5052ca584689d07331a80a02fc4ea883c0322b (patch) | |
| tree | dd6f10e3f2b29e066b4f74acf6fe6c14d0604f4c /clformat/data/formats.sprop | |
| parent | 6261466749a5a351ed1ae0890e5f4359d8d58031 (diff) | |
Add named parameters
You can now use named prefix parameters in FORMAT strings.
Well, none of the directives support them yet, but they are accepted in
the directives, and it'll be easy enough to add the support
Diffstat (limited to 'clformat/data/formats.sprop')
| -rw-r--r-- | clformat/data/formats.sprop | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/clformat/data/formats.sprop b/clformat/data/formats.sprop index b6eac35..a32ca2e 100644 --- a/clformat/data/formats.sprop +++ b/clformat/data/formats.sprop @@ -19,10 +19,25 @@ clFormatDirective ~(?<params>%1$s)?(?<modifiers>%2$s?)(?:%3$s) ## * A single character preceded by a single quote ## * The letter V (or v) ## * The character # -clFormatPrefix (?:(?:[-+]?\d+|'.|[Vv]|#|%|".*?(?<!\\)")?) +## * The character % +## * A double-quoted string +clFormatPrefixParam (?:(?:[-+]?\d+|'.|[Vv]|#|%|".*?(?<!\\)")?) + +## Matches a (possibly named) format string prefix parameter +## +## Parameters are seperated by ',' +## +## Named parameters are indicated by a preceeding #, which is followed by a +## parameter name (any sequence of non-space, non-seperator (',', ':', ';') +## printing characters), a seperator (: or ;), then the value of the parameter +clFormatPrefix (?:(?:#[\S&&[^,:;]][:;]%1$s)|%1$s) ## Match a format string modifier -## A modifier is any combination of $, :, * and @; duplicates don't matter though +## A modifier is any combination of the following characters +## * '$' * ':' +## * '*' * '@' +## +## Duplicates have no effect clFormatModifier (?:[@$:*]+) ## Matches a directive name. |
