diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2021-04-22 13:22:32 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2021-04-23 09:55:06 -0400 |
commit | b8fadcd74139d09b470100a6deef65ac13d4442a (patch) | |
tree | 310cd4760554721685b5e1d39645623c10c47d89 /src | |
parent | spine options, pod uses source file structure (diff) |
ext-dep: d-yaml updated
Diffstat (limited to 'src')
-rw-r--r-- | src/ext_depends/D-YAML.meta | 2 | ||||
-rw-r--r-- | src/ext_depends/D-YAML/source/dyaml/resolver.d | 75 |
2 files changed, 35 insertions, 42 deletions
diff --git a/src/ext_depends/D-YAML.meta b/src/ext_depends/D-YAML.meta index 4a9839a..22193e0 100644 --- a/src/ext_depends/D-YAML.meta +++ b/src/ext_depends/D-YAML.meta @@ -1,3 +1,3 @@ -D-YAML ecbd63ed +D-YAML ddd418fa https://github.com/dlang-community/D-YAML Boost Software License 1.0 (BSL-1.0) diff --git a/src/ext_depends/D-YAML/source/dyaml/resolver.d b/src/ext_depends/D-YAML/source/dyaml/resolver.d index ceed1e5..f57cbbe 100644 --- a/src/ext_depends/D-YAML/source/dyaml/resolver.d +++ b/src/ext_depends/D-YAML/source/dyaml/resolver.d @@ -27,50 +27,43 @@ import dyaml.exception; /// Type of `regexes` private alias RegexType = Tuple!(string, "tag", const Regex!char, "regexp", string, "chars"); -private immutable RegexType[] regexes; - -shared static this() @safe -{ - RegexType[] tmp; - tmp ~= RegexType("tag:yaml.org,2002:bool", - regex(r"^(?:yes|Yes|YES|no|No|NO|true|True|TRUE" ~ - "|false|False|FALSE|on|On|ON|off|Off|OFF)$"), - "yYnNtTfFoO"); - tmp ~= RegexType("tag:yaml.org,2002:float", - regex(r"^(?:[-+]?([0-9][0-9_]*)\\.[0-9_]*" ~ - "(?:[eE][-+][0-9]+)?|[-+]?(?:[0-9][0-9_]" ~ - "*)?\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?" ~ - "[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]" ~ - "*|[-+]?\\.(?:inf|Inf|INF)|\\." ~ - "(?:nan|NaN|NAN))$"), - "-+0123456789."); - tmp ~= RegexType("tag:yaml.org,2002:int", - regex(r"^(?:[-+]?0b[0-1_]+" ~ - "|[-+]?0[0-7_]+" ~ - "|[-+]?(?:0|[1-9][0-9_]*)" ~ - "|[-+]?0x[0-9a-fA-F_]+" ~ - "|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$"), - "-+0123456789"); - tmp ~= RegexType("tag:yaml.org,2002:merge", regex(r"^<<$"), "<"); - tmp ~= RegexType("tag:yaml.org,2002:null", - regex(r"^$|^(?:~|null|Null|NULL)$"), "~nN\0"); - tmp ~= RegexType("tag:yaml.org,2002:timestamp", - regex(r"^[0-9][0-9][0-9][0-9]-[0-9][0-9]-" ~ - "[0-9][0-9]|[0-9][0-9][0-9][0-9]-[0-9]" ~ - "[0-9]?-[0-9][0-9]?[Tt]|[ \t]+[0-9]" ~ - "[0-9]?:[0-9][0-9]:[0-9][0-9]" ~ - "(?:\\.[0-9]*)?(?:[ \t]*Z|[-+][0-9]" ~ - "[0-9]?(?::[0-9][0-9])?)?$"), - "0123456789"); - tmp ~= RegexType("tag:yaml.org,2002:value", regex(r"^=$"), "="); - +private immutable RegexType[] regexes = [ + RegexType("tag:yaml.org,2002:bool", + regex(r"^(?:yes|Yes|YES|no|No|NO|true|True|TRUE" ~ + "|false|False|FALSE|on|On|ON|off|Off|OFF)$"), + "yYnNtTfFoO"), + RegexType("tag:yaml.org,2002:float", + regex(r"^(?:[-+]?([0-9][0-9_]*)\\.[0-9_]*" ~ + "(?:[eE][-+][0-9]+)?|[-+]?(?:[0-9][0-9_]" ~ + "*)?\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?" ~ + "[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]" ~ + "*|[-+]?\\.(?:inf|Inf|INF)|\\." ~ + "(?:nan|NaN|NAN))$"), + "-+0123456789."), + RegexType("tag:yaml.org,2002:int", + regex(r"^(?:[-+]?0b[0-1_]+" ~ + "|[-+]?0[0-7_]+" ~ + "|[-+]?(?:0|[1-9][0-9_]*)" ~ + "|[-+]?0x[0-9a-fA-F_]+" ~ + "|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$"), + "-+0123456789"), + RegexType("tag:yaml.org,2002:merge", regex(r"^<<$"), "<"), + RegexType("tag:yaml.org,2002:null", + regex(r"^$|^(?:~|null|Null|NULL)$"), "~nN\0"), + RegexType("tag:yaml.org,2002:timestamp", + regex(r"^[0-9][0-9][0-9][0-9]-[0-9][0-9]-" ~ + "[0-9][0-9]|[0-9][0-9][0-9][0-9]-[0-9]" ~ + "[0-9]?-[0-9][0-9]?[Tt]|[ \t]+[0-9]" ~ + "[0-9]?:[0-9][0-9]:[0-9][0-9]" ~ + "(?:\\.[0-9]*)?(?:[ \t]*Z|[-+][0-9]" ~ + "[0-9]?(?::[0-9][0-9])?)?$"), + "0123456789"), + RegexType("tag:yaml.org,2002:value", regex(r"^=$"), "="), //The following resolver is only for documentation purposes. It cannot work //because plain scalars cannot start with '!', '&', or '*'. - tmp ~= RegexType("tag:yaml.org,2002:yaml", regex(r"^(?:!|&|\*)$"), "!&*"); - - regexes = () @trusted { return cast(immutable)tmp; }(); -} + RegexType("tag:yaml.org,2002:yaml", regex(r"^(?:!|&|\*)$"), "!&*"), +]; /** * Resolves YAML tags (data types). |