From ee7517173727dfec1b6fe7604c64114f0baa5445 Mon Sep 17 00:00:00 2001 From: Nick Dichev Date: Wed, 20 May 2020 13:39:08 -0700 Subject: [PATCH 1/2] Bump locked version of :unicode_set to 0.7 --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index 46142ff..626cec5 100644 --- a/mix.lock +++ b/mix.lock @@ -7,5 +7,5 @@ "makeup": {:hex, :makeup, "1.0.0", "671df94cf5a594b739ce03b0d0316aa64312cee2574b6a44becb83cd90fb05dc", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "a10c6eb62cca416019663129699769f0c2ccf39428b3bb3c0cb38c718a0c186d"}, "makeup_elixir": {:hex, :makeup_elixir, "0.14.0", "cf8b7c66ad1cff4c14679698d532f0b5d45a3968ffbcbfd590339cb57742f1ae", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "d4b316c7222a85bbaa2fd7c6e90e37e953257ad196dc229505137c5e505e9eff"}, "nimble_parsec": {:hex, :nimble_parsec, "0.5.3", "def21c10a9ed70ce22754fdeea0810dafd53c2db3219a0cd54cf5526377af1c6", [:mix], [], "hexpm", "589b5af56f4afca65217a1f3eb3fee7e79b09c40c742fddc1c312b3ac0b3399f"}, - "unicode_set": {:hex, :unicode_set, "0.5.1", "17433e103392a863e7ec3e4be330e23186daec986b46d28c5f255631ca11bc05", [:mix], [{:ex_unicode, "~> 1.5", [hex: :ex_unicode, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "6cd855f958152edd7cb06af05763ff3c4831970ba2bb872f2f1e78c2d99eb7b1"}, + "unicode_set": {:hex, :unicode_set, "0.7.0", "d5256d31d7c672e1ac0d830e1f04f3fe698b2894ae1f25b55ea5dfa550c8315a", [:mix], [{:ex_unicode, "~> 1.5", [hex: :ex_unicode, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "ca5d6a085e4bc1a17ae8afd90b15b2682539281efac99fc3df4fd62a08318a40"}, } From 0e92abd7ae95f132e1c135e352a37aba845f3310 Mon Sep 17 00:00:00 2001 From: Nick Dichev Date: Wed, 20 May 2020 13:39:48 -0700 Subject: [PATCH 2/2] Escape whitespace in match clause for is_whitespace/1 --- lib/unicode_guards.ex | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/unicode_guards.ex b/lib/unicode_guards.ex index 0ea10f8..caf9021 100644 --- a/lib/unicode_guards.ex +++ b/lib/unicode_guards.ex @@ -59,7 +59,6 @@ defmodule Unicode.Guards do defguard is_currency_symbol(codepoint) when is_integer(codepoint) and match?(codepoint, "[[:Sc:]]") - @doc """ Guards whether a UTF8 codepoint is a whitespace symbol character. @@ -69,7 +68,7 @@ defmodule Unicode.Guards do """ defguard is_whitespace(codepoint) - when is_integer(codepoint) and match?(codepoint, "[[\u0009-\u000d][:Zs:]]") + when is_integer(codepoint) and match?(codepoint, "[[\\u0009-\\u000d][:Zs:]]") @doc """ Guards whether a UTF8 codepoint is a unicode separator symbol @@ -79,7 +78,7 @@ defmodule Unicode.Guards do """ defguard is_separator(codepoint) - when is_integer(codepoint) and match?(codepoint, "[[:Zs:]]") + when is_integer(codepoint) and match?(codepoint, "[[:Zs:]]") @doc """ Guards whether a UTF8 codepoint is a unicode quote symbol @@ -92,7 +91,7 @@ defmodule Unicode.Guards do """ defguard is_quote_mark(codepoint) - when is_integer(codepoint) and match?(codepoint, "[[:QuoteMark:]]") + when is_integer(codepoint) and match?(codepoint, "[[:QuoteMark:]]") @doc """ Guards whether a UTF8 codepoint is a unicode left quote symbol @@ -102,7 +101,7 @@ defmodule Unicode.Guards do """ defguard is_quote_mark_left(codepoint) - when is_integer(codepoint) and match?(codepoint, "[[:QuoteMarkLeft:]]") + when is_integer(codepoint) and match?(codepoint, "[[:QuoteMarkLeft:]]") @doc """ Guards whether a UTF8 codepoint is a unicode right quote symbol @@ -112,7 +111,7 @@ defmodule Unicode.Guards do """ defguard is_quote_mark_right(codepoint) - when is_integer(codepoint) and match?(codepoint, "[[:QuoteMarkRight:]]") + when is_integer(codepoint) and match?(codepoint, "[[:QuoteMarkRight:]]") @doc """ Guards whether a UTF8 codepoint is a unicode quote symbol that can @@ -122,7 +121,7 @@ defmodule Unicode.Guards do """ defguard is_quote_mark_ambidextrous(codepoint) - when is_integer(codepoint) and match?(codepoint, "[[:QuoteMarkAmbidextrous:]]") + when is_integer(codepoint) and match?(codepoint, "[[:QuoteMarkAmbidextrous:]]") @doc """ Guards whether a UTF8 codepoint is a unicode quote symbol that is @@ -132,7 +131,7 @@ defmodule Unicode.Guards do """ defguard is_quote_mark_single(codepoint) - when is_integer(codepoint) and match?(codepoint, "[[:QuoteMarkSingle:]]") + when is_integer(codepoint) and match?(codepoint, "[[:QuoteMarkSingle:]]") @doc """ Guards whether a UTF8 codepoint is a unicode quote symbol that is @@ -142,7 +141,7 @@ defmodule Unicode.Guards do """ defguard is_quote_mark_double(codepoint) - when is_integer(codepoint) and match?(codepoint, "[[:QuoteMarkDouble:]]") + when is_integer(codepoint) and match?(codepoint, "[[:QuoteMarkDouble:]]") @doc """ Guards whether a UTF8 codepoint is a printable. @@ -152,7 +151,7 @@ defmodule Unicode.Guards do """ defguard is_printable(codepoint) - when is_integer(codepoint) and match?(codepoint, "[[:printable:]]") + when is_integer(codepoint) and match?(codepoint, "[[:printable:]]") @doc """ Guards whether a UTF8 codepoint is a visible. @@ -165,6 +164,5 @@ defmodule Unicode.Guards do """ defguard is_visible(codepoint) - when is_integer(codepoint) and match?(codepoint, "[[:visible:]]") - + when is_integer(codepoint) and match?(codepoint, "[[:visible:]]") end