<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3AUnicode_data%2Fage%2Fmake</id>
	<title>Module:Unicode data/age/make - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3AUnicode_data%2Fage%2Fmake"/>
	<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:Unicode_data/age/make&amp;action=history"/>
	<updated>2026-04-22T14:14:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://70.231.62.181/index.php?title=Module:Unicode_data/age/make&amp;diff=22901141&amp;oldid=prev</id>
		<title>imported&gt;Erutuon: add aliases, though probably not that useful</title>
		<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:Unicode_data/age/make&amp;diff=22901141&amp;oldid=prev"/>
		<updated>2019-09-18T22:46:26Z</updated>

		<summary type="html">&lt;p&gt;add aliases, though probably not that useful&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local page = frame.args[1] or &amp;quot;User:Erutuon/Unicode/DerivedAge.txt&amp;quot;&lt;br /&gt;
	local text = assert(mw.title.new(page):getContent())&lt;br /&gt;
	local singles, ranges = {}, {}&lt;br /&gt;
	for code_point1, code_point2, age in text:gmatch(&amp;quot;%f[^\n%z](%x+)%.?%.?(%x*)%s*;%s*([%d.]+)&amp;quot;) do&lt;br /&gt;
		code_point1, code_point2 = tonumber(code_point1, 16), tonumber(code_point2, 16)&lt;br /&gt;
		local last_range = ranges[#ranges]&lt;br /&gt;
		if last_range and last_range[2] == code_point1 - 1 and last_range[3] == age then&lt;br /&gt;
			last_range[2] = code_point2 or code_point1&lt;br /&gt;
		elseif singles[code_point1 - 1] == age then&lt;br /&gt;
			singles[code_point1 - 1] = nil&lt;br /&gt;
			table.insert(ranges, { code_point1 - 1, code_point2 or code_point1, age })&lt;br /&gt;
		else&lt;br /&gt;
			if not code_point2 then&lt;br /&gt;
				singles[code_point1] = age&lt;br /&gt;
			else&lt;br /&gt;
				table.insert(ranges, { code_point1, code_point2, age })&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
		local template = [[&lt;br /&gt;
return {&lt;br /&gt;
	singles = {&lt;br /&gt;
...&lt;br /&gt;
	},&lt;br /&gt;
	ranges = {&lt;br /&gt;
...&lt;br /&gt;
	},&lt;br /&gt;
	aliases = {&lt;br /&gt;
...&lt;br /&gt;
	},&lt;br /&gt;
}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
	table.sort(&lt;br /&gt;
		ranges,&lt;br /&gt;
		function(range1, range2)&lt;br /&gt;
			return range1[1] &amp;lt; range2[1]&lt;br /&gt;
		end)&lt;br /&gt;
	&lt;br /&gt;
	local function make_padding(age)&lt;br /&gt;
		return (&amp;quot; &amp;quot;):rep(#&amp;#039;&amp;quot;12.1&amp;quot;&amp;#039; - (#age + 2))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local Array = require &amp;quot;Module:array&amp;quot;&lt;br /&gt;
	local printed_ranges = Array()&lt;br /&gt;
	for _, range in ipairs(ranges) do&lt;br /&gt;
		local low, high, age = unpack(range)&lt;br /&gt;
		printed_ranges:insert((&amp;#039;\t\t{ 0x%06X, 0x%06X, %s%q },&amp;#039;)&lt;br /&gt;
			:format(low, high, make_padding(age), age))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local printed_singles = Array()&lt;br /&gt;
	for codepoint, age in require &amp;#039;Module:TableTools&amp;#039;.sortedPairs(singles) do&lt;br /&gt;
		printed_singles:insert((&amp;#039;\t\t[0x%06X] = %s%q,&amp;#039;)&lt;br /&gt;
			:format(codepoint, make_padding(age), age))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local printed_aliases = Array()&lt;br /&gt;
	local property_value_aliases = mw.title.new &amp;quot;User:Erutuon/Unicode/PropertyValueAliases.txt&amp;quot;:getContent()&lt;br /&gt;
	local age_aliases = property_value_aliases:match &amp;quot;# Age[^\n]+%s*(.-)%s*%f[^\n]#&amp;quot;&lt;br /&gt;
	for age, alias in age_aliases:gmatch &amp;quot;age%s*;%s*(%S+)%s*;%s*(%S+)&amp;quot; do&lt;br /&gt;
		printed_aliases:insert((&amp;#039;\t\t[%s&amp;quot;%s&amp;quot;] = &amp;quot;%s&amp;quot;,&amp;#039;)&lt;br /&gt;
			:format(make_padding(age), age, alias))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local data = template&lt;br /&gt;
		:gsub(&amp;#039;%.%.%.&amp;#039;, printed_singles:concat(&amp;#039;\n&amp;#039;), 1)&lt;br /&gt;
		:gsub(&amp;#039;%.%.%.&amp;#039;, printed_ranges:concat(&amp;#039;\n&amp;#039;), 1)&lt;br /&gt;
		:gsub(&amp;#039;%.%.%.&amp;#039;, printed_aliases:concat(&amp;#039;\n&amp;#039;), 1)&lt;br /&gt;
	&lt;br /&gt;
	return mw.getCurrentFrame():extensionTag{&lt;br /&gt;
		name = &amp;quot;syntaxhighlight&amp;quot;,&lt;br /&gt;
		content = data,&lt;br /&gt;
		args = { lang = &amp;quot;lua&amp;quot; }&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Erutuon</name></author>
	</entry>
</feed>