Skip to content

Commit 69ac8e6

Browse files
committed
Fix v1.0 issues with current_module gone
1 parent 4959141 commit 69ac8e6

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ keywords = ["Strings", "Characters", "Encodings"]
44
license = "MIT"
55
desc = "Basic API for string encodings, character sets, etc."
66
authors = ["ScottPJones <scottjones@alum.mit.edu>"]
7-
version = "0.1.4"
7+
version = "0.1.5"
88

99
[deps]
1010
ModuleInterfaceTools = "5cb8414e-7aab-5a03-a681-351269c074bf"

src/StrAPI.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ function _uppercase end
123123
function _titlecase end
124124
@api develop! _write, _print, _isvalid, _lowercase, _uppercase, _titlecase
125125

126+
const curmod = @static V6_COMPAT ? current_module() : @__MODULE__
127+
126128
include("errors.jl")
127129
include("traits.jl")
128130
include("codepoints.jl")
@@ -137,7 +139,6 @@ include("uni.jl")
137139

138140
# Todo: Should probably have a @api function for importing/defining renamed functions
139141
const namlst = Symbol[]
140-
const mod = @static V6_COMPAT ? current_module() : @__MODULE__
141142

142143
for (pref, lst) in
143144
((0,
@@ -162,7 +163,7 @@ for (pref, lst) in
162163
? (symstr("is", nam[1]), symstr("is_", nam[2]))
163164
: (symstr("is", nam), symstr("is_", nam)))
164165

165-
m_eval(mod,
166+
m_eval(curmod,
166167
(isdefined(Base, oldname)
167168
? Expr(:const, Expr(:(=), newname, oldname))
168169
: Expr(:function, newname)))

src/uni.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Licensed under MIT License, see LICENSE.md
88
"""
99
module Uni
1010

11-
using ModuleInterfaceTools: m_eval, cur_mod
11+
using ModuleInterfaceTools: m_eval
1212

1313
@enum(Category::Int8,Cn,Lu,Ll,Lt,Lm,Lo,Mn,Mc,Me,Nd,Nl,No,Pc,Pd,Ps,Pe,Pi,Pf,Po,Sm,Sc,Sk,So,
1414
Zs,Zl,Zp,Cc,Cf,Cs,Co,Ci,Cm)
@@ -57,8 +57,10 @@ Base.:(+)(x::Category, t::Integer) = Category(Int(x) + t)
5757
Base.:(-)(x::Category, y::Integer) = Category(Int(x) - y)
5858
Base.:(-)(x::Category, y::Category) = Int(x) - Int(y)
5959

60+
const curmod = @static VERSION < v"0.7" ? current_module() : @__MODULE__
61+
6062
for i = Int(typemin(Category)):Int(typemax(Category))
61-
m_eval(cur_mod(),
63+
m_eval(curmod,
6264
Expr(:macrocall, Symbol("@doc"),
6365
string("Unicode Category: ", category_strings[i+1]),
6466
Symbol(Category(i))))

0 commit comments

Comments
 (0)