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,1058 @@
|
|
1
|
+
// Copyright 2015 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 bidi
|
6
|
+
|
7
|
+
import "log"
|
8
|
+
|
9
|
+
// This implementation is a port based on the reference implementation found at:
|
10
|
+
// http://www.unicode.org/Public/PROGRAMS/BidiReferenceJava/
|
11
|
+
//
|
12
|
+
// described in Unicode Bidirectional Algorithm (UAX #9).
|
13
|
+
//
|
14
|
+
// Input:
|
15
|
+
// There are two levels of input to the algorithm, since clients may prefer to
|
16
|
+
// supply some information from out-of-band sources rather than relying on the
|
17
|
+
// default behavior.
|
18
|
+
//
|
19
|
+
// - Bidi class array
|
20
|
+
// - Bidi class array, with externally supplied base line direction
|
21
|
+
//
|
22
|
+
// Output:
|
23
|
+
// Output is separated into several stages:
|
24
|
+
//
|
25
|
+
// - levels array over entire paragraph
|
26
|
+
// - reordering array over entire paragraph
|
27
|
+
// - levels array over line
|
28
|
+
// - reordering array over line
|
29
|
+
//
|
30
|
+
// Note that for conformance to the Unicode Bidirectional Algorithm,
|
31
|
+
// implementations are only required to generate correct reordering and
|
32
|
+
// character directionality (odd or even levels) over a line. Generating
|
33
|
+
// identical level arrays over a line is not required. Bidi explicit format
|
34
|
+
// codes (LRE, RLE, LRO, RLO, PDF) and BN can be assigned arbitrary levels and
|
35
|
+
// positions as long as the rest of the input is properly reordered.
|
36
|
+
//
|
37
|
+
// As the algorithm is defined to operate on a single paragraph at a time, this
|
38
|
+
// implementation is written to handle single paragraphs. Thus rule P1 is
|
39
|
+
// presumed by this implementation-- the data provided to the implementation is
|
40
|
+
// assumed to be a single paragraph, and either contains no 'B' codes, or a
|
41
|
+
// single 'B' code at the end of the input. 'B' is allowed as input to
|
42
|
+
// illustrate how the algorithm assigns it a level.
|
43
|
+
//
|
44
|
+
// Also note that rules L3 and L4 depend on the rendering engine that uses the
|
45
|
+
// result of the bidi algorithm. This implementation assumes that the rendering
|
46
|
+
// engine expects combining marks in visual order (e.g. to the left of their
|
47
|
+
// base character in RTL runs) and that it adjusts the glyphs used to render
|
48
|
+
// mirrored characters that are in RTL runs so that they render appropriately.
|
49
|
+
|
50
|
+
// level is the embedding level of a character. Even embedding levels indicate
|
51
|
+
// left-to-right order and odd levels indicate right-to-left order. The special
|
52
|
+
// level of -1 is reserved for undefined order.
|
53
|
+
type level int8
|
54
|
+
|
55
|
+
const implicitLevel level = -1
|
56
|
+
|
57
|
+
// in returns if x is equal to any of the values in set.
|
58
|
+
func (c Class) in(set ...Class) bool {
|
59
|
+
for _, s := range set {
|
60
|
+
if c == s {
|
61
|
+
return true
|
62
|
+
}
|
63
|
+
}
|
64
|
+
return false
|
65
|
+
}
|
66
|
+
|
67
|
+
// A paragraph contains the state of a paragraph.
|
68
|
+
type paragraph struct {
|
69
|
+
initialTypes []Class
|
70
|
+
|
71
|
+
// Arrays of properties needed for paired bracket evaluation in N0
|
72
|
+
pairTypes []bracketType // paired Bracket types for paragraph
|
73
|
+
pairValues []rune // rune for opening bracket or pbOpen and pbClose; 0 for pbNone
|
74
|
+
|
75
|
+
embeddingLevel level // default: = implicitLevel;
|
76
|
+
|
77
|
+
// at the paragraph levels
|
78
|
+
resultTypes []Class
|
79
|
+
resultLevels []level
|
80
|
+
|
81
|
+
// Index of matching PDI for isolate initiator characters. For other
|
82
|
+
// characters, the value of matchingPDI will be set to -1. For isolate
|
83
|
+
// initiators with no matching PDI, matchingPDI will be set to the length of
|
84
|
+
// the input string.
|
85
|
+
matchingPDI []int
|
86
|
+
|
87
|
+
// Index of matching isolate initiator for PDI characters. For other
|
88
|
+
// characters, and for PDIs with no matching isolate initiator, the value of
|
89
|
+
// matchingIsolateInitiator will be set to -1.
|
90
|
+
matchingIsolateInitiator []int
|
91
|
+
}
|
92
|
+
|
93
|
+
// newParagraph initializes a paragraph. The user needs to supply a few arrays
|
94
|
+
// corresponding to the preprocessed text input. The types correspond to the
|
95
|
+
// Unicode BiDi classes for each rune. pairTypes indicates the bracket type for
|
96
|
+
// each rune. pairValues provides a unique bracket class identifier for each
|
97
|
+
// rune (suggested is the rune of the open bracket for opening and matching
|
98
|
+
// close brackets, after normalization). The embedding levels are optional, but
|
99
|
+
// may be supplied to encode embedding levels of styled text.
|
100
|
+
//
|
101
|
+
// TODO: return an error.
|
102
|
+
func newParagraph(types []Class, pairTypes []bracketType, pairValues []rune, levels level) *paragraph {
|
103
|
+
validateTypes(types)
|
104
|
+
validatePbTypes(pairTypes)
|
105
|
+
validatePbValues(pairValues, pairTypes)
|
106
|
+
validateParagraphEmbeddingLevel(levels)
|
107
|
+
|
108
|
+
p := ¶graph{
|
109
|
+
initialTypes: append([]Class(nil), types...),
|
110
|
+
embeddingLevel: levels,
|
111
|
+
|
112
|
+
pairTypes: pairTypes,
|
113
|
+
pairValues: pairValues,
|
114
|
+
|
115
|
+
resultTypes: append([]Class(nil), types...),
|
116
|
+
}
|
117
|
+
p.run()
|
118
|
+
return p
|
119
|
+
}
|
120
|
+
|
121
|
+
func (p *paragraph) Len() int { return len(p.initialTypes) }
|
122
|
+
|
123
|
+
// The algorithm. Does not include line-based processing (Rules L1, L2).
|
124
|
+
// These are applied later in the line-based phase of the algorithm.
|
125
|
+
func (p *paragraph) run() {
|
126
|
+
p.determineMatchingIsolates()
|
127
|
+
|
128
|
+
// 1) determining the paragraph level
|
129
|
+
// Rule P1 is the requirement for entering this algorithm.
|
130
|
+
// Rules P2, P3.
|
131
|
+
// If no externally supplied paragraph embedding level, use default.
|
132
|
+
if p.embeddingLevel == implicitLevel {
|
133
|
+
p.embeddingLevel = p.determineParagraphEmbeddingLevel(0, p.Len())
|
134
|
+
}
|
135
|
+
|
136
|
+
// Initialize result levels to paragraph embedding level.
|
137
|
+
p.resultLevels = make([]level, p.Len())
|
138
|
+
setLevels(p.resultLevels, p.embeddingLevel)
|
139
|
+
|
140
|
+
// 2) Explicit levels and directions
|
141
|
+
// Rules X1-X8.
|
142
|
+
p.determineExplicitEmbeddingLevels()
|
143
|
+
|
144
|
+
// Rule X9.
|
145
|
+
// We do not remove the embeddings, the overrides, the PDFs, and the BNs
|
146
|
+
// from the string explicitly. But they are not copied into isolating run
|
147
|
+
// sequences when they are created, so they are removed for all
|
148
|
+
// practical purposes.
|
149
|
+
|
150
|
+
// Rule X10.
|
151
|
+
// Run remainder of algorithm one isolating run sequence at a time
|
152
|
+
for _, seq := range p.determineIsolatingRunSequences() {
|
153
|
+
// 3) resolving weak types
|
154
|
+
// Rules W1-W7.
|
155
|
+
seq.resolveWeakTypes()
|
156
|
+
|
157
|
+
// 4a) resolving paired brackets
|
158
|
+
// Rule N0
|
159
|
+
resolvePairedBrackets(seq)
|
160
|
+
|
161
|
+
// 4b) resolving neutral types
|
162
|
+
// Rules N1-N3.
|
163
|
+
seq.resolveNeutralTypes()
|
164
|
+
|
165
|
+
// 5) resolving implicit embedding levels
|
166
|
+
// Rules I1, I2.
|
167
|
+
seq.resolveImplicitLevels()
|
168
|
+
|
169
|
+
// Apply the computed levels and types
|
170
|
+
seq.applyLevelsAndTypes()
|
171
|
+
}
|
172
|
+
|
173
|
+
// Assign appropriate levels to 'hide' LREs, RLEs, LROs, RLOs, PDFs, and
|
174
|
+
// BNs. This is for convenience, so the resulting level array will have
|
175
|
+
// a value for every character.
|
176
|
+
p.assignLevelsToCharactersRemovedByX9()
|
177
|
+
}
|
178
|
+
|
179
|
+
// determineMatchingIsolates determines the matching PDI for each isolate
|
180
|
+
// initiator and vice versa.
|
181
|
+
//
|
182
|
+
// Definition BD9.
|
183
|
+
//
|
184
|
+
// At the end of this function:
|
185
|
+
//
|
186
|
+
// - The member variable matchingPDI is set to point to the index of the
|
187
|
+
// matching PDI character for each isolate initiator character. If there is
|
188
|
+
// no matching PDI, it is set to the length of the input text. For other
|
189
|
+
// characters, it is set to -1.
|
190
|
+
// - The member variable matchingIsolateInitiator is set to point to the
|
191
|
+
// index of the matching isolate initiator character for each PDI character.
|
192
|
+
// If there is no matching isolate initiator, or the character is not a PDI,
|
193
|
+
// it is set to -1.
|
194
|
+
func (p *paragraph) determineMatchingIsolates() {
|
195
|
+
p.matchingPDI = make([]int, p.Len())
|
196
|
+
p.matchingIsolateInitiator = make([]int, p.Len())
|
197
|
+
|
198
|
+
for i := range p.matchingIsolateInitiator {
|
199
|
+
p.matchingIsolateInitiator[i] = -1
|
200
|
+
}
|
201
|
+
|
202
|
+
for i := range p.matchingPDI {
|
203
|
+
p.matchingPDI[i] = -1
|
204
|
+
|
205
|
+
if t := p.resultTypes[i]; t.in(LRI, RLI, FSI) {
|
206
|
+
depthCounter := 1
|
207
|
+
for j := i + 1; j < p.Len(); j++ {
|
208
|
+
if u := p.resultTypes[j]; u.in(LRI, RLI, FSI) {
|
209
|
+
depthCounter++
|
210
|
+
} else if u == PDI {
|
211
|
+
if depthCounter--; depthCounter == 0 {
|
212
|
+
p.matchingPDI[i] = j
|
213
|
+
p.matchingIsolateInitiator[j] = i
|
214
|
+
break
|
215
|
+
}
|
216
|
+
}
|
217
|
+
}
|
218
|
+
if p.matchingPDI[i] == -1 {
|
219
|
+
p.matchingPDI[i] = p.Len()
|
220
|
+
}
|
221
|
+
}
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
// determineParagraphEmbeddingLevel reports the resolved paragraph direction of
|
226
|
+
// the substring limited by the given range [start, end).
|
227
|
+
//
|
228
|
+
// Determines the paragraph level based on rules P2, P3. This is also used
|
229
|
+
// in rule X5c to find if an FSI should resolve to LRI or RLI.
|
230
|
+
func (p *paragraph) determineParagraphEmbeddingLevel(start, end int) level {
|
231
|
+
var strongType Class = unknownClass
|
232
|
+
|
233
|
+
// Rule P2.
|
234
|
+
for i := start; i < end; i++ {
|
235
|
+
if t := p.resultTypes[i]; t.in(L, AL, R) {
|
236
|
+
strongType = t
|
237
|
+
break
|
238
|
+
} else if t.in(FSI, LRI, RLI) {
|
239
|
+
i = p.matchingPDI[i] // skip over to the matching PDI
|
240
|
+
if i > end {
|
241
|
+
log.Panic("assert (i <= end)")
|
242
|
+
}
|
243
|
+
}
|
244
|
+
}
|
245
|
+
// Rule P3.
|
246
|
+
switch strongType {
|
247
|
+
case unknownClass: // none found
|
248
|
+
// default embedding level when no strong types found is 0.
|
249
|
+
return 0
|
250
|
+
case L:
|
251
|
+
return 0
|
252
|
+
default: // AL, R
|
253
|
+
return 1
|
254
|
+
}
|
255
|
+
}
|
256
|
+
|
257
|
+
const maxDepth = 125
|
258
|
+
|
259
|
+
// This stack will store the embedding levels and override and isolated
|
260
|
+
// statuses
|
261
|
+
type directionalStatusStack struct {
|
262
|
+
stackCounter int
|
263
|
+
embeddingLevelStack [maxDepth + 1]level
|
264
|
+
overrideStatusStack [maxDepth + 1]Class
|
265
|
+
isolateStatusStack [maxDepth + 1]bool
|
266
|
+
}
|
267
|
+
|
268
|
+
func (s *directionalStatusStack) empty() { s.stackCounter = 0 }
|
269
|
+
func (s *directionalStatusStack) pop() { s.stackCounter-- }
|
270
|
+
func (s *directionalStatusStack) depth() int { return s.stackCounter }
|
271
|
+
|
272
|
+
func (s *directionalStatusStack) push(level level, overrideStatus Class, isolateStatus bool) {
|
273
|
+
s.embeddingLevelStack[s.stackCounter] = level
|
274
|
+
s.overrideStatusStack[s.stackCounter] = overrideStatus
|
275
|
+
s.isolateStatusStack[s.stackCounter] = isolateStatus
|
276
|
+
s.stackCounter++
|
277
|
+
}
|
278
|
+
|
279
|
+
func (s *directionalStatusStack) lastEmbeddingLevel() level {
|
280
|
+
return s.embeddingLevelStack[s.stackCounter-1]
|
281
|
+
}
|
282
|
+
|
283
|
+
func (s *directionalStatusStack) lastDirectionalOverrideStatus() Class {
|
284
|
+
return s.overrideStatusStack[s.stackCounter-1]
|
285
|
+
}
|
286
|
+
|
287
|
+
func (s *directionalStatusStack) lastDirectionalIsolateStatus() bool {
|
288
|
+
return s.isolateStatusStack[s.stackCounter-1]
|
289
|
+
}
|
290
|
+
|
291
|
+
// Determine explicit levels using rules X1 - X8
|
292
|
+
func (p *paragraph) determineExplicitEmbeddingLevels() {
|
293
|
+
var stack directionalStatusStack
|
294
|
+
var overflowIsolateCount, overflowEmbeddingCount, validIsolateCount int
|
295
|
+
|
296
|
+
// Rule X1.
|
297
|
+
stack.push(p.embeddingLevel, ON, false)
|
298
|
+
|
299
|
+
for i, t := range p.resultTypes {
|
300
|
+
// Rules X2, X3, X4, X5, X5a, X5b, X5c
|
301
|
+
switch t {
|
302
|
+
case RLE, LRE, RLO, LRO, RLI, LRI, FSI:
|
303
|
+
isIsolate := t.in(RLI, LRI, FSI)
|
304
|
+
isRTL := t.in(RLE, RLO, RLI)
|
305
|
+
|
306
|
+
// override if this is an FSI that resolves to RLI
|
307
|
+
if t == FSI {
|
308
|
+
isRTL = (p.determineParagraphEmbeddingLevel(i+1, p.matchingPDI[i]) == 1)
|
309
|
+
}
|
310
|
+
if isIsolate {
|
311
|
+
p.resultLevels[i] = stack.lastEmbeddingLevel()
|
312
|
+
if stack.lastDirectionalOverrideStatus() != ON {
|
313
|
+
p.resultTypes[i] = stack.lastDirectionalOverrideStatus()
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
var newLevel level
|
318
|
+
if isRTL {
|
319
|
+
// least greater odd
|
320
|
+
newLevel = (stack.lastEmbeddingLevel() + 1) | 1
|
321
|
+
} else {
|
322
|
+
// least greater even
|
323
|
+
newLevel = (stack.lastEmbeddingLevel() + 2) &^ 1
|
324
|
+
}
|
325
|
+
|
326
|
+
if newLevel <= maxDepth && overflowIsolateCount == 0 && overflowEmbeddingCount == 0 {
|
327
|
+
if isIsolate {
|
328
|
+
validIsolateCount++
|
329
|
+
}
|
330
|
+
// Push new embedding level, override status, and isolated
|
331
|
+
// status.
|
332
|
+
// No check for valid stack counter, since the level check
|
333
|
+
// suffices.
|
334
|
+
switch t {
|
335
|
+
case LRO:
|
336
|
+
stack.push(newLevel, L, isIsolate)
|
337
|
+
case RLO:
|
338
|
+
stack.push(newLevel, R, isIsolate)
|
339
|
+
default:
|
340
|
+
stack.push(newLevel, ON, isIsolate)
|
341
|
+
}
|
342
|
+
// Not really part of the spec
|
343
|
+
if !isIsolate {
|
344
|
+
p.resultLevels[i] = newLevel
|
345
|
+
}
|
346
|
+
} else {
|
347
|
+
// This is an invalid explicit formatting character,
|
348
|
+
// so apply the "Otherwise" part of rules X2-X5b.
|
349
|
+
if isIsolate {
|
350
|
+
overflowIsolateCount++
|
351
|
+
} else { // !isIsolate
|
352
|
+
if overflowIsolateCount == 0 {
|
353
|
+
overflowEmbeddingCount++
|
354
|
+
}
|
355
|
+
}
|
356
|
+
}
|
357
|
+
|
358
|
+
// Rule X6a
|
359
|
+
case PDI:
|
360
|
+
if overflowIsolateCount > 0 {
|
361
|
+
overflowIsolateCount--
|
362
|
+
} else if validIsolateCount == 0 {
|
363
|
+
// do nothing
|
364
|
+
} else {
|
365
|
+
overflowEmbeddingCount = 0
|
366
|
+
for !stack.lastDirectionalIsolateStatus() {
|
367
|
+
stack.pop()
|
368
|
+
}
|
369
|
+
stack.pop()
|
370
|
+
validIsolateCount--
|
371
|
+
}
|
372
|
+
p.resultLevels[i] = stack.lastEmbeddingLevel()
|
373
|
+
|
374
|
+
// Rule X7
|
375
|
+
case PDF:
|
376
|
+
// Not really part of the spec
|
377
|
+
p.resultLevels[i] = stack.lastEmbeddingLevel()
|
378
|
+
|
379
|
+
if overflowIsolateCount > 0 {
|
380
|
+
// do nothing
|
381
|
+
} else if overflowEmbeddingCount > 0 {
|
382
|
+
overflowEmbeddingCount--
|
383
|
+
} else if !stack.lastDirectionalIsolateStatus() && stack.depth() >= 2 {
|
384
|
+
stack.pop()
|
385
|
+
}
|
386
|
+
|
387
|
+
case B: // paragraph separator.
|
388
|
+
// Rule X8.
|
389
|
+
|
390
|
+
// These values are reset for clarity, in this implementation B
|
391
|
+
// can only occur as the last code in the array.
|
392
|
+
stack.empty()
|
393
|
+
overflowIsolateCount = 0
|
394
|
+
overflowEmbeddingCount = 0
|
395
|
+
validIsolateCount = 0
|
396
|
+
p.resultLevels[i] = p.embeddingLevel
|
397
|
+
|
398
|
+
default:
|
399
|
+
p.resultLevels[i] = stack.lastEmbeddingLevel()
|
400
|
+
if stack.lastDirectionalOverrideStatus() != ON {
|
401
|
+
p.resultTypes[i] = stack.lastDirectionalOverrideStatus()
|
402
|
+
}
|
403
|
+
}
|
404
|
+
}
|
405
|
+
}
|
406
|
+
|
407
|
+
type isolatingRunSequence struct {
|
408
|
+
p *paragraph
|
409
|
+
|
410
|
+
indexes []int // indexes to the original string
|
411
|
+
|
412
|
+
types []Class // type of each character using the index
|
413
|
+
resolvedLevels []level // resolved levels after application of rules
|
414
|
+
level level
|
415
|
+
sos, eos Class
|
416
|
+
}
|
417
|
+
|
418
|
+
func (i *isolatingRunSequence) Len() int { return len(i.indexes) }
|
419
|
+
|
420
|
+
func maxLevel(a, b level) level {
|
421
|
+
if a > b {
|
422
|
+
return a
|
423
|
+
}
|
424
|
+
return b
|
425
|
+
}
|
426
|
+
|
427
|
+
// Rule X10, second bullet: Determine the start-of-sequence (sos) and end-of-sequence (eos) types,
|
428
|
+
// either L or R, for each isolating run sequence.
|
429
|
+
func (p *paragraph) isolatingRunSequence(indexes []int) *isolatingRunSequence {
|
430
|
+
length := len(indexes)
|
431
|
+
types := make([]Class, length)
|
432
|
+
for i, x := range indexes {
|
433
|
+
types[i] = p.resultTypes[x]
|
434
|
+
}
|
435
|
+
|
436
|
+
// assign level, sos and eos
|
437
|
+
prevChar := indexes[0] - 1
|
438
|
+
for prevChar >= 0 && isRemovedByX9(p.initialTypes[prevChar]) {
|
439
|
+
prevChar--
|
440
|
+
}
|
441
|
+
prevLevel := p.embeddingLevel
|
442
|
+
if prevChar >= 0 {
|
443
|
+
prevLevel = p.resultLevels[prevChar]
|
444
|
+
}
|
445
|
+
|
446
|
+
var succLevel level
|
447
|
+
lastType := types[length-1]
|
448
|
+
if lastType.in(LRI, RLI, FSI) {
|
449
|
+
succLevel = p.embeddingLevel
|
450
|
+
} else {
|
451
|
+
// the first character after the end of run sequence
|
452
|
+
limit := indexes[length-1] + 1
|
453
|
+
for ; limit < p.Len() && isRemovedByX9(p.initialTypes[limit]); limit++ {
|
454
|
+
|
455
|
+
}
|
456
|
+
succLevel = p.embeddingLevel
|
457
|
+
if limit < p.Len() {
|
458
|
+
succLevel = p.resultLevels[limit]
|
459
|
+
}
|
460
|
+
}
|
461
|
+
level := p.resultLevels[indexes[0]]
|
462
|
+
return &isolatingRunSequence{
|
463
|
+
p: p,
|
464
|
+
indexes: indexes,
|
465
|
+
types: types,
|
466
|
+
level: level,
|
467
|
+
sos: typeForLevel(maxLevel(prevLevel, level)),
|
468
|
+
eos: typeForLevel(maxLevel(succLevel, level)),
|
469
|
+
}
|
470
|
+
}
|
471
|
+
|
472
|
+
// Resolving weak types Rules W1-W7.
|
473
|
+
//
|
474
|
+
// Note that some weak types (EN, AN) remain after this processing is
|
475
|
+
// complete.
|
476
|
+
func (s *isolatingRunSequence) resolveWeakTypes() {
|
477
|
+
|
478
|
+
// on entry, only these types remain
|
479
|
+
s.assertOnly(L, R, AL, EN, ES, ET, AN, CS, B, S, WS, ON, NSM, LRI, RLI, FSI, PDI)
|
480
|
+
|
481
|
+
// Rule W1.
|
482
|
+
// Changes all NSMs.
|
483
|
+
preceedingCharacterType := s.sos
|
484
|
+
for i, t := range s.types {
|
485
|
+
if t == NSM {
|
486
|
+
s.types[i] = preceedingCharacterType
|
487
|
+
} else {
|
488
|
+
if t.in(LRI, RLI, FSI, PDI) {
|
489
|
+
preceedingCharacterType = ON
|
490
|
+
}
|
491
|
+
preceedingCharacterType = t
|
492
|
+
}
|
493
|
+
}
|
494
|
+
|
495
|
+
// Rule W2.
|
496
|
+
// EN does not change at the start of the run, because sos != AL.
|
497
|
+
for i, t := range s.types {
|
498
|
+
if t == EN {
|
499
|
+
for j := i - 1; j >= 0; j-- {
|
500
|
+
if t := s.types[j]; t.in(L, R, AL) {
|
501
|
+
if t == AL {
|
502
|
+
s.types[i] = AN
|
503
|
+
}
|
504
|
+
break
|
505
|
+
}
|
506
|
+
}
|
507
|
+
}
|
508
|
+
}
|
509
|
+
|
510
|
+
// Rule W3.
|
511
|
+
for i, t := range s.types {
|
512
|
+
if t == AL {
|
513
|
+
s.types[i] = R
|
514
|
+
}
|
515
|
+
}
|
516
|
+
|
517
|
+
// Rule W4.
|
518
|
+
// Since there must be values on both sides for this rule to have an
|
519
|
+
// effect, the scan skips the first and last value.
|
520
|
+
//
|
521
|
+
// Although the scan proceeds left to right, and changes the type
|
522
|
+
// values in a way that would appear to affect the computations
|
523
|
+
// later in the scan, there is actually no problem. A change in the
|
524
|
+
// current value can only affect the value to its immediate right,
|
525
|
+
// and only affect it if it is ES or CS. But the current value can
|
526
|
+
// only change if the value to its right is not ES or CS. Thus
|
527
|
+
// either the current value will not change, or its change will have
|
528
|
+
// no effect on the remainder of the analysis.
|
529
|
+
|
530
|
+
for i := 1; i < s.Len()-1; i++ {
|
531
|
+
t := s.types[i]
|
532
|
+
if t == ES || t == CS {
|
533
|
+
prevSepType := s.types[i-1]
|
534
|
+
succSepType := s.types[i+1]
|
535
|
+
if prevSepType == EN && succSepType == EN {
|
536
|
+
s.types[i] = EN
|
537
|
+
} else if s.types[i] == CS && prevSepType == AN && succSepType == AN {
|
538
|
+
s.types[i] = AN
|
539
|
+
}
|
540
|
+
}
|
541
|
+
}
|
542
|
+
|
543
|
+
// Rule W5.
|
544
|
+
for i, t := range s.types {
|
545
|
+
if t == ET {
|
546
|
+
// locate end of sequence
|
547
|
+
runStart := i
|
548
|
+
runEnd := s.findRunLimit(runStart, ET)
|
549
|
+
|
550
|
+
// check values at ends of sequence
|
551
|
+
t := s.sos
|
552
|
+
if runStart > 0 {
|
553
|
+
t = s.types[runStart-1]
|
554
|
+
}
|
555
|
+
if t != EN {
|
556
|
+
t = s.eos
|
557
|
+
if runEnd < len(s.types) {
|
558
|
+
t = s.types[runEnd]
|
559
|
+
}
|
560
|
+
}
|
561
|
+
if t == EN {
|
562
|
+
setTypes(s.types[runStart:runEnd], EN)
|
563
|
+
}
|
564
|
+
// continue at end of sequence
|
565
|
+
i = runEnd
|
566
|
+
}
|
567
|
+
}
|
568
|
+
|
569
|
+
// Rule W6.
|
570
|
+
for i, t := range s.types {
|
571
|
+
if t.in(ES, ET, CS) {
|
572
|
+
s.types[i] = ON
|
573
|
+
}
|
574
|
+
}
|
575
|
+
|
576
|
+
// Rule W7.
|
577
|
+
for i, t := range s.types {
|
578
|
+
if t == EN {
|
579
|
+
// set default if we reach start of run
|
580
|
+
prevStrongType := s.sos
|
581
|
+
for j := i - 1; j >= 0; j-- {
|
582
|
+
t = s.types[j]
|
583
|
+
if t == L || t == R { // AL's have been changed to R
|
584
|
+
prevStrongType = t
|
585
|
+
break
|
586
|
+
}
|
587
|
+
}
|
588
|
+
if prevStrongType == L {
|
589
|
+
s.types[i] = L
|
590
|
+
}
|
591
|
+
}
|
592
|
+
}
|
593
|
+
}
|
594
|
+
|
595
|
+
// 6) resolving neutral types Rules N1-N2.
|
596
|
+
func (s *isolatingRunSequence) resolveNeutralTypes() {
|
597
|
+
|
598
|
+
// on entry, only these types can be in resultTypes
|
599
|
+
s.assertOnly(L, R, EN, AN, B, S, WS, ON, RLI, LRI, FSI, PDI)
|
600
|
+
|
601
|
+
for i, t := range s.types {
|
602
|
+
switch t {
|
603
|
+
case WS, ON, B, S, RLI, LRI, FSI, PDI:
|
604
|
+
// find bounds of run of neutrals
|
605
|
+
runStart := i
|
606
|
+
runEnd := s.findRunLimit(runStart, B, S, WS, ON, RLI, LRI, FSI, PDI)
|
607
|
+
|
608
|
+
// determine effective types at ends of run
|
609
|
+
var leadType, trailType Class
|
610
|
+
|
611
|
+
// Note that the character found can only be L, R, AN, or
|
612
|
+
// EN.
|
613
|
+
if runStart == 0 {
|
614
|
+
leadType = s.sos
|
615
|
+
} else {
|
616
|
+
leadType = s.types[runStart-1]
|
617
|
+
if leadType.in(AN, EN) {
|
618
|
+
leadType = R
|
619
|
+
}
|
620
|
+
}
|
621
|
+
if runEnd == len(s.types) {
|
622
|
+
trailType = s.eos
|
623
|
+
} else {
|
624
|
+
trailType = s.types[runEnd]
|
625
|
+
if trailType.in(AN, EN) {
|
626
|
+
trailType = R
|
627
|
+
}
|
628
|
+
}
|
629
|
+
|
630
|
+
var resolvedType Class
|
631
|
+
if leadType == trailType {
|
632
|
+
// Rule N1.
|
633
|
+
resolvedType = leadType
|
634
|
+
} else {
|
635
|
+
// Rule N2.
|
636
|
+
// Notice the embedding level of the run is used, not
|
637
|
+
// the paragraph embedding level.
|
638
|
+
resolvedType = typeForLevel(s.level)
|
639
|
+
}
|
640
|
+
|
641
|
+
setTypes(s.types[runStart:runEnd], resolvedType)
|
642
|
+
|
643
|
+
// skip over run of (former) neutrals
|
644
|
+
i = runEnd
|
645
|
+
}
|
646
|
+
}
|
647
|
+
}
|
648
|
+
|
649
|
+
func setLevels(levels []level, newLevel level) {
|
650
|
+
for i := range levels {
|
651
|
+
levels[i] = newLevel
|
652
|
+
}
|
653
|
+
}
|
654
|
+
|
655
|
+
func setTypes(types []Class, newType Class) {
|
656
|
+
for i := range types {
|
657
|
+
types[i] = newType
|
658
|
+
}
|
659
|
+
}
|
660
|
+
|
661
|
+
// 7) resolving implicit embedding levels Rules I1, I2.
|
662
|
+
func (s *isolatingRunSequence) resolveImplicitLevels() {
|
663
|
+
|
664
|
+
// on entry, only these types can be in resultTypes
|
665
|
+
s.assertOnly(L, R, EN, AN)
|
666
|
+
|
667
|
+
s.resolvedLevels = make([]level, len(s.types))
|
668
|
+
setLevels(s.resolvedLevels, s.level)
|
669
|
+
|
670
|
+
if (s.level & 1) == 0 { // even level
|
671
|
+
for i, t := range s.types {
|
672
|
+
// Rule I1.
|
673
|
+
if t == L {
|
674
|
+
// no change
|
675
|
+
} else if t == R {
|
676
|
+
s.resolvedLevels[i] += 1
|
677
|
+
} else { // t == AN || t == EN
|
678
|
+
s.resolvedLevels[i] += 2
|
679
|
+
}
|
680
|
+
}
|
681
|
+
} else { // odd level
|
682
|
+
for i, t := range s.types {
|
683
|
+
// Rule I2.
|
684
|
+
if t == R {
|
685
|
+
// no change
|
686
|
+
} else { // t == L || t == AN || t == EN
|
687
|
+
s.resolvedLevels[i] += 1
|
688
|
+
}
|
689
|
+
}
|
690
|
+
}
|
691
|
+
}
|
692
|
+
|
693
|
+
// Applies the levels and types resolved in rules W1-I2 to the
|
694
|
+
// resultLevels array.
|
695
|
+
func (s *isolatingRunSequence) applyLevelsAndTypes() {
|
696
|
+
for i, x := range s.indexes {
|
697
|
+
s.p.resultTypes[x] = s.types[i]
|
698
|
+
s.p.resultLevels[x] = s.resolvedLevels[i]
|
699
|
+
}
|
700
|
+
}
|
701
|
+
|
702
|
+
// Return the limit of the run consisting only of the types in validSet
|
703
|
+
// starting at index. This checks the value at index, and will return
|
704
|
+
// index if that value is not in validSet.
|
705
|
+
func (s *isolatingRunSequence) findRunLimit(index int, validSet ...Class) int {
|
706
|
+
loop:
|
707
|
+
for ; index < len(s.types); index++ {
|
708
|
+
t := s.types[index]
|
709
|
+
for _, valid := range validSet {
|
710
|
+
if t == valid {
|
711
|
+
continue loop
|
712
|
+
}
|
713
|
+
}
|
714
|
+
return index // didn't find a match in validSet
|
715
|
+
}
|
716
|
+
return len(s.types)
|
717
|
+
}
|
718
|
+
|
719
|
+
// Algorithm validation. Assert that all values in types are in the
|
720
|
+
// provided set.
|
721
|
+
func (s *isolatingRunSequence) assertOnly(codes ...Class) {
|
722
|
+
loop:
|
723
|
+
for i, t := range s.types {
|
724
|
+
for _, c := range codes {
|
725
|
+
if t == c {
|
726
|
+
continue loop
|
727
|
+
}
|
728
|
+
}
|
729
|
+
log.Panicf("invalid bidi code %v present in assertOnly at position %d", t, s.indexes[i])
|
730
|
+
}
|
731
|
+
}
|
732
|
+
|
733
|
+
// determineLevelRuns returns an array of level runs. Each level run is
|
734
|
+
// described as an array of indexes into the input string.
|
735
|
+
//
|
736
|
+
// Determines the level runs. Rule X9 will be applied in determining the
|
737
|
+
// runs, in the way that makes sure the characters that are supposed to be
|
738
|
+
// removed are not included in the runs.
|
739
|
+
func (p *paragraph) determineLevelRuns() [][]int {
|
740
|
+
run := []int{}
|
741
|
+
allRuns := [][]int{}
|
742
|
+
currentLevel := implicitLevel
|
743
|
+
|
744
|
+
for i := range p.initialTypes {
|
745
|
+
if !isRemovedByX9(p.initialTypes[i]) {
|
746
|
+
if p.resultLevels[i] != currentLevel {
|
747
|
+
// we just encountered a new run; wrap up last run
|
748
|
+
if currentLevel >= 0 { // only wrap it up if there was a run
|
749
|
+
allRuns = append(allRuns, run)
|
750
|
+
run = nil
|
751
|
+
}
|
752
|
+
// Start new run
|
753
|
+
currentLevel = p.resultLevels[i]
|
754
|
+
}
|
755
|
+
run = append(run, i)
|
756
|
+
}
|
757
|
+
}
|
758
|
+
// Wrap up the final run, if any
|
759
|
+
if len(run) > 0 {
|
760
|
+
allRuns = append(allRuns, run)
|
761
|
+
}
|
762
|
+
return allRuns
|
763
|
+
}
|
764
|
+
|
765
|
+
// Definition BD13. Determine isolating run sequences.
|
766
|
+
func (p *paragraph) determineIsolatingRunSequences() []*isolatingRunSequence {
|
767
|
+
levelRuns := p.determineLevelRuns()
|
768
|
+
|
769
|
+
// Compute the run that each character belongs to
|
770
|
+
runForCharacter := make([]int, p.Len())
|
771
|
+
for i, run := range levelRuns {
|
772
|
+
for _, index := range run {
|
773
|
+
runForCharacter[index] = i
|
774
|
+
}
|
775
|
+
}
|
776
|
+
|
777
|
+
sequences := []*isolatingRunSequence{}
|
778
|
+
|
779
|
+
var currentRunSequence []int
|
780
|
+
|
781
|
+
for _, run := range levelRuns {
|
782
|
+
first := run[0]
|
783
|
+
if p.initialTypes[first] != PDI || p.matchingIsolateInitiator[first] == -1 {
|
784
|
+
currentRunSequence = nil
|
785
|
+
// int run = i;
|
786
|
+
for {
|
787
|
+
// Copy this level run into currentRunSequence
|
788
|
+
currentRunSequence = append(currentRunSequence, run...)
|
789
|
+
|
790
|
+
last := currentRunSequence[len(currentRunSequence)-1]
|
791
|
+
lastT := p.initialTypes[last]
|
792
|
+
if lastT.in(LRI, RLI, FSI) && p.matchingPDI[last] != p.Len() {
|
793
|
+
run = levelRuns[runForCharacter[p.matchingPDI[last]]]
|
794
|
+
} else {
|
795
|
+
break
|
796
|
+
}
|
797
|
+
}
|
798
|
+
sequences = append(sequences, p.isolatingRunSequence(currentRunSequence))
|
799
|
+
}
|
800
|
+
}
|
801
|
+
return sequences
|
802
|
+
}
|
803
|
+
|
804
|
+
// Assign level information to characters removed by rule X9. This is for
|
805
|
+
// ease of relating the level information to the original input data. Note
|
806
|
+
// that the levels assigned to these codes are arbitrary, they're chosen so
|
807
|
+
// as to avoid breaking level runs.
|
808
|
+
func (p *paragraph) assignLevelsToCharactersRemovedByX9() {
|
809
|
+
for i, t := range p.initialTypes {
|
810
|
+
if t.in(LRE, RLE, LRO, RLO, PDF, BN) {
|
811
|
+
p.resultTypes[i] = t
|
812
|
+
p.resultLevels[i] = -1
|
813
|
+
}
|
814
|
+
}
|
815
|
+
// now propagate forward the levels information (could have
|
816
|
+
// propagated backward, the main thing is not to introduce a level
|
817
|
+
// break where one doesn't already exist).
|
818
|
+
|
819
|
+
if p.resultLevels[0] == -1 {
|
820
|
+
p.resultLevels[0] = p.embeddingLevel
|
821
|
+
}
|
822
|
+
for i := 1; i < len(p.initialTypes); i++ {
|
823
|
+
if p.resultLevels[i] == -1 {
|
824
|
+
p.resultLevels[i] = p.resultLevels[i-1]
|
825
|
+
}
|
826
|
+
}
|
827
|
+
// Embedding information is for informational purposes only so need not be
|
828
|
+
// adjusted.
|
829
|
+
}
|
830
|
+
|
831
|
+
//
|
832
|
+
// Output
|
833
|
+
//
|
834
|
+
|
835
|
+
// getLevels computes levels array breaking lines at offsets in linebreaks.
|
836
|
+
// Rule L1.
|
837
|
+
//
|
838
|
+
// The linebreaks array must include at least one value. The values must be
|
839
|
+
// in strictly increasing order (no duplicates) between 1 and the length of
|
840
|
+
// the text, inclusive. The last value must be the length of the text.
|
841
|
+
func (p *paragraph) getLevels(linebreaks []int) []level {
|
842
|
+
// Note that since the previous processing has removed all
|
843
|
+
// P, S, and WS values from resultTypes, the values referred to
|
844
|
+
// in these rules are the initial types, before any processing
|
845
|
+
// has been applied (including processing of overrides).
|
846
|
+
//
|
847
|
+
// This example implementation has reinserted explicit format codes
|
848
|
+
// and BN, in order that the levels array correspond to the
|
849
|
+
// initial text. Their final placement is not normative.
|
850
|
+
// These codes are treated like WS in this implementation,
|
851
|
+
// so they don't interrupt sequences of WS.
|
852
|
+
|
853
|
+
validateLineBreaks(linebreaks, p.Len())
|
854
|
+
|
855
|
+
result := append([]level(nil), p.resultLevels...)
|
856
|
+
|
857
|
+
// don't worry about linebreaks since if there is a break within
|
858
|
+
// a series of WS values preceding S, the linebreak itself
|
859
|
+
// causes the reset.
|
860
|
+
for i, t := range p.initialTypes {
|
861
|
+
if t.in(B, S) {
|
862
|
+
// Rule L1, clauses one and two.
|
863
|
+
result[i] = p.embeddingLevel
|
864
|
+
|
865
|
+
// Rule L1, clause three.
|
866
|
+
for j := i - 1; j >= 0; j-- {
|
867
|
+
if isWhitespace(p.initialTypes[j]) { // including format codes
|
868
|
+
result[j] = p.embeddingLevel
|
869
|
+
} else {
|
870
|
+
break
|
871
|
+
}
|
872
|
+
}
|
873
|
+
}
|
874
|
+
}
|
875
|
+
|
876
|
+
// Rule L1, clause four.
|
877
|
+
start := 0
|
878
|
+
for _, limit := range linebreaks {
|
879
|
+
for j := limit - 1; j >= start; j-- {
|
880
|
+
if isWhitespace(p.initialTypes[j]) { // including format codes
|
881
|
+
result[j] = p.embeddingLevel
|
882
|
+
} else {
|
883
|
+
break
|
884
|
+
}
|
885
|
+
}
|
886
|
+
start = limit
|
887
|
+
}
|
888
|
+
|
889
|
+
return result
|
890
|
+
}
|
891
|
+
|
892
|
+
// getReordering returns the reordering of lines from a visual index to a
|
893
|
+
// logical index for line breaks at the given offsets.
|
894
|
+
//
|
895
|
+
// Lines are concatenated from left to right. So for example, the fifth
|
896
|
+
// character from the left on the third line is
|
897
|
+
//
|
898
|
+
// getReordering(linebreaks)[linebreaks[1] + 4]
|
899
|
+
//
|
900
|
+
// (linebreaks[1] is the position after the last character of the second
|
901
|
+
// line, which is also the index of the first character on the third line,
|
902
|
+
// and adding four gets the fifth character from the left).
|
903
|
+
//
|
904
|
+
// The linebreaks array must include at least one value. The values must be
|
905
|
+
// in strictly increasing order (no duplicates) between 1 and the length of
|
906
|
+
// the text, inclusive. The last value must be the length of the text.
|
907
|
+
func (p *paragraph) getReordering(linebreaks []int) []int {
|
908
|
+
validateLineBreaks(linebreaks, p.Len())
|
909
|
+
|
910
|
+
return computeMultilineReordering(p.getLevels(linebreaks), linebreaks)
|
911
|
+
}
|
912
|
+
|
913
|
+
// Return multiline reordering array for a given level array. Reordering
|
914
|
+
// does not occur across a line break.
|
915
|
+
func computeMultilineReordering(levels []level, linebreaks []int) []int {
|
916
|
+
result := make([]int, len(levels))
|
917
|
+
|
918
|
+
start := 0
|
919
|
+
for _, limit := range linebreaks {
|
920
|
+
tempLevels := make([]level, limit-start)
|
921
|
+
copy(tempLevels, levels[start:])
|
922
|
+
|
923
|
+
for j, order := range computeReordering(tempLevels) {
|
924
|
+
result[start+j] = order + start
|
925
|
+
}
|
926
|
+
start = limit
|
927
|
+
}
|
928
|
+
return result
|
929
|
+
}
|
930
|
+
|
931
|
+
// Return reordering array for a given level array. This reorders a single
|
932
|
+
// line. The reordering is a visual to logical map. For example, the
|
933
|
+
// leftmost char is string.charAt(order[0]). Rule L2.
|
934
|
+
func computeReordering(levels []level) []int {
|
935
|
+
result := make([]int, len(levels))
|
936
|
+
// initialize order
|
937
|
+
for i := range result {
|
938
|
+
result[i] = i
|
939
|
+
}
|
940
|
+
|
941
|
+
// locate highest level found on line.
|
942
|
+
// Note the rules say text, but no reordering across line bounds is
|
943
|
+
// performed, so this is sufficient.
|
944
|
+
highestLevel := level(0)
|
945
|
+
lowestOddLevel := level(maxDepth + 2)
|
946
|
+
for _, level := range levels {
|
947
|
+
if level > highestLevel {
|
948
|
+
highestLevel = level
|
949
|
+
}
|
950
|
+
if level&1 != 0 && level < lowestOddLevel {
|
951
|
+
lowestOddLevel = level
|
952
|
+
}
|
953
|
+
}
|
954
|
+
|
955
|
+
for level := highestLevel; level >= lowestOddLevel; level-- {
|
956
|
+
for i := 0; i < len(levels); i++ {
|
957
|
+
if levels[i] >= level {
|
958
|
+
// find range of text at or above this level
|
959
|
+
start := i
|
960
|
+
limit := i + 1
|
961
|
+
for limit < len(levels) && levels[limit] >= level {
|
962
|
+
limit++
|
963
|
+
}
|
964
|
+
|
965
|
+
for j, k := start, limit-1; j < k; j, k = j+1, k-1 {
|
966
|
+
result[j], result[k] = result[k], result[j]
|
967
|
+
}
|
968
|
+
// skip to end of level run
|
969
|
+
i = limit
|
970
|
+
}
|
971
|
+
}
|
972
|
+
}
|
973
|
+
|
974
|
+
return result
|
975
|
+
}
|
976
|
+
|
977
|
+
// isWhitespace reports whether the type is considered a whitespace type for the
|
978
|
+
// line break rules.
|
979
|
+
func isWhitespace(c Class) bool {
|
980
|
+
switch c {
|
981
|
+
case LRE, RLE, LRO, RLO, PDF, LRI, RLI, FSI, PDI, BN, WS:
|
982
|
+
return true
|
983
|
+
}
|
984
|
+
return false
|
985
|
+
}
|
986
|
+
|
987
|
+
// isRemovedByX9 reports whether the type is one of the types removed in X9.
|
988
|
+
func isRemovedByX9(c Class) bool {
|
989
|
+
switch c {
|
990
|
+
case LRE, RLE, LRO, RLO, PDF, BN:
|
991
|
+
return true
|
992
|
+
}
|
993
|
+
return false
|
994
|
+
}
|
995
|
+
|
996
|
+
// typeForLevel reports the strong type (L or R) corresponding to the level.
|
997
|
+
func typeForLevel(level level) Class {
|
998
|
+
if (level & 0x1) == 0 {
|
999
|
+
return L
|
1000
|
+
}
|
1001
|
+
return R
|
1002
|
+
}
|
1003
|
+
|
1004
|
+
// TODO: change validation to not panic
|
1005
|
+
|
1006
|
+
func validateTypes(types []Class) {
|
1007
|
+
if len(types) == 0 {
|
1008
|
+
log.Panic("types is null")
|
1009
|
+
}
|
1010
|
+
for i, t := range types[:len(types)-1] {
|
1011
|
+
if t == B {
|
1012
|
+
log.Panicf("B type before end of paragraph at index: %d", i)
|
1013
|
+
}
|
1014
|
+
}
|
1015
|
+
}
|
1016
|
+
|
1017
|
+
func validateParagraphEmbeddingLevel(embeddingLevel level) {
|
1018
|
+
if embeddingLevel != implicitLevel &&
|
1019
|
+
embeddingLevel != 0 &&
|
1020
|
+
embeddingLevel != 1 {
|
1021
|
+
log.Panicf("illegal paragraph embedding level: %d", embeddingLevel)
|
1022
|
+
}
|
1023
|
+
}
|
1024
|
+
|
1025
|
+
func validateLineBreaks(linebreaks []int, textLength int) {
|
1026
|
+
prev := 0
|
1027
|
+
for i, next := range linebreaks {
|
1028
|
+
if next <= prev {
|
1029
|
+
log.Panicf("bad linebreak: %d at index: %d", next, i)
|
1030
|
+
}
|
1031
|
+
prev = next
|
1032
|
+
}
|
1033
|
+
if prev != textLength {
|
1034
|
+
log.Panicf("last linebreak was %d, want %d", prev, textLength)
|
1035
|
+
}
|
1036
|
+
}
|
1037
|
+
|
1038
|
+
func validatePbTypes(pairTypes []bracketType) {
|
1039
|
+
if len(pairTypes) == 0 {
|
1040
|
+
log.Panic("pairTypes is null")
|
1041
|
+
}
|
1042
|
+
for i, pt := range pairTypes {
|
1043
|
+
switch pt {
|
1044
|
+
case bpNone, bpOpen, bpClose:
|
1045
|
+
default:
|
1046
|
+
log.Panicf("illegal pairType value at %d: %v", i, pairTypes[i])
|
1047
|
+
}
|
1048
|
+
}
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
func validatePbValues(pairValues []rune, pairTypes []bracketType) {
|
1052
|
+
if pairValues == nil {
|
1053
|
+
log.Panic("pairValues is null")
|
1054
|
+
}
|
1055
|
+
if len(pairTypes) != len(pairValues) {
|
1056
|
+
log.Panic("pairTypes is different length from pairValues")
|
1057
|
+
}
|
1058
|
+
}
|