Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
176d5769
Commit
176d5769
authored
Jan 31, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib9: update to Unicode 6.0.0
R=r CC=golang-dev
https://golang.org/cl/4121042
parent
ad006444
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1588 additions
and
56 deletions
+1588
-56
src/lib9/utf/Makefile
src/lib9/utf/Makefile
+16
-0
src/lib9/utf/mkrunetype.c
src/lib9/utf/mkrunetype.c
+6
-4
src/lib9/utf/runetype.c
src/lib9/utf/runetype.c
+1
-46
src/lib9/utf/runetypebody-6.0.0.c
src/lib9/utf/runetypebody-6.0.0.c
+1565
-0
src/lib9/utf/utf.h
src/lib9/utf/utf.h
+0
-6
No files found.
src/lib9/utf/Makefile
View file @
176d5769
...
...
@@ -14,3 +14,19 @@ OFILES=\
mkrunetype.
$O
\
include
../../Make.ccmd
UnicodeData-%.txt
:
curl http://www.unicode.org/Public/
$*
/ucd/UnicodeData.txt
>
_
$@
mv
_
$@
$@
runetypebody-%.c
:
mkrunetype UnicodeData-%.txt
mkrunetype
-p
UnicodeData-
$*
.txt
>
_
$@
mv
_
$@
$@
CLEANFILES
+=
UnicodeData.txt
UNICODE_VERSION
=
6.0.0
test
:
mkrunetype UnicodeData-$(UNICODE_VERSION).txt
mkrunetype
-c
UnicodeData-
$(UNICODE_VERSION)
.txt
src/lib9/utf/mkrunetype.c
View file @
176d5769
...
...
@@ -93,8 +93,9 @@ usage(void)
exit
(
1
);
}
int
main
(
int
argc
,
char
*
argv
[]){
void
main
(
int
argc
,
char
*
argv
[])
{
FILE
*
in
;
char
buf
[
MAX_LINE
],
buf2
[
MAX_LINE
];
char
*
fields
[
NFIELDS
+
1
],
*
fields2
[
NFIELDS
+
1
];
...
...
@@ -239,7 +240,7 @@ main(int argc, char *argv[]){
}
else
{
mktables
(
argv
[
0
],
usepairs
);
}
return
0
;
exit
(
0
)
;
}
/*
...
...
@@ -562,7 +563,8 @@ mkto(const char* label, int* map, int usepairs)
// Make only range tables and a function for is<label>rune.
static
void
mkisronly
(
const
char
*
label
,
char
*
prop
)
{
mkisronly
(
const
char
*
label
,
char
*
prop
)
{
mkisrange
(
label
,
prop
,
1
);
printf
(
"int
\n
"
...
...
src/lib9/utf/runetype.c
View file @
176d5769
...
...
@@ -35,49 +35,4 @@ rbsearch(Rune c, Rune *t, int n, int ne)
return
0
;
}
/*
* The "ideographic" property is hard to extract from UnicodeData.txt,
* so it is hard coded here.
*
* It is defined in the Unicode PropList.txt file, for example
* PropList-3.0.0.txt. Unlike the UnicodeData.txt file, the format of
* PropList changes between versions. This property appears relatively static;
* it is the same in version 4.0.1, except that version defines some >16 bit
* chars as ideographic as well: 20000..2a6d6, and 2f800..2Fa1d.
*/
static
Rune
__isideographicr
[]
=
{
0x3006
,
0x3007
,
/* 0x3006 added in 2.0.14 */
0x3021
,
0x3029
,
0x3038
,
0x303a
,
/* added in 3.0.0 */
0x3400
,
0x4db5
,
/* added in 3.0.0 */
/* consecutive */
0x4e00
,
0x9fa5
,
0x9fa6
,
0x9fbb
,
/* added in 4.1.0 */
0x9fbc
,
0x9fc3
,
/* added in 5.1.0 */
0x9fc4
,
0x9fcb
,
/* added in 5.2.0 */
0xf900
,
0xfa2d
,
/* consecutive */
0xfa30
,
0xfa6a
,
/* added in 5.1.0 */
0xfa6b
,
0xfa6d
,
/* added in 5.2.0 */
0xfa70
,
0xfad9
,
/* added in 4.1.0 */
0x20000
,
0x2a6d6
,
/* added in 3.1.0 */
0x2a700
,
0x2b734
,
/* added in 5.2.0 */
0x2f800
,
0x2fa1d
,
/* added in 3.1.0 */
};
int
isideographicrune
(
Rune
c
)
{
Rune
*
p
;
p
=
rbsearch
(
c
,
__isideographicr
,
nelem
(
__isideographicr
)
/
2
,
2
);
if
(
p
&&
c
>=
p
[
0
]
&&
c
<=
p
[
1
])
return
1
;
return
0
;
}
#include "runetypebody-5.2.0.c"
#include "runetypebody-6.0.0.c"
src/lib9/utf/runetypebody-6.0.0.c
0 → 100644
View file @
176d5769
This diff is collapsed.
Click to expand it.
src/lib9/utf/utf.h
View file @
176d5769
...
...
@@ -224,12 +224,6 @@ int isalpharune(Rune r);
int
isdigitrune
(
Rune
r
);
// isideographicrune tests for ideographic characters and numbers, as
// defined by the Unicode standard.
int
isideographicrune
(
Rune
r
);
// isspacerune tests for whitespace characters, including "C" locale
// whitespace, Unicode defined whitespace, and the "zero-width
// non-break space" character.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment