Skip to content

Commit

Permalink
release new version
Browse files Browse the repository at this point in the history
  • Loading branch information
starwing committed Jul 29, 2020
1 parent 97fb626 commit c462d19
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 9 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,14 @@ UCD.*/
ucd/
ucd.*/
*.dll

lua-utf8.so
lua-utf8.so.*
luautf8-*.zip
luautf8-*.rock

*.gcov
*.gcda
*.gcno

test_*.lua
20 changes: 11 additions & 9 deletions parseucd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-- - UCD\EastAsianWidth.txt
-- - UCD\PropList.txt
-- - UCD\UnicodeData.txt
--
--
-- files can be downloaded at: http://unicode.org/Public/UCD/latest/UCD/


Expand All @@ -15,7 +15,7 @@ local function parse_UnicodeData()
-- 1. name
-- 2. general category
-- 3. canonical combining class
-- 4. bidi class
-- 4. bidi class
-- 5. decomposition type/mapping
-- 6. numberic type/value
-- 7. numberic type/value
Expand Down Expand Up @@ -81,8 +81,8 @@ local function parse_EastAsianWidth()
assert(first, line)
end

local first = tonumber(first, 16)
local last = tonumber(last, 16)
first = tonumber(first, 16)
last = tonumber(last, 16)

if mark == 'W' or mark == 'F' then
for i = first, last do
Expand Down Expand Up @@ -139,8 +139,8 @@ local function parse_PropList(f)
assert(first, line)
end

local first = tonumber(first, 16)
local last = tonumber(last, 16)
first = tonumber(first, 16)
last = tonumber(last, 16)

if f(mark) then
for i = first, last do
Expand All @@ -157,15 +157,15 @@ local function parse_PropList(f)
return ranges, lookup
end

local function get_ranges(list, func, proc)
local function get_ranges(list, func)
local first, last, step, offset
local ranges = {}
for i = 1, #list do
local v_cp, v_offset
local v = list[i]
local res = not func or func(v)
if type(v) == 'number' then
v_cp, v_offset = v
v_cp, v_offset = v, nil
elseif v.cp then
v_cp, v_offset = v.cp, v.offset
end
Expand All @@ -180,7 +180,7 @@ local function get_ranges(list, func, proc)
local r = { first = first, last = last, step = step, offset = offset }
ranges[#ranges+1] = r
end
first, last, step = v_cp, v_cp
first, last, step = v_cp, v_cp, nil
offset = v_offset
end
end
Expand All @@ -192,6 +192,7 @@ local function get_ranges(list, func, proc)
return ranges
end

--[[
local function merge_ranges(...)
local ranges = {}
local lookup = {}
Expand Down Expand Up @@ -238,6 +239,7 @@ local function diff_ranges(base, sub, force)
end
return get_ranges(ranges)
end
--]]

local function write_ranges(name, ranges)
io.write("static struct range_table "..name.."_table[] = {\n")
Expand Down
23 changes: 23 additions & 0 deletions rockspecs/luautf8-0.1.2-2.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package = "luautf8"
version = "0.1.2-2"
source = {
url = "https://github.com/starwing/luautf8/archive/0.1.2.tar.gz",
dir = "luautf8-0.1.2"
}
description = {
summary = "A UTF-8 support module for Lua",
detailed = [[
This module adds UTF-8 support to Lua. It's compatible with Lua "string" module.
]],
homepage = "http://github.com/starwing/luautf8",
license = "MIT"
}
dependencies = {
"lua >= 5.1"
}
build = {
type = "builtin",
modules = {
["lua-utf8"] = "lutf8lib.c"
}
}
23 changes: 23 additions & 0 deletions rockspecs/luautf8-0.1.3-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package = "luautf8"
version = "0.1.3-1"
source = {
url = "https://github.com/starwing/luautf8/archive/0.1.3.tar.gz",
dir = "luautf8-0.1.3"
}
description = {
summary = "A UTF-8 support module for Lua",
detailed = [[
This module adds UTF-8 support to Lua. It's compatible with Lua "string" module.
]],
homepage = "http://github.com/starwing/luautf8",
license = "MIT"
}
dependencies = {
"lua >= 5.1"
}
build = {
type = "builtin",
modules = {
["lua-utf8"] = "lutf8lib.c"
}
}

0 comments on commit c462d19

Please sign in to comment.