module Minjs module Ctype def hex_number?(code) code >= 0x30 && code <= 0x39 or code >= 0x41 && code <= 0x46 or code >= 0x61 && code <= 0x66 end def white_space?(code) code == 0x20 || code == 0x9 || code == 0xb || code == 0xc || code == 0xa0 || code == 0xfeff end def line_terminator?(code) code == 0x0a || code == 0x0d || code == 0x2028 || code == 0x2029 end def identifier_start?(c) return false if c.nil? # almost all characters are ascii if c == 0x24 || c == 0x5f || (c >= 0x41 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a) return true elsif c <= 0x7f return false elsif (c >= 0xaa && c <= 0xaa) || (c >= 0xb5 && c <= 0xb5) || (c >= 0xba && c <= 0xba) || (c >= 0xc0 && c <= 0xd6) || (c >= 0xd8 && c <= 0xf6) || (c >= 0xf8 && c <= 0x2c1) return true elsif c <= 0xff return false elsif (c >= 0x2c6 && c <= 0x2d1) || (c >= 0x2e0 && c <= 0x2e4) || (c >= 0x2ec && c <= 0x2ec) || (c >= 0x2ee && c <= 0x2ee) || (c >= 0x370 && c <= 0x374) || (c >= 0x376 && c <= 0x377) || (c >= 0x37a && c <= 0x37d) || (c >= 0x37f && c <= 0x37f) || (c >= 0x386 && c <= 0x386) || (c >= 0x388 && c <= 0x38a) || (c >= 0x38c && c <= 0x38c) || (c >= 0x38e && c <= 0x3a1) || (c >= 0x3a3 && c <= 0x3f5) || (c >= 0x3f7 && c <= 0x481) || (c >= 0x48a && c <= 0x52f) || (c >= 0x531 && c <= 0x556) || (c >= 0x559 && c <= 0x559) || (c >= 0x561 && c <= 0x587) || (c >= 0x5d0 && c <= 0x5ea) || (c >= 0x5f0 && c <= 0x5f2) || (c >= 0x620 && c <= 0x64a) || (c >= 0x66e && c <= 0x66f) || (c >= 0x671 && c <= 0x6d3) || (c >= 0x6d5 && c <= 0x6d5) || (c >= 0x6e5 && c <= 0x6e6) || (c >= 0x6ee && c <= 0x6ef) || (c >= 0x6fa && c <= 0x6fc) || (c >= 0x6ff && c <= 0x6ff) || (c >= 0x710 && c <= 0x710) || (c >= 0x712 && c <= 0x72f) || (c >= 0x74d && c <= 0x7a5) || (c >= 0x7b1 && c <= 0x7b1) || (c >= 0x7ca && c <= 0x7ea) || (c >= 0x7f4 && c <= 0x7f5) || (c >= 0x7fa && c <= 0x7fa) || (c >= 0x800 && c <= 0x815) || (c >= 0x81a && c <= 0x81a) || (c >= 0x824 && c <= 0x824) || (c >= 0x828 && c <= 0x828) || (c >= 0x840 && c <= 0x858) || (c >= 0x8a0 && c <= 0x8b2) || (c >= 0x904 && c <= 0x939) || (c >= 0x93d && c <= 0x93d) || (c >= 0x950 && c <= 0x950) || (c >= 0x958 && c <= 0x961) || (c >= 0x971 && c <= 0x980) || (c >= 0x985 && c <= 0x98c) || (c >= 0x98f && c <= 0x990) || (c >= 0x993 && c <= 0x9a8) || (c >= 0x9aa && c <= 0x9b0) || (c >= 0x9b2 && c <= 0x9b2) || (c >= 0x9b6 && c <= 0x9b9) || (c >= 0x9bd && c <= 0x9bd) || (c >= 0x9ce && c <= 0x9ce) || (c >= 0x9dc && c <= 0x9dd) || (c >= 0x9df && c <= 0x9e1) || (c >= 0x9f0 && c <= 0x9f1) || (c >= 0xa05 && c <= 0xa0a) || (c >= 0xa0f && c <= 0xa10) || (c >= 0xa13 && c <= 0xa28) || (c >= 0xa2a && c <= 0xa30) || (c >= 0xa32 && c <= 0xa33) || (c >= 0xa35 && c <= 0xa36) || (c >= 0xa38 && c <= 0xa39) || (c >= 0xa59 && c <= 0xa5c) || (c >= 0xa5e && c <= 0xa5e) || (c >= 0xa72 && c <= 0xa74) || (c >= 0xa85 && c <= 0xa8d) || (c >= 0xa8f && c <= 0xa91) || (c >= 0xa93 && c <= 0xaa8) || (c >= 0xaaa && c <= 0xab0) || (c >= 0xab2 && c <= 0xab3) || (c >= 0xab5 && c <= 0xab9) || (c >= 0xabd && c <= 0xabd) || (c >= 0xad0 && c <= 0xad0) || (c >= 0xae0 && c <= 0xae1) || (c >= 0xb05 && c <= 0xb0c) || (c >= 0xb0f && c <= 0xb10) || (c >= 0xb13 && c <= 0xb28) || (c >= 0xb2a && c <= 0xb30) || (c >= 0xb32 && c <= 0xb33) || (c >= 0xb35 && c <= 0xb39) || (c >= 0xb3d && c <= 0xb3d) || (c >= 0xb5c && c <= 0xb5d) || (c >= 0xb5f && c <= 0xb61) || (c >= 0xb71 && c <= 0xb71) || (c >= 0xb83 && c <= 0xb83) || (c >= 0xb85 && c <= 0xb8a) || (c >= 0xb8e && c <= 0xb90) || (c >= 0xb92 && c <= 0xb95) || (c >= 0xb99 && c <= 0xb9a) || (c >= 0xb9c && c <= 0xb9c) || (c >= 0xb9e && c <= 0xb9f) || (c >= 0xba3 && c <= 0xba4) || (c >= 0xba8 && c <= 0xbaa) || (c >= 0xbae && c <= 0xbb9) || (c >= 0xbd0 && c <= 0xbd0) || (c >= 0xc05 && c <= 0xc0c) || (c >= 0xc0e && c <= 0xc10) || (c >= 0xc12 && c <= 0xc28) || (c >= 0xc2a && c <= 0xc39) || (c >= 0xc3d && c <= 0xc3d) || (c >= 0xc58 && c <= 0xc59) || (c >= 0xc60 && c <= 0xc61) || (c >= 0xc85 && c <= 0xc8c) || (c >= 0xc8e && c <= 0xc90) || (c >= 0xc92 && c <= 0xca8) || (c >= 0xcaa && c <= 0xcb3) || (c >= 0xcb5 && c <= 0xcb9) || (c >= 0xcbd && c <= 0xcbd) || (c >= 0xcde && c <= 0xcde) || (c >= 0xce0 && c <= 0xce1) || (c >= 0xcf1 && c <= 0xcf2) || (c >= 0xd05 && c <= 0xd0c) || (c >= 0xd0e && c <= 0xd10) || (c >= 0xd12 && c <= 0xd3a) || (c >= 0xd3d && c <= 0xd3d) || (c >= 0xd4e && c <= 0xd4e) || (c >= 0xd60 && c <= 0xd61) || (c >= 0xd7a && c <= 0xd7f) || (c >= 0xd85 && c <= 0xd96) || (c >= 0xd9a && c <= 0xdb1) || (c >= 0xdb3 && c <= 0xdbb) || (c >= 0xdbd && c <= 0xdbd) || (c >= 0xdc0 && c <= 0xdc6) || (c >= 0xe01 && c <= 0xe30) || (c >= 0xe32 && c <= 0xe33) || (c >= 0xe40 && c <= 0xe46) || (c >= 0xe81 && c <= 0xe82) || (c >= 0xe84 && c <= 0xe84) || (c >= 0xe87 && c <= 0xe88) || (c >= 0xe8a && c <= 0xe8a) || (c >= 0xe8d && c <= 0xe8d) || (c >= 0xe94 && c <= 0xe97) || (c >= 0xe99 && c <= 0xe9f) || (c >= 0xea1 && c <= 0xea3) || (c >= 0xea5 && c <= 0xea5) || (c >= 0xea7 && c <= 0xea7) || (c >= 0xeaa && c <= 0xeab) || (c >= 0xead && c <= 0xeb0) || (c >= 0xeb2 && c <= 0xeb3) || (c >= 0xebd && c <= 0xebd) || (c >= 0xec0 && c <= 0xec4) || (c >= 0xec6 && c <= 0xec6) || (c >= 0xedc && c <= 0xedf) || (c >= 0xf00 && c <= 0xf00) || (c >= 0xf40 && c <= 0xf47) || (c >= 0xf49 && c <= 0xf6c) || (c >= 0xf88 && c <= 0xf8c) || (c >= 0x1000 && c <= 0x102a) || (c >= 0x103f && c <= 0x103f) || (c >= 0x1050 && c <= 0x1055) || (c >= 0x105a && c <= 0x105d) || (c >= 0x1061 && c <= 0x1061) || (c >= 0x1065 && c <= 0x1066) || (c >= 0x106e && c <= 0x1070) || (c >= 0x1075 && c <= 0x1081) || (c >= 0x108e && c <= 0x108e) || (c >= 0x10a0 && c <= 0x10c5) || (c >= 0x10c7 && c <= 0x10c7) || (c >= 0x10cd && c <= 0x10cd) || (c >= 0x10d0 && c <= 0x10fa) || (c >= 0x10fc && c <= 0x1248) || (c >= 0x124a && c <= 0x124d) || (c >= 0x1250 && c <= 0x1256) || (c >= 0x1258 && c <= 0x1258) || (c >= 0x125a && c <= 0x125d) || (c >= 0x1260 && c <= 0x1288) || (c >= 0x128a && c <= 0x128d) || (c >= 0x1290 && c <= 0x12b0) || (c >= 0x12b2 && c <= 0x12b5) || (c >= 0x12b8 && c <= 0x12be) || (c >= 0x12c0 && c <= 0x12c0) || (c >= 0x12c2 && c <= 0x12c5) || (c >= 0x12c8 && c <= 0x12d6) || (c >= 0x12d8 && c <= 0x1310) || (c >= 0x1312 && c <= 0x1315) || (c >= 0x1318 && c <= 0x135a) || (c >= 0x1380 && c <= 0x138f) || (c >= 0x13a0 && c <= 0x13f4) || (c >= 0x1401 && c <= 0x166c) || (c >= 0x166f && c <= 0x167f) || (c >= 0x1681 && c <= 0x169a) || (c >= 0x16a0 && c <= 0x16ea) || (c >= 0x16ee && c <= 0x16f8) || (c >= 0x1700 && c <= 0x170c) || (c >= 0x170e && c <= 0x1711) || (c >= 0x1720 && c <= 0x1731) || (c >= 0x1740 && c <= 0x1751) || (c >= 0x1760 && c <= 0x176c) || (c >= 0x176e && c <= 0x1770) || (c >= 0x1780 && c <= 0x17b3) || (c >= 0x17d7 && c <= 0x17d7) || (c >= 0x17dc && c <= 0x17dc) || (c >= 0x1820 && c <= 0x1877) || (c >= 0x1880 && c <= 0x18a8) || (c >= 0x18aa && c <= 0x18aa) || (c >= 0x18b0 && c <= 0x18f5) || (c >= 0x1900 && c <= 0x191e) || (c >= 0x1950 && c <= 0x196d) || (c >= 0x1970 && c <= 0x1974) || (c >= 0x1980 && c <= 0x19ab) || (c >= 0x19c1 && c <= 0x19c7) || (c >= 0x1a00 && c <= 0x1a16) || (c >= 0x1a20 && c <= 0x1a54) || (c >= 0x1aa7 && c <= 0x1aa7) || (c >= 0x1b05 && c <= 0x1b33) || (c >= 0x1b45 && c <= 0x1b4b) || (c >= 0x1b83 && c <= 0x1ba0) || (c >= 0x1bae && c <= 0x1baf) || (c >= 0x1bba && c <= 0x1be5) || (c >= 0x1c00 && c <= 0x1c23) || (c >= 0x1c4d && c <= 0x1c4f) || (c >= 0x1c5a && c <= 0x1c7d) || (c >= 0x1ce9 && c <= 0x1cec) || (c >= 0x1cee && c <= 0x1cf1) || (c >= 0x1cf5 && c <= 0x1cf6) || (c >= 0x1d00 && c <= 0x1dbf) || (c >= 0x1e00 && c <= 0x1f15) || (c >= 0x1f18 && c <= 0x1f1d) || (c >= 0x1f20 && c <= 0x1f45) || (c >= 0x1f48 && c <= 0x1f4d) || (c >= 0x1f50 && c <= 0x1f57) || (c >= 0x1f59 && c <= 0x1f59) || (c >= 0x1f5b && c <= 0x1f5b) || (c >= 0x1f5d && c <= 0x1f5d) || (c >= 0x1f5f && c <= 0x1f7d) || (c >= 0x1f80 && c <= 0x1fb4) || (c >= 0x1fb6 && c <= 0x1fbc) || (c >= 0x1fbe && c <= 0x1fbe) || (c >= 0x1fc2 && c <= 0x1fc4) || (c >= 0x1fc6 && c <= 0x1fcc) || (c >= 0x1fd0 && c <= 0x1fd3) || (c >= 0x1fd6 && c <= 0x1fdb) || (c >= 0x1fe0 && c <= 0x1fec) || (c >= 0x1ff2 && c <= 0x1ff4) || (c >= 0x1ff6 && c <= 0x1ffc) || (c >= 0x2071 && c <= 0x2071) || (c >= 0x207f && c <= 0x207f) || (c >= 0x2090 && c <= 0x209c) || (c >= 0x2102 && c <= 0x2102) || (c >= 0x2107 && c <= 0x2107) || (c >= 0x210a && c <= 0x2113) || (c >= 0x2115 && c <= 0x2115) || (c >= 0x2119 && c <= 0x211d) || (c >= 0x2124 && c <= 0x2124) || (c >= 0x2126 && c <= 0x2126) || (c >= 0x2128 && c <= 0x2128) || (c >= 0x212a && c <= 0x212d) || (c >= 0x212f && c <= 0x2139) || (c >= 0x213c && c <= 0x213f) || (c >= 0x2145 && c <= 0x2149) || (c >= 0x214e && c <= 0x214e) || (c >= 0x2160 && c <= 0x2188) || (c >= 0x2c00 && c <= 0x2c2e) || (c >= 0x2c30 && c <= 0x2c5e) || (c >= 0x2c60 && c <= 0x2ce4) || (c >= 0x2ceb && c <= 0x2cee) || (c >= 0x2cf2 && c <= 0x2cf3) || (c >= 0x2d00 && c <= 0x2d25) || (c >= 0x2d27 && c <= 0x2d27) || (c >= 0x2d2d && c <= 0x2d2d) || (c >= 0x2d30 && c <= 0x2d67) || (c >= 0x2d6f && c <= 0x2d6f) || (c >= 0x2d80 && c <= 0x2d96) || (c >= 0x2da0 && c <= 0x2da6) || (c >= 0x2da8 && c <= 0x2dae) || (c >= 0x2db0 && c <= 0x2db6) || (c >= 0x2db8 && c <= 0x2dbe) || (c >= 0x2dc0 && c <= 0x2dc6) || (c >= 0x2dc8 && c <= 0x2dce) || (c >= 0x2dd0 && c <= 0x2dd6) || (c >= 0x2dd8 && c <= 0x2dde) || (c >= 0x2e2f && c <= 0x2e2f) || (c >= 0x3005 && c <= 0x3007) || (c >= 0x3021 && c <= 0x3029) || (c >= 0x3031 && c <= 0x3035) || (c >= 0x3038 && c <= 0x303c) || (c >= 0x3041 && c <= 0x3096) || (c >= 0x309d && c <= 0x309f) || (c >= 0x30a1 && c <= 0x30fa) || (c >= 0x30fc && c <= 0x30ff) || (c >= 0x3105 && c <= 0x312d) || (c >= 0x3131 && c <= 0x318e) || (c >= 0x31a0 && c <= 0x31ba) || (c >= 0x31f0 && c <= 0x31ff) || (c >= 0x3400 && c <= 0x3400) || (c >= 0x4db5 && c <= 0x4db5) || (c >= 0x4e00 && c <= 0x4e00) || (c >= 0x9fcc && c <= 0x9fcc) || (c >= 0xa000 && c <= 0xa48c) || (c >= 0xa4d0 && c <= 0xa4fd) || (c >= 0xa500 && c <= 0xa60c) || (c >= 0xa610 && c <= 0xa61f) || (c >= 0xa62a && c <= 0xa62b) || (c >= 0xa640 && c <= 0xa66e) || (c >= 0xa67f && c <= 0xa69d) || (c >= 0xa6a0 && c <= 0xa6ef) || (c >= 0xa717 && c <= 0xa71f) || (c >= 0xa722 && c <= 0xa788) || (c >= 0xa78b && c <= 0xa78e) || (c >= 0xa790 && c <= 0xa7ad) || (c >= 0xa7b0 && c <= 0xa7b1) || (c >= 0xa7f7 && c <= 0xa801) || (c >= 0xa803 && c <= 0xa805) || (c >= 0xa807 && c <= 0xa80a) || (c >= 0xa80c && c <= 0xa822) || (c >= 0xa840 && c <= 0xa873) || (c >= 0xa882 && c <= 0xa8b3) || (c >= 0xa8f2 && c <= 0xa8f7) || (c >= 0xa8fb && c <= 0xa8fb) || (c >= 0xa90a && c <= 0xa925) || (c >= 0xa930 && c <= 0xa946) || (c >= 0xa960 && c <= 0xa97c) || (c >= 0xa984 && c <= 0xa9b2) || (c >= 0xa9cf && c <= 0xa9cf) || (c >= 0xa9e0 && c <= 0xa9e4) || (c >= 0xa9e6 && c <= 0xa9ef) || (c >= 0xa9fa && c <= 0xa9fe) || (c >= 0xaa00 && c <= 0xaa28) || (c >= 0xaa40 && c <= 0xaa42) || (c >= 0xaa44 && c <= 0xaa4b) || (c >= 0xaa60 && c <= 0xaa76) || (c >= 0xaa7a && c <= 0xaa7a) || (c >= 0xaa7e && c <= 0xaaaf) || (c >= 0xaab1 && c <= 0xaab1) || (c >= 0xaab5 && c <= 0xaab6) || (c >= 0xaab9 && c <= 0xaabd) || (c >= 0xaac0 && c <= 0xaac0) || (c >= 0xaac2 && c <= 0xaac2) || (c >= 0xaadb && c <= 0xaadd) || (c >= 0xaae0 && c <= 0xaaea) || (c >= 0xaaf2 && c <= 0xaaf4) || (c >= 0xab01 && c <= 0xab06) || (c >= 0xab09 && c <= 0xab0e) || (c >= 0xab11 && c <= 0xab16) || (c >= 0xab20 && c <= 0xab26) || (c >= 0xab28 && c <= 0xab2e) || (c >= 0xab30 && c <= 0xab5a) || (c >= 0xab5c && c <= 0xab5f) || (c >= 0xab64 && c <= 0xab65) || (c >= 0xabc0 && c <= 0xabe2) || (c >= 0xac00 && c <= 0xac00) || (c >= 0xd7a3 && c <= 0xd7a3) || (c >= 0xd7b0 && c <= 0xd7c6) || (c >= 0xd7cb && c <= 0xd7fb) || (c >= 0xf900 && c <= 0xfa6d) || (c >= 0xfa70 && c <= 0xfad9) || (c >= 0xfb00 && c <= 0xfb06) || (c >= 0xfb13 && c <= 0xfb17) || (c >= 0xfb1d && c <= 0xfb1d) || (c >= 0xfb1f && c <= 0xfb28) || (c >= 0xfb2a && c <= 0xfb36) || (c >= 0xfb38 && c <= 0xfb3c) || (c >= 0xfb3e && c <= 0xfb3e) || (c >= 0xfb40 && c <= 0xfb41) || (c >= 0xfb43 && c <= 0xfb44) || (c >= 0xfb46 && c <= 0xfbb1) || (c >= 0xfbd3 && c <= 0xfd3d) || (c >= 0xfd50 && c <= 0xfd8f) || (c >= 0xfd92 && c <= 0xfdc7) || (c >= 0xfdf0 && c <= 0xfdfb) || (c >= 0xfe70 && c <= 0xfe74) || (c >= 0xfe76 && c <= 0xfefc) || (c >= 0xff21 && c <= 0xff3a) || (c >= 0xff41 && c <= 0xff5a) || (c >= 0xff66 && c <= 0xffbe) || (c >= 0xffc2 && c <= 0xffc7) || (c >= 0xffca && c <= 0xffcf) || (c >= 0xffd2 && c <= 0xffd7) || (c >= 0xffda && c <= 0xffdc) || (c >= 0x10000 && c <= 0x1000b) || (c >= 0x1000d && c <= 0x10026) || (c >= 0x10028 && c <= 0x1003a) || (c >= 0x1003c && c <= 0x1003d) || (c >= 0x1003f && c <= 0x1004d) || (c >= 0x10050 && c <= 0x1005d) || (c >= 0x10080 && c <= 0x100fa) || (c >= 0x10140 && c <= 0x10174) || (c >= 0x10280 && c <= 0x1029c) || (c >= 0x102a0 && c <= 0x102d0) || (c >= 0x10300 && c <= 0x1031f) || (c >= 0x10330 && c <= 0x1034a) || (c >= 0x10350 && c <= 0x10375) || (c >= 0x10380 && c <= 0x1039d) || (c >= 0x103a0 && c <= 0x103c3) || (c >= 0x103c8 && c <= 0x103cf) || (c >= 0x103d1 && c <= 0x103d5) || (c >= 0x10400 && c <= 0x1049d) || (c >= 0x10500 && c <= 0x10527) || (c >= 0x10530 && c <= 0x10563) || (c >= 0x10600 && c <= 0x10736) || (c >= 0x10740 && c <= 0x10755) || (c >= 0x10760 && c <= 0x10767) || (c >= 0x10800 && c <= 0x10805) || (c >= 0x10808 && c <= 0x10808) || (c >= 0x1080a && c <= 0x10835) || (c >= 0x10837 && c <= 0x10838) || (c >= 0x1083c && c <= 0x1083c) || (c >= 0x1083f && c <= 0x10855) || (c >= 0x10860 && c <= 0x10876) || (c >= 0x10880 && c <= 0x1089e) || (c >= 0x10900 && c <= 0x10915) || (c >= 0x10920 && c <= 0x10939) || (c >= 0x10980 && c <= 0x109b7) || (c >= 0x109be && c <= 0x109bf) || (c >= 0x10a00 && c <= 0x10a00) || (c >= 0x10a10 && c <= 0x10a13) || (c >= 0x10a15 && c <= 0x10a17) || (c >= 0x10a19 && c <= 0x10a33) || (c >= 0x10a60 && c <= 0x10a7c) || (c >= 0x10a80 && c <= 0x10a9c) || (c >= 0x10ac0 && c <= 0x10ac7) || (c >= 0x10ac9 && c <= 0x10ae4) || (c >= 0x10b00 && c <= 0x10b35) || (c >= 0x10b40 && c <= 0x10b55) || (c >= 0x10b60 && c <= 0x10b72) || (c >= 0x10b80 && c <= 0x10b91) || (c >= 0x10c00 && c <= 0x10c48) || (c >= 0x11003 && c <= 0x11037) || (c >= 0x11083 && c <= 0x110af) || (c >= 0x110d0 && c <= 0x110e8) || (c >= 0x11103 && c <= 0x11126) || (c >= 0x11150 && c <= 0x11172) || (c >= 0x11176 && c <= 0x11176) || (c >= 0x11183 && c <= 0x111b2) || (c >= 0x111c1 && c <= 0x111c4) || (c >= 0x111da && c <= 0x111da) || (c >= 0x11200 && c <= 0x11211) || (c >= 0x11213 && c <= 0x1122b) || (c >= 0x112b0 && c <= 0x112de) || (c >= 0x11305 && c <= 0x1130c) || (c >= 0x1130f && c <= 0x11310) || (c >= 0x11313 && c <= 0x11328) || (c >= 0x1132a && c <= 0x11330) || (c >= 0x11332 && c <= 0x11333) || (c >= 0x11335 && c <= 0x11339) || (c >= 0x1133d && c <= 0x1133d) || (c >= 0x1135d && c <= 0x11361) || (c >= 0x11480 && c <= 0x114af) || (c >= 0x114c4 && c <= 0x114c5) || (c >= 0x114c7 && c <= 0x114c7) || (c >= 0x11580 && c <= 0x115ae) || (c >= 0x11600 && c <= 0x1162f) || (c >= 0x11644 && c <= 0x11644) || (c >= 0x11680 && c <= 0x116aa) || (c >= 0x118a0 && c <= 0x118df) || (c >= 0x118ff && c <= 0x118ff) || (c >= 0x11ac0 && c <= 0x11af8) || (c >= 0x12000 && c <= 0x12398) || (c >= 0x12400 && c <= 0x1246e) || (c >= 0x13000 && c <= 0x1342e) || (c >= 0x16800 && c <= 0x16a38) || (c >= 0x16a40 && c <= 0x16a5e) || (c >= 0x16ad0 && c <= 0x16aed) || (c >= 0x16b00 && c <= 0x16b2f) || (c >= 0x16b40 && c <= 0x16b43) || (c >= 0x16b63 && c <= 0x16b77) || (c >= 0x16b7d && c <= 0x16b8f) || (c >= 0x16f00 && c <= 0x16f44) || (c >= 0x16f50 && c <= 0x16f50) || (c >= 0x16f93 && c <= 0x16f9f) || (c >= 0x1b000 && c <= 0x1b001) || (c >= 0x1bc00 && c <= 0x1bc6a) || (c >= 0x1bc70 && c <= 0x1bc7c) || (c >= 0x1bc80 && c <= 0x1bc88) || (c >= 0x1bc90 && c <= 0x1bc99) || (c >= 0x1d400 && c <= 0x1d454) || (c >= 0x1d456 && c <= 0x1d49c) || (c >= 0x1d49e && c <= 0x1d49f) || (c >= 0x1d4a2 && c <= 0x1d4a2) || (c >= 0x1d4a5 && c <= 0x1d4a6) || (c >= 0x1d4a9 && c <= 0x1d4ac) || (c >= 0x1d4ae && c <= 0x1d4b9) || (c >= 0x1d4bb && c <= 0x1d4bb) || (c >= 0x1d4bd && c <= 0x1d4c3) || (c >= 0x1d4c5 && c <= 0x1d505) || (c >= 0x1d507 && c <= 0x1d50a) || (c >= 0x1d50d && c <= 0x1d514) || (c >= 0x1d516 && c <= 0x1d51c) || (c >= 0x1d51e && c <= 0x1d539) || (c >= 0x1d53b && c <= 0x1d53e) || (c >= 0x1d540 && c <= 0x1d544) || (c >= 0x1d546 && c <= 0x1d546) || (c >= 0x1d54a && c <= 0x1d550) || (c >= 0x1d552 && c <= 0x1d6a5) || (c >= 0x1d6a8 && c <= 0x1d6c0) || (c >= 0x1d6c2 && c <= 0x1d6da) || (c >= 0x1d6dc && c <= 0x1d6fa) || (c >= 0x1d6fc && c <= 0x1d714) || (c >= 0x1d716 && c <= 0x1d734) || (c >= 0x1d736 && c <= 0x1d74e) || (c >= 0x1d750 && c <= 0x1d76e) || (c >= 0x1d770 && c <= 0x1d788) || (c >= 0x1d78a && c <= 0x1d7a8) || (c >= 0x1d7aa && c <= 0x1d7c2) || (c >= 0x1d7c4 && c <= 0x1d7cb) || (c >= 0x1e800 && c <= 0x1e8c4) || (c >= 0x1ee00 && c <= 0x1ee03) || (c >= 0x1ee05 && c <= 0x1ee1f) || (c >= 0x1ee21 && c <= 0x1ee22) || (c >= 0x1ee24 && c <= 0x1ee24) || (c >= 0x1ee27 && c <= 0x1ee27) || (c >= 0x1ee29 && c <= 0x1ee32) || (c >= 0x1ee34 && c <= 0x1ee37) || (c >= 0x1ee39 && c <= 0x1ee39) || (c >= 0x1ee3b && c <= 0x1ee3b) || (c >= 0x1ee42 && c <= 0x1ee42) || (c >= 0x1ee47 && c <= 0x1ee47) || (c >= 0x1ee49 && c <= 0x1ee49) || (c >= 0x1ee4b && c <= 0x1ee4b) || (c >= 0x1ee4d && c <= 0x1ee4f) || (c >= 0x1ee51 && c <= 0x1ee52) || (c >= 0x1ee54 && c <= 0x1ee54) || (c >= 0x1ee57 && c <= 0x1ee57) || (c >= 0x1ee59 && c <= 0x1ee59) || (c >= 0x1ee5b && c <= 0x1ee5b) || (c >= 0x1ee5d && c <= 0x1ee5d) || (c >= 0x1ee5f && c <= 0x1ee5f) || (c >= 0x1ee61 && c <= 0x1ee62) || (c >= 0x1ee64 && c <= 0x1ee64) || (c >= 0x1ee67 && c <= 0x1ee6a) || (c >= 0x1ee6c && c <= 0x1ee72) || (c >= 0x1ee74 && c <= 0x1ee77) || (c >= 0x1ee79 && c <= 0x1ee7c) || (c >= 0x1ee7e && c <= 0x1ee7e) || (c >= 0x1ee80 && c <= 0x1ee89) || (c >= 0x1ee8b && c <= 0x1ee9b) || (c >= 0x1eea1 && c <= 0x1eea3) || (c >= 0x1eea5 && c <= 0x1eea9) || (c >= 0x1eeab && c <= 0x1eebb) || (c >= 0x20000 && c <= 0x20000) || (c >= 0x2a6d6 && c <= 0x2a6d6) || (c >= 0x2a700 && c <= 0x2a700) || (c >= 0x2b734 && c <= 0x2b734) || (c >= 0x2b740 && c <= 0x2b740) || (c >= 0x2b81d && c <= 0x2b81d) return true end end def identifier_part?(c) return false if c.nil? if (c >= 0x30 && c <= 0x39) || c == 0x24 || c == 0x5f || (c >= 0x41 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a) return true elsif identifier_start?(c) || (c >= 0x300 && c <= 0x36f) || (c >= 0x483 && c <= 0x487) || (c >= 0x591 && c <= 0x5bd) || (c >= 0x5bf && c <= 0x5bf) || (c >= 0x5c1 && c <= 0x5c2) || (c >= 0x5c4 && c <= 0x5c5) || (c >= 0x5c7 && c <= 0x5c7) || (c >= 0x610 && c <= 0x61a) || (c >= 0x64b && c <= 0x669) || (c >= 0x670 && c <= 0x670) || (c >= 0x6d6 && c <= 0x6dc) || (c >= 0x6df && c <= 0x6e4) || (c >= 0x6e7 && c <= 0x6e8) || (c >= 0x6ea && c <= 0x6ed) || (c >= 0x6f0 && c <= 0x6f9) || (c >= 0x711 && c <= 0x711) || (c >= 0x730 && c <= 0x74a) || (c >= 0x7a6 && c <= 0x7b0) || (c >= 0x7c0 && c <= 0x7c9) || (c >= 0x7eb && c <= 0x7f3) || (c >= 0x816 && c <= 0x819) || (c >= 0x81b && c <= 0x823) || (c >= 0x825 && c <= 0x827) || (c >= 0x829 && c <= 0x82d) || (c >= 0x859 && c <= 0x85b) || (c >= 0x8e4 && c <= 0x903) || (c >= 0x93a && c <= 0x93c) || (c >= 0x93e && c <= 0x94f) || (c >= 0x951 && c <= 0x957) || (c >= 0x962 && c <= 0x963) || (c >= 0x966 && c <= 0x96f) || (c >= 0x981 && c <= 0x983) || (c >= 0x9bc && c <= 0x9bc) || (c >= 0x9be && c <= 0x9c4) || (c >= 0x9c7 && c <= 0x9c8) || (c >= 0x9cb && c <= 0x9cd) || (c >= 0x9d7 && c <= 0x9d7) || (c >= 0x9e2 && c <= 0x9e3) || (c >= 0x9e6 && c <= 0x9ef) || (c >= 0xa01 && c <= 0xa03) || (c >= 0xa3c && c <= 0xa3c) || (c >= 0xa3e && c <= 0xa42) || (c >= 0xa47 && c <= 0xa48) || (c >= 0xa4b && c <= 0xa4d) || (c >= 0xa51 && c <= 0xa51) || (c >= 0xa66 && c <= 0xa71) || (c >= 0xa75 && c <= 0xa75) || (c >= 0xa81 && c <= 0xa83) || (c >= 0xabc && c <= 0xabc) || (c >= 0xabe && c <= 0xac5) || (c >= 0xac7 && c <= 0xac9) || (c >= 0xacb && c <= 0xacd) || (c >= 0xae2 && c <= 0xae3) || (c >= 0xae6 && c <= 0xaef) || (c >= 0xb01 && c <= 0xb03) || (c >= 0xb3c && c <= 0xb3c) || (c >= 0xb3e && c <= 0xb44) || (c >= 0xb47 && c <= 0xb48) || (c >= 0xb4b && c <= 0xb4d) || (c >= 0xb56 && c <= 0xb57) || (c >= 0xb62 && c <= 0xb63) || (c >= 0xb66 && c <= 0xb6f) || (c >= 0xb82 && c <= 0xb82) || (c >= 0xbbe && c <= 0xbc2) || (c >= 0xbc6 && c <= 0xbc8) || (c >= 0xbca && c <= 0xbcd) || (c >= 0xbd7 && c <= 0xbd7) || (c >= 0xbe6 && c <= 0xbef) || (c >= 0xc00 && c <= 0xc03) || (c >= 0xc3e && c <= 0xc44) || (c >= 0xc46 && c <= 0xc48) || (c >= 0xc4a && c <= 0xc4d) || (c >= 0xc55 && c <= 0xc56) || (c >= 0xc62 && c <= 0xc63) || (c >= 0xc66 && c <= 0xc6f) || (c >= 0xc81 && c <= 0xc83) || (c >= 0xcbc && c <= 0xcbc) || (c >= 0xcbe && c <= 0xcc4) || (c >= 0xcc6 && c <= 0xcc8) || (c >= 0xcca && c <= 0xccd) || (c >= 0xcd5 && c <= 0xcd6) || (c >= 0xce2 && c <= 0xce3) || (c >= 0xce6 && c <= 0xcef) || (c >= 0xd01 && c <= 0xd03) || (c >= 0xd3e && c <= 0xd44) || (c >= 0xd46 && c <= 0xd48) || (c >= 0xd4a && c <= 0xd4d) || (c >= 0xd57 && c <= 0xd57) || (c >= 0xd62 && c <= 0xd63) || (c >= 0xd66 && c <= 0xd6f) || (c >= 0xd82 && c <= 0xd83) || (c >= 0xdca && c <= 0xdca) || (c >= 0xdcf && c <= 0xdd4) || (c >= 0xdd6 && c <= 0xdd6) || (c >= 0xdd8 && c <= 0xddf) || (c >= 0xde6 && c <= 0xdef) || (c >= 0xdf2 && c <= 0xdf3) || (c >= 0xe31 && c <= 0xe31) || (c >= 0xe34 && c <= 0xe3a) || (c >= 0xe47 && c <= 0xe4e) || (c >= 0xe50 && c <= 0xe59) || (c >= 0xeb1 && c <= 0xeb1) || (c >= 0xeb4 && c <= 0xeb9) || (c >= 0xebb && c <= 0xebc) || (c >= 0xec8 && c <= 0xecd) || (c >= 0xed0 && c <= 0xed9) || (c >= 0xf18 && c <= 0xf19) || (c >= 0xf20 && c <= 0xf29) || (c >= 0xf35 && c <= 0xf35) || (c >= 0xf37 && c <= 0xf37) || (c >= 0xf39 && c <= 0xf39) || (c >= 0xf3e && c <= 0xf3f) || (c >= 0xf71 && c <= 0xf84) || (c >= 0xf86 && c <= 0xf87) || (c >= 0xf8d && c <= 0xf97) || (c >= 0xf99 && c <= 0xfbc) || (c >= 0xfc6 && c <= 0xfc6) || (c >= 0x102b && c <= 0x103e) || (c >= 0x1040 && c <= 0x1049) || (c >= 0x1056 && c <= 0x1059) || (c >= 0x105e && c <= 0x1060) || (c >= 0x1062 && c <= 0x1064) || (c >= 0x1067 && c <= 0x106d) || (c >= 0x1071 && c <= 0x1074) || (c >= 0x1082 && c <= 0x108d) || (c >= 0x108f && c <= 0x109d) || (c >= 0x135d && c <= 0x135f) || (c >= 0x1712 && c <= 0x1714) || (c >= 0x1732 && c <= 0x1734) || (c >= 0x1752 && c <= 0x1753) || (c >= 0x1772 && c <= 0x1773) || (c >= 0x17b4 && c <= 0x17d3) || (c >= 0x17dd && c <= 0x17dd) || (c >= 0x17e0 && c <= 0x17e9) || (c >= 0x180b && c <= 0x180d) || (c >= 0x1810 && c <= 0x1819) || (c >= 0x18a9 && c <= 0x18a9) || (c >= 0x1920 && c <= 0x192b) || (c >= 0x1930 && c <= 0x193b) || (c >= 0x1946 && c <= 0x194f) || (c >= 0x19b0 && c <= 0x19c0) || (c >= 0x19c8 && c <= 0x19c9) || (c >= 0x19d0 && c <= 0x19d9) || (c >= 0x1a17 && c <= 0x1a1b) || (c >= 0x1a55 && c <= 0x1a5e) || (c >= 0x1a60 && c <= 0x1a7c) || (c >= 0x1a7f && c <= 0x1a89) || (c >= 0x1a90 && c <= 0x1a99) || (c >= 0x1ab0 && c <= 0x1abd) || (c >= 0x1b00 && c <= 0x1b04) || (c >= 0x1b34 && c <= 0x1b44) || (c >= 0x1b50 && c <= 0x1b59) || (c >= 0x1b6b && c <= 0x1b73) || (c >= 0x1b80 && c <= 0x1b82) || (c >= 0x1ba1 && c <= 0x1bad) || (c >= 0x1bb0 && c <= 0x1bb9) || (c >= 0x1be6 && c <= 0x1bf3) || (c >= 0x1c24 && c <= 0x1c37) || (c >= 0x1c40 && c <= 0x1c49) || (c >= 0x1c50 && c <= 0x1c59) || (c >= 0x1cd0 && c <= 0x1cd2) || (c >= 0x1cd4 && c <= 0x1ce8) || (c >= 0x1ced && c <= 0x1ced) || (c >= 0x1cf2 && c <= 0x1cf4) || (c >= 0x1cf8 && c <= 0x1cf9) || (c >= 0x1dc0 && c <= 0x1df5) || (c >= 0x1dfc && c <= 0x1dff) || (c >= 0x203f && c <= 0x2040) || (c >= 0x2054 && c <= 0x2054) || (c >= 0x20d0 && c <= 0x20dc) || (c >= 0x20e1 && c <= 0x20e1) || (c >= 0x20e5 && c <= 0x20f0) || (c >= 0x2cef && c <= 0x2cf1) || (c >= 0x2d7f && c <= 0x2d7f) || (c >= 0x2de0 && c <= 0x2dff) || (c >= 0x302a && c <= 0x302f) || (c >= 0x3099 && c <= 0x309a) || (c >= 0xa620 && c <= 0xa629) || (c >= 0xa66f && c <= 0xa66f) || (c >= 0xa674 && c <= 0xa67d) || (c >= 0xa69f && c <= 0xa69f) || (c >= 0xa6f0 && c <= 0xa6f1) || (c >= 0xa802 && c <= 0xa802) || (c >= 0xa806 && c <= 0xa806) || (c >= 0xa80b && c <= 0xa80b) || (c >= 0xa823 && c <= 0xa827) || (c >= 0xa880 && c <= 0xa881) || (c >= 0xa8b4 && c <= 0xa8c4) || (c >= 0xa8d0 && c <= 0xa8d9) || (c >= 0xa8e0 && c <= 0xa8f1) || (c >= 0xa900 && c <= 0xa909) || (c >= 0xa926 && c <= 0xa92d) || (c >= 0xa947 && c <= 0xa953) || (c >= 0xa980 && c <= 0xa983) || (c >= 0xa9b3 && c <= 0xa9c0) || (c >= 0xa9d0 && c <= 0xa9d9) || (c >= 0xa9e5 && c <= 0xa9e5) || (c >= 0xa9f0 && c <= 0xa9f9) || (c >= 0xaa29 && c <= 0xaa36) || (c >= 0xaa43 && c <= 0xaa43) || (c >= 0xaa4c && c <= 0xaa4d) || (c >= 0xaa50 && c <= 0xaa59) || (c >= 0xaa7b && c <= 0xaa7d) || (c >= 0xaab0 && c <= 0xaab0) || (c >= 0xaab2 && c <= 0xaab4) || (c >= 0xaab7 && c <= 0xaab8) || (c >= 0xaabe && c <= 0xaabf) || (c >= 0xaac1 && c <= 0xaac1) || (c >= 0xaaeb && c <= 0xaaef) || (c >= 0xaaf5 && c <= 0xaaf6) || (c >= 0xabe3 && c <= 0xabea) || (c >= 0xabec && c <= 0xabed) || (c >= 0xabf0 && c <= 0xabf9) || (c >= 0xfb1e && c <= 0xfb1e) || (c >= 0xfe00 && c <= 0xfe0f) || (c >= 0xfe20 && c <= 0xfe2d) || (c >= 0xfe33 && c <= 0xfe34) || (c >= 0xfe4d && c <= 0xfe4f) || (c >= 0xff10 && c <= 0xff19) || (c >= 0xff3f && c <= 0xff3f) || (c >= 0x101fd && c <= 0x101fd) || (c >= 0x102e0 && c <= 0x102e0) || (c >= 0x10376 && c <= 0x1037a) || (c >= 0x104a0 && c <= 0x104a9) || (c >= 0x10a01 && c <= 0x10a03) || (c >= 0x10a05 && c <= 0x10a06) || (c >= 0x10a0c && c <= 0x10a0f) || (c >= 0x10a38 && c <= 0x10a3a) || (c >= 0x10a3f && c <= 0x10a3f) || (c >= 0x10ae5 && c <= 0x10ae6) || (c >= 0x11000 && c <= 0x11002) || (c >= 0x11038 && c <= 0x11046) || (c >= 0x11066 && c <= 0x1106f) || (c >= 0x1107f && c <= 0x11082) || (c >= 0x110b0 && c <= 0x110ba) || (c >= 0x110f0 && c <= 0x110f9) || (c >= 0x11100 && c <= 0x11102) || (c >= 0x11127 && c <= 0x11134) || (c >= 0x11136 && c <= 0x1113f) || (c >= 0x11173 && c <= 0x11173) || (c >= 0x11180 && c <= 0x11182) || (c >= 0x111b3 && c <= 0x111c0) || (c >= 0x111d0 && c <= 0x111d9) || (c >= 0x1122c && c <= 0x11237) || (c >= 0x112df && c <= 0x112ea) || (c >= 0x112f0 && c <= 0x112f9) || (c >= 0x11301 && c <= 0x11303) || (c >= 0x1133c && c <= 0x1133c) || (c >= 0x1133e && c <= 0x11344) || (c >= 0x11347 && c <= 0x11348) || (c >= 0x1134b && c <= 0x1134d) || (c >= 0x11357 && c <= 0x11357) || (c >= 0x11362 && c <= 0x11363) || (c >= 0x11366 && c <= 0x1136c) || (c >= 0x11370 && c <= 0x11374) || (c >= 0x114b0 && c <= 0x114c3) || (c >= 0x114d0 && c <= 0x114d9) || (c >= 0x115af && c <= 0x115b5) || (c >= 0x115b8 && c <= 0x115c0) || (c >= 0x11630 && c <= 0x11640) || (c >= 0x11650 && c <= 0x11659) || (c >= 0x116ab && c <= 0x116b7) || (c >= 0x116c0 && c <= 0x116c9) || (c >= 0x118e0 && c <= 0x118e9) || (c >= 0x16a60 && c <= 0x16a69) || (c >= 0x16af0 && c <= 0x16af4) || (c >= 0x16b30 && c <= 0x16b36) || (c >= 0x16b50 && c <= 0x16b59) || (c >= 0x16f51 && c <= 0x16f7e) || (c >= 0x16f8f && c <= 0x16f92) || (c >= 0x1bc9d && c <= 0x1bc9e) || (c >= 0x1d165 && c <= 0x1d169) || (c >= 0x1d16d && c <= 0x1d172) || (c >= 0x1d17b && c <= 0x1d182) || (c >= 0x1d185 && c <= 0x1d18b) || (c >= 0x1d1aa && c <= 0x1d1ad) || (c >= 0x1d242 && c <= 0x1d244) || (c >= 0x1d7ce && c <= 0x1d7ff) || (c >= 0x1e8d0 && c <= 0x1e8d6) || c == 0x200d || c == 0x200c return true end end def idname?(name) return false if name.length == 0 s = name.codepoints return false unless identifier_start?(s[0]) s.unshift s.each do |code| return false unless identifier_part?(code) end return true end end end