ires 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -45
- data/ext/Gopkg.lock +31 -1
- data/ext/ires/image.go +227 -0
- data/ext/ires/ires.go +47 -59
- data/ext/ires/uri.go +143 -0
- data/ext/main.go +18 -9
- data/ext/vendor/github.com/PuerkitoBio/purell/LICENSE +12 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/README.md +187 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/bench_test.go +57 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/benchmarks/v0.1.0 +9 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/example_test.go +35 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/purell.go +379 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/purell_test.go +768 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/urlnorm_test.go +53 -0
- data/ext/vendor/github.com/PuerkitoBio/urlesc/LICENSE +27 -0
- data/ext/vendor/github.com/PuerkitoBio/urlesc/README.md +16 -0
- data/ext/vendor/github.com/PuerkitoBio/urlesc/urlesc.go +180 -0
- data/ext/vendor/github.com/PuerkitoBio/urlesc/urlesc_test.go +641 -0
- data/ext/vendor/github.com/{satori/go.uuid → goware/urlx}/LICENSE +3 -1
- data/ext/vendor/github.com/goware/urlx/README.md +172 -0
- data/ext/vendor/github.com/goware/urlx/urlx.go +196 -0
- data/ext/vendor/github.com/goware/urlx/urlx_test.go +232 -0
- data/ext/vendor/golang.org/x/net/AUTHORS +3 -0
- data/ext/vendor/golang.org/x/net/CONTRIBUTING.md +31 -0
- data/ext/vendor/golang.org/x/net/CONTRIBUTORS +3 -0
- data/ext/vendor/golang.org/x/net/LICENSE +27 -0
- data/ext/vendor/golang.org/x/net/PATENTS +22 -0
- data/ext/vendor/golang.org/x/net/README.md +16 -0
- data/ext/vendor/golang.org/x/net/bpf/asm.go +41 -0
- data/ext/vendor/golang.org/x/net/bpf/constants.go +218 -0
- data/ext/vendor/golang.org/x/net/bpf/doc.go +82 -0
- data/ext/vendor/golang.org/x/net/bpf/instructions.go +704 -0
- data/ext/vendor/golang.org/x/net/bpf/instructions_test.go +525 -0
- data/ext/vendor/golang.org/x/net/bpf/setter.go +10 -0
- data/ext/vendor/golang.org/x/net/bpf/testdata/all_instructions.bpf +1 -0
- data/ext/vendor/golang.org/x/net/bpf/testdata/all_instructions.txt +79 -0
- data/ext/vendor/golang.org/x/net/bpf/vm.go +140 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_aluop_test.go +512 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_bpf_test.go +192 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_extension_test.go +49 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_instructions.go +174 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_jump_test.go +380 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_load_test.go +246 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_ret_test.go +115 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_scratch_test.go +247 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_test.go +144 -0
- data/ext/vendor/golang.org/x/net/codereview.cfg +1 -0
- data/ext/vendor/golang.org/x/net/context/context.go +54 -0
- data/ext/vendor/golang.org/x/net/context/context_test.go +583 -0
- data/ext/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go +74 -0
- data/ext/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_17_test.go +29 -0
- data/ext/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go +147 -0
- data/ext/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17_test.go +79 -0
- data/ext/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go +105 -0
- data/ext/vendor/golang.org/x/net/context/go17.go +72 -0
- data/ext/vendor/golang.org/x/net/context/go19.go +20 -0
- data/ext/vendor/golang.org/x/net/context/pre_go17.go +300 -0
- data/ext/vendor/golang.org/x/net/context/pre_go19.go +109 -0
- data/ext/vendor/golang.org/x/net/context/withtimeout_test.go +31 -0
- data/ext/vendor/golang.org/x/net/dict/dict.go +210 -0
- data/ext/vendor/golang.org/x/net/dns/dnsmessage/example_test.go +132 -0
- data/ext/vendor/golang.org/x/net/dns/dnsmessage/message.go +1997 -0
- data/ext/vendor/golang.org/x/net/dns/dnsmessage/message_test.go +1116 -0
- data/ext/vendor/golang.org/x/net/html/atom/atom.go +78 -0
- data/ext/vendor/golang.org/x/net/html/atom/atom_test.go +109 -0
- data/ext/vendor/golang.org/x/net/html/atom/gen.go +709 -0
- data/ext/vendor/golang.org/x/net/html/atom/table.go +777 -0
- data/ext/vendor/golang.org/x/net/html/atom/table_test.go +373 -0
- data/ext/vendor/golang.org/x/net/html/charset/charset.go +257 -0
- data/ext/vendor/golang.org/x/net/html/charset/charset_test.go +237 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/HTTP-charset.html +48 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html +48 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html +49 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html +49 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html +47 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/README +9 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html +0 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html +0 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html +49 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html +48 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html +48 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/meta-content-attribute.html +48 -0
- data/ext/vendor/golang.org/x/net/html/const.go +104 -0
- data/ext/vendor/golang.org/x/net/html/doc.go +106 -0
- data/ext/vendor/golang.org/x/net/html/doctype.go +156 -0
- data/ext/vendor/golang.org/x/net/html/entity.go +2253 -0
- data/ext/vendor/golang.org/x/net/html/entity_test.go +29 -0
- data/ext/vendor/golang.org/x/net/html/escape.go +258 -0
- data/ext/vendor/golang.org/x/net/html/escape_test.go +97 -0
- data/ext/vendor/golang.org/x/net/html/example_test.go +40 -0
- data/ext/vendor/golang.org/x/net/html/foreign.go +226 -0
- data/ext/vendor/golang.org/x/net/html/node.go +193 -0
- data/ext/vendor/golang.org/x/net/html/node_test.go +146 -0
- data/ext/vendor/golang.org/x/net/html/parse.go +2094 -0
- data/ext/vendor/golang.org/x/net/html/parse_test.go +388 -0
- data/ext/vendor/golang.org/x/net/html/render.go +271 -0
- data/ext/vendor/golang.org/x/net/html/render_test.go +156 -0
- data/ext/vendor/golang.org/x/net/html/testdata/go1.html +2237 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/README +28 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/adoption01.dat +194 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/adoption02.dat +31 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/comments01.dat +135 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/doctype01.dat +370 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/entities01.dat +603 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/entities02.dat +249 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/html5test-com.dat +246 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/inbody01.dat +43 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/isindex.dat +40 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/pending-spec-changes-plain-text-unsafe.dat +0 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/pending-spec-changes.dat +52 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/plain-text-unsafe.dat +0 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/scriptdata01.dat +308 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/scripted/adoption01.dat +15 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/scripted/webkit01.dat +28 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tables01.dat +212 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests1.dat +1952 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests10.dat +799 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests11.dat +482 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests12.dat +62 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests14.dat +74 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests15.dat +208 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests16.dat +2299 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests17.dat +153 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests18.dat +269 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests19.dat +1237 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests2.dat +763 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests20.dat +455 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests21.dat +221 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests22.dat +157 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests23.dat +155 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests24.dat +79 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests25.dat +219 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests26.dat +313 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests3.dat +305 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests4.dat +59 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests5.dat +191 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests6.dat +663 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests7.dat +390 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests8.dat +148 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests9.dat +457 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests_innerHTML_1.dat +741 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tricky01.dat +261 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/webkit01.dat +610 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/webkit02.dat +159 -0
- data/ext/vendor/golang.org/x/net/html/token.go +1219 -0
- data/ext/vendor/golang.org/x/net/html/token_test.go +748 -0
- data/ext/vendor/golang.org/x/net/http2/Dockerfile +51 -0
- data/ext/vendor/golang.org/x/net/http2/Makefile +3 -0
- data/ext/vendor/golang.org/x/net/http2/README +20 -0
- data/ext/vendor/golang.org/x/net/http2/ciphers.go +641 -0
- data/ext/vendor/golang.org/x/net/http2/ciphers_test.go +309 -0
- data/ext/vendor/golang.org/x/net/http2/client_conn_pool.go +256 -0
- data/ext/vendor/golang.org/x/net/http2/configure_transport.go +80 -0
- data/ext/vendor/golang.org/x/net/http2/databuffer.go +146 -0
- data/ext/vendor/golang.org/x/net/http2/databuffer_test.go +157 -0
- data/ext/vendor/golang.org/x/net/http2/errors.go +133 -0
- data/ext/vendor/golang.org/x/net/http2/errors_test.go +24 -0
- data/ext/vendor/golang.org/x/net/http2/flow.go +50 -0
- data/ext/vendor/golang.org/x/net/http2/flow_test.go +53 -0
- data/ext/vendor/golang.org/x/net/http2/frame.go +1579 -0
- data/ext/vendor/golang.org/x/net/http2/frame_test.go +1191 -0
- data/ext/vendor/golang.org/x/net/http2/go16.go +16 -0
- data/ext/vendor/golang.org/x/net/http2/go17.go +106 -0
- data/ext/vendor/golang.org/x/net/http2/go17_not18.go +36 -0
- data/ext/vendor/golang.org/x/net/http2/go18.go +56 -0
- data/ext/vendor/golang.org/x/net/http2/go18_test.go +79 -0
- data/ext/vendor/golang.org/x/net/http2/go19.go +16 -0
- data/ext/vendor/golang.org/x/net/http2/go19_test.go +60 -0
- data/ext/vendor/golang.org/x/net/http2/gotrack.go +170 -0
- data/ext/vendor/golang.org/x/net/http2/gotrack_test.go +33 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/Makefile +8 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/README +16 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/h2demo.go +538 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/launch.go +302 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/rootCA.key +27 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/rootCA.pem +26 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/rootCA.srl +1 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/server.crt +20 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/server.key +27 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/tmpl.go +1991 -0
- data/ext/vendor/golang.org/x/net/http2/h2i/README.md +97 -0
- data/ext/vendor/golang.org/x/net/http2/h2i/h2i.go +522 -0
- data/ext/vendor/golang.org/x/net/http2/headermap.go +78 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/encode.go +240 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/encode_test.go +386 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/hpack.go +490 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/hpack_test.go +722 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/huffman.go +212 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/tables.go +479 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/tables_test.go +214 -0
- data/ext/vendor/golang.org/x/net/http2/http2.go +391 -0
- data/ext/vendor/golang.org/x/net/http2/http2_test.go +199 -0
- data/ext/vendor/golang.org/x/net/http2/not_go16.go +21 -0
- data/ext/vendor/golang.org/x/net/http2/not_go17.go +87 -0
- data/ext/vendor/golang.org/x/net/http2/not_go18.go +29 -0
- data/ext/vendor/golang.org/x/net/http2/not_go19.go +16 -0
- data/ext/vendor/golang.org/x/net/http2/pipe.go +163 -0
- data/ext/vendor/golang.org/x/net/http2/pipe_test.go +130 -0
- data/ext/vendor/golang.org/x/net/http2/server.go +2857 -0
- data/ext/vendor/golang.org/x/net/http2/server_push_test.go +521 -0
- data/ext/vendor/golang.org/x/net/http2/server_test.go +3721 -0
- data/ext/vendor/golang.org/x/net/http2/testdata/draft-ietf-httpbis-http2.xml +5021 -0
- data/ext/vendor/golang.org/x/net/http2/transport.go +2285 -0
- data/ext/vendor/golang.org/x/net/http2/transport_test.go +3714 -0
- data/ext/vendor/golang.org/x/net/http2/write.go +370 -0
- data/ext/vendor/golang.org/x/net/http2/writesched.go +242 -0
- data/ext/vendor/golang.org/x/net/http2/writesched_priority.go +452 -0
- data/ext/vendor/golang.org/x/net/http2/writesched_priority_test.go +541 -0
- data/ext/vendor/golang.org/x/net/http2/writesched_random.go +72 -0
- data/ext/vendor/golang.org/x/net/http2/writesched_random_test.go +44 -0
- data/ext/vendor/golang.org/x/net/http2/writesched_test.go +125 -0
- data/ext/vendor/golang.org/x/net/http2/z_spec_test.go +356 -0
- data/ext/vendor/golang.org/x/net/icmp/dstunreach.go +41 -0
- data/ext/vendor/golang.org/x/net/icmp/echo.go +45 -0
- data/ext/vendor/golang.org/x/net/icmp/endpoint.go +113 -0
- data/ext/vendor/golang.org/x/net/icmp/example_test.go +63 -0
- data/ext/vendor/golang.org/x/net/icmp/extension.go +89 -0
- data/ext/vendor/golang.org/x/net/icmp/extension_test.go +259 -0
- data/ext/vendor/golang.org/x/net/icmp/helper_posix.go +75 -0
- data/ext/vendor/golang.org/x/net/icmp/interface.go +236 -0
- data/ext/vendor/golang.org/x/net/icmp/ipv4.go +61 -0
- data/ext/vendor/golang.org/x/net/icmp/ipv4_test.go +83 -0
- data/ext/vendor/golang.org/x/net/icmp/ipv6.go +23 -0
- data/ext/vendor/golang.org/x/net/icmp/listen_posix.go +100 -0
- data/ext/vendor/golang.org/x/net/icmp/listen_stub.go +33 -0
- data/ext/vendor/golang.org/x/net/icmp/message.go +152 -0
- data/ext/vendor/golang.org/x/net/icmp/message_test.go +134 -0
- data/ext/vendor/golang.org/x/net/icmp/messagebody.go +41 -0
- data/ext/vendor/golang.org/x/net/icmp/mpls.go +77 -0
- data/ext/vendor/golang.org/x/net/icmp/multipart.go +109 -0
- data/ext/vendor/golang.org/x/net/icmp/multipart_test.go +442 -0
- data/ext/vendor/golang.org/x/net/icmp/packettoobig.go +43 -0
- data/ext/vendor/golang.org/x/net/icmp/paramprob.go +63 -0
- data/ext/vendor/golang.org/x/net/icmp/ping_test.go +200 -0
- data/ext/vendor/golang.org/x/net/icmp/sys_freebsd.go +11 -0
- data/ext/vendor/golang.org/x/net/icmp/timeexceeded.go +39 -0
- data/ext/vendor/golang.org/x/net/idna/example_test.go +70 -0
- data/ext/vendor/golang.org/x/net/idna/idna.go +680 -0
- data/ext/vendor/golang.org/x/net/idna/idna_test.go +108 -0
- data/ext/vendor/golang.org/x/net/idna/punycode.go +203 -0
- data/ext/vendor/golang.org/x/net/idna/punycode_test.go +198 -0
- data/ext/vendor/golang.org/x/net/idna/tables.go +4477 -0
- data/ext/vendor/golang.org/x/net/idna/trie.go +72 -0
- data/ext/vendor/golang.org/x/net/idna/trieval.go +114 -0
- data/ext/vendor/golang.org/x/net/internal/iana/const.go +180 -0
- data/ext/vendor/golang.org/x/net/internal/iana/gen.go +293 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_bsd.go +53 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_nobsd.go +15 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_posix.go +31 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_stub.go +32 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_unix.go +29 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_windows.go +42 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/interface.go +94 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/rlimit.go +11 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/stack.go +147 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr.go +11 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go +13 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go +17 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_darwin.go +44 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_dragonfly.go +44 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_freebsd.go +44 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_linux.go +49 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_netbsd.go +47 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_openbsd.go +44 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_solaris.go +44 -0
- data/ext/vendor/golang.org/x/net/internal/socket/error_unix.go +31 -0
- data/ext/vendor/golang.org/x/net/internal/socket/error_windows.go +26 -0
- data/ext/vendor/golang.org/x/net/internal/socket/iovec_32bit.go +19 -0
- data/ext/vendor/golang.org/x/net/internal/socket/iovec_64bit.go +19 -0
- data/ext/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go +19 -0
- data/ext/vendor/golang.org/x/net/internal/socket/iovec_stub.go +11 -0
- data/ext/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go +21 -0
- data/ext/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go +42 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go +39 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go +16 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_linux.go +36 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go +24 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go +24 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_openbsd.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go +36 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_stub.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go +74 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn_msg.go +77 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go +18 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go +18 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn_stub.go +25 -0
- data/ext/vendor/golang.org/x/net/internal/socket/reflect.go +62 -0
- data/ext/vendor/golang.org/x/net/internal/socket/socket.go +285 -0
- data/ext/vendor/golang.org/x/net/internal/socket/socket_go1_9_test.go +259 -0
- data/ext/vendor/golang.org/x/net/internal/socket/socket_test.go +46 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys.go +33 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_bsd.go +17 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_bsdvar.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_darwin.go +7 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_dragonfly.go +7 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux.go +27 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_386.go +55 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_386.s +11 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_amd64.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_arm.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_arm64.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_mips.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_mips64.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_mips64le.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_mipsle.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64le.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go +55 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.s +11 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_netbsd.go +25 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_posix.go +168 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_solaris.go +71 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_solaris_amd64.s +11 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_stub.go +64 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_unix.go +33 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_windows.go +70 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go +61 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go +61 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go +61 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go +63 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go +63 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go +63 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go +63 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go +65 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go +68 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go +61 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go +60 -0
- data/ext/vendor/golang.org/x/net/internal/timeseries/timeseries.go +525 -0
- data/ext/vendor/golang.org/x/net/internal/timeseries/timeseries_test.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv4/batch.go +191 -0
- data/ext/vendor/golang.org/x/net/ipv4/bpf_test.go +93 -0
- data/ext/vendor/golang.org/x/net/ipv4/control.go +144 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_bsd.go +40 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_pktinfo.go +39 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_stub.go +13 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_test.go +21 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_unix.go +73 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_windows.go +16 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_darwin.go +77 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_dragonfly.go +38 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_freebsd.go +75 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_linux.go +122 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_netbsd.go +37 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_openbsd.go +37 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_solaris.go +84 -0
- data/ext/vendor/golang.org/x/net/ipv4/dgramopt.go +265 -0
- data/ext/vendor/golang.org/x/net/ipv4/doc.go +244 -0
- data/ext/vendor/golang.org/x/net/ipv4/endpoint.go +187 -0
- data/ext/vendor/golang.org/x/net/ipv4/example_test.go +224 -0
- data/ext/vendor/golang.org/x/net/ipv4/gen.go +199 -0
- data/ext/vendor/golang.org/x/net/ipv4/genericopt.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv4/header.go +159 -0
- data/ext/vendor/golang.org/x/net/ipv4/header_test.go +228 -0
- data/ext/vendor/golang.org/x/net/ipv4/helper.go +63 -0
- data/ext/vendor/golang.org/x/net/ipv4/iana.go +34 -0
- data/ext/vendor/golang.org/x/net/ipv4/icmp.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv4/icmp_linux.go +25 -0
- data/ext/vendor/golang.org/x/net/ipv4/icmp_stub.go +25 -0
- data/ext/vendor/golang.org/x/net/ipv4/icmp_test.go +95 -0
- data/ext/vendor/golang.org/x/net/ipv4/multicast_test.go +334 -0
- data/ext/vendor/golang.org/x/net/ipv4/multicastlistener_test.go +265 -0
- data/ext/vendor/golang.org/x/net/ipv4/multicastsockopt_test.go +195 -0
- data/ext/vendor/golang.org/x/net/ipv4/packet.go +69 -0
- data/ext/vendor/golang.org/x/net/ipv4/packet_go1_8.go +56 -0
- data/ext/vendor/golang.org/x/net/ipv4/packet_go1_9.go +67 -0
- data/ext/vendor/golang.org/x/net/ipv4/payload.go +23 -0
- data/ext/vendor/golang.org/x/net/ipv4/payload_cmsg.go +36 -0
- data/ext/vendor/golang.org/x/net/ipv4/payload_cmsg_go1_8.go +59 -0
- data/ext/vendor/golang.org/x/net/ipv4/payload_cmsg_go1_9.go +67 -0
- data/ext/vendor/golang.org/x/net/ipv4/payload_nocmsg.go +42 -0
- data/ext/vendor/golang.org/x/net/ipv4/readwrite_go1_8_test.go +248 -0
- data/ext/vendor/golang.org/x/net/ipv4/readwrite_go1_9_test.go +388 -0
- data/ext/vendor/golang.org/x/net/ipv4/readwrite_test.go +140 -0
- data/ext/vendor/golang.org/x/net/ipv4/sockopt.go +44 -0
- data/ext/vendor/golang.org/x/net/ipv4/sockopt_posix.go +71 -0
- data/ext/vendor/golang.org/x/net/ipv4/sockopt_stub.go +42 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_asmreq.go +119 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go +25 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_asmreqn.go +42 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go +21 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_bpf.go +23 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go +16 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_bsd.go +37 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_darwin.go +93 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_dragonfly.go +35 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_freebsd.go +76 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_linux.go +59 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_solaris.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_ssmreq.go +54 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go +21 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_stub.go +13 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_windows.go +67 -0
- data/ext/vendor/golang.org/x/net/ipv4/unicast_test.go +247 -0
- data/ext/vendor/golang.org/x/net/ipv4/unicastsockopt_test.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_darwin.go +99 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go +31 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go +93 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go +95 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go +95 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_386.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_netbsd.go +30 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_openbsd.go +30 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_solaris.go +100 -0
- data/ext/vendor/golang.org/x/net/ipv6/batch.go +119 -0
- data/ext/vendor/golang.org/x/net/ipv6/bpf_test.go +96 -0
- data/ext/vendor/golang.org/x/net/ipv6/control.go +187 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go +48 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go +94 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_stub.go +13 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_test.go +21 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_unix.go +55 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_windows.go +16 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_darwin.go +112 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_dragonfly.go +84 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_freebsd.go +105 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_linux.go +147 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_netbsd.go +80 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_openbsd.go +89 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_solaris.go +114 -0
- data/ext/vendor/golang.org/x/net/ipv6/dgramopt.go +302 -0
- data/ext/vendor/golang.org/x/net/ipv6/doc.go +243 -0
- data/ext/vendor/golang.org/x/net/ipv6/endpoint.go +128 -0
- data/ext/vendor/golang.org/x/net/ipv6/example_test.go +216 -0
- data/ext/vendor/golang.org/x/net/ipv6/gen.go +199 -0
- data/ext/vendor/golang.org/x/net/ipv6/genericopt.go +58 -0
- data/ext/vendor/golang.org/x/net/ipv6/header.go +55 -0
- data/ext/vendor/golang.org/x/net/ipv6/header_test.go +55 -0
- data/ext/vendor/golang.org/x/net/ipv6/helper.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv6/iana.go +82 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp.go +60 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_bsd.go +29 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_linux.go +27 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_solaris.go +27 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_stub.go +23 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_test.go +96 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_windows.go +22 -0
- data/ext/vendor/golang.org/x/net/ipv6/mocktransponder_test.go +32 -0
- data/ext/vendor/golang.org/x/net/ipv6/multicast_test.go +264 -0
- data/ext/vendor/golang.org/x/net/ipv6/multicastlistener_test.go +261 -0
- data/ext/vendor/golang.org/x/net/ipv6/multicastsockopt_test.go +157 -0
- data/ext/vendor/golang.org/x/net/ipv6/payload.go +23 -0
- data/ext/vendor/golang.org/x/net/ipv6/payload_cmsg.go +35 -0
- data/ext/vendor/golang.org/x/net/ipv6/payload_cmsg_go1_8.go +55 -0
- data/ext/vendor/golang.org/x/net/ipv6/payload_cmsg_go1_9.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv6/payload_nocmsg.go +41 -0
- data/ext/vendor/golang.org/x/net/ipv6/readwrite_go1_8_test.go +242 -0
- data/ext/vendor/golang.org/x/net/ipv6/readwrite_go1_9_test.go +373 -0
- data/ext/vendor/golang.org/x/net/ipv6/readwrite_test.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv6/sockopt.go +43 -0
- data/ext/vendor/golang.org/x/net/ipv6/sockopt_posix.go +87 -0
- data/ext/vendor/golang.org/x/net/ipv6/sockopt_stub.go +46 -0
- data/ext/vendor/golang.org/x/net/ipv6/sockopt_test.go +133 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_asmreq.go +24 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go +17 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_bpf.go +23 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go +16 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_bsd.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_darwin.go +106 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_freebsd.go +92 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_linux.go +74 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_solaris.go +74 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_ssmreq.go +54 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go +21 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_stub.go +13 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_windows.go +75 -0
- data/ext/vendor/golang.org/x/net/ipv6/unicast_test.go +184 -0
- data/ext/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go +120 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_darwin.go +131 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go +88 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go +122 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go +124 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go +124 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_386.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_netbsd.go +84 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_openbsd.go +93 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_solaris.go +131 -0
- data/ext/vendor/golang.org/x/net/lex/httplex/httplex.go +351 -0
- data/ext/vendor/golang.org/x/net/lex/httplex/httplex_test.go +119 -0
- data/ext/vendor/golang.org/x/net/lif/address.go +105 -0
- data/ext/vendor/golang.org/x/net/lif/address_test.go +123 -0
- data/ext/vendor/golang.org/x/net/lif/binary.go +115 -0
- data/ext/vendor/golang.org/x/net/lif/defs_solaris.go +90 -0
- data/ext/vendor/golang.org/x/net/lif/lif.go +43 -0
- data/ext/vendor/golang.org/x/net/lif/link.go +126 -0
- data/ext/vendor/golang.org/x/net/lif/link_test.go +63 -0
- data/ext/vendor/golang.org/x/net/lif/sys.go +21 -0
- data/ext/vendor/golang.org/x/net/lif/sys_solaris_amd64.s +8 -0
- data/ext/vendor/golang.org/x/net/lif/syscall.go +28 -0
- data/ext/vendor/golang.org/x/net/lif/zsys_solaris_amd64.go +103 -0
- data/ext/vendor/golang.org/x/net/nettest/conntest.go +456 -0
- data/ext/vendor/golang.org/x/net/nettest/conntest_go16.go +24 -0
- data/ext/vendor/golang.org/x/net/nettest/conntest_go17.go +24 -0
- data/ext/vendor/golang.org/x/net/nettest/conntest_test.go +76 -0
- data/ext/vendor/golang.org/x/net/netutil/listen.go +48 -0
- data/ext/vendor/golang.org/x/net/netutil/listen_test.go +101 -0
- data/ext/vendor/golang.org/x/net/proxy/direct.go +18 -0
- data/ext/vendor/golang.org/x/net/proxy/per_host.go +140 -0
- data/ext/vendor/golang.org/x/net/proxy/per_host_test.go +55 -0
- data/ext/vendor/golang.org/x/net/proxy/proxy.go +134 -0
- data/ext/vendor/golang.org/x/net/proxy/proxy_test.go +215 -0
- data/ext/vendor/golang.org/x/net/proxy/socks5.go +214 -0
- data/ext/vendor/golang.org/x/net/publicsuffix/gen.go +713 -0
- data/ext/vendor/golang.org/x/net/publicsuffix/list.go +135 -0
- data/ext/vendor/golang.org/x/net/publicsuffix/list_test.go +416 -0
- data/ext/vendor/golang.org/x/net/publicsuffix/table.go +9419 -0
- data/ext/vendor/golang.org/x/net/publicsuffix/table_test.go +16756 -0
- data/ext/vendor/golang.org/x/net/route/address.go +425 -0
- data/ext/vendor/golang.org/x/net/route/address_darwin_test.go +63 -0
- data/ext/vendor/golang.org/x/net/route/address_test.go +103 -0
- data/ext/vendor/golang.org/x/net/route/binary.go +90 -0
- data/ext/vendor/golang.org/x/net/route/defs_darwin.go +114 -0
- data/ext/vendor/golang.org/x/net/route/defs_dragonfly.go +113 -0
- data/ext/vendor/golang.org/x/net/route/defs_freebsd.go +337 -0
- data/ext/vendor/golang.org/x/net/route/defs_netbsd.go +112 -0
- data/ext/vendor/golang.org/x/net/route/defs_openbsd.go +116 -0
- data/ext/vendor/golang.org/x/net/route/interface.go +64 -0
- data/ext/vendor/golang.org/x/net/route/interface_announce.go +32 -0
- data/ext/vendor/golang.org/x/net/route/interface_classic.go +66 -0
- data/ext/vendor/golang.org/x/net/route/interface_freebsd.go +78 -0
- data/ext/vendor/golang.org/x/net/route/interface_multicast.go +30 -0
- data/ext/vendor/golang.org/x/net/route/interface_openbsd.go +90 -0
- data/ext/vendor/golang.org/x/net/route/message.go +72 -0
- data/ext/vendor/golang.org/x/net/route/message_darwin_test.go +34 -0
- data/ext/vendor/golang.org/x/net/route/message_freebsd_test.go +92 -0
- data/ext/vendor/golang.org/x/net/route/message_test.go +239 -0
- data/ext/vendor/golang.org/x/net/route/route.go +123 -0
- data/ext/vendor/golang.org/x/net/route/route_classic.go +67 -0
- data/ext/vendor/golang.org/x/net/route/route_openbsd.go +65 -0
- data/ext/vendor/golang.org/x/net/route/route_test.go +390 -0
- data/ext/vendor/golang.org/x/net/route/sys.go +39 -0
- data/ext/vendor/golang.org/x/net/route/sys_darwin.go +87 -0
- data/ext/vendor/golang.org/x/net/route/sys_dragonfly.go +76 -0
- data/ext/vendor/golang.org/x/net/route/sys_freebsd.go +155 -0
- data/ext/vendor/golang.org/x/net/route/sys_netbsd.go +71 -0
- data/ext/vendor/golang.org/x/net/route/sys_openbsd.go +80 -0
- data/ext/vendor/golang.org/x/net/route/syscall.go +28 -0
- data/ext/vendor/golang.org/x/net/route/zsys_darwin.go +99 -0
- data/ext/vendor/golang.org/x/net/route/zsys_dragonfly.go +98 -0
- data/ext/vendor/golang.org/x/net/route/zsys_freebsd_386.go +126 -0
- data/ext/vendor/golang.org/x/net/route/zsys_freebsd_amd64.go +123 -0
- data/ext/vendor/golang.org/x/net/route/zsys_freebsd_arm.go +123 -0
- data/ext/vendor/golang.org/x/net/route/zsys_netbsd.go +97 -0
- data/ext/vendor/golang.org/x/net/route/zsys_openbsd.go +101 -0
- data/ext/vendor/golang.org/x/net/trace/events.go +532 -0
- data/ext/vendor/golang.org/x/net/trace/histogram.go +365 -0
- data/ext/vendor/golang.org/x/net/trace/histogram_test.go +325 -0
- data/ext/vendor/golang.org/x/net/trace/trace.go +1082 -0
- data/ext/vendor/golang.org/x/net/trace/trace_go16.go +21 -0
- data/ext/vendor/golang.org/x/net/trace/trace_go17.go +21 -0
- data/ext/vendor/golang.org/x/net/trace/trace_test.go +178 -0
- data/ext/vendor/golang.org/x/net/webdav/file.go +796 -0
- data/ext/vendor/golang.org/x/net/webdav/file_go1.6.go +17 -0
- data/ext/vendor/golang.org/x/net/webdav/file_go1.7.go +16 -0
- data/ext/vendor/golang.org/x/net/webdav/file_test.go +1184 -0
- data/ext/vendor/golang.org/x/net/webdav/if.go +173 -0
- data/ext/vendor/golang.org/x/net/webdav/if_test.go +322 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/README +11 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/atom_test.go +56 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/example_test.go +151 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/marshal.go +1223 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/marshal_test.go +1939 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/read.go +692 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/read_test.go +744 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/typeinfo.go +371 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/xml.go +1998 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/xml_test.go +752 -0
- data/ext/vendor/golang.org/x/net/webdav/litmus_test_server.go +94 -0
- data/ext/vendor/golang.org/x/net/webdav/lock.go +445 -0
- data/ext/vendor/golang.org/x/net/webdav/lock_test.go +731 -0
- data/ext/vendor/golang.org/x/net/webdav/prop.go +418 -0
- data/ext/vendor/golang.org/x/net/webdav/prop_test.go +613 -0
- data/ext/vendor/golang.org/x/net/webdav/webdav.go +702 -0
- data/ext/vendor/golang.org/x/net/webdav/webdav_test.go +344 -0
- data/ext/vendor/golang.org/x/net/webdav/xml.go +519 -0
- data/ext/vendor/golang.org/x/net/webdav/xml_test.go +906 -0
- data/ext/vendor/golang.org/x/net/websocket/client.go +106 -0
- data/ext/vendor/golang.org/x/net/websocket/dial.go +24 -0
- data/ext/vendor/golang.org/x/net/websocket/dial_test.go +43 -0
- data/ext/vendor/golang.org/x/net/websocket/exampledial_test.go +31 -0
- data/ext/vendor/golang.org/x/net/websocket/examplehandler_test.go +26 -0
- data/ext/vendor/golang.org/x/net/websocket/hybi.go +583 -0
- data/ext/vendor/golang.org/x/net/websocket/hybi_test.go +608 -0
- data/ext/vendor/golang.org/x/net/websocket/server.go +113 -0
- data/ext/vendor/golang.org/x/net/websocket/websocket.go +448 -0
- data/ext/vendor/golang.org/x/net/websocket/websocket_test.go +665 -0
- data/ext/vendor/golang.org/x/net/xsrftoken/xsrf.go +94 -0
- data/ext/vendor/golang.org/x/net/xsrftoken/xsrf_test.go +83 -0
- data/ext/vendor/golang.org/x/text/AUTHORS +3 -0
- data/ext/vendor/golang.org/x/text/CONTRIBUTING.md +31 -0
- data/ext/vendor/golang.org/x/text/CONTRIBUTORS +3 -0
- data/ext/vendor/golang.org/x/text/LICENSE +27 -0
- data/ext/vendor/golang.org/x/text/PATENTS +22 -0
- data/ext/vendor/golang.org/x/text/README.md +91 -0
- data/ext/vendor/golang.org/x/text/cases/cases.go +162 -0
- data/ext/vendor/golang.org/x/text/cases/context.go +376 -0
- data/ext/vendor/golang.org/x/text/cases/context_test.go +438 -0
- data/ext/vendor/golang.org/x/text/cases/example_test.go +53 -0
- data/ext/vendor/golang.org/x/text/cases/fold.go +34 -0
- data/ext/vendor/golang.org/x/text/cases/fold_test.go +51 -0
- data/ext/vendor/golang.org/x/text/cases/gen.go +839 -0
- data/ext/vendor/golang.org/x/text/cases/gen_trieval.go +219 -0
- data/ext/vendor/golang.org/x/text/cases/icu.go +61 -0
- data/ext/vendor/golang.org/x/text/cases/icu_test.go +210 -0
- data/ext/vendor/golang.org/x/text/cases/info.go +82 -0
- data/ext/vendor/golang.org/x/text/cases/map.go +816 -0
- data/ext/vendor/golang.org/x/text/cases/map_test.go +950 -0
- data/ext/vendor/golang.org/x/text/cases/tables.go +2251 -0
- data/ext/vendor/golang.org/x/text/cases/tables_test.go +1158 -0
- data/ext/vendor/golang.org/x/text/cases/trieval.go +215 -0
- data/ext/vendor/golang.org/x/text/cmd/gotext/doc.go +35 -0
- data/ext/vendor/golang.org/x/text/cmd/gotext/extract.go +195 -0
- data/ext/vendor/golang.org/x/text/cmd/gotext/main.go +356 -0
- data/ext/vendor/golang.org/x/text/cmd/gotext/message.go +127 -0
- data/ext/vendor/golang.org/x/text/codereview.cfg +1 -0
- data/ext/vendor/golang.org/x/text/collate/build/builder.go +702 -0
- data/ext/vendor/golang.org/x/text/collate/build/builder_test.go +290 -0
- data/ext/vendor/golang.org/x/text/collate/build/colelem.go +294 -0
- data/ext/vendor/golang.org/x/text/collate/build/colelem_test.go +215 -0
- data/ext/vendor/golang.org/x/text/collate/build/contract.go +309 -0
- data/ext/vendor/golang.org/x/text/collate/build/contract_test.go +266 -0
- data/ext/vendor/golang.org/x/text/collate/build/order.go +393 -0
- data/ext/vendor/golang.org/x/text/collate/build/order_test.go +229 -0
- data/ext/vendor/golang.org/x/text/collate/build/table.go +81 -0
- data/ext/vendor/golang.org/x/text/collate/build/trie.go +290 -0
- data/ext/vendor/golang.org/x/text/collate/build/trie_test.go +107 -0
- data/ext/vendor/golang.org/x/text/collate/collate.go +403 -0
- data/ext/vendor/golang.org/x/text/collate/collate_test.go +482 -0
- data/ext/vendor/golang.org/x/text/collate/export_test.go +51 -0
- data/ext/vendor/golang.org/x/text/collate/index.go +32 -0
- data/ext/vendor/golang.org/x/text/collate/maketables.go +553 -0
- data/ext/vendor/golang.org/x/text/collate/option.go +239 -0
- data/ext/vendor/golang.org/x/text/collate/option_test.go +209 -0
- data/ext/vendor/golang.org/x/text/collate/reg_test.go +230 -0
- data/ext/vendor/golang.org/x/text/collate/sort.go +81 -0
- data/ext/vendor/golang.org/x/text/collate/sort_test.go +55 -0
- data/ext/vendor/golang.org/x/text/collate/table_test.go +291 -0
- data/ext/vendor/golang.org/x/text/collate/tables.go +73789 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/Makefile +7 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/chars.go +1156 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/col.go +97 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/colcmp.go +529 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/darwin.go +111 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/gen.go +183 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/icu.go +209 -0
- data/ext/vendor/golang.org/x/text/currency/common.go +66 -0
- data/ext/vendor/golang.org/x/text/currency/currency.go +185 -0
- data/ext/vendor/golang.org/x/text/currency/currency_test.go +171 -0
- data/ext/vendor/golang.org/x/text/currency/example_test.go +27 -0
- data/ext/vendor/golang.org/x/text/currency/format.go +215 -0
- data/ext/vendor/golang.org/x/text/currency/format_test.go +70 -0
- data/ext/vendor/golang.org/x/text/currency/gen.go +400 -0
- data/ext/vendor/golang.org/x/text/currency/gen_common.go +70 -0
- data/ext/vendor/golang.org/x/text/currency/query.go +152 -0
- data/ext/vendor/golang.org/x/text/currency/query_test.go +107 -0
- data/ext/vendor/golang.org/x/text/currency/tables.go +2574 -0
- data/ext/vendor/golang.org/x/text/currency/tables_test.go +93 -0
- data/ext/vendor/golang.org/x/text/doc.go +13 -0
- data/ext/vendor/golang.org/x/text/encoding/charmap/charmap.go +249 -0
- data/ext/vendor/golang.org/x/text/encoding/charmap/charmap_test.go +258 -0
- data/ext/vendor/golang.org/x/text/encoding/charmap/maketables.go +556 -0
- data/ext/vendor/golang.org/x/text/encoding/charmap/tables.go +7410 -0
- data/ext/vendor/golang.org/x/text/encoding/encoding.go +335 -0
- data/ext/vendor/golang.org/x/text/encoding/encoding_test.go +290 -0
- data/ext/vendor/golang.org/x/text/encoding/example_test.go +42 -0
- data/ext/vendor/golang.org/x/text/encoding/htmlindex/gen.go +173 -0
- data/ext/vendor/golang.org/x/text/encoding/htmlindex/htmlindex.go +86 -0
- data/ext/vendor/golang.org/x/text/encoding/htmlindex/htmlindex_test.go +144 -0
- data/ext/vendor/golang.org/x/text/encoding/htmlindex/map.go +105 -0
- data/ext/vendor/golang.org/x/text/encoding/htmlindex/tables.go +352 -0
- data/ext/vendor/golang.org/x/text/encoding/ianaindex/example_test.go +27 -0
- data/ext/vendor/golang.org/x/text/encoding/ianaindex/gen.go +192 -0
- data/ext/vendor/golang.org/x/text/encoding/ianaindex/ianaindex.go +209 -0
- data/ext/vendor/golang.org/x/text/encoding/ianaindex/ianaindex_test.go +192 -0
- data/ext/vendor/golang.org/x/text/encoding/ianaindex/tables.go +2348 -0
- data/ext/vendor/golang.org/x/text/encoding/internal/enctest/enctest.go +180 -0
- data/ext/vendor/golang.org/x/text/encoding/internal/identifier/gen.go +137 -0
- data/ext/vendor/golang.org/x/text/encoding/internal/identifier/identifier.go +81 -0
- data/ext/vendor/golang.org/x/text/encoding/internal/identifier/mib.go +1621 -0
- data/ext/vendor/golang.org/x/text/encoding/internal/internal.go +75 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/all.go +12 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/all_test.go +248 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/eucjp.go +225 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/iso2022jp.go +299 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/maketables.go +161 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/shiftjis.go +189 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/tables.go +26971 -0
- data/ext/vendor/golang.org/x/text/encoding/korean/all_test.go +94 -0
- data/ext/vendor/golang.org/x/text/encoding/korean/euckr.go +177 -0
- data/ext/vendor/golang.org/x/text/encoding/korean/maketables.go +143 -0
- data/ext/vendor/golang.org/x/text/encoding/korean/tables.go +34152 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/all.go +12 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/all_test.go +143 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/gbk.go +269 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/hzgb2312.go +245 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go +161 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/tables.go +43999 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/candide-gb18030.txt +510 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/candide-utf-16le.txt +0 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/candide-utf-32be.txt +0 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/candide-utf-8.txt +510 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/candide-windows-1252.txt +510 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/rashomon-euc-jp.txt +178 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/rashomon-iso-2022-jp.txt +178 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/rashomon-shift-jis.txt +178 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/rashomon-utf-8.txt +178 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-gb-levels-1-and-2-hz-gb2312.txt +107 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-gb-levels-1-and-2-utf-8.txt +107 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-simplified-gbk.txt +107 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-simplified-utf-8.txt +107 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-traditional-big5.txt +106 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-traditional-utf-8.txt +106 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/unsu-joh-eun-nal-euc-kr.txt +175 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/unsu-joh-eun-nal-utf-8.txt +175 -0
- data/ext/vendor/golang.org/x/text/encoding/traditionalchinese/all_test.go +114 -0
- data/ext/vendor/golang.org/x/text/encoding/traditionalchinese/big5.go +199 -0
- data/ext/vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go +140 -0
- data/ext/vendor/golang.org/x/text/encoding/traditionalchinese/tables.go +37142 -0
- data/ext/vendor/golang.org/x/text/encoding/unicode/override.go +82 -0
- data/ext/vendor/golang.org/x/text/encoding/unicode/unicode.go +434 -0
- data/ext/vendor/golang.org/x/text/encoding/unicode/unicode_test.go +499 -0
- data/ext/vendor/golang.org/x/text/encoding/unicode/utf32/utf32.go +296 -0
- data/ext/vendor/golang.org/x/text/encoding/unicode/utf32/utf32_test.go +248 -0
- data/ext/vendor/golang.org/x/text/feature/plural/common.go +70 -0
- data/ext/vendor/golang.org/x/text/feature/plural/data_test.go +190 -0
- data/ext/vendor/golang.org/x/text/feature/plural/example_test.go +46 -0
- data/ext/vendor/golang.org/x/text/feature/plural/gen.go +513 -0
- data/ext/vendor/golang.org/x/text/feature/plural/gen_common.go +74 -0
- data/ext/vendor/golang.org/x/text/feature/plural/message.go +244 -0
- data/ext/vendor/golang.org/x/text/feature/plural/message_test.go +197 -0
- data/ext/vendor/golang.org/x/text/feature/plural/plural.go +258 -0
- data/ext/vendor/golang.org/x/text/feature/plural/plural_test.go +216 -0
- data/ext/vendor/golang.org/x/text/feature/plural/tables.go +540 -0
- data/ext/vendor/golang.org/x/text/gen.go +318 -0
- data/ext/vendor/golang.org/x/text/internal/catmsg/catmsg.go +366 -0
- data/ext/vendor/golang.org/x/text/internal/catmsg/catmsg_test.go +316 -0
- data/ext/vendor/golang.org/x/text/internal/catmsg/codec.go +407 -0
- data/ext/vendor/golang.org/x/text/internal/catmsg/varint.go +62 -0
- data/ext/vendor/golang.org/x/text/internal/catmsg/varint_test.go +123 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/collate_test.go +121 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/collelem.go +371 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/collelem_test.go +183 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/colltab.go +105 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/colltab_test.go +64 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/contract.go +145 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/contract_test.go +131 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/iter.go +178 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/iter_test.go +63 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/numeric.go +236 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/numeric_test.go +159 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/table.go +275 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/trie.go +159 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/trie_test.go +106 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/weighter.go +31 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/weighter_test.go +42 -0
- data/ext/vendor/golang.org/x/text/internal/export/README +4 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/common_test.go +55 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/example_test.go +68 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/gen.go +276 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/gen_common.go +59 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/gen_test.go +91 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/gen_trieval.go +123 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/idna.go +717 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/idna_test.go +308 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/punycode.go +201 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/punycode_test.go +198 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/tables.go +4557 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/trie.go +70 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/trieval.go +119 -0
- data/ext/vendor/golang.org/x/text/internal/format/format.go +41 -0
- data/ext/vendor/golang.org/x/text/internal/gen.go +52 -0
- data/ext/vendor/golang.org/x/text/internal/gen/code.go +351 -0
- data/ext/vendor/golang.org/x/text/internal/gen/gen.go +281 -0
- data/ext/vendor/golang.org/x/text/internal/gen_test.go +38 -0
- data/ext/vendor/golang.org/x/text/internal/internal.go +51 -0
- data/ext/vendor/golang.org/x/text/internal/internal_test.go +38 -0
- data/ext/vendor/golang.org/x/text/internal/match.go +67 -0
- data/ext/vendor/golang.org/x/text/internal/match_test.go +56 -0
- data/ext/vendor/golang.org/x/text/internal/number/common.go +40 -0
- data/ext/vendor/golang.org/x/text/internal/number/decimal.go +498 -0
- data/ext/vendor/golang.org/x/text/internal/number/decimal_test.go +329 -0
- data/ext/vendor/golang.org/x/text/internal/number/format.go +540 -0
- data/ext/vendor/golang.org/x/text/internal/number/format_test.go +522 -0
- data/ext/vendor/golang.org/x/text/internal/number/gen.go +458 -0
- data/ext/vendor/golang.org/x/text/internal/number/gen_common.go +44 -0
- data/ext/vendor/golang.org/x/text/internal/number/number.go +154 -0
- data/ext/vendor/golang.org/x/text/internal/number/number_test.go +100 -0
- data/ext/vendor/golang.org/x/text/internal/number/pattern.go +485 -0
- data/ext/vendor/golang.org/x/text/internal/number/pattern_test.go +438 -0
- data/ext/vendor/golang.org/x/text/internal/number/roundingmode_string.go +16 -0
- data/ext/vendor/golang.org/x/text/internal/number/tables.go +1154 -0
- data/ext/vendor/golang.org/x/text/internal/number/tables_test.go +125 -0
- data/ext/vendor/golang.org/x/text/internal/stringset/set.go +86 -0
- data/ext/vendor/golang.org/x/text/internal/stringset/set_test.go +53 -0
- data/ext/vendor/golang.org/x/text/internal/tables.go +117 -0
- data/ext/vendor/golang.org/x/text/internal/tag/tag.go +100 -0
- data/ext/vendor/golang.org/x/text/internal/tag/tag_test.go +67 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/codesize.go +53 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/flag.go +22 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/gc.go +14 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/gccgo.go +11 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/go1_6.go +23 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/go1_7.go +17 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/text.go +105 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/compact.go +58 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/data_test.go +875 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/example_compact_test.go +71 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/example_test.go +148 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/gen_test.go +68 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/print.go +251 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/triegen.go +494 -0
- data/ext/vendor/golang.org/x/text/internal/ucd/example_test.go +81 -0
- data/ext/vendor/golang.org/x/text/internal/ucd/ucd.go +371 -0
- data/ext/vendor/golang.org/x/text/internal/ucd/ucd_test.go +105 -0
- data/ext/vendor/golang.org/x/text/internal/utf8internal/utf8internal.go +87 -0
- data/ext/vendor/golang.org/x/text/language/Makefile +16 -0
- data/ext/vendor/golang.org/x/text/language/common.go +16 -0
- data/ext/vendor/golang.org/x/text/language/coverage.go +197 -0
- data/ext/vendor/golang.org/x/text/language/coverage_test.go +154 -0
- data/ext/vendor/golang.org/x/text/language/display/dict.go +92 -0
- data/ext/vendor/golang.org/x/text/language/display/dict_test.go +39 -0
- data/ext/vendor/golang.org/x/text/language/display/display.go +420 -0
- data/ext/vendor/golang.org/x/text/language/display/display_test.go +705 -0
- data/ext/vendor/golang.org/x/text/language/display/examples_test.go +116 -0
- data/ext/vendor/golang.org/x/text/language/display/lookup.go +251 -0
- data/ext/vendor/golang.org/x/text/language/display/maketables.go +602 -0
- data/ext/vendor/golang.org/x/text/language/display/tables.go +50344 -0
- data/ext/vendor/golang.org/x/text/language/doc.go +102 -0
- data/ext/vendor/golang.org/x/text/language/examples_test.go +413 -0
- data/ext/vendor/golang.org/x/text/language/gen.go +1706 -0
- data/ext/vendor/golang.org/x/text/language/gen_common.go +20 -0
- data/ext/vendor/golang.org/x/text/language/gen_index.go +162 -0
- data/ext/vendor/golang.org/x/text/language/go1_1.go +38 -0
- data/ext/vendor/golang.org/x/text/language/go1_2.go +11 -0
- data/ext/vendor/golang.org/x/text/language/httpexample_test.go +48 -0
- data/ext/vendor/golang.org/x/text/language/index.go +769 -0
- data/ext/vendor/golang.org/x/text/language/language.go +887 -0
- data/ext/vendor/golang.org/x/text/language/language_test.go +878 -0
- data/ext/vendor/golang.org/x/text/language/lookup.go +396 -0
- data/ext/vendor/golang.org/x/text/language/lookup_test.go +457 -0
- data/ext/vendor/golang.org/x/text/language/match.go +933 -0
- data/ext/vendor/golang.org/x/text/language/match_test.go +505 -0
- data/ext/vendor/golang.org/x/text/language/parse.go +859 -0
- data/ext/vendor/golang.org/x/text/language/parse_test.go +517 -0
- data/ext/vendor/golang.org/x/text/language/tables.go +3675 -0
- data/ext/vendor/golang.org/x/text/language/tags.go +143 -0
- data/ext/vendor/golang.org/x/text/language/testdata/CLDRLocaleMatcherTest.txt +389 -0
- data/ext/vendor/golang.org/x/text/language/testdata/GoLocaleMatcherTest.txt +226 -0
- data/ext/vendor/golang.org/x/text/message/catalog.go +28 -0
- data/ext/vendor/golang.org/x/text/message/catalog/catalog.go +292 -0
- data/ext/vendor/golang.org/x/text/message/catalog/catalog_test.go +194 -0
- data/ext/vendor/golang.org/x/text/message/catalog/dict.go +90 -0
- data/ext/vendor/golang.org/x/text/message/doc.go +100 -0
- data/ext/vendor/golang.org/x/text/message/examples_test.go +42 -0
- data/ext/vendor/golang.org/x/text/message/fmt_test.go +1889 -0
- data/ext/vendor/golang.org/x/text/message/format.go +532 -0
- data/ext/vendor/golang.org/x/text/message/message.go +169 -0
- data/ext/vendor/golang.org/x/text/message/message_test.go +181 -0
- data/ext/vendor/golang.org/x/text/message/print.go +1194 -0
- data/ext/vendor/golang.org/x/text/number/doc.go +28 -0
- data/ext/vendor/golang.org/x/text/number/examples_test.go +28 -0
- data/ext/vendor/golang.org/x/text/number/format.go +122 -0
- data/ext/vendor/golang.org/x/text/number/format_test.go +107 -0
- data/ext/vendor/golang.org/x/text/number/number.go +77 -0
- data/ext/vendor/golang.org/x/text/number/number_test.go +190 -0
- data/ext/vendor/golang.org/x/text/number/option.go +177 -0
- data/ext/vendor/golang.org/x/text/runes/cond.go +187 -0
- data/ext/vendor/golang.org/x/text/runes/cond_test.go +282 -0
- data/ext/vendor/golang.org/x/text/runes/example_test.go +60 -0
- data/ext/vendor/golang.org/x/text/runes/runes.go +355 -0
- data/ext/vendor/golang.org/x/text/runes/runes_test.go +664 -0
- data/ext/vendor/golang.org/x/text/search/index.go +35 -0
- data/ext/vendor/golang.org/x/text/search/pattern.go +155 -0
- data/ext/vendor/golang.org/x/text/search/pattern_test.go +357 -0
- data/ext/vendor/golang.org/x/text/search/search.go +237 -0
- data/ext/vendor/golang.org/x/text/search/tables.go +12448 -0
- data/ext/vendor/golang.org/x/text/secure/bidirule/bench_test.go +54 -0
- data/ext/vendor/golang.org/x/text/secure/bidirule/bidirule.go +340 -0
- data/ext/vendor/golang.org/x/text/secure/bidirule/bidirule_test.go +851 -0
- data/ext/vendor/golang.org/x/text/secure/doc.go +6 -0
- data/ext/vendor/golang.org/x/text/secure/precis/benchmark_test.go +82 -0
- data/ext/vendor/golang.org/x/text/secure/precis/class.go +36 -0
- data/ext/vendor/golang.org/x/text/secure/precis/class_test.go +50 -0
- data/ext/vendor/golang.org/x/text/secure/precis/context.go +139 -0
- data/ext/vendor/golang.org/x/text/secure/precis/doc.go +14 -0
- data/ext/vendor/golang.org/x/text/secure/precis/enforce_test.go +396 -0
- data/ext/vendor/golang.org/x/text/secure/precis/gen.go +310 -0
- data/ext/vendor/golang.org/x/text/secure/precis/gen_trieval.go +68 -0
- data/ext/vendor/golang.org/x/text/secure/precis/nickname.go +72 -0
- data/ext/vendor/golang.org/x/text/secure/precis/options.go +157 -0
- data/ext/vendor/golang.org/x/text/secure/precis/profile.go +402 -0
- data/ext/vendor/golang.org/x/text/secure/precis/profile_test.go +149 -0
- data/ext/vendor/golang.org/x/text/secure/precis/profiles.go +78 -0
- data/ext/vendor/golang.org/x/text/secure/precis/tables.go +3887 -0
- data/ext/vendor/golang.org/x/text/secure/precis/tables_test.go +69 -0
- data/ext/vendor/golang.org/x/text/secure/precis/transformer.go +32 -0
- data/ext/vendor/golang.org/x/text/secure/precis/trieval.go +64 -0
- data/ext/vendor/golang.org/x/text/transform/examples_test.go +37 -0
- data/ext/vendor/golang.org/x/text/transform/transform.go +705 -0
- data/ext/vendor/golang.org/x/text/transform/transform_test.go +1317 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/bidi.go +198 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/bracket.go +335 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/core.go +1058 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/core_test.go +224 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/gen.go +133 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go +57 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go +64 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/prop.go +206 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/ranges_test.go +53 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/tables.go +1813 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/tables_test.go +82 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/trieval.go +60 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/base.go +100 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/cldr.go +130 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/cldr_test.go +27 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/collate.go +359 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/collate_test.go +275 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/data_test.go +186 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/decode.go +171 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/examples_test.go +21 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/makexml.go +400 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/resolve.go +602 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/resolve_test.go +368 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/slice.go +144 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/slice_test.go +175 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/xml.go +1487 -0
- data/ext/vendor/golang.org/x/text/unicode/doc.go +8 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/composition.go +508 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/composition_test.go +130 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/example_iter_test.go +82 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/example_test.go +27 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/forminfo.go +259 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/forminfo_test.go +54 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/input.go +109 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/iter.go +457 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/iter_test.go +98 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/maketables.go +976 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/norm_test.go +14 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/normalize.go +609 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/normalize_test.go +1287 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/readwriter.go +125 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/readwriter_test.go +56 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/tables.go +7651 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/transform.go +88 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/transform_test.go +101 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/trie.go +54 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/triegen.go +117 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/ucd_test.go +275 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/gen.go +115 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/merge.go +260 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/merge_test.go +184 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/rangetable.go +70 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/rangetable_test.go +55 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/tables.go +6376 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/bits.go +59 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/example_test.go +118 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/gen.go +195 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/gen_bits.go +63 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/runenames.go +48 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/runenames_test.go +46 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/tables.go +15514 -0
- data/ext/vendor/golang.org/x/text/width/common_test.go +92 -0
- data/ext/vendor/golang.org/x/text/width/example_test.go +52 -0
- data/ext/vendor/golang.org/x/text/width/gen.go +115 -0
- data/ext/vendor/golang.org/x/text/width/gen_common.go +96 -0
- data/ext/vendor/golang.org/x/text/width/gen_trieval.go +34 -0
- data/ext/vendor/golang.org/x/text/width/kind_string.go +16 -0
- data/ext/vendor/golang.org/x/text/width/runes_test.go +461 -0
- data/ext/vendor/golang.org/x/text/width/tables.go +1316 -0
- data/ext/vendor/golang.org/x/text/width/tables_test.go +59 -0
- data/ext/vendor/golang.org/x/text/width/transform.go +239 -0
- data/ext/vendor/golang.org/x/text/width/transform_test.go +701 -0
- data/ext/vendor/golang.org/x/text/width/trieval.go +30 -0
- data/ext/vendor/golang.org/x/text/width/width.go +206 -0
- data/lib/ires/version.rb +1 -1
- data/shared/darwin/ires.so +0 -0
- data/shared/linux/ires.so +0 -0
- metadata +1011 -23
- data/ext/operate/image.go +0 -176
- data/ext/util/uri/uri.go +0 -105
- data/ext/vendor/github.com/satori/go.uuid/README.md +0 -65
- data/ext/vendor/github.com/satori/go.uuid/benchmarks_test.go +0 -121
- data/ext/vendor/github.com/satori/go.uuid/uuid.go +0 -488
- data/ext/vendor/github.com/satori/go.uuid/uuid_test.go +0 -633
@@ -0,0 +1,98 @@
|
|
1
|
+
// Copyright 2011 The Go Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style
|
3
|
+
// license that can be found in the LICENSE file.
|
4
|
+
|
5
|
+
package norm
|
6
|
+
|
7
|
+
import (
|
8
|
+
"strings"
|
9
|
+
"testing"
|
10
|
+
)
|
11
|
+
|
12
|
+
func doIterNorm(f Form, s string) []byte {
|
13
|
+
acc := []byte{}
|
14
|
+
i := Iter{}
|
15
|
+
i.InitString(f, s)
|
16
|
+
for !i.Done() {
|
17
|
+
acc = append(acc, i.Next()...)
|
18
|
+
}
|
19
|
+
return acc
|
20
|
+
}
|
21
|
+
|
22
|
+
func TestIterNext(t *testing.T) {
|
23
|
+
runNormTests(t, "IterNext", func(f Form, out []byte, s string) []byte {
|
24
|
+
return doIterNorm(f, string(append(out, s...)))
|
25
|
+
})
|
26
|
+
}
|
27
|
+
|
28
|
+
type SegmentTest struct {
|
29
|
+
in string
|
30
|
+
out []string
|
31
|
+
}
|
32
|
+
|
33
|
+
var segmentTests = []SegmentTest{
|
34
|
+
{"\u1E0A\u0323a", []string{"\x44\u0323\u0307", "a", ""}},
|
35
|
+
{rep('a', segSize), append(strings.Split(rep('a', segSize), ""), "")},
|
36
|
+
{rep('a', segSize+2), append(strings.Split(rep('a', segSize+2), ""), "")},
|
37
|
+
{rep('a', segSize) + "\u0300aa",
|
38
|
+
append(strings.Split(rep('a', segSize-1), ""), "a\u0300", "a", "a", "")},
|
39
|
+
|
40
|
+
// U+0f73 is NOT treated as a starter as it is a modifier
|
41
|
+
{"a" + grave(29) + "\u0f73", []string{"a" + grave(29), cgj + "\u0f73"}},
|
42
|
+
{"a\u0f73", []string{"a\u0f73"}},
|
43
|
+
|
44
|
+
// U+ff9e is treated as a non-starter.
|
45
|
+
// TODO: should we? Note that this will only affect iteration, as whether
|
46
|
+
// or not we do so does not affect the normalization output and will either
|
47
|
+
// way result in consistent iteration output.
|
48
|
+
{"a" + grave(30) + "\uff9e", []string{"a" + grave(30), cgj + "\uff9e"}},
|
49
|
+
{"a\uff9e", []string{"a\uff9e"}},
|
50
|
+
}
|
51
|
+
|
52
|
+
var segmentTestsK = []SegmentTest{
|
53
|
+
{"\u3332", []string{"\u30D5", "\u30A1", "\u30E9", "\u30C3", "\u30C8\u3099", ""}},
|
54
|
+
// last segment of multi-segment decomposition needs normalization
|
55
|
+
{"\u3332\u093C", []string{"\u30D5", "\u30A1", "\u30E9", "\u30C3", "\u30C8\u093C\u3099", ""}},
|
56
|
+
{"\u320E", []string{"\x28", "\uAC00", "\x29"}},
|
57
|
+
|
58
|
+
// last segment should be copied to start of buffer.
|
59
|
+
{"\ufdfa", []string{"\u0635", "\u0644", "\u0649", " ", "\u0627", "\u0644", "\u0644", "\u0647", " ", "\u0639", "\u0644", "\u064a", "\u0647", " ", "\u0648", "\u0633", "\u0644", "\u0645", ""}},
|
60
|
+
{"\ufdfa" + grave(30), []string{"\u0635", "\u0644", "\u0649", " ", "\u0627", "\u0644", "\u0644", "\u0647", " ", "\u0639", "\u0644", "\u064a", "\u0647", " ", "\u0648", "\u0633", "\u0644", "\u0645" + grave(30), ""}},
|
61
|
+
{"\uFDFA" + grave(64), []string{"\u0635", "\u0644", "\u0649", " ", "\u0627", "\u0644", "\u0644", "\u0647", " ", "\u0639", "\u0644", "\u064a", "\u0647", " ", "\u0648", "\u0633", "\u0644", "\u0645" + grave(30), cgj + grave(30), cgj + grave(4), ""}},
|
62
|
+
|
63
|
+
// Hangul and Jamo are grouped together.
|
64
|
+
{"\uAC00", []string{"\u1100\u1161", ""}},
|
65
|
+
{"\uAC01", []string{"\u1100\u1161\u11A8", ""}},
|
66
|
+
{"\u1100\u1161", []string{"\u1100\u1161", ""}},
|
67
|
+
}
|
68
|
+
|
69
|
+
// Note that, by design, segmentation is equal for composing and decomposing forms.
|
70
|
+
func TestIterSegmentation(t *testing.T) {
|
71
|
+
segmentTest(t, "SegmentTestD", NFD, segmentTests)
|
72
|
+
segmentTest(t, "SegmentTestC", NFC, segmentTests)
|
73
|
+
segmentTest(t, "SegmentTestKD", NFKD, segmentTestsK)
|
74
|
+
segmentTest(t, "SegmentTestKC", NFKC, segmentTestsK)
|
75
|
+
}
|
76
|
+
|
77
|
+
func segmentTest(t *testing.T, name string, f Form, tests []SegmentTest) {
|
78
|
+
iter := Iter{}
|
79
|
+
for i, tt := range tests {
|
80
|
+
iter.InitString(f, tt.in)
|
81
|
+
for j, seg := range tt.out {
|
82
|
+
if seg == "" {
|
83
|
+
if !iter.Done() {
|
84
|
+
res := string(iter.Next())
|
85
|
+
t.Errorf(`%s:%d:%d: expected Done()==true, found segment %+q`, name, i, j, res)
|
86
|
+
}
|
87
|
+
continue
|
88
|
+
}
|
89
|
+
if iter.Done() {
|
90
|
+
t.Errorf("%s:%d:%d: Done()==true, want false", name, i, j)
|
91
|
+
}
|
92
|
+
seg = f.String(seg)
|
93
|
+
if res := string(iter.Next()); res != seg {
|
94
|
+
t.Errorf(`%s:%d:%d" segment was %+q (%d); want %+q (%d)`, name, i, j, pc(res), len(res), pc(seg), len(seg))
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
@@ -0,0 +1,976 @@
|
|
1
|
+
// Copyright 2011 The Go Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style
|
3
|
+
// license that can be found in the LICENSE file.
|
4
|
+
|
5
|
+
// +build ignore
|
6
|
+
|
7
|
+
// Normalization table generator.
|
8
|
+
// Data read from the web.
|
9
|
+
// See forminfo.go for a description of the trie values associated with each rune.
|
10
|
+
|
11
|
+
package main
|
12
|
+
|
13
|
+
import (
|
14
|
+
"bytes"
|
15
|
+
"flag"
|
16
|
+
"fmt"
|
17
|
+
"io"
|
18
|
+
"log"
|
19
|
+
"sort"
|
20
|
+
"strconv"
|
21
|
+
"strings"
|
22
|
+
|
23
|
+
"golang.org/x/text/internal/gen"
|
24
|
+
"golang.org/x/text/internal/triegen"
|
25
|
+
"golang.org/x/text/internal/ucd"
|
26
|
+
)
|
27
|
+
|
28
|
+
func main() {
|
29
|
+
gen.Init()
|
30
|
+
loadUnicodeData()
|
31
|
+
compactCCC()
|
32
|
+
loadCompositionExclusions()
|
33
|
+
completeCharFields(FCanonical)
|
34
|
+
completeCharFields(FCompatibility)
|
35
|
+
computeNonStarterCounts()
|
36
|
+
verifyComputed()
|
37
|
+
printChars()
|
38
|
+
testDerived()
|
39
|
+
printTestdata()
|
40
|
+
makeTables()
|
41
|
+
}
|
42
|
+
|
43
|
+
var (
|
44
|
+
tablelist = flag.String("tables",
|
45
|
+
"all",
|
46
|
+
"comma-separated list of which tables to generate; "+
|
47
|
+
"can be 'decomp', 'recomp', 'info' and 'all'")
|
48
|
+
test = flag.Bool("test",
|
49
|
+
false,
|
50
|
+
"test existing tables against DerivedNormalizationProps and generate test data for regression testing")
|
51
|
+
verbose = flag.Bool("verbose",
|
52
|
+
false,
|
53
|
+
"write data to stdout as it is parsed")
|
54
|
+
)
|
55
|
+
|
56
|
+
const MaxChar = 0x10FFFF // anything above this shouldn't exist
|
57
|
+
|
58
|
+
// Quick Check properties of runes allow us to quickly
|
59
|
+
// determine whether a rune may occur in a normal form.
|
60
|
+
// For a given normal form, a rune may be guaranteed to occur
|
61
|
+
// verbatim (QC=Yes), may or may not combine with another
|
62
|
+
// rune (QC=Maybe), or may not occur (QC=No).
|
63
|
+
type QCResult int
|
64
|
+
|
65
|
+
const (
|
66
|
+
QCUnknown QCResult = iota
|
67
|
+
QCYes
|
68
|
+
QCNo
|
69
|
+
QCMaybe
|
70
|
+
)
|
71
|
+
|
72
|
+
func (r QCResult) String() string {
|
73
|
+
switch r {
|
74
|
+
case QCYes:
|
75
|
+
return "Yes"
|
76
|
+
case QCNo:
|
77
|
+
return "No"
|
78
|
+
case QCMaybe:
|
79
|
+
return "Maybe"
|
80
|
+
}
|
81
|
+
return "***UNKNOWN***"
|
82
|
+
}
|
83
|
+
|
84
|
+
const (
|
85
|
+
FCanonical = iota // NFC or NFD
|
86
|
+
FCompatibility // NFKC or NFKD
|
87
|
+
FNumberOfFormTypes
|
88
|
+
)
|
89
|
+
|
90
|
+
const (
|
91
|
+
MComposed = iota // NFC or NFKC
|
92
|
+
MDecomposed // NFD or NFKD
|
93
|
+
MNumberOfModes
|
94
|
+
)
|
95
|
+
|
96
|
+
// This contains only the properties we're interested in.
|
97
|
+
type Char struct {
|
98
|
+
name string
|
99
|
+
codePoint rune // if zero, this index is not a valid code point.
|
100
|
+
ccc uint8 // canonical combining class
|
101
|
+
origCCC uint8
|
102
|
+
excludeInComp bool // from CompositionExclusions.txt
|
103
|
+
compatDecomp bool // it has a compatibility expansion
|
104
|
+
|
105
|
+
nTrailingNonStarters uint8
|
106
|
+
nLeadingNonStarters uint8 // must be equal to trailing if non-zero
|
107
|
+
|
108
|
+
forms [FNumberOfFormTypes]FormInfo // For FCanonical and FCompatibility
|
109
|
+
|
110
|
+
state State
|
111
|
+
}
|
112
|
+
|
113
|
+
var chars = make([]Char, MaxChar+1)
|
114
|
+
var cccMap = make(map[uint8]uint8)
|
115
|
+
|
116
|
+
func (c Char) String() string {
|
117
|
+
buf := new(bytes.Buffer)
|
118
|
+
|
119
|
+
fmt.Fprintf(buf, "%U [%s]:\n", c.codePoint, c.name)
|
120
|
+
fmt.Fprintf(buf, " ccc: %v\n", c.ccc)
|
121
|
+
fmt.Fprintf(buf, " excludeInComp: %v\n", c.excludeInComp)
|
122
|
+
fmt.Fprintf(buf, " compatDecomp: %v\n", c.compatDecomp)
|
123
|
+
fmt.Fprintf(buf, " state: %v\n", c.state)
|
124
|
+
fmt.Fprintf(buf, " NFC:\n")
|
125
|
+
fmt.Fprint(buf, c.forms[FCanonical])
|
126
|
+
fmt.Fprintf(buf, " NFKC:\n")
|
127
|
+
fmt.Fprint(buf, c.forms[FCompatibility])
|
128
|
+
|
129
|
+
return buf.String()
|
130
|
+
}
|
131
|
+
|
132
|
+
// In UnicodeData.txt, some ranges are marked like this:
|
133
|
+
// 3400;<CJK Ideograph Extension A, First>;Lo;0;L;;;;;N;;;;;
|
134
|
+
// 4DB5;<CJK Ideograph Extension A, Last>;Lo;0;L;;;;;N;;;;;
|
135
|
+
// parseCharacter keeps a state variable indicating the weirdness.
|
136
|
+
type State int
|
137
|
+
|
138
|
+
const (
|
139
|
+
SNormal State = iota // known to be zero for the type
|
140
|
+
SFirst
|
141
|
+
SLast
|
142
|
+
SMissing
|
143
|
+
)
|
144
|
+
|
145
|
+
var lastChar = rune('\u0000')
|
146
|
+
|
147
|
+
func (c Char) isValid() bool {
|
148
|
+
return c.codePoint != 0 && c.state != SMissing
|
149
|
+
}
|
150
|
+
|
151
|
+
type FormInfo struct {
|
152
|
+
quickCheck [MNumberOfModes]QCResult // index: MComposed or MDecomposed
|
153
|
+
verified [MNumberOfModes]bool // index: MComposed or MDecomposed
|
154
|
+
|
155
|
+
combinesForward bool // May combine with rune on the right
|
156
|
+
combinesBackward bool // May combine with rune on the left
|
157
|
+
isOneWay bool // Never appears in result
|
158
|
+
inDecomp bool // Some decompositions result in this char.
|
159
|
+
decomp Decomposition
|
160
|
+
expandedDecomp Decomposition
|
161
|
+
}
|
162
|
+
|
163
|
+
func (f FormInfo) String() string {
|
164
|
+
buf := bytes.NewBuffer(make([]byte, 0))
|
165
|
+
|
166
|
+
fmt.Fprintf(buf, " quickCheck[C]: %v\n", f.quickCheck[MComposed])
|
167
|
+
fmt.Fprintf(buf, " quickCheck[D]: %v\n", f.quickCheck[MDecomposed])
|
168
|
+
fmt.Fprintf(buf, " cmbForward: %v\n", f.combinesForward)
|
169
|
+
fmt.Fprintf(buf, " cmbBackward: %v\n", f.combinesBackward)
|
170
|
+
fmt.Fprintf(buf, " isOneWay: %v\n", f.isOneWay)
|
171
|
+
fmt.Fprintf(buf, " inDecomp: %v\n", f.inDecomp)
|
172
|
+
fmt.Fprintf(buf, " decomposition: %X\n", f.decomp)
|
173
|
+
fmt.Fprintf(buf, " expandedDecomp: %X\n", f.expandedDecomp)
|
174
|
+
|
175
|
+
return buf.String()
|
176
|
+
}
|
177
|
+
|
178
|
+
type Decomposition []rune
|
179
|
+
|
180
|
+
func parseDecomposition(s string, skipfirst bool) (a []rune, err error) {
|
181
|
+
decomp := strings.Split(s, " ")
|
182
|
+
if len(decomp) > 0 && skipfirst {
|
183
|
+
decomp = decomp[1:]
|
184
|
+
}
|
185
|
+
for _, d := range decomp {
|
186
|
+
point, err := strconv.ParseUint(d, 16, 64)
|
187
|
+
if err != nil {
|
188
|
+
return a, err
|
189
|
+
}
|
190
|
+
a = append(a, rune(point))
|
191
|
+
}
|
192
|
+
return a, nil
|
193
|
+
}
|
194
|
+
|
195
|
+
func loadUnicodeData() {
|
196
|
+
f := gen.OpenUCDFile("UnicodeData.txt")
|
197
|
+
defer f.Close()
|
198
|
+
p := ucd.New(f)
|
199
|
+
for p.Next() {
|
200
|
+
r := p.Rune(ucd.CodePoint)
|
201
|
+
char := &chars[r]
|
202
|
+
|
203
|
+
char.ccc = uint8(p.Uint(ucd.CanonicalCombiningClass))
|
204
|
+
decmap := p.String(ucd.DecompMapping)
|
205
|
+
|
206
|
+
exp, err := parseDecomposition(decmap, false)
|
207
|
+
isCompat := false
|
208
|
+
if err != nil {
|
209
|
+
if len(decmap) > 0 {
|
210
|
+
exp, err = parseDecomposition(decmap, true)
|
211
|
+
if err != nil {
|
212
|
+
log.Fatalf(`%U: bad decomp |%v|: "%s"`, r, decmap, err)
|
213
|
+
}
|
214
|
+
isCompat = true
|
215
|
+
}
|
216
|
+
}
|
217
|
+
|
218
|
+
char.name = p.String(ucd.Name)
|
219
|
+
char.codePoint = r
|
220
|
+
char.forms[FCompatibility].decomp = exp
|
221
|
+
if !isCompat {
|
222
|
+
char.forms[FCanonical].decomp = exp
|
223
|
+
} else {
|
224
|
+
char.compatDecomp = true
|
225
|
+
}
|
226
|
+
if len(decmap) > 0 {
|
227
|
+
char.forms[FCompatibility].decomp = exp
|
228
|
+
}
|
229
|
+
}
|
230
|
+
if err := p.Err(); err != nil {
|
231
|
+
log.Fatal(err)
|
232
|
+
}
|
233
|
+
}
|
234
|
+
|
235
|
+
// compactCCC converts the sparse set of CCC values to a continguous one,
|
236
|
+
// reducing the number of bits needed from 8 to 6.
|
237
|
+
func compactCCC() {
|
238
|
+
m := make(map[uint8]uint8)
|
239
|
+
for i := range chars {
|
240
|
+
c := &chars[i]
|
241
|
+
m[c.ccc] = 0
|
242
|
+
}
|
243
|
+
cccs := []int{}
|
244
|
+
for v, _ := range m {
|
245
|
+
cccs = append(cccs, int(v))
|
246
|
+
}
|
247
|
+
sort.Ints(cccs)
|
248
|
+
for i, c := range cccs {
|
249
|
+
cccMap[uint8(i)] = uint8(c)
|
250
|
+
m[uint8(c)] = uint8(i)
|
251
|
+
}
|
252
|
+
for i := range chars {
|
253
|
+
c := &chars[i]
|
254
|
+
c.origCCC = c.ccc
|
255
|
+
c.ccc = m[c.ccc]
|
256
|
+
}
|
257
|
+
if len(m) >= 1<<6 {
|
258
|
+
log.Fatalf("too many difference CCC values: %d >= 64", len(m))
|
259
|
+
}
|
260
|
+
}
|
261
|
+
|
262
|
+
// CompositionExclusions.txt has form:
|
263
|
+
// 0958 # ...
|
264
|
+
// See http://unicode.org/reports/tr44/ for full explanation
|
265
|
+
func loadCompositionExclusions() {
|
266
|
+
f := gen.OpenUCDFile("CompositionExclusions.txt")
|
267
|
+
defer f.Close()
|
268
|
+
p := ucd.New(f)
|
269
|
+
for p.Next() {
|
270
|
+
c := &chars[p.Rune(0)]
|
271
|
+
if c.excludeInComp {
|
272
|
+
log.Fatalf("%U: Duplicate entry in exclusions.", c.codePoint)
|
273
|
+
}
|
274
|
+
c.excludeInComp = true
|
275
|
+
}
|
276
|
+
if e := p.Err(); e != nil {
|
277
|
+
log.Fatal(e)
|
278
|
+
}
|
279
|
+
}
|
280
|
+
|
281
|
+
// hasCompatDecomp returns true if any of the recursive
|
282
|
+
// decompositions contains a compatibility expansion.
|
283
|
+
// In this case, the character may not occur in NFK*.
|
284
|
+
func hasCompatDecomp(r rune) bool {
|
285
|
+
c := &chars[r]
|
286
|
+
if c.compatDecomp {
|
287
|
+
return true
|
288
|
+
}
|
289
|
+
for _, d := range c.forms[FCompatibility].decomp {
|
290
|
+
if hasCompatDecomp(d) {
|
291
|
+
return true
|
292
|
+
}
|
293
|
+
}
|
294
|
+
return false
|
295
|
+
}
|
296
|
+
|
297
|
+
// Hangul related constants.
|
298
|
+
const (
|
299
|
+
HangulBase = 0xAC00
|
300
|
+
HangulEnd = 0xD7A4 // hangulBase + Jamo combinations (19 * 21 * 28)
|
301
|
+
|
302
|
+
JamoLBase = 0x1100
|
303
|
+
JamoLEnd = 0x1113
|
304
|
+
JamoVBase = 0x1161
|
305
|
+
JamoVEnd = 0x1176
|
306
|
+
JamoTBase = 0x11A8
|
307
|
+
JamoTEnd = 0x11C3
|
308
|
+
|
309
|
+
JamoLVTCount = 19 * 21 * 28
|
310
|
+
JamoTCount = 28
|
311
|
+
)
|
312
|
+
|
313
|
+
func isHangul(r rune) bool {
|
314
|
+
return HangulBase <= r && r < HangulEnd
|
315
|
+
}
|
316
|
+
|
317
|
+
func isHangulWithoutJamoT(r rune) bool {
|
318
|
+
if !isHangul(r) {
|
319
|
+
return false
|
320
|
+
}
|
321
|
+
r -= HangulBase
|
322
|
+
return r < JamoLVTCount && r%JamoTCount == 0
|
323
|
+
}
|
324
|
+
|
325
|
+
func ccc(r rune) uint8 {
|
326
|
+
return chars[r].ccc
|
327
|
+
}
|
328
|
+
|
329
|
+
// Insert a rune in a buffer, ordered by Canonical Combining Class.
|
330
|
+
func insertOrdered(b Decomposition, r rune) Decomposition {
|
331
|
+
n := len(b)
|
332
|
+
b = append(b, 0)
|
333
|
+
cc := ccc(r)
|
334
|
+
if cc > 0 {
|
335
|
+
// Use bubble sort.
|
336
|
+
for ; n > 0; n-- {
|
337
|
+
if ccc(b[n-1]) <= cc {
|
338
|
+
break
|
339
|
+
}
|
340
|
+
b[n] = b[n-1]
|
341
|
+
}
|
342
|
+
}
|
343
|
+
b[n] = r
|
344
|
+
return b
|
345
|
+
}
|
346
|
+
|
347
|
+
// Recursively decompose.
|
348
|
+
func decomposeRecursive(form int, r rune, d Decomposition) Decomposition {
|
349
|
+
dcomp := chars[r].forms[form].decomp
|
350
|
+
if len(dcomp) == 0 {
|
351
|
+
return insertOrdered(d, r)
|
352
|
+
}
|
353
|
+
for _, c := range dcomp {
|
354
|
+
d = decomposeRecursive(form, c, d)
|
355
|
+
}
|
356
|
+
return d
|
357
|
+
}
|
358
|
+
|
359
|
+
func completeCharFields(form int) {
|
360
|
+
// Phase 0: pre-expand decomposition.
|
361
|
+
for i := range chars {
|
362
|
+
f := &chars[i].forms[form]
|
363
|
+
if len(f.decomp) == 0 {
|
364
|
+
continue
|
365
|
+
}
|
366
|
+
exp := make(Decomposition, 0)
|
367
|
+
for _, c := range f.decomp {
|
368
|
+
exp = decomposeRecursive(form, c, exp)
|
369
|
+
}
|
370
|
+
f.expandedDecomp = exp
|
371
|
+
}
|
372
|
+
|
373
|
+
// Phase 1: composition exclusion, mark decomposition.
|
374
|
+
for i := range chars {
|
375
|
+
c := &chars[i]
|
376
|
+
f := &c.forms[form]
|
377
|
+
|
378
|
+
// Marks script-specific exclusions and version restricted.
|
379
|
+
f.isOneWay = c.excludeInComp
|
380
|
+
|
381
|
+
// Singletons
|
382
|
+
f.isOneWay = f.isOneWay || len(f.decomp) == 1
|
383
|
+
|
384
|
+
// Non-starter decompositions
|
385
|
+
if len(f.decomp) > 1 {
|
386
|
+
chk := c.ccc != 0 || chars[f.decomp[0]].ccc != 0
|
387
|
+
f.isOneWay = f.isOneWay || chk
|
388
|
+
}
|
389
|
+
|
390
|
+
// Runes that decompose into more than two runes.
|
391
|
+
f.isOneWay = f.isOneWay || len(f.decomp) > 2
|
392
|
+
|
393
|
+
if form == FCompatibility {
|
394
|
+
f.isOneWay = f.isOneWay || hasCompatDecomp(c.codePoint)
|
395
|
+
}
|
396
|
+
|
397
|
+
for _, r := range f.decomp {
|
398
|
+
chars[r].forms[form].inDecomp = true
|
399
|
+
}
|
400
|
+
}
|
401
|
+
|
402
|
+
// Phase 2: forward and backward combining.
|
403
|
+
for i := range chars {
|
404
|
+
c := &chars[i]
|
405
|
+
f := &c.forms[form]
|
406
|
+
|
407
|
+
if !f.isOneWay && len(f.decomp) == 2 {
|
408
|
+
f0 := &chars[f.decomp[0]].forms[form]
|
409
|
+
f1 := &chars[f.decomp[1]].forms[form]
|
410
|
+
if !f0.isOneWay {
|
411
|
+
f0.combinesForward = true
|
412
|
+
}
|
413
|
+
if !f1.isOneWay {
|
414
|
+
f1.combinesBackward = true
|
415
|
+
}
|
416
|
+
}
|
417
|
+
if isHangulWithoutJamoT(rune(i)) {
|
418
|
+
f.combinesForward = true
|
419
|
+
}
|
420
|
+
}
|
421
|
+
|
422
|
+
// Phase 3: quick check values.
|
423
|
+
for i := range chars {
|
424
|
+
c := &chars[i]
|
425
|
+
f := &c.forms[form]
|
426
|
+
|
427
|
+
switch {
|
428
|
+
case len(f.decomp) > 0:
|
429
|
+
f.quickCheck[MDecomposed] = QCNo
|
430
|
+
case isHangul(rune(i)):
|
431
|
+
f.quickCheck[MDecomposed] = QCNo
|
432
|
+
default:
|
433
|
+
f.quickCheck[MDecomposed] = QCYes
|
434
|
+
}
|
435
|
+
switch {
|
436
|
+
case f.isOneWay:
|
437
|
+
f.quickCheck[MComposed] = QCNo
|
438
|
+
case (i & 0xffff00) == JamoLBase:
|
439
|
+
f.quickCheck[MComposed] = QCYes
|
440
|
+
if JamoLBase <= i && i < JamoLEnd {
|
441
|
+
f.combinesForward = true
|
442
|
+
}
|
443
|
+
if JamoVBase <= i && i < JamoVEnd {
|
444
|
+
f.quickCheck[MComposed] = QCMaybe
|
445
|
+
f.combinesBackward = true
|
446
|
+
f.combinesForward = true
|
447
|
+
}
|
448
|
+
if JamoTBase <= i && i < JamoTEnd {
|
449
|
+
f.quickCheck[MComposed] = QCMaybe
|
450
|
+
f.combinesBackward = true
|
451
|
+
}
|
452
|
+
case !f.combinesBackward:
|
453
|
+
f.quickCheck[MComposed] = QCYes
|
454
|
+
default:
|
455
|
+
f.quickCheck[MComposed] = QCMaybe
|
456
|
+
}
|
457
|
+
}
|
458
|
+
}
|
459
|
+
|
460
|
+
func computeNonStarterCounts() {
|
461
|
+
// Phase 4: leading and trailing non-starter count
|
462
|
+
for i := range chars {
|
463
|
+
c := &chars[i]
|
464
|
+
|
465
|
+
runes := []rune{rune(i)}
|
466
|
+
// We always use FCompatibility so that the CGJ insertion points do not
|
467
|
+
// change for repeated normalizations with different forms.
|
468
|
+
if exp := c.forms[FCompatibility].expandedDecomp; len(exp) > 0 {
|
469
|
+
runes = exp
|
470
|
+
}
|
471
|
+
// We consider runes that combine backwards to be non-starters for the
|
472
|
+
// purpose of Stream-Safe Text Processing.
|
473
|
+
for _, r := range runes {
|
474
|
+
if cr := &chars[r]; cr.ccc == 0 && !cr.forms[FCompatibility].combinesBackward {
|
475
|
+
break
|
476
|
+
}
|
477
|
+
c.nLeadingNonStarters++
|
478
|
+
}
|
479
|
+
for i := len(runes) - 1; i >= 0; i-- {
|
480
|
+
if cr := &chars[runes[i]]; cr.ccc == 0 && !cr.forms[FCompatibility].combinesBackward {
|
481
|
+
break
|
482
|
+
}
|
483
|
+
c.nTrailingNonStarters++
|
484
|
+
}
|
485
|
+
if c.nTrailingNonStarters > 3 {
|
486
|
+
log.Fatalf("%U: Decomposition with more than 3 (%d) trailing modifiers (%U)", i, c.nTrailingNonStarters, runes)
|
487
|
+
}
|
488
|
+
|
489
|
+
if isHangul(rune(i)) {
|
490
|
+
c.nTrailingNonStarters = 2
|
491
|
+
if isHangulWithoutJamoT(rune(i)) {
|
492
|
+
c.nTrailingNonStarters = 1
|
493
|
+
}
|
494
|
+
}
|
495
|
+
|
496
|
+
if l, t := c.nLeadingNonStarters, c.nTrailingNonStarters; l > 0 && l != t {
|
497
|
+
log.Fatalf("%U: number of leading and trailing non-starters should be equal (%d vs %d)", i, l, t)
|
498
|
+
}
|
499
|
+
if t := c.nTrailingNonStarters; t > 3 {
|
500
|
+
log.Fatalf("%U: number of trailing non-starters is %d > 3", t)
|
501
|
+
}
|
502
|
+
}
|
503
|
+
}
|
504
|
+
|
505
|
+
func printBytes(w io.Writer, b []byte, name string) {
|
506
|
+
fmt.Fprintf(w, "// %s: %d bytes\n", name, len(b))
|
507
|
+
fmt.Fprintf(w, "var %s = [...]byte {", name)
|
508
|
+
for i, c := range b {
|
509
|
+
switch {
|
510
|
+
case i%64 == 0:
|
511
|
+
fmt.Fprintf(w, "\n// Bytes %x - %x\n", i, i+63)
|
512
|
+
case i%8 == 0:
|
513
|
+
fmt.Fprintf(w, "\n")
|
514
|
+
}
|
515
|
+
fmt.Fprintf(w, "0x%.2X, ", c)
|
516
|
+
}
|
517
|
+
fmt.Fprint(w, "\n}\n\n")
|
518
|
+
}
|
519
|
+
|
520
|
+
// See forminfo.go for format.
|
521
|
+
func makeEntry(f *FormInfo, c *Char) uint16 {
|
522
|
+
e := uint16(0)
|
523
|
+
if r := c.codePoint; HangulBase <= r && r < HangulEnd {
|
524
|
+
e |= 0x40
|
525
|
+
}
|
526
|
+
if f.combinesForward {
|
527
|
+
e |= 0x20
|
528
|
+
}
|
529
|
+
if f.quickCheck[MDecomposed] == QCNo {
|
530
|
+
e |= 0x4
|
531
|
+
}
|
532
|
+
switch f.quickCheck[MComposed] {
|
533
|
+
case QCYes:
|
534
|
+
case QCNo:
|
535
|
+
e |= 0x10
|
536
|
+
case QCMaybe:
|
537
|
+
e |= 0x18
|
538
|
+
default:
|
539
|
+
log.Fatalf("Illegal quickcheck value %v.", f.quickCheck[MComposed])
|
540
|
+
}
|
541
|
+
e |= uint16(c.nTrailingNonStarters)
|
542
|
+
return e
|
543
|
+
}
|
544
|
+
|
545
|
+
// decompSet keeps track of unique decompositions, grouped by whether
|
546
|
+
// the decomposition is followed by a trailing and/or leading CCC.
|
547
|
+
type decompSet [7]map[string]bool
|
548
|
+
|
549
|
+
const (
|
550
|
+
normalDecomp = iota
|
551
|
+
firstMulti
|
552
|
+
firstCCC
|
553
|
+
endMulti
|
554
|
+
firstLeadingCCC
|
555
|
+
firstCCCZeroExcept
|
556
|
+
firstStarterWithNLead
|
557
|
+
lastDecomp
|
558
|
+
)
|
559
|
+
|
560
|
+
var cname = []string{"firstMulti", "firstCCC", "endMulti", "firstLeadingCCC", "firstCCCZeroExcept", "firstStarterWithNLead", "lastDecomp"}
|
561
|
+
|
562
|
+
func makeDecompSet() decompSet {
|
563
|
+
m := decompSet{}
|
564
|
+
for i := range m {
|
565
|
+
m[i] = make(map[string]bool)
|
566
|
+
}
|
567
|
+
return m
|
568
|
+
}
|
569
|
+
func (m *decompSet) insert(key int, s string) {
|
570
|
+
m[key][s] = true
|
571
|
+
}
|
572
|
+
|
573
|
+
func printCharInfoTables(w io.Writer) int {
|
574
|
+
mkstr := func(r rune, f *FormInfo) (int, string) {
|
575
|
+
d := f.expandedDecomp
|
576
|
+
s := string([]rune(d))
|
577
|
+
if max := 1 << 6; len(s) >= max {
|
578
|
+
const msg = "%U: too many bytes in decomposition: %d >= %d"
|
579
|
+
log.Fatalf(msg, r, len(s), max)
|
580
|
+
}
|
581
|
+
head := uint8(len(s))
|
582
|
+
if f.quickCheck[MComposed] != QCYes {
|
583
|
+
head |= 0x40
|
584
|
+
}
|
585
|
+
if f.combinesForward {
|
586
|
+
head |= 0x80
|
587
|
+
}
|
588
|
+
s = string([]byte{head}) + s
|
589
|
+
|
590
|
+
lccc := ccc(d[0])
|
591
|
+
tccc := ccc(d[len(d)-1])
|
592
|
+
cc := ccc(r)
|
593
|
+
if cc != 0 && lccc == 0 && tccc == 0 {
|
594
|
+
log.Fatalf("%U: trailing and leading ccc are 0 for non-zero ccc %d", r, cc)
|
595
|
+
}
|
596
|
+
if tccc < lccc && lccc != 0 {
|
597
|
+
const msg = "%U: lccc (%d) must be <= tcc (%d)"
|
598
|
+
log.Fatalf(msg, r, lccc, tccc)
|
599
|
+
}
|
600
|
+
index := normalDecomp
|
601
|
+
nTrail := chars[r].nTrailingNonStarters
|
602
|
+
nLead := chars[r].nLeadingNonStarters
|
603
|
+
if tccc > 0 || lccc > 0 || nTrail > 0 {
|
604
|
+
tccc <<= 2
|
605
|
+
tccc |= nTrail
|
606
|
+
s += string([]byte{tccc})
|
607
|
+
index = endMulti
|
608
|
+
for _, r := range d[1:] {
|
609
|
+
if ccc(r) == 0 {
|
610
|
+
index = firstCCC
|
611
|
+
}
|
612
|
+
}
|
613
|
+
if lccc > 0 || nLead > 0 {
|
614
|
+
s += string([]byte{lccc})
|
615
|
+
if index == firstCCC {
|
616
|
+
log.Fatalf("%U: multi-segment decomposition not supported for decompositions with leading CCC != 0", r)
|
617
|
+
}
|
618
|
+
index = firstLeadingCCC
|
619
|
+
}
|
620
|
+
if cc != lccc {
|
621
|
+
if cc != 0 {
|
622
|
+
log.Fatalf("%U: for lccc != ccc, expected ccc to be 0; was %d", r, cc)
|
623
|
+
}
|
624
|
+
index = firstCCCZeroExcept
|
625
|
+
}
|
626
|
+
} else if len(d) > 1 {
|
627
|
+
index = firstMulti
|
628
|
+
}
|
629
|
+
return index, s
|
630
|
+
}
|
631
|
+
|
632
|
+
decompSet := makeDecompSet()
|
633
|
+
const nLeadStr = "\x00\x01" // 0-byte length and tccc with nTrail.
|
634
|
+
decompSet.insert(firstStarterWithNLead, nLeadStr)
|
635
|
+
|
636
|
+
// Store the uniqued decompositions in a byte buffer,
|
637
|
+
// preceded by their byte length.
|
638
|
+
for _, c := range chars {
|
639
|
+
for _, f := range c.forms {
|
640
|
+
if len(f.expandedDecomp) == 0 {
|
641
|
+
continue
|
642
|
+
}
|
643
|
+
if f.combinesBackward {
|
644
|
+
log.Fatalf("%U: combinesBackward and decompose", c.codePoint)
|
645
|
+
}
|
646
|
+
index, s := mkstr(c.codePoint, &f)
|
647
|
+
decompSet.insert(index, s)
|
648
|
+
}
|
649
|
+
}
|
650
|
+
|
651
|
+
decompositions := bytes.NewBuffer(make([]byte, 0, 10000))
|
652
|
+
size := 0
|
653
|
+
positionMap := make(map[string]uint16)
|
654
|
+
decompositions.WriteString("\000")
|
655
|
+
fmt.Fprintln(w, "const (")
|
656
|
+
for i, m := range decompSet {
|
657
|
+
sa := []string{}
|
658
|
+
for s := range m {
|
659
|
+
sa = append(sa, s)
|
660
|
+
}
|
661
|
+
sort.Strings(sa)
|
662
|
+
for _, s := range sa {
|
663
|
+
p := decompositions.Len()
|
664
|
+
decompositions.WriteString(s)
|
665
|
+
positionMap[s] = uint16(p)
|
666
|
+
}
|
667
|
+
if cname[i] != "" {
|
668
|
+
fmt.Fprintf(w, "%s = 0x%X\n", cname[i], decompositions.Len())
|
669
|
+
}
|
670
|
+
}
|
671
|
+
fmt.Fprintln(w, "maxDecomp = 0x8000")
|
672
|
+
fmt.Fprintln(w, ")")
|
673
|
+
b := decompositions.Bytes()
|
674
|
+
printBytes(w, b, "decomps")
|
675
|
+
size += len(b)
|
676
|
+
|
677
|
+
varnames := []string{"nfc", "nfkc"}
|
678
|
+
for i := 0; i < FNumberOfFormTypes; i++ {
|
679
|
+
trie := triegen.NewTrie(varnames[i])
|
680
|
+
|
681
|
+
for r, c := range chars {
|
682
|
+
f := c.forms[i]
|
683
|
+
d := f.expandedDecomp
|
684
|
+
if len(d) != 0 {
|
685
|
+
_, key := mkstr(c.codePoint, &f)
|
686
|
+
trie.Insert(rune(r), uint64(positionMap[key]))
|
687
|
+
if c.ccc != ccc(d[0]) {
|
688
|
+
// We assume the lead ccc of a decomposition !=0 in this case.
|
689
|
+
if ccc(d[0]) == 0 {
|
690
|
+
log.Fatalf("Expected leading CCC to be non-zero; ccc is %d", c.ccc)
|
691
|
+
}
|
692
|
+
}
|
693
|
+
} else if c.nLeadingNonStarters > 0 && len(f.expandedDecomp) == 0 && c.ccc == 0 && !f.combinesBackward {
|
694
|
+
// Handle cases where it can't be detected that the nLead should be equal
|
695
|
+
// to nTrail.
|
696
|
+
trie.Insert(c.codePoint, uint64(positionMap[nLeadStr]))
|
697
|
+
} else if v := makeEntry(&f, &c)<<8 | uint16(c.ccc); v != 0 {
|
698
|
+
trie.Insert(c.codePoint, uint64(0x8000|v))
|
699
|
+
}
|
700
|
+
}
|
701
|
+
sz, err := trie.Gen(w, triegen.Compact(&normCompacter{name: varnames[i]}))
|
702
|
+
if err != nil {
|
703
|
+
log.Fatal(err)
|
704
|
+
}
|
705
|
+
size += sz
|
706
|
+
}
|
707
|
+
return size
|
708
|
+
}
|
709
|
+
|
710
|
+
func contains(sa []string, s string) bool {
|
711
|
+
for _, a := range sa {
|
712
|
+
if a == s {
|
713
|
+
return true
|
714
|
+
}
|
715
|
+
}
|
716
|
+
return false
|
717
|
+
}
|
718
|
+
|
719
|
+
func makeTables() {
|
720
|
+
w := &bytes.Buffer{}
|
721
|
+
|
722
|
+
size := 0
|
723
|
+
if *tablelist == "" {
|
724
|
+
return
|
725
|
+
}
|
726
|
+
list := strings.Split(*tablelist, ",")
|
727
|
+
if *tablelist == "all" {
|
728
|
+
list = []string{"recomp", "info"}
|
729
|
+
}
|
730
|
+
|
731
|
+
// Compute maximum decomposition size.
|
732
|
+
max := 0
|
733
|
+
for _, c := range chars {
|
734
|
+
if n := len(string(c.forms[FCompatibility].expandedDecomp)); n > max {
|
735
|
+
max = n
|
736
|
+
}
|
737
|
+
}
|
738
|
+
|
739
|
+
fmt.Fprintln(w, "const (")
|
740
|
+
fmt.Fprintln(w, "\t// Version is the Unicode edition from which the tables are derived.")
|
741
|
+
fmt.Fprintf(w, "\tVersion = %q\n", gen.UnicodeVersion())
|
742
|
+
fmt.Fprintln(w)
|
743
|
+
fmt.Fprintln(w, "\t// MaxTransformChunkSize indicates the maximum number of bytes that Transform")
|
744
|
+
fmt.Fprintln(w, "\t// may need to write atomically for any Form. Making a destination buffer at")
|
745
|
+
fmt.Fprintln(w, "\t// least this size ensures that Transform can always make progress and that")
|
746
|
+
fmt.Fprintln(w, "\t// the user does not need to grow the buffer on an ErrShortDst.")
|
747
|
+
fmt.Fprintf(w, "\tMaxTransformChunkSize = %d+maxNonStarters*4\n", len(string(0x034F))+max)
|
748
|
+
fmt.Fprintln(w, ")\n")
|
749
|
+
|
750
|
+
// Print the CCC remap table.
|
751
|
+
size += len(cccMap)
|
752
|
+
fmt.Fprintf(w, "var ccc = [%d]uint8{", len(cccMap))
|
753
|
+
for i := 0; i < len(cccMap); i++ {
|
754
|
+
if i%8 == 0 {
|
755
|
+
fmt.Fprintln(w)
|
756
|
+
}
|
757
|
+
fmt.Fprintf(w, "%3d, ", cccMap[uint8(i)])
|
758
|
+
}
|
759
|
+
fmt.Fprintln(w, "\n}\n")
|
760
|
+
|
761
|
+
if contains(list, "info") {
|
762
|
+
size += printCharInfoTables(w)
|
763
|
+
}
|
764
|
+
|
765
|
+
if contains(list, "recomp") {
|
766
|
+
// Note that we use 32 bit keys, instead of 64 bit.
|
767
|
+
// This clips the bits of three entries, but we know
|
768
|
+
// this won't cause a collision. The compiler will catch
|
769
|
+
// any changes made to UnicodeData.txt that introduces
|
770
|
+
// a collision.
|
771
|
+
// Note that the recomposition map for NFC and NFKC
|
772
|
+
// are identical.
|
773
|
+
|
774
|
+
// Recomposition map
|
775
|
+
nrentries := 0
|
776
|
+
for _, c := range chars {
|
777
|
+
f := c.forms[FCanonical]
|
778
|
+
if !f.isOneWay && len(f.decomp) > 0 {
|
779
|
+
nrentries++
|
780
|
+
}
|
781
|
+
}
|
782
|
+
sz := nrentries * 8
|
783
|
+
size += sz
|
784
|
+
fmt.Fprintf(w, "// recompMap: %d bytes (entries only)\n", sz)
|
785
|
+
fmt.Fprintln(w, "var recompMap = map[uint32]rune{")
|
786
|
+
for i, c := range chars {
|
787
|
+
f := c.forms[FCanonical]
|
788
|
+
d := f.decomp
|
789
|
+
if !f.isOneWay && len(d) > 0 {
|
790
|
+
key := uint32(uint16(d[0]))<<16 + uint32(uint16(d[1]))
|
791
|
+
fmt.Fprintf(w, "0x%.8X: 0x%.4X,\n", key, i)
|
792
|
+
}
|
793
|
+
}
|
794
|
+
fmt.Fprintf(w, "}\n\n")
|
795
|
+
}
|
796
|
+
|
797
|
+
fmt.Fprintf(w, "// Total size of tables: %dKB (%d bytes)\n", (size+512)/1024, size)
|
798
|
+
gen.WriteGoFile("tables.go", "norm", w.Bytes())
|
799
|
+
}
|
800
|
+
|
801
|
+
func printChars() {
|
802
|
+
if *verbose {
|
803
|
+
for _, c := range chars {
|
804
|
+
if !c.isValid() || c.state == SMissing {
|
805
|
+
continue
|
806
|
+
}
|
807
|
+
fmt.Println(c)
|
808
|
+
}
|
809
|
+
}
|
810
|
+
}
|
811
|
+
|
812
|
+
// verifyComputed does various consistency tests.
|
813
|
+
func verifyComputed() {
|
814
|
+
for i, c := range chars {
|
815
|
+
for _, f := range c.forms {
|
816
|
+
isNo := (f.quickCheck[MDecomposed] == QCNo)
|
817
|
+
if (len(f.decomp) > 0) != isNo && !isHangul(rune(i)) {
|
818
|
+
log.Fatalf("%U: NF*D QC must be No if rune decomposes", i)
|
819
|
+
}
|
820
|
+
|
821
|
+
isMaybe := f.quickCheck[MComposed] == QCMaybe
|
822
|
+
if f.combinesBackward != isMaybe {
|
823
|
+
log.Fatalf("%U: NF*C QC must be Maybe if combinesBackward", i)
|
824
|
+
}
|
825
|
+
if len(f.decomp) > 0 && f.combinesForward && isMaybe {
|
826
|
+
log.Fatalf("%U: NF*C QC must be Yes or No if combinesForward and decomposes", i)
|
827
|
+
}
|
828
|
+
|
829
|
+
if len(f.expandedDecomp) != 0 {
|
830
|
+
continue
|
831
|
+
}
|
832
|
+
if a, b := c.nLeadingNonStarters > 0, (c.ccc > 0 || f.combinesBackward); a != b {
|
833
|
+
// We accept these runes to be treated differently (it only affects
|
834
|
+
// segment breaking in iteration, most likely on improper use), but
|
835
|
+
// reconsider if more characters are added.
|
836
|
+
// U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK;Lm;0;L;<narrow> 3099;;;;N;;;;;
|
837
|
+
// U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK;Lm;0;L;<narrow> 309A;;;;N;;;;;
|
838
|
+
// U+3133 HANGUL LETTER KIYEOK-SIOS;Lo;0;L;<compat> 11AA;;;;N;HANGUL LETTER GIYEOG SIOS;;;;
|
839
|
+
// U+318E HANGUL LETTER ARAEAE;Lo;0;L;<compat> 11A1;;;;N;HANGUL LETTER ALAE AE;;;;
|
840
|
+
// U+FFA3 HALFWIDTH HANGUL LETTER KIYEOK-SIOS;Lo;0;L;<narrow> 3133;;;;N;HALFWIDTH HANGUL LETTER GIYEOG SIOS;;;;
|
841
|
+
// U+FFDC HALFWIDTH HANGUL LETTER I;Lo;0;L;<narrow> 3163;;;;N;;;;;
|
842
|
+
if i != 0xFF9E && i != 0xFF9F && !(0x3133 <= i && i <= 0x318E) && !(0xFFA3 <= i && i <= 0xFFDC) {
|
843
|
+
log.Fatalf("%U: nLead was %v; want %v", i, a, b)
|
844
|
+
}
|
845
|
+
}
|
846
|
+
}
|
847
|
+
nfc := c.forms[FCanonical]
|
848
|
+
nfkc := c.forms[FCompatibility]
|
849
|
+
if nfc.combinesBackward != nfkc.combinesBackward {
|
850
|
+
log.Fatalf("%U: Cannot combine combinesBackward\n", c.codePoint)
|
851
|
+
}
|
852
|
+
}
|
853
|
+
}
|
854
|
+
|
855
|
+
// Use values in DerivedNormalizationProps.txt to compare against the
|
856
|
+
// values we computed.
|
857
|
+
// DerivedNormalizationProps.txt has form:
|
858
|
+
// 00C0..00C5 ; NFD_QC; N # ...
|
859
|
+
// 0374 ; NFD_QC; N # ...
|
860
|
+
// See http://unicode.org/reports/tr44/ for full explanation
|
861
|
+
func testDerived() {
|
862
|
+
f := gen.OpenUCDFile("DerivedNormalizationProps.txt")
|
863
|
+
defer f.Close()
|
864
|
+
p := ucd.New(f)
|
865
|
+
for p.Next() {
|
866
|
+
r := p.Rune(0)
|
867
|
+
c := &chars[r]
|
868
|
+
|
869
|
+
var ftype, mode int
|
870
|
+
qt := p.String(1)
|
871
|
+
switch qt {
|
872
|
+
case "NFC_QC":
|
873
|
+
ftype, mode = FCanonical, MComposed
|
874
|
+
case "NFD_QC":
|
875
|
+
ftype, mode = FCanonical, MDecomposed
|
876
|
+
case "NFKC_QC":
|
877
|
+
ftype, mode = FCompatibility, MComposed
|
878
|
+
case "NFKD_QC":
|
879
|
+
ftype, mode = FCompatibility, MDecomposed
|
880
|
+
default:
|
881
|
+
continue
|
882
|
+
}
|
883
|
+
var qr QCResult
|
884
|
+
switch p.String(2) {
|
885
|
+
case "Y":
|
886
|
+
qr = QCYes
|
887
|
+
case "N":
|
888
|
+
qr = QCNo
|
889
|
+
case "M":
|
890
|
+
qr = QCMaybe
|
891
|
+
default:
|
892
|
+
log.Fatalf(`Unexpected quick check value "%s"`, p.String(2))
|
893
|
+
}
|
894
|
+
if got := c.forms[ftype].quickCheck[mode]; got != qr {
|
895
|
+
log.Printf("%U: FAILED %s (was %v need %v)\n", r, qt, got, qr)
|
896
|
+
}
|
897
|
+
c.forms[ftype].verified[mode] = true
|
898
|
+
}
|
899
|
+
if err := p.Err(); err != nil {
|
900
|
+
log.Fatal(err)
|
901
|
+
}
|
902
|
+
// Any unspecified value must be QCYes. Verify this.
|
903
|
+
for i, c := range chars {
|
904
|
+
for j, fd := range c.forms {
|
905
|
+
for k, qr := range fd.quickCheck {
|
906
|
+
if !fd.verified[k] && qr != QCYes {
|
907
|
+
m := "%U: FAIL F:%d M:%d (was %v need Yes) %s\n"
|
908
|
+
log.Printf(m, i, j, k, qr, c.name)
|
909
|
+
}
|
910
|
+
}
|
911
|
+
}
|
912
|
+
}
|
913
|
+
}
|
914
|
+
|
915
|
+
var testHeader = `const (
|
916
|
+
Yes = iota
|
917
|
+
No
|
918
|
+
Maybe
|
919
|
+
)
|
920
|
+
|
921
|
+
type formData struct {
|
922
|
+
qc uint8
|
923
|
+
combinesForward bool
|
924
|
+
decomposition string
|
925
|
+
}
|
926
|
+
|
927
|
+
type runeData struct {
|
928
|
+
r rune
|
929
|
+
ccc uint8
|
930
|
+
nLead uint8
|
931
|
+
nTrail uint8
|
932
|
+
f [2]formData // 0: canonical; 1: compatibility
|
933
|
+
}
|
934
|
+
|
935
|
+
func f(qc uint8, cf bool, dec string) [2]formData {
|
936
|
+
return [2]formData{{qc, cf, dec}, {qc, cf, dec}}
|
937
|
+
}
|
938
|
+
|
939
|
+
func g(qc, qck uint8, cf, cfk bool, d, dk string) [2]formData {
|
940
|
+
return [2]formData{{qc, cf, d}, {qck, cfk, dk}}
|
941
|
+
}
|
942
|
+
|
943
|
+
var testData = []runeData{
|
944
|
+
`
|
945
|
+
|
946
|
+
func printTestdata() {
|
947
|
+
type lastInfo struct {
|
948
|
+
ccc uint8
|
949
|
+
nLead uint8
|
950
|
+
nTrail uint8
|
951
|
+
f string
|
952
|
+
}
|
953
|
+
|
954
|
+
last := lastInfo{}
|
955
|
+
w := &bytes.Buffer{}
|
956
|
+
fmt.Fprintf(w, testHeader)
|
957
|
+
for r, c := range chars {
|
958
|
+
f := c.forms[FCanonical]
|
959
|
+
qc, cf, d := f.quickCheck[MComposed], f.combinesForward, string(f.expandedDecomp)
|
960
|
+
f = c.forms[FCompatibility]
|
961
|
+
qck, cfk, dk := f.quickCheck[MComposed], f.combinesForward, string(f.expandedDecomp)
|
962
|
+
s := ""
|
963
|
+
if d == dk && qc == qck && cf == cfk {
|
964
|
+
s = fmt.Sprintf("f(%s, %v, %q)", qc, cf, d)
|
965
|
+
} else {
|
966
|
+
s = fmt.Sprintf("g(%s, %s, %v, %v, %q, %q)", qc, qck, cf, cfk, d, dk)
|
967
|
+
}
|
968
|
+
current := lastInfo{c.ccc, c.nLeadingNonStarters, c.nTrailingNonStarters, s}
|
969
|
+
if last != current {
|
970
|
+
fmt.Fprintf(w, "\t{0x%x, %d, %d, %d, %s},\n", r, c.origCCC, c.nLeadingNonStarters, c.nTrailingNonStarters, s)
|
971
|
+
last = current
|
972
|
+
}
|
973
|
+
}
|
974
|
+
fmt.Fprintln(w, "}")
|
975
|
+
gen.WriteGoFile("data_test.go", "norm", w.Bytes())
|
976
|
+
}
|