Skip to content

Fix unescaped whitespace in is_whitespace/1#1

Merged
kipcole9 merged 2 commits intoelixir-unicode:masterfrom
nickdichev:fix_unescaped_whitespace
May 20, 2020
Merged

Fix unescaped whitespace in is_whitespace/1#1
kipcole9 merged 2 commits intoelixir-unicode:masterfrom
nickdichev:fix_unescaped_whitespace

Conversation

@nickdichev
Copy link

Hi, first of all thanks for the library.

I think version 0.6.0 of :unicode_set broke this library, I was getting a compilation error:

== Compilation error in file lib/unicode_guards.ex ==
** (Unicode.Set.ParseError) Unable to parse "[[\t-\r][:Zs:]]". expected range while processing sequence inside set inside property or empty set or set. Detected at "[\t-\r][:Zs:]]".
    lib/unicode_set.ex:72: Unicode.Set.parse!/1
    expanding macro: Unicode.Set.match?/2
    lib/unicode_guards.ex:72: Unicode.Guards.is_whitespace/1
    (elixir 1.10.1) expanding macro: Kernel.and/2
    lib/unicode_guards.ex:72: Unicode.Guards.is_whitespace/1
    (elixir 1.10.1) expanding macro: Kernel.Utils.defguard/2
    lib/unicode_guards.ex: Unicode.Guards.is_whitespace/1

I noticed that :unicode_set is pinned at version 0.5.1 but I got the latest 0.7.0 when I pulled the dep.

I think this should fix the issue. I got the library to compile and the tests are passing!

@kipcole9 kipcole9 merged commit 3a4862f into elixir-unicode:master May 20, 2020
kipcole9 added a commit that referenced this pull request May 20, 2020
@kipcole9
Copy link
Contributor

Really appreciate the PR and sorry for the sloppy release testing on my side. All fixed now and published on hex as unicode_guards version 0.3.1. The changelog is:

Bug Fixes

kipcole9 pushed a commit that referenced this pull request Feb 20, 2025
Use `defmacro/2` to define a guard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants