mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-01-13 16:57:54 -05:00
Compare commits
625 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed6733d177 | ||
|
|
d572d744eb | ||
|
|
e82de9c0f6 | ||
|
|
f5073fa132 | ||
|
|
f9c3316aa5 | ||
|
|
ff13d85625 | ||
|
|
c4f1fe7132 | ||
|
|
b0946c3c60 | ||
|
|
b90bc2459a | ||
|
|
07f644c392 | ||
|
|
2fd9ee403c | ||
|
|
389ce89555 | ||
|
|
75d376f2ef | ||
|
|
3136bde928 | ||
|
|
26a7ba1659 | ||
|
|
9cef39d21a | ||
|
|
92ad04b9b1 | ||
|
|
6fe980e569 | ||
|
|
bb8df1e052 | ||
|
|
61d408f093 | ||
|
|
ba41b4417d | ||
|
|
33bbef963c | ||
|
|
c4f0c9ed06 | ||
|
|
8677a0dbc4 | ||
|
|
ee2a107f3c | ||
|
|
8fb5c1ba4f | ||
|
|
b2b2f97873 | ||
|
|
0045cb21ba | ||
|
|
a8273bf980 | ||
|
|
3e7c570679 | ||
|
|
a34c0c9502 | ||
|
|
2ab714b4fe | ||
|
|
56eec0bc4e | ||
|
|
f528e5e754 | ||
|
|
bdcb2c73af | ||
|
|
9b37f16f11 | ||
|
|
26351096a6 | ||
|
|
a091bb82f9 | ||
|
|
a6d4bf1982 | ||
|
|
0e51cdaccd | ||
|
|
d4b7bd3a1f | ||
|
|
559e735994 | ||
|
|
09caa217c2 | ||
|
|
a35df430db | ||
|
|
05d45e9b27 | ||
|
|
69521b97ce | ||
|
|
c7e538a624 | ||
|
|
44be72a4d9 | ||
|
|
9cfcf8623c | ||
|
|
25c23786af | ||
|
|
47bf5d962b | ||
|
|
a30e6807b1 | ||
|
|
d735c81da0 | ||
|
|
f56515b100 | ||
|
|
74d6635f95 | ||
|
|
e8d0deae78 | ||
|
|
95d6ec7492 | ||
|
|
09c95394e1 | ||
|
|
ddb5dac49d | ||
|
|
265b251a7d | ||
|
|
7539f7af2e | ||
|
|
2f27225e8c | ||
|
|
99ad0cc16c | ||
|
|
70c2c4706f | ||
|
|
9d1af43c91 | ||
|
|
c6fdde8834 | ||
|
|
0174ee082c | ||
|
|
82b7bd3a92 | ||
|
|
1f22c16bee | ||
|
|
f33d4dd4f1 | ||
|
|
9c913f86fa | ||
|
|
f0bb59790a | ||
|
|
391fcc4afa | ||
|
|
7b2fb18a0b | ||
|
|
5596a5c209 | ||
|
|
71750554c3 | ||
|
|
0574b664e8 | ||
|
|
ca0ac814b3 | ||
|
|
c0b3217766 | ||
|
|
12a5271489 | ||
|
|
f4fcf65750 | ||
|
|
92f69b2bca | ||
|
|
742224471f | ||
|
|
086430840e | ||
|
|
82f92fea97 | ||
|
|
d23919c430 | ||
|
|
ada35d8951 | ||
|
|
7e0eb6a92d | ||
|
|
28a1a1d304 | ||
|
|
0c2d3673d3 | ||
|
|
e6f6aa8c85 | ||
|
|
c09d8fbedb | ||
|
|
730a4bcdad | ||
|
|
7466c81414 | ||
|
|
b79ea321a3 | ||
|
|
ae2f72e15d | ||
|
|
f6d63776c3 | ||
|
|
b982b7cd0e | ||
|
|
0b5bac666f | ||
|
|
41b31c7293 | ||
|
|
eaeb77a527 | ||
|
|
ec034e2673 | ||
|
|
ff24e5ce52 | ||
|
|
4549f9a4c5 | ||
|
|
d0be6391c6 | ||
|
|
f70f4f09b7 | ||
|
|
3f5abb3c60 | ||
|
|
ca275c2a1c | ||
|
|
99b7826f1b | ||
|
|
806a442894 | ||
|
|
63ffe0aead | ||
|
|
74e0798f89 | ||
|
|
247b511c6a | ||
|
|
6a8e6a4078 | ||
|
|
42402da526 | ||
|
|
42622b15a9 | ||
|
|
1879af6585 | ||
|
|
a7b1fa51e7 | ||
|
|
38c8b2f35f | ||
|
|
4392d26985 | ||
|
|
2f82b75862 | ||
|
|
459814f58d | ||
|
|
088659f893 | ||
|
|
0e37130f2e | ||
|
|
fb539579c3 | ||
|
|
7c54532010 | ||
|
|
5d57ea785c | ||
|
|
94e29c9a95 | ||
|
|
fe7377aed5 | ||
|
|
e934a42e75 | ||
|
|
294bb4754e | ||
|
|
5eab5f1d22 | ||
|
|
8b775c95ad | ||
|
|
251700549a | ||
|
|
3fbf76e135 | ||
|
|
ca04dd6e47 | ||
|
|
a82f869453 | ||
|
|
f932206213 | ||
|
|
849dd53287 | ||
|
|
e03a87da04 | ||
|
|
29aa9b36fe | ||
|
|
c6472fa617 | ||
|
|
1bbbca6496 | ||
|
|
6b1e9bb82b | ||
|
|
eb22196850 | ||
|
|
3b1c49240b | ||
|
|
ea33c28f1b | ||
|
|
7b251f493d | ||
|
|
0be8c5d161 | ||
|
|
617a2d5b65 | ||
|
|
e1625a0d31 | ||
|
|
4c6cc8d060 | ||
|
|
e6153d9841 | ||
|
|
6e86b67818 | ||
|
|
b4dceaea67 | ||
|
|
d83b95bd39 | ||
|
|
4ba1be131c | ||
|
|
8dabec0f9b | ||
|
|
e679cbccf7 | ||
|
|
b18e91f936 | ||
|
|
c31a30d3fa | ||
|
|
99b2578aa7 | ||
|
|
ddfde6810c | ||
|
|
71350d67c4 | ||
|
|
13857a5d71 | ||
|
|
6225627579 | ||
|
|
c4245e50c2 | ||
|
|
6ce1d36acd | ||
|
|
b2669abecc | ||
|
|
db86dc4d8b | ||
|
|
98b2a69416 | ||
|
|
16b4448fe8 | ||
|
|
af82c1f41f | ||
|
|
3e089ca59d | ||
|
|
7f8b36a8bd | ||
|
|
812571843c | ||
|
|
8a25195442 | ||
|
|
70f6cb70e2 | ||
|
|
be702d67f3 | ||
|
|
68302e6da7 | ||
|
|
0e7677ad62 | ||
|
|
7cf739e2b6 | ||
|
|
41185ca7ac | ||
|
|
7dbdca8c54 | ||
|
|
8e66ae404e | ||
|
|
7beb631694 | ||
|
|
c2792e4840 | ||
|
|
d82272b6c2 | ||
|
|
fe7554828a | ||
|
|
708e57586c | ||
|
|
8061ecf0e2 | ||
|
|
6df8f5ff17 | ||
|
|
776e7e5328 | ||
|
|
871079b25c | ||
|
|
be2b24310f | ||
|
|
1f9cd4eaf7 | ||
|
|
47c491ffa1 | ||
|
|
195a46ab77 | ||
|
|
e5aa758dda | ||
|
|
001f97ac39 | ||
|
|
ce66a499de | ||
|
|
0268505119 | ||
|
|
5a43b2d7c5 | ||
|
|
820942c3d0 | ||
|
|
1869f3121d | ||
|
|
4c0363fb7c | ||
|
|
746b0c7cc6 | ||
|
|
b2fe7772c5 | ||
|
|
23479eb486 | ||
|
|
63b8543d73 | ||
|
|
7542a75ff8 | ||
|
|
0875039d52 | ||
|
|
e0833c29ce | ||
|
|
72ab6feb2f | ||
|
|
eb7009268d | ||
|
|
571e9df335 | ||
|
|
a73f66bc11 | ||
|
|
ba094126e2 | ||
|
|
794f65fbd7 | ||
|
|
0490eb9a3a | ||
|
|
9e80f6fa67 | ||
|
|
fc5ab1afa3 | ||
|
|
0aa77f157a | ||
|
|
1849f0db76 | ||
|
|
d86597dbad | ||
|
|
bf91781888 | ||
|
|
dcd6de9a77 | ||
|
|
70b510bcb7 | ||
|
|
84d596d534 | ||
|
|
c804087ec9 | ||
|
|
74bd537d6c | ||
|
|
0217ed5505 | ||
|
|
e53307b46b | ||
|
|
c8c8c167d1 | ||
|
|
c1283ead45 | ||
|
|
3ade25a32c | ||
|
|
7ea3ea92f3 | ||
|
|
a70f1a082e | ||
|
|
2ccbb6b91a | ||
|
|
e348026073 | ||
|
|
7c6f3788ca | ||
|
|
12fcbfc654 | ||
|
|
38f5963b85 | ||
|
|
ffbe51e374 | ||
|
|
926cb8463c | ||
|
|
b1286752b9 | ||
|
|
5eb9dded52 | ||
|
|
7f5ab7eb0d | ||
|
|
5bc85b8f6d | ||
|
|
81d1b511f0 | ||
|
|
2dc3f6c87a | ||
|
|
04959162c6 | ||
|
|
f14c7ffa3f | ||
|
|
64b8dd486a | ||
|
|
7864acabc3 | ||
|
|
9812d28748 | ||
|
|
555c22af58 | ||
|
|
3f4b03bcff | ||
|
|
a706a64a6d | ||
|
|
637fe305a6 | ||
|
|
bd824c73dd | ||
|
|
cbc695b831 | ||
|
|
f3375e798c | ||
|
|
e2308093e4 | ||
|
|
0dc4755920 | ||
|
|
6faa7f2b35 | ||
|
|
063c2d1f56 | ||
|
|
4d4e47bfb2 | ||
|
|
22fb31e317 | ||
|
|
a2037e799f | ||
|
|
694e69d872 | ||
|
|
bb2871fdde | ||
|
|
08e00331dd | ||
|
|
0b0a9ef2c4 | ||
|
|
9df1457c55 | ||
|
|
22f92f23ae | ||
|
|
cd516b954f | ||
|
|
27eff5ca77 | ||
|
|
5cbd25f5d4 | ||
|
|
eb127923a7 | ||
|
|
42da56deb1 | ||
|
|
81260bff7d | ||
|
|
35f784bcdf | ||
|
|
c17b6b8863 | ||
|
|
1965996933 | ||
|
|
a67dfae985 | ||
|
|
1cb733989c | ||
|
|
a2a2e769c3 | ||
|
|
19231dbcad | ||
|
|
aecc115c79 | ||
|
|
4c41831474 | ||
|
|
659f1b3c4c | ||
|
|
f51c1a150b | ||
|
|
970f31c292 | ||
|
|
d172405244 | ||
|
|
44ebfdb764 | ||
|
|
1b8f1af287 | ||
|
|
e7073bc5d9 | ||
|
|
63d3b699d7 | ||
|
|
458440e57b | ||
|
|
df9d4a2343 | ||
|
|
9e043bbae7 | ||
|
|
671486989f | ||
|
|
4a4f752204 | ||
|
|
b20e52da99 | ||
|
|
5525b2ba01 | ||
|
|
fe5ff39ca2 | ||
|
|
906bedf93a | ||
|
|
6f961a20dd | ||
|
|
e54b8a1009 | ||
|
|
d7d69a4a18 | ||
|
|
eb38dba5d6 | ||
|
|
6cea181ff1 | ||
|
|
9ff82fe17b | ||
|
|
5713b7eb6c | ||
|
|
7c627f9dfd | ||
|
|
c81e2d4767 | ||
|
|
3dd458267b | ||
|
|
892c4699dd | ||
|
|
40c351135a | ||
|
|
a3b08e1bef | ||
|
|
44a27c6204 | ||
|
|
c212e6e9ab | ||
|
|
5a709ed4a8 | ||
|
|
2491d3286d | ||
|
|
1a6477adec | ||
|
|
2149c3561b | ||
|
|
232041db2a | ||
|
|
4623bf5bba | ||
|
|
2664c2c108 | ||
|
|
f9367bacf1 | ||
|
|
aef54aeaf7 | ||
|
|
eff160eeb7 | ||
|
|
911c21f7be | ||
|
|
52795587ec | ||
|
|
3a6ffa6a85 | ||
|
|
e3c2c0397a | ||
|
|
ae7f97b639 | ||
|
|
2653b3bbf9 | ||
|
|
64c790f299 | ||
|
|
cbf035fca9 | ||
|
|
a118ec7cc9 | ||
|
|
6d21dc5495 | ||
|
|
6c9cf37811 | ||
|
|
557351156e | ||
|
|
4e57ca6833 | ||
|
|
d287a798cc | ||
|
|
27f21a34e2 | ||
|
|
852c5786ee | ||
|
|
799bc6e81c | ||
|
|
50674cb351 | ||
|
|
3be9038028 | ||
|
|
35eb58fae8 | ||
|
|
ab52fd75c2 | ||
|
|
e4bf1631e1 | ||
|
|
56725ad275 | ||
|
|
8ea7edf02a | ||
|
|
9d82bf74f3 | ||
|
|
ebe8493020 | ||
|
|
704924c3cd | ||
|
|
a7a6006533 | ||
|
|
58c608620e | ||
|
|
b1d2061cbc | ||
|
|
1f31073201 | ||
|
|
a3a1fb0dd7 | ||
|
|
b1b34d328a | ||
|
|
8234ce2712 | ||
|
|
26f6fa6570 | ||
|
|
0619a7a76c | ||
|
|
31cd782ba7 | ||
|
|
5e90b224c2 | ||
|
|
9a48566b24 | ||
|
|
76e70a6c81 | ||
|
|
5b7a7779fb | ||
|
|
48c7debe5a | ||
|
|
dc0fb85fd3 | ||
|
|
63b109a4f5 | ||
|
|
cd6daf0b79 | ||
|
|
d756bd6851 | ||
|
|
8c9e24841e | ||
|
|
f0e9837dca | ||
|
|
b449e1be60 | ||
|
|
f661f91323 | ||
|
|
7134856df2 | ||
|
|
8407dd885a | ||
|
|
e00fa5d5f8 | ||
|
|
993347bb8a | ||
|
|
e381e48a79 | ||
|
|
22d0cc1012 | ||
|
|
b28e398396 | ||
|
|
eba271db5b | ||
|
|
51c06574a0 | ||
|
|
26cb24acc8 | ||
|
|
2f9ab1d328 | ||
|
|
3e70d31e5d | ||
|
|
277975e33a | ||
|
|
7ef5cb4a1f | ||
|
|
07ae1edb44 | ||
|
|
7e35c2c3da | ||
|
|
5651b8b14b | ||
|
|
ac1b2b5c30 | ||
|
|
3058eedf47 | ||
|
|
89db842c3d | ||
|
|
96b6c5f65a | ||
|
|
bfce05438b | ||
|
|
ff60e6a6ce | ||
|
|
e215a2d280 | ||
|
|
0e8feb7ee9 | ||
|
|
ae096a331a | ||
|
|
d7e096aeee | ||
|
|
0da9d711c5 | ||
|
|
fecdbac291 | ||
|
|
473e8a1841 | ||
|
|
faf6d179be | ||
|
|
d141d5c9ae | ||
|
|
a36b45434f | ||
|
|
2ec1a1851d | ||
|
|
db216ec384 | ||
|
|
9b77371ea8 | ||
|
|
72cf485dce | ||
|
|
d20f54967e | ||
|
|
fb60070647 | ||
|
|
be7c1be75f | ||
|
|
8292d25d29 | ||
|
|
76945ab458 | ||
|
|
90ec761f95 | ||
|
|
050aaa40f8 | ||
|
|
0576eb3a10 | ||
|
|
7129f8347e | ||
|
|
4d25907155 | ||
|
|
b192e215a5 | ||
|
|
5e1d978946 | ||
|
|
a7447d5bba | ||
|
|
2d1addf5a4 | ||
|
|
962374aec1 | ||
|
|
ed4c8286a2 | ||
|
|
fcf7ddaf45 | ||
|
|
725fe8e018 | ||
|
|
5596dac5e1 | ||
|
|
57c0b16eeb | ||
|
|
0c06fb2b9f | ||
|
|
cfdec64958 | ||
|
|
d0c6e53b83 | ||
|
|
27caf62322 | ||
|
|
b8df321058 | ||
|
|
c1e3c02d13 | ||
|
|
06f6efa6d5 | ||
|
|
c035d53fb0 | ||
|
|
dde7b0d98a | ||
|
|
98d1644c5b | ||
|
|
5888ac56d8 | ||
|
|
a6bf72a791 | ||
|
|
3aa177c88f | ||
|
|
608799f5d0 | ||
|
|
97aef9b30d | ||
|
|
ca0fd229e1 | ||
|
|
a9bd53d77f | ||
|
|
ccbf3152af | ||
|
|
f8ce1a8183 | ||
|
|
cee1076e1d | ||
|
|
f8c150f201 | ||
|
|
a5cb8cd7c3 | ||
|
|
32799ad732 | ||
|
|
d47f90599e | ||
|
|
5817aeb837 | ||
|
|
7de06c3dcb | ||
|
|
6f0f173795 | ||
|
|
221a8720fe | ||
|
|
ff56533e0b | ||
|
|
e88619a3bb | ||
|
|
4cc701a9da | ||
|
|
d2e94c6ebd | ||
|
|
d7d32cf0b6 | ||
|
|
ebe32d35e2 | ||
|
|
ecafe7ce0f | ||
|
|
41a229e22e | ||
|
|
d9194b2670 | ||
|
|
365d1968e9 | ||
|
|
eebc432efb | ||
|
|
dd5aa2b7a4 | ||
|
|
d1d2c16fdd | ||
|
|
ef1898ba42 | ||
|
|
81cbca5bb8 | ||
|
|
da3db1be39 | ||
|
|
396bd4f2f2 | ||
|
|
cbea7b5d1c | ||
|
|
3e7973e08d | ||
|
|
ec5adf53a7 | ||
|
|
48eb173bcd | ||
|
|
69a07dfa6d | ||
|
|
800116d859 | ||
|
|
4f6073f283 | ||
|
|
9e13100f58 | ||
|
|
52bc1dab0b | ||
|
|
ff9f078a89 | ||
|
|
8d81804fee | ||
|
|
0fc625d7e9 | ||
|
|
ef1005b920 | ||
|
|
5cf8256d2e | ||
|
|
f0e884dc4e | ||
|
|
24bef3a1f5 | ||
|
|
5d557a54e1 | ||
|
|
3379f233e8 | ||
|
|
26b1584fd8 | ||
|
|
5fa91e7b95 | ||
|
|
d8bd2b7fd0 | ||
|
|
d02376c4c6 | ||
|
|
69fbb361f2 | ||
|
|
4468ca69c0 | ||
|
|
a4b3a3ba39 | ||
|
|
ad90f4ad99 | ||
|
|
cc8dd150f5 | ||
|
|
7ced071934 | ||
|
|
28d077c08a | ||
|
|
31ff5e4194 | ||
|
|
ea269104bd | ||
|
|
78b21c2483 | ||
|
|
fc42b3ed24 | ||
|
|
c8a3c1a6fd | ||
|
|
58f9428c58 | ||
|
|
3c6e235b32 | ||
|
|
35cfba06b4 | ||
|
|
f01dcd3894 | ||
|
|
e48fea1892 | ||
|
|
47bd5aca58 | ||
|
|
0aa3166709 | ||
|
|
51aaef3d76 | ||
|
|
d62f7adc9b | ||
|
|
853dd456a8 | ||
|
|
462a60da7b | ||
|
|
4abd0fa06d | ||
|
|
b1313962a7 | ||
|
|
2a862d533f | ||
|
|
a825336ba9 | ||
|
|
a55dbc0c37 | ||
|
|
818d262843 | ||
|
|
e05a4e9000 | ||
|
|
c3b3af8746 | ||
|
|
4889109b8d | ||
|
|
93f1f3777c | ||
|
|
14382abc2d | ||
|
|
85b3be9ce3 | ||
|
|
512b580820 | ||
|
|
e90cf16965 | ||
|
|
59001f2fe3 | ||
|
|
db055bb916 | ||
|
|
80fdc6ecc3 | ||
|
|
ff1725b367 | ||
|
|
d278c730ea | ||
|
|
4aa0130a92 | ||
|
|
c7ad70731a | ||
|
|
16dda9c496 | ||
|
|
b2e10e597f | ||
|
|
b2bf505e4c | ||
|
|
9c9058ebb4 | ||
|
|
ece610d682 | ||
|
|
d61d4272ce | ||
|
|
618e851cd6 | ||
|
|
2167a7ab2e | ||
|
|
ec9e559ec0 | ||
|
|
07e4047b7f | ||
|
|
7bb5ccfd80 | ||
|
|
eb36d6e7a2 | ||
|
|
000dc03360 | ||
|
|
0dd727e6eb | ||
|
|
6a845aa4f6 | ||
|
|
9eb7c63158 | ||
|
|
0f10082a21 | ||
|
|
6bd087ebb2 | ||
|
|
c7539e3310 | ||
|
|
e139d59896 | ||
|
|
b481bd1f73 | ||
|
|
2392a91033 | ||
|
|
0145bf397a | ||
|
|
d524dc8ad0 | ||
|
|
d2fb1b5ce8 | ||
|
|
286eec74f9 | ||
|
|
fb3e1a8e65 | ||
|
|
ba3411a1ac | ||
|
|
6685771255 | ||
|
|
e38866b2bf | ||
|
|
6f6df0e48d | ||
|
|
33e6242f6f | ||
|
|
aff191fc53 | ||
|
|
dd0a4f33ee | ||
|
|
4d4839011b | ||
|
|
0ef9eef87d | ||
|
|
14a63149f4 | ||
|
|
ceca091816 | ||
|
|
bc471da960 | ||
|
|
6f595f8fd3 | ||
|
|
42a10ba39e | ||
|
|
a21ce38fdf | ||
|
|
f8fa52a5d7 | ||
|
|
57ffe14fab | ||
|
|
9524159e68 | ||
|
|
dc25f462a9 | ||
|
|
663595ba94 | ||
|
|
8b1c109b9c | ||
|
|
ea3f044816 | ||
|
|
993f459880 | ||
|
|
43e580321a | ||
|
|
327395d793 | ||
|
|
acb3c8d79c | ||
|
|
ad4a6c4877 | ||
|
|
496fd5d3d3 | ||
|
|
a1bcf7f1d9 | ||
|
|
9e0a4f844a | ||
|
|
fb2be8e1e3 | ||
|
|
c04c3850ec | ||
|
|
f14e8b279c | ||
|
|
70a7265f35 | ||
|
|
b35bb20a18 | ||
|
|
def685a4e1 | ||
|
|
8647e50941 | ||
|
|
8b50fd0461 | ||
|
|
01890cd415 | ||
|
|
a1809277a0 | ||
|
|
8138c663a8 | ||
|
|
c5c4d7c8f8 | ||
|
|
f8b0c8049c | ||
|
|
1d230fe055 | ||
|
|
329b2d1cb2 | ||
|
|
bb40b1188c | ||
|
|
98068611b1 |
44
.github/workflows/continuous-integration.yml
vendored
Normal file
44
.github/workflows/continuous-integration.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
# Based on https://github.com/actions/starter-workflows/blob/master/ci/node.js.yml
|
||||
|
||||
name: Build and Test
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, macos-latest, windows-latest]
|
||||
node-version: [10.x, 12.x, 14.x, 16.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- run: npm ci
|
||||
|
||||
# Ensure that we can still build in the current version of Node
|
||||
- run: node ./bin/cake build:except-parser
|
||||
- run: node ./bin/cake build:parser
|
||||
# Build twice to ensure that the latest build of the compiler can still build itself
|
||||
- run: node ./bin/cake build:except-parser
|
||||
- run: node ./bin/cake build:parser
|
||||
# Build the browser compiler for the headless browser test
|
||||
- run: node ./bin/cake build:browser
|
||||
|
||||
# Check that the git diff is clean, to ensure that the updated build output was committed
|
||||
- run: git diff --exit-code
|
||||
|
||||
# Build test.html, so that test:browser uses the latest tests
|
||||
- run: node ./bin/cake doc:test
|
||||
|
||||
# Test
|
||||
- run: node ./bin/cake test
|
||||
- run: node ./bin/cake test:browser
|
||||
- run: node ./bin/cake test:browser:node
|
||||
- run: node ./bin/cake test:integrations
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -8,3 +8,5 @@ test/*.js
|
||||
parser.output
|
||||
/node_modules
|
||||
npm-debug.log*
|
||||
yarn.lock
|
||||
.DS_Store
|
||||
|
||||
46
CODE_OF_CONDUCT.md
Normal file
46
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at maintainers@coffeescript.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
@@ -4,6 +4,11 @@
|
||||
|
||||
* Before sending a pull request for a feature, be sure to have [tests](https://github.com/jashkenas/coffeescript/tree/master/test).
|
||||
|
||||
* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffeescript/tree/master/src). If you're just getting started with CoffeeScript, there's a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide).
|
||||
* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffeescript/tree/master/src). If you’re just getting started with CoffeeScript, there’s a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide).
|
||||
|
||||
* In your pull request, do not add documentation to `index.html` or re-build the minified `coffee-script.js` file. We'll do those things before cutting a new release.
|
||||
* In your pull request, do not add documentation to `index.html` or re-build the minified `coffeescript.js` file. We’ll do those things before cutting a new release. You _should,_ however, commit the updated compiled JavaScript files in `lib`.
|
||||
|
||||
* To get started, read the guides in the wiki:
|
||||
* [Hacking on the CoffeeScript Compiler](https://github.com/jashkenas/coffeescript/wiki/%5BHowTo%5D-Hacking-on-the-CoffeeScript-Compiler)
|
||||
* [How parsing works](https://github.com/jashkenas/coffeescript/wiki/%5BHowTo%5D-How-parsing-works)
|
||||
* [Update the docs](https://github.com/jashkenas/coffeescript/wiki/%5BHowTo%5D-Update-the-docs)
|
||||
|
||||
382
Cakefile
382
Cakefile
@@ -1,25 +1,27 @@
|
||||
fs = require 'fs'
|
||||
os = require 'os'
|
||||
path = require 'path'
|
||||
_ = require 'underscore'
|
||||
{ spawn, exec, execSync } = require 'child_process'
|
||||
CoffeeScript = require './lib/coffee-script'
|
||||
helpers = require './lib/coffee-script/helpers'
|
||||
CoffeeScript = require './lib/coffeescript'
|
||||
helpers = require './lib/coffeescript/helpers'
|
||||
|
||||
# ANSI Terminal Colors.
|
||||
bold = red = green = reset = ''
|
||||
bold = red = green = yellow = reset = ''
|
||||
unless process.env.NODE_DISABLE_COLORS
|
||||
bold = '\x1B[0;1m'
|
||||
red = '\x1B[0;31m'
|
||||
green = '\x1B[0;32m'
|
||||
reset = '\x1B[0m'
|
||||
bold = '\x1B[0;1m'
|
||||
red = '\x1B[0;31m'
|
||||
green = '\x1B[0;32m'
|
||||
yellow = '\x1B[0;33m'
|
||||
reset = '\x1B[0m'
|
||||
|
||||
# Built file header.
|
||||
header = """
|
||||
/**
|
||||
* CoffeeScript Compiler v#{CoffeeScript.VERSION}
|
||||
* http://coffeescript.org
|
||||
* https://coffeescript.org
|
||||
*
|
||||
* Copyright 2011, Jeremy Ashkenas
|
||||
* Copyright 2011-#{new Date().getFullYear()}, Jeremy Ashkenas
|
||||
* Released under the MIT License
|
||||
*/
|
||||
"""
|
||||
@@ -51,27 +53,40 @@ run = (args, callback) ->
|
||||
buildParser = ->
|
||||
helpers.extend global, require 'util'
|
||||
require 'jison'
|
||||
parser = require('./lib/coffee-script/grammar').parser.generate()
|
||||
# Patch Jison’s output, until https://github.com/zaach/jison/pull/339 is accepted,
|
||||
# to ensure that require('fs') is only called where it exists.
|
||||
parser = parser.replace "var source = require('fs')", """
|
||||
var source = '';
|
||||
var fs = require('fs');
|
||||
if (typeof fs !== 'undefined' && fs !== null)
|
||||
source = fs"""
|
||||
fs.writeFileSync 'lib/coffee-script/parser.js', parser
|
||||
# We don't need `moduleMain`, since the parser is unlikely to be run standalone.
|
||||
parser = require('./lib/coffeescript/grammar').parser.generate(moduleMain: ->)
|
||||
fs.writeFileSync 'lib/coffeescript/parser.js', parser
|
||||
|
||||
buildExceptParser = (callback) ->
|
||||
files = fs.readdirSync 'src'
|
||||
files = ('src/' + file for file in files when file.match(/\.(lit)?coffee$/))
|
||||
run ['-c', '-o', 'lib/coffee-script'].concat(files), callback
|
||||
run ['-c', '-o', 'lib/coffeescript'].concat(files), callback
|
||||
|
||||
build = (callback) ->
|
||||
buildParser()
|
||||
buildExceptParser callback
|
||||
|
||||
transpile = (code, options = {}) ->
|
||||
options.minify = process.env.MINIFY isnt 'false'
|
||||
options.transform = process.env.TRANSFORM isnt 'false'
|
||||
options.sourceType ?= 'script'
|
||||
babel = require '@babel/core'
|
||||
presets = []
|
||||
# Exclude the `modules` plugin in order to not break the `}(this));`
|
||||
# at the end of the `build:browser` code block.
|
||||
presets.push ['@babel/env', {modules: no}] if options.transform
|
||||
presets.push ['minify', {mangle: no, evaluate: no, removeUndefined: no}] if options.minify
|
||||
babelOptions =
|
||||
presets: presets
|
||||
compact: options.minify
|
||||
minified: options.minify
|
||||
comments: not options.minify
|
||||
sourceType: options.sourceType
|
||||
{ code } = babel.transformSync code, babelOptions unless presets.length is 0
|
||||
code
|
||||
|
||||
testBuiltCode = (watch = no) ->
|
||||
csPath = './lib/coffee-script'
|
||||
csPath = './lib/coffeescript'
|
||||
csDir = path.dirname require.resolve csPath
|
||||
|
||||
for mod of require.cache when csDir is mod[0 ... csDir.length]
|
||||
@@ -83,7 +98,7 @@ testBuiltCode = (watch = no) ->
|
||||
|
||||
buildAndTest = (includingParser = yes, harmony = no) ->
|
||||
process.stdout.write '\x1Bc' # Clear terminal screen.
|
||||
execSync 'git checkout lib/*', stdio: [0,1,2] # Reset the generated compiler.
|
||||
execSync 'git checkout lib/*', stdio: 'inherit' # Reset the generated compiler.
|
||||
|
||||
buildArgs = ['bin/cake']
|
||||
buildArgs.push if includingParser then 'build' else 'build:except-parser'
|
||||
@@ -116,27 +131,32 @@ task 'build:full', 'build the CoffeeScript compiler from source twice, and run t
|
||||
build ->
|
||||
build testBuiltCode
|
||||
|
||||
task 'build:browser', 'build the merged script for inclusion in the browser', ->
|
||||
task 'build:browser', 'merge the built scripts into a single file for use in a browser', ->
|
||||
code = """
|
||||
require['../../package.json'] = (function() {
|
||||
return #{fs.readFileSync "./package.json"};
|
||||
})();
|
||||
"""
|
||||
for name in ['helpers', 'rewriter', 'lexer', 'parser', 'scope', 'nodes', 'sourcemap', 'coffee-script', 'browser']
|
||||
for name in ['helpers', 'rewriter', 'lexer', 'parser', 'scope', 'nodes', 'sourcemap', 'coffeescript', 'browser']
|
||||
code += """
|
||||
require['./#{name}'] = (function() {
|
||||
var exports = {}, module = {exports: exports};
|
||||
#{fs.readFileSync "lib/coffee-script/#{name}.js"}
|
||||
#{fs.readFileSync "lib/coffeescript/#{name}.js"}
|
||||
return module.exports;
|
||||
})();
|
||||
"""
|
||||
# From here, we generate two outputs: a legacy script output for all browsers
|
||||
# and a module output for browsers that support `<script type="module">`.
|
||||
code = """
|
||||
var CoffeeScript = function() {
|
||||
function require(path){ return require[path]; }
|
||||
#{code}
|
||||
return require['./browser'];
|
||||
}();
|
||||
"""
|
||||
scriptCode = transpile """
|
||||
(function(root) {
|
||||
var CoffeeScript = function() {
|
||||
function require(path){ return require[path]; }
|
||||
#{code}
|
||||
return require['./coffee-script'];
|
||||
}();
|
||||
#{code}
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function() { return CoffeeScript; });
|
||||
@@ -145,15 +165,28 @@ task 'build:browser', 'build the merged script for inclusion in the browser', ->
|
||||
}
|
||||
}(this));
|
||||
"""
|
||||
unless process.env.MINIFY is 'false'
|
||||
{compiledCode: code} = require('google-closure-compiler-js').compile
|
||||
jsCode: [
|
||||
src: code
|
||||
languageOut: if majorVersion is 1 then 'ES5' else 'ES6'
|
||||
]
|
||||
outputFolder = "docs/v#{majorVersion}/browser-compiler"
|
||||
fs.mkdirSync outputFolder unless fs.existsSync outputFolder
|
||||
fs.writeFileSync "#{outputFolder}/coffee-script.js", header + '\n' + code
|
||||
moduleCode = transpile """
|
||||
#{code}
|
||||
|
||||
export default CoffeeScript;
|
||||
const { VERSION, compile, eval: evaluate, load, run, runScripts } = CoffeeScript;
|
||||
export { VERSION, compile, evaluate as eval, load, run, runScripts };
|
||||
""", {sourceType: 'module'}
|
||||
outputFolders = [
|
||||
"docs/v#{majorVersion}/browser-compiler-legacy"
|
||||
"docs/v#{majorVersion}/browser-compiler-modern"
|
||||
"lib/coffeescript-browser-compiler-legacy"
|
||||
"lib/coffeescript-browser-compiler-modern"
|
||||
]
|
||||
for outputFolder in outputFolders
|
||||
fs.mkdirSync outputFolder unless fs.existsSync outputFolder
|
||||
fs.writeFileSync "#{outputFolder}/coffeescript.js", """
|
||||
#{header}
|
||||
#{if outputFolder.includes('legacy') then scriptCode else moduleCode}
|
||||
"""
|
||||
|
||||
task 'build:browser:full', 'merge the built scripts into a single file for use in a browser, and test it', ->
|
||||
invoke 'build:browser'
|
||||
console.log "built ... running browser tests:"
|
||||
invoke 'test:browser'
|
||||
|
||||
@@ -166,54 +199,69 @@ task 'build:watch:harmony', 'watch and continually rebuild the CoffeeScript comp
|
||||
|
||||
buildDocs = (watch = no) ->
|
||||
# Constants
|
||||
indexFile = 'documentation/index.html'
|
||||
versionedSourceFolder = "documentation/v#{majorVersion}"
|
||||
sectionsSourceFolder = 'documentation/sections'
|
||||
examplesSourceFolder = 'documentation/examples'
|
||||
outputFolder = "docs/v#{majorVersion}"
|
||||
indexFile = 'documentation/site/index.html'
|
||||
siteSourceFolder = "documentation/site"
|
||||
sectionsSourceFolder = 'documentation/sections'
|
||||
changelogSourceFolder = 'documentation/sections/changelog'
|
||||
examplesSourceFolder = 'documentation/examples'
|
||||
outputFolder = "docs/v#{majorVersion}"
|
||||
|
||||
# Helpers
|
||||
releaseHeader = (date, version, prevVersion) ->
|
||||
monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
||||
|
||||
formatDate = (date) ->
|
||||
date.replace /^(\d\d\d\d)-(\d\d)-(\d\d)$/, (match, $1, $2, $3) ->
|
||||
"#{monthNames[$2 - 1]} #{+$3}, #{$1}"
|
||||
|
||||
"""
|
||||
<div class="anchor" id="#{version}"></div>
|
||||
<h2 class="header">
|
||||
#{prevVersion and "<a href=\"https://github.com/jashkenas/coffeescript/compare/#{prevVersion}...#{version}\">#{version}</a>" or version}
|
||||
<span class="timestamp"> — <time datetime="#{date}">#{formatDate date}</time></span>
|
||||
</h2>
|
||||
<h3>#{prevVersion and "<a href=\"https://github.com/jashkenas/coffeescript/compare/#{prevVersion}...#{version}\">#{version}</a>" or version}
|
||||
<span class="timestamp"> — <time datetime="#{date}">#{date}</time></span>
|
||||
</h3>
|
||||
"""
|
||||
|
||||
codeFor = require "./documentation/v#{majorVersion}/code.coffee"
|
||||
codeFor = require "./documentation/site/code.coffee"
|
||||
|
||||
htmlFor = ->
|
||||
marked = require 'marked'
|
||||
markdownRenderer = new marked.Renderer()
|
||||
markdownRenderer.heading = (text, level) ->
|
||||
"<h#{level}>#{text}</h#{level}>" # Don’t let marked add an id
|
||||
markdownRenderer.code = (code) ->
|
||||
hljs = require 'highlight.js'
|
||||
hljs.configure classPrefix: ''
|
||||
markdownRenderer = require('markdown-it')
|
||||
html: yes
|
||||
typographer: yes
|
||||
highlight: (str, language) ->
|
||||
# From https://github.com/markdown-it/markdown-it#syntax-highlighting
|
||||
if language and hljs.getLanguage(language)
|
||||
try
|
||||
return hljs.highlight(str, { language }).value
|
||||
catch ex
|
||||
return '' # No syntax highlighting
|
||||
|
||||
|
||||
# Add some custom overrides to Markdown-It’s rendering, per
|
||||
# https://github.com/markdown-it/markdown-it/blob/master/docs/architecture.md#renderer
|
||||
defaultFence = markdownRenderer.renderer.rules.fence
|
||||
markdownRenderer.renderer.rules.fence = (tokens, idx, options, env, slf) ->
|
||||
code = tokens[idx].content
|
||||
if code.indexOf('codeFor(') is 0 or code.indexOf('releaseHeader(') is 0
|
||||
"<%= #{code} %>"
|
||||
else
|
||||
"<pre><code>#{code}</code></pre>" # Default
|
||||
"<blockquote class=\"uneditable-code-block\">#{defaultFence.apply @, arguments}</blockquote>"
|
||||
|
||||
(file, bookmark) ->
|
||||
md = fs.readFileSync "#{sectionsSourceFolder}/#{file}.md", 'utf-8'
|
||||
md = fs.readFileSync "#{sectionsSourceFolder}/#{file.replace /\//g, path.sep}.md", 'utf-8'
|
||||
md = md.replace /<%= releaseHeader %>/g, releaseHeader
|
||||
md = md.replace /<%= majorVersion %>/g, majorVersion
|
||||
md = md.replace /<%= fullVersion %>/g, CoffeeScript.VERSION
|
||||
html = marked md, renderer: markdownRenderer
|
||||
html = markdownRenderer.render md
|
||||
html = _.template(html)
|
||||
codeFor: codeFor()
|
||||
releaseHeader: releaseHeader
|
||||
|
||||
includeScript = ->
|
||||
(file) ->
|
||||
file = "#{siteSourceFolder}/#{file}" unless '/' in file
|
||||
code = fs.readFileSync file, 'utf-8'
|
||||
code = CoffeeScript.compile code
|
||||
code = transpile code
|
||||
code
|
||||
|
||||
include = ->
|
||||
(file) ->
|
||||
file = "#{versionedSourceFolder}/#{file}" if file.indexOf('/') is -1
|
||||
file = "#{siteSourceFolder}/#{file}" unless '/' in file
|
||||
output = fs.readFileSync file, 'utf-8'
|
||||
if /\.html$/.test(file)
|
||||
render = _.template output
|
||||
@@ -224,6 +272,7 @@ buildDocs = (watch = no) ->
|
||||
htmlFor: htmlFor()
|
||||
codeFor: codeFor()
|
||||
include: include()
|
||||
includeScript: includeScript()
|
||||
output
|
||||
|
||||
# Task
|
||||
@@ -238,7 +287,7 @@ buildDocs = (watch = no) ->
|
||||
catch exception
|
||||
|
||||
if watch
|
||||
for target in [indexFile, versionedSourceFolder, examplesSourceFolder, sectionsSourceFolder]
|
||||
for target in [indexFile, siteSourceFolder, examplesSourceFolder, sectionsSourceFolder, changelogSourceFolder]
|
||||
fs.watch target, interval: 200, renderIndex
|
||||
log 'watching...', green
|
||||
|
||||
@@ -251,9 +300,9 @@ task 'doc:site:watch', 'watch and continually rebuild the documentation for the
|
||||
|
||||
buildDocTests = (watch = no) ->
|
||||
# Constants
|
||||
testFile = 'documentation/test.html'
|
||||
testFile = 'documentation/site/test.html'
|
||||
testsSourceFolder = 'test'
|
||||
outputFolder = "docs/v#{majorVersion}"
|
||||
outputFolder = "docs/v#{majorVersion}"
|
||||
|
||||
# Included in test.html
|
||||
testHelpers = fs.readFileSync('test/support/helpers.coffee', 'utf-8').replace /exports\./g, '@'
|
||||
@@ -301,7 +350,7 @@ task 'doc:test:watch', 'watch and continually rebuild the browser-based tests',
|
||||
|
||||
buildAnnotatedSource = (watch = no) ->
|
||||
do generateAnnotatedSource = ->
|
||||
exec "node_modules/docco/bin/docco src/*.*coffee --output docs/v#{majorVersion}/annotated-source", (err) -> throw err if err
|
||||
exec "cd src && ../node_modules/docco/bin/docco *.*coffee --output ../docs/v#{majorVersion}/annotated-source", (err) -> throw err if err
|
||||
log 'generated', green, "annotated source in docs/v#{majorVersion}/annotated-source/"
|
||||
|
||||
if watch
|
||||
@@ -316,15 +365,21 @@ task 'doc:source:watch', 'watch and continually rebuild the annotated source doc
|
||||
|
||||
|
||||
task 'release', 'build and test the CoffeeScript source, and build the documentation', ->
|
||||
invoke 'build:full'
|
||||
invoke 'build:browser'
|
||||
invoke 'doc:site'
|
||||
invoke 'doc:test'
|
||||
invoke 'doc:source'
|
||||
execSync '''
|
||||
cake build:full
|
||||
cake build:browser
|
||||
cake doc:test
|
||||
cake test:browser:node
|
||||
cake test:browser
|
||||
cake test:integrations
|
||||
cake doc:site
|
||||
cake doc:source
|
||||
''', stdio: 'inherit'
|
||||
|
||||
|
||||
task 'bench', 'quick benchmark of compilation time', ->
|
||||
{Rewriter} = require './lib/coffee-script/rewriter'
|
||||
sources = ['coffee-script', 'grammar', 'helpers', 'lexer', 'nodes', 'rewriter']
|
||||
{Rewriter} = require './lib/coffeescript/rewriter'
|
||||
sources = ['coffeescript', 'grammar', 'helpers', 'lexer', 'nodes', 'rewriter']
|
||||
coffee = sources.map((name) -> fs.readFileSync "src/#{name}.coffee").join '\n'
|
||||
litcoffee = fs.readFileSync("src/scope.litcoffee").toString()
|
||||
fmt = (ms) -> " #{bold}#{ " #{ms}".slice -4 }#{reset} ms"
|
||||
@@ -346,30 +401,49 @@ task 'bench', 'quick benchmark of compilation time', ->
|
||||
|
||||
# Run the CoffeeScript test suite.
|
||||
runTests = (CoffeeScript) ->
|
||||
CoffeeScript.register()
|
||||
startTime = Date.now()
|
||||
currentFile = null
|
||||
passedTests = 0
|
||||
failures = []
|
||||
CoffeeScript.register() unless global.testingBrowser
|
||||
|
||||
# These are attached to `global` so that they’re accessible from within
|
||||
# `test/async.coffee`, which has an async-capable version of
|
||||
# `global.test`.
|
||||
global.currentFile = null
|
||||
global.passedTests = 0
|
||||
global.failures = []
|
||||
|
||||
global[name] = func for name, func of require 'assert'
|
||||
|
||||
# Convenience aliases.
|
||||
global.CoffeeScript = CoffeeScript
|
||||
global.Repl = require './lib/coffee-script/repl'
|
||||
global.Repl = require './lib/coffeescript/repl'
|
||||
global.bold = bold
|
||||
global.red = red
|
||||
global.green = green
|
||||
global.yellow = yellow
|
||||
global.reset = reset
|
||||
|
||||
asyncTests = []
|
||||
onFail = (description, fn, err) ->
|
||||
failures.push
|
||||
filename: global.currentFile
|
||||
error: err
|
||||
description: description
|
||||
source: fn.toString() if fn.toString?
|
||||
|
||||
# Our test helper function for delimiting different test cases.
|
||||
global.test = (description, fn) ->
|
||||
try
|
||||
fn.test = {description, currentFile}
|
||||
fn.call(fn)
|
||||
++passedTests
|
||||
catch e
|
||||
failures.push
|
||||
filename: currentFile
|
||||
error: e
|
||||
description: description if description?
|
||||
source: fn.toString() if fn.toString?
|
||||
result = fn.call(fn)
|
||||
if result instanceof Promise # An async test.
|
||||
asyncTests.push result
|
||||
result.then ->
|
||||
passedTests++
|
||||
.catch (err) ->
|
||||
onFail description, fn, err
|
||||
else
|
||||
passedTests++
|
||||
catch err
|
||||
onFail description, fn, err
|
||||
|
||||
helpers.extend global, require './test/support/helpers'
|
||||
|
||||
@@ -388,9 +462,24 @@ runTests = (CoffeeScript) ->
|
||||
console.log " #{source}" if source
|
||||
return
|
||||
|
||||
# Run every test in the `test` folder, recording failures.
|
||||
files = fs.readdirSync 'test'
|
||||
# Run every test in the `test` folder, recording failures, except for files
|
||||
# we’re skipping because the features to be tested are unsupported in the
|
||||
# current Node runtime.
|
||||
testFilesToSkip = []
|
||||
skipUnless = (featureDetect, filenames) ->
|
||||
unless (try new Function featureDetect)
|
||||
testFilesToSkip = testFilesToSkip.concat filenames
|
||||
skipUnless 'async () => {}', ['async.coffee', 'async_iterators.coffee']
|
||||
skipUnless 'async function* generator() { yield 42; }', ['async_iterators.coffee']
|
||||
skipUnless 'var a = 2 ** 2; a **= 3', ['exponentiation.coffee']
|
||||
skipUnless 'var {...a} = {}', ['object_rest_spread.coffee']
|
||||
skipUnless '/foo.bar/s.test("foo\tbar")', ['regex_dotall.coffee']
|
||||
skipUnless '1_2_3', ['numeric_literal_separators.coffee']
|
||||
skipUnless '1n', ['numbers_bigint.coffee']
|
||||
files = fs.readdirSync('test').filter (filename) ->
|
||||
filename not in testFilesToSkip
|
||||
|
||||
startTime = Date.now()
|
||||
for file in files when helpers.isCoffee file
|
||||
literate = helpers.isLiterate file
|
||||
currentFile = filename = path.join 'test', file
|
||||
@@ -399,16 +488,117 @@ runTests = (CoffeeScript) ->
|
||||
CoffeeScript.run code.toString(), {filename, literate}
|
||||
catch error
|
||||
failures.push {filename, error}
|
||||
return !failures.length
|
||||
|
||||
Promise.all(asyncTests).then ->
|
||||
Promise.reject() if failures.length isnt 0
|
||||
|
||||
|
||||
task 'test', 'run the CoffeeScript language test suite', ->
|
||||
runTests CoffeeScript
|
||||
runTests(CoffeeScript).catch -> process.exit 1
|
||||
|
||||
|
||||
task 'test:browser', 'run the test suite against the merged browser script', ->
|
||||
source = fs.readFileSync "docs/v#{majorVersion}/browser-compiler/coffee-script.js", 'utf-8'
|
||||
task 'test:browser', 'run the test suite against the modern browser compiler in a headless browser', ->
|
||||
# This test uses Puppeteer to launch headless Chrome to test the ES module
|
||||
# version of the browser compiler. There’s no reason to run this test in old
|
||||
# versions of Node (the runtime is the headless Chrome browser, not Node),
|
||||
# and Puppeteer 3 only supports Node >= 10.18.1, so limit this test to those
|
||||
# versions. The code below uses `Promise.prototype.finally` because the
|
||||
# CoffeeScript codebase currently maintains compatibility with Node 6, which
|
||||
# did not support `async`/`await` syntax. Even though this test doesn’t run
|
||||
# in Node 6, it needs to still _parse_ in Node 6 so that this file can load.
|
||||
[major, minor, build] = process.versions.node.split('.').map (n) -> parseInt(n, 10)
|
||||
return if major < 10 or (major is 10 and minor < 18) or (major is 10 and minor is 18 and build < 1)
|
||||
|
||||
# Create very simple web server to serve the two files we need.
|
||||
http = require 'http'
|
||||
serveFile = (res, fileToServe, mimeType) ->
|
||||
res.statusCode = 200
|
||||
res.setHeader 'Content-Type', mimeType
|
||||
fs.createReadStream(fileToServe).pipe res
|
||||
server = http.createServer (req, res) ->
|
||||
if req.url is '/'
|
||||
serveFile res, path.join(__dirname, 'docs', "v#{majorVersion}", 'test.html'), 'text/html'
|
||||
else if req.url is '/browser-compiler-modern/coffeescript.js'
|
||||
# The `text/javascript` MIME type is required for an ES module file to be
|
||||
# loaded in a browser.
|
||||
serveFile res, path.join(__dirname, 'docs', "v#{majorVersion}", 'browser-compiler-modern', 'coffeescript.js'), 'text/javascript'
|
||||
else
|
||||
res.statusCode = 404
|
||||
res.end()
|
||||
server.listen 8080
|
||||
|
||||
puppeteer = require 'puppeteer'
|
||||
browser = page = result = null
|
||||
puppeteer.launch()
|
||||
.then((browserHandle) ->
|
||||
browser = browserHandle
|
||||
browser.newPage()
|
||||
).then((pageHandle) ->
|
||||
page = pageHandle
|
||||
page.goto 'http://localhost:8080/'
|
||||
).then(->
|
||||
page.waitForSelector '#result',
|
||||
visible: yes
|
||||
polling: 'mutation'
|
||||
).then((element) ->
|
||||
page.evaluate ((el) => el.textContent), element
|
||||
).then((elementText) ->
|
||||
result = elementText
|
||||
).finally(->
|
||||
browser.close()
|
||||
).finally ->
|
||||
server.close()
|
||||
if result and not result.includes('failed')
|
||||
log result, green
|
||||
else
|
||||
log result, red
|
||||
process.exit 1
|
||||
|
||||
|
||||
task 'test:browser:node', 'run the test suite against the legacy browser compiler in Node', ->
|
||||
source = fs.readFileSync "lib/coffeescript-browser-compiler-legacy/coffeescript.js", 'utf-8'
|
||||
result = {}
|
||||
global.testingBrowser = yes
|
||||
(-> eval source).call result
|
||||
runTests result.CoffeeScript
|
||||
runTests(CoffeeScript).catch -> process.exit 1
|
||||
|
||||
|
||||
task 'test:integrations', 'test the module integrated with other libraries and environments', ->
|
||||
# Tools like Webpack and Browserify generate builds intended for a browser
|
||||
# environment where Node modules are not available. We want to ensure that
|
||||
# the CoffeeScript module as presented by the `browser` key in `package.json`
|
||||
# can be built by such tools; if such a build succeeds, it verifies that no
|
||||
# Node modules are required as part of the compiler (as opposed to the tests)
|
||||
# and that therefore the compiler will run in a browser environment.
|
||||
# Webpack 5 requires Node >= 10.13.0.
|
||||
[major, minor] = process.versions.node.split('.').map (n) -> parseInt(n, 10)
|
||||
return if major < 10 or (major is 10 and minor < 13)
|
||||
tmpdir = os.tmpdir()
|
||||
webpack = require 'webpack'
|
||||
webpack {
|
||||
entry: './'
|
||||
optimization:
|
||||
# Webpack’s minification causes the CoffeeScript module to fail some tests.
|
||||
minimize: off
|
||||
output:
|
||||
path: tmpdir
|
||||
filename: 'coffeescript.js'
|
||||
library: 'CoffeeScript'
|
||||
libraryTarget: 'commonjs2'
|
||||
}, (err, stats) ->
|
||||
if err or stats.hasErrors()
|
||||
if err
|
||||
console.error err.stack or err
|
||||
console.error err.details if err.details
|
||||
if stats.hasErrors()
|
||||
console.error error for error in stats.compilation.errors
|
||||
if stats.hasWarnings()
|
||||
console.warn warning for warning in stats.compilation.warnings
|
||||
process.exit 1
|
||||
|
||||
builtCompiler = path.join tmpdir, 'coffeescript.js'
|
||||
{ CoffeeScript } = require builtCompiler
|
||||
global.testingBrowser = yes
|
||||
testResults = runTests CoffeeScript
|
||||
fs.unlinkSync builtCompiler
|
||||
process.exit 1 unless testResults
|
||||
|
||||
62
ISSUE_TEMPLATE.md
Normal file
62
ISSUE_TEMPLATE.md
Normal file
@@ -0,0 +1,62 @@
|
||||
<!---
|
||||
Thanks for filing an issue 😄! Before you submit, please read the following:
|
||||
|
||||
Search open/closed issues before submitting since someone might have asked the same thing before!
|
||||
Our issues history stretches back to 2009, so the odds are good that your topic has come up.
|
||||
|
||||
If you have a support request or question please use Stack Overflow:
|
||||
https://stackoverflow.com/questions/tagged/coffeescript
|
||||
|
||||
Issues on GitHub are only related to problems of the CoffeeScript compiler itself and we cannot answer
|
||||
support questions here.
|
||||
-->
|
||||
|
||||
Choose one: is this a bug report or feature request?
|
||||
|
||||
<!---
|
||||
Provide a general summary of the issue in the title above.
|
||||
|
||||
For bugs, please also preface your title with “Bug:”. For feature requests, please preface your title
|
||||
with “Proposal:”. Once your issue is reviewed, a maintainer will edit the title to refer to the part
|
||||
of the codebase most relevant to the issue (if applicable).
|
||||
|
||||
If your request is that CoffeeScript support a new feature recently arrived to JavaScript, please note
|
||||
that we generally only add features that have reached Stage 4 in the specification (in other words,
|
||||
the syntax is finalized and the feature is approved to be part of the next ES release). You can still
|
||||
open an issue, but it will likely be tagged with “[Awaiting Stage 4]” until the relevant ES feature is
|
||||
approved for release. See https://coffeescript.org/#contributing
|
||||
|
||||
There are also a handful of JavaScript features that CoffeeScript intentionally does not support.
|
||||
Please do not open issues regarding these. They’re listed in https://coffeescript.org/#unsupported
|
||||
-->
|
||||
|
||||
### Input Code
|
||||
<!--- If you're describing a bug, please let us know which sample code reproduces your problem. -->
|
||||
<!--- If you have link from https://coffeescript.org/#try or a standalone repo please include that! -->
|
||||
|
||||
```coffee
|
||||
your (code) => here
|
||||
```
|
||||
|
||||
### Expected Behavior
|
||||
<!--- If you’re describing a bug, tell us what should happen. -->
|
||||
<!--- If you’re suggesting a change/improvement, tell us how it should work. -->
|
||||
|
||||
### Current Behavior
|
||||
<!--- If describing a bug, tell us what happens instead of the expected behavior. -->
|
||||
<!--- If suggesting a change/improvement, explain the difference from current behavior. -->
|
||||
|
||||
### Possible Solution
|
||||
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||
<!--- or ideas how to implement the addition or change. -->
|
||||
|
||||
### Context
|
||||
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||
<!--- Providing context helps us come up with a solution that is most useful in the real world. -->
|
||||
|
||||
### Environment
|
||||
<!--- For bugs, please let us know what version of CoffeeScript you’re running: `coffee -v`. -->
|
||||
<!--- If you think it might be relevant, please also let us know your version of Node. -->
|
||||
|
||||
* CoffeeScript version:
|
||||
* Node.js version:
|
||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2009-2017 Jeremy Ashkenas
|
||||
Copyright (c) 2009-2018 Jeremy Ashkenas
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
|
||||
22
PULL_REQUEST_TEMPLATE.md
Normal file
22
PULL_REQUEST_TEMPLATE.md
Normal file
@@ -0,0 +1,22 @@
|
||||
<!--
|
||||
Before making a PR please make sure to read our contributing guidelines:
|
||||
https://coffeescript.org/#contributing
|
||||
|
||||
For issue references: Add a comma-separated list of a
|
||||
[closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by
|
||||
the ticket number fixed by the PR. It should be underlined in the preview if done correctly.
|
||||
|
||||
All new features require tests. All but the most trivial bug fixes should also have new or updated tests.
|
||||
|
||||
Ensure that all new code you add to the compiler can be run in the minimum version of Node listed in
|
||||
`package.json`. New tests can require newer Node runtimes, but you may need to ensure that such tests
|
||||
only run in supported runtimes; see `Cakefile` for examples of how to filter out certain tests in
|
||||
runtimes that don’t support them.
|
||||
|
||||
Please follow the code style of the rest of the CoffeeScript codebase. Write comments in complete
|
||||
sentences using Markdown, as the comments become the [annotated source](https://coffeescript.org/#annotated-source).
|
||||
For tests proving a bug is fixed, please mention the issue number in the test description (see examples
|
||||
in the codebase).
|
||||
|
||||
Describe your changes below in as much detail as possible.
|
||||
-->
|
||||
63
README.md
63
README.md
@@ -1,34 +1,43 @@
|
||||
{
|
||||
} } {
|
||||
{ { } }
|
||||
} }{ {
|
||||
{ }{ } } _____ __ __
|
||||
{ }{ }{ { } / ____| / _|/ _|
|
||||
.- { { } { }} -. | | ___ | |_| |_ ___ ___
|
||||
( { } { } { } } ) | | / _ \| _| _/ _ \/ _ \
|
||||
|`-..________ ..-'| | |___| (_) | | | || __/ __/
|
||||
| | \_____\___/|_| |_| \___|\___|
|
||||
| ;--.
|
||||
| (__ \ _____ _ _
|
||||
| | ) ) / ____| (_) | |
|
||||
| |/ / | (___ ___ _ __ _ _ __ | |_
|
||||
| ( / \___ \ / __| '__| | '_ \| __|
|
||||
| |/ ____) | (__| | | | |_) | |_
|
||||
| | |_____/ \___|_| |_| .__/ \__|
|
||||
`-.._________..-' | |
|
||||
|_|
|
||||
```
|
||||
@@@@@@@ @@@@ @@@@@
|
||||
@@@@@@@@@@ @@@ @@@ {
|
||||
@@@@ @@ @@@ @@@ } } {
|
||||
@@@@ @@@@@@@ @@@ @@@ @@@@@@ @@@@@@ { { } }
|
||||
@@@@ @@@ @@ @@@@@ @@@@@@ @@@ @@ @@@@ @@ } }{ {
|
||||
@@@@ @@@@ @@ @@@ @@@ @@@ @@@ @@@ @@@ { }{ } }
|
||||
@@@@ @@@@ @@ @@@ @@@ @@@@@@@@ @@@@@@@@ { }{ }{ { }
|
||||
@@@@@ @@@@ @@ @@@ @@@ @@@ @@@ { { } { } { } }
|
||||
@@@@@@@@@@ @@@@@@@@ @@@ @@@ @@@@@@@@ @@@@@@@@ { } { } { }
|
||||
@@@@@ @@@ @@@ @@@@@ @@@@@ @@@@@@ { } { } @@@@@@@
|
||||
@@@ @@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
@@@@@@ @@@ @@@ @@ @@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
@@@@ @@ @@@ @@@@ @@ @@@@@@@@@@@@@@@@@@@@@@@@
|
||||
@@@@ @@@ @@ @@@@ @@@ @@@@@@@@@@@@@@@@@@@@@
|
||||
@@@@@ @@@@@ @@ @@ @@@ @@@@@@@ @@@@@ @@@ @@@@@@@@@@@@@@@@@@
|
||||
@@@@@ @@@ @@@ @@@@@@@@ @@@@ @@@@ @@@@@@@ @@@ @@@@@@@@@@@@@@@@
|
||||
@@@@@ @@@ @@@@ @@@@ @@@ @@@ @@@ @@@@@@@@@@@@@@
|
||||
@@@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@
|
||||
@@@ @@@@ @@@ @@@@ @@@@ @@@ @@@@ @@@@
|
||||
@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@
|
||||
@@@@@@@@@ @@@@@@ @@@@ @@@@ @@@@@@@@@ @@@@
|
||||
@@@ @@@@
|
||||
@@@
|
||||
@@@
|
||||
```
|
||||
|
||||
CoffeeScript is a little language that compiles into JavaScript.
|
||||
|
||||
## Installation
|
||||
|
||||
If you have the node package manager, npm, installed:
|
||||
Once you have Node.js installed:
|
||||
|
||||
```shell
|
||||
npm install --global coffee-script
|
||||
```
|
||||
# Install locally for a project:
|
||||
npm install --save-dev coffeescript
|
||||
|
||||
Leave off the `--global` if you don’t wish to install globally.
|
||||
# Install globally to execute .coffee files anywhere:
|
||||
npm install --global coffeescript
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -44,14 +53,14 @@ Compile a script:
|
||||
coffee -c /path/to/script.coffee
|
||||
```
|
||||
|
||||
For documentation, usage, and examples, see: http://coffeescript.org/
|
||||
For documentation, usage, and examples, see: https://coffeescript.org/
|
||||
|
||||
To suggest a feature or report a bug: http://github.com/jashkenas/coffeescript/issues
|
||||
To suggest a feature or report a bug: https://github.com/jashkenas/coffeescript/issues
|
||||
|
||||
If you’d like to chat, drop by #coffeescript on Freenode IRC.
|
||||
|
||||
The source repository: https://github.com/jashkenas/coffeescript.git
|
||||
|
||||
Changelog: http://coffeescript.org/#changelog
|
||||
Changelog: https://coffeescript.org/#changelog
|
||||
|
||||
Our lovely and talented contributors are listed here: http://github.com/jashkenas/coffeescript/contributors
|
||||
Our lovely and talented contributors are listed here: https://github.com/jashkenas/coffeescript/contributors
|
||||
|
||||
22
bin/cake
22
bin/cake
@@ -1,7 +1,25 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
try {
|
||||
new Function('var {a} = {a: 1}')();
|
||||
} catch (error) {
|
||||
console.error('Your JavaScript runtime does not support some features used by the cake command. Please use Node 6 or later.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
|
||||
|
||||
require(lib + '/coffee-script/cake').run();
|
||||
var potentialPaths = [
|
||||
path.join(process.cwd(), 'node_modules/coffeescript/lib/coffeescript'),
|
||||
path.join(process.cwd(), 'node_modules/coffeescript/lib/coffee-script'),
|
||||
path.join(process.cwd(), 'node_modules/coffee-script/lib/coffee-script'),
|
||||
path.join(__dirname, '../lib/coffeescript')
|
||||
];
|
||||
|
||||
for (var i = 0, len = potentialPaths.length; i < len; i++) {
|
||||
if (fs.existsSync(potentialPaths[i])) {
|
||||
require(potentialPaths[i] + '/cake').run();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
22
bin/coffee
22
bin/coffee
@@ -1,7 +1,25 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
try {
|
||||
new Function('var {a} = {a: 1}')();
|
||||
} catch (error) {
|
||||
console.error('Your JavaScript runtime does not support some features used by the coffee command. Please use Node 6 or later.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
|
||||
|
||||
require(lib + '/coffee-script/command').run();
|
||||
var potentialPaths = [
|
||||
path.join(process.cwd(), 'node_modules/coffeescript/lib/coffeescript'),
|
||||
path.join(process.cwd(), 'node_modules/coffeescript/lib/coffee-script'),
|
||||
path.join(process.cwd(), 'node_modules/coffee-script/lib/coffee-script'),
|
||||
path.join(__dirname, '../lib/coffeescript')
|
||||
];
|
||||
|
||||
for (var i = 0, len = potentialPaths.length; i < len; i++) {
|
||||
if (fs.existsSync(potentialPaths[i])) {
|
||||
require(potentialPaths[i] + '/command').run();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "coffee-script",
|
||||
"name": "coffeescript",
|
||||
"main": [
|
||||
"lib/coffee-script/coffee-script.js"
|
||||
"lib/coffeescript/browser.js"
|
||||
],
|
||||
"description": "Unfancy JavaScript",
|
||||
"keywords": [
|
||||
|
||||
@@ -1 +1 @@
|
||||
coffeescript.org
|
||||
coffeescript.org
|
||||
1
docs/annotated-source
Symbolic link
1
docs/annotated-source
Symbolic link
@@ -0,0 +1 @@
|
||||
v2/annotated-source
|
||||
1
docs/announcing-coffeescript-2
Symbolic link
1
docs/announcing-coffeescript-2
Symbolic link
@@ -0,0 +1 @@
|
||||
v2/announcing-coffeescript-2
|
||||
1
docs/browser-compiler
Symbolic link
1
docs/browser-compiler
Symbolic link
@@ -0,0 +1 @@
|
||||
v2/browser-compiler-legacy
|
||||
1
docs/browser-compiler-legacy
Symbolic link
1
docs/browser-compiler-legacy
Symbolic link
@@ -0,0 +1 @@
|
||||
v2/browser-compiler-legacy
|
||||
1
docs/browser-compiler-modern
Symbolic link
1
docs/browser-compiler-modern
Symbolic link
@@ -0,0 +1 @@
|
||||
v2/browser-compiler-modern
|
||||
@@ -1 +1 @@
|
||||
v1/index.html
|
||||
v2/index.html
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "",
|
||||
"name": "CoffeeScript",
|
||||
"description": "Unfancy JavaScript",
|
||||
"icons": [
|
||||
{
|
||||
"src": "\/android-chrome-192x192.png",
|
||||
|
||||
1
docs/test.html
Symbolic link
1
docs/test.html
Symbolic link
@@ -0,0 +1 @@
|
||||
v2/test.html
|
||||
@@ -116,7 +116,7 @@
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
<p><code>cake</code> is a simplified version of <a href="http://www.gnu.org/software/make/">Make</a>
|
||||
(<a href="http://rake.rubyforge.org/">Rake</a>, <a href="http://github.com/280north/jake">Jake</a>)
|
||||
(<a href="http://rake.rubyforge.org/">Rake</a>, <a href="https://github.com/280north/jake">Jake</a>)
|
||||
for CoffeeScript. You define tasks with names and descriptions in a Cakefile,
|
||||
and can call them from the command line, or invoke them from other tasks.</p>
|
||||
<p>Running <code>cake</code> with no arguments will print out a list of all the tasks in the
|
||||
|
||||
@@ -115,17 +115,17 @@
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
<p>The CoffeeScript parser is generated by <a href="http://github.com/zaach/jison">Jison</a>
|
||||
<p>The CoffeeScript parser is generated by <a href="https://github.com/zaach/jison">Jison</a>
|
||||
from this grammar file. Jison is a bottom-up parser generator, similar in
|
||||
style to <a href="http://www.gnu.org/software/bison">Bison</a>, implemented in JavaScript.
|
||||
It can recognize <a href="http://en.wikipedia.org/wiki/LR_grammar">LALR(1), LR(0), SLR(1), and LR(1)</a>
|
||||
It can recognize <a href="https://en.wikipedia.org/wiki/LR_grammar">LALR(1), LR(0), SLR(1), and LR(1)</a>
|
||||
type grammars. To create the Jison parser, we list the pattern to match
|
||||
on the left-hand side, and the action to take (usually the creation of syntax
|
||||
tree nodes) on the right. As the parser runs, it
|
||||
shifts tokens from our token stream, from left to right, and
|
||||
<a href="http://en.wikipedia.org/wiki/Bottom-up_parsing">attempts to match</a>
|
||||
<a href="https://en.wikipedia.org/wiki/Bottom-up_parsing">attempts to match</a>
|
||||
the token sequence against the rules below. When a match can be made, it
|
||||
reduces into the <a href="http://en.wikipedia.org/wiki/Terminal_and_nonterminal_symbols">nonterminal</a>
|
||||
reduces into the <a href="https://en.wikipedia.org/wiki/Terminal_and_nonterminal_symbols">nonterminal</a>
|
||||
(the enclosing name at the top), and we proceed from there.</p>
|
||||
<p>If you run the <code>cake build:parser</code> command, Jison constructs a parse table
|
||||
from our rules and saves it into <code>lib/parser.js</code>.</p>
|
||||
@@ -199,7 +199,7 @@ wrapper and just returning the value directly.</p>
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
<p>Our handy DSL for Jison grammar generation, thanks to
|
||||
<a href="http://github.com/creationix">Tim Caswell</a>. For every rule in the grammar,
|
||||
<a href="https://github.com/creationix">Tim Caswell</a>. For every rule in the grammar,
|
||||
we pass the pattern-defining string, the action to run, and extra options,
|
||||
optionally. If no action is specified, we simply pass the value of the
|
||||
previous nonterminal.</p>
|
||||
@@ -575,6 +575,7 @@ the ordinary <strong>Assign</strong> is that these allow numbers and strings as
|
||||
|
||||
<div class="content"><div class='highlight'><pre> Return: [
|
||||
o <span class="hljs-string">'RETURN Expression'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Return $<span class="hljs-number">2</span>
|
||||
o <span class="hljs-string">'RETURN INDENT Object OUTDENT'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Return <span class="hljs-keyword">new</span> Value $<span class="hljs-number">3</span>
|
||||
o <span class="hljs-string">'RETURN'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> Return
|
||||
]
|
||||
|
||||
@@ -968,6 +969,7 @@ and optional references to the superclass.</p>
|
||||
o <span class="hljs-string">'Identifier AS Identifier'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> ExportSpecifier $<span class="hljs-number">1</span>, $<span class="hljs-number">3</span>
|
||||
o <span class="hljs-string">'Identifier AS DEFAULT'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> ExportSpecifier $<span class="hljs-number">1</span>, <span class="hljs-keyword">new</span> Literal $<span class="hljs-number">3</span>
|
||||
o <span class="hljs-string">'DEFAULT'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> ExportSpecifier <span class="hljs-keyword">new</span> Literal $<span class="hljs-number">1</span>
|
||||
o <span class="hljs-string">'DEFAULT AS Identifier'</span>, <span class="hljs-function">-></span> <span class="hljs-keyword">new</span> ExportSpecifier <span class="hljs-keyword">new</span> Literal($<span class="hljs-number">1</span>), $<span class="hljs-number">3</span>
|
||||
]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
@@ -121,7 +121,7 @@ a token is produced, we consume the match, and start again. Tokens are in the
|
||||
form:</p>
|
||||
<pre><code>[tag, value, locationData]
|
||||
</code></pre><p>where locationData is {first_line, first_column, last_line, last_column}, which is a
|
||||
format that can be fed directly into <a href="http://github.com/zaach/jison">Jison</a>. These
|
||||
format that can be fed directly into <a href="https://github.com/zaach/jison">Jison</a>. These
|
||||
are read by jison in the <code>parser.lexer</code> function defined in coffee-script.coffee.</p>
|
||||
|
||||
</div>
|
||||
@@ -219,6 +219,7 @@ it has consumed.</p>
|
||||
@seenFor = <span class="hljs-literal">no</span> <span class="hljs-comment"># Used to recognize FORIN, FOROF and FORFROM tokens.</span>
|
||||
@seenImport = <span class="hljs-literal">no</span> <span class="hljs-comment"># Used to recognize IMPORT FROM? AS? tokens.</span>
|
||||
@seenExport = <span class="hljs-literal">no</span> <span class="hljs-comment"># Used to recognize EXPORT FROM? AS? tokens.</span>
|
||||
@importSpecifierList = <span class="hljs-literal">no</span> <span class="hljs-comment"># Used to identify when in an IMPORT {...} FROM? ...</span>
|
||||
@exportSpecifierList = <span class="hljs-literal">no</span> <span class="hljs-comment"># Used to identify when in an EXPORT {...} FROM? ...</span>
|
||||
|
||||
@chunkLine =
|
||||
@@ -380,10 +381,10 @@ though <code>is</code> means <code>===</code> otherwise.</p>
|
||||
<span class="hljs-keyword">if</span> @tag() <span class="hljs-keyword">in</span> [<span class="hljs-string">'DEFAULT'</span>, <span class="hljs-string">'IMPORT_ALL'</span>, <span class="hljs-string">'IDENTIFIER'</span>]
|
||||
@token <span class="hljs-string">'AS'</span>, id
|
||||
<span class="hljs-keyword">return</span> id.length
|
||||
<span class="hljs-keyword">if</span> id <span class="hljs-keyword">is</span> <span class="hljs-string">'as'</span> <span class="hljs-keyword">and</span> @seenExport <span class="hljs-keyword">and</span> @tag() <span class="hljs-keyword">is</span> <span class="hljs-string">'IDENTIFIER'</span>
|
||||
<span class="hljs-keyword">if</span> id <span class="hljs-keyword">is</span> <span class="hljs-string">'as'</span> <span class="hljs-keyword">and</span> @seenExport <span class="hljs-keyword">and</span> @tag() <span class="hljs-keyword">in</span> [<span class="hljs-string">'IDENTIFIER'</span>, <span class="hljs-string">'DEFAULT'</span>]
|
||||
@token <span class="hljs-string">'AS'</span>, id
|
||||
<span class="hljs-keyword">return</span> id.length
|
||||
<span class="hljs-keyword">if</span> id <span class="hljs-keyword">is</span> <span class="hljs-string">'default'</span> <span class="hljs-keyword">and</span> @seenExport
|
||||
<span class="hljs-keyword">if</span> id <span class="hljs-keyword">is</span> <span class="hljs-string">'default'</span> <span class="hljs-keyword">and</span> @seenExport <span class="hljs-keyword">and</span> @tag() <span class="hljs-keyword">in</span> [<span class="hljs-string">'EXPORT'</span>, <span class="hljs-string">'AS'</span>]
|
||||
@token <span class="hljs-string">'DEFAULT'</span>, id
|
||||
<span class="hljs-keyword">return</span> id.length
|
||||
|
||||
@@ -565,14 +566,14 @@ properly tag the <code>from</code>.</p>
|
||||
indent = attempt <span class="hljs-keyword">if</span> indent <span class="hljs-keyword">is</span> <span class="hljs-literal">null</span> <span class="hljs-keyword">or</span> <span class="hljs-number">0</span> < attempt.length < indent.length
|
||||
indentRegex = <span class="hljs-regexp">/// \n<span class="hljs-subst">#{indent}</span> ///</span>g <span class="hljs-keyword">if</span> indent
|
||||
@mergeInterpolationTokens tokens, {delimiter}, <span class="hljs-function"><span class="hljs-params">(value, i)</span> =></span>
|
||||
value = @formatString value
|
||||
value = @formatString value, delimiter: quote
|
||||
value = value.replace indentRegex, <span class="hljs-string">'\n'</span> <span class="hljs-keyword">if</span> indentRegex
|
||||
value = value.replace LEADING_BLANK_LINE, <span class="hljs-string">''</span> <span class="hljs-keyword">if</span> i <span class="hljs-keyword">is</span> <span class="hljs-number">0</span>
|
||||
value = value.replace TRAILING_BLANK_LINE, <span class="hljs-string">''</span> <span class="hljs-keyword">if</span> i <span class="hljs-keyword">is</span> $
|
||||
value
|
||||
<span class="hljs-keyword">else</span>
|
||||
@mergeInterpolationTokens tokens, {delimiter}, <span class="hljs-function"><span class="hljs-params">(value, i)</span> =></span>
|
||||
value = @formatString value
|
||||
value = @formatString value, delimiter: quote
|
||||
value = value.replace SIMPLE_STRING_OMIT, <span class="hljs-function"><span class="hljs-params">(match, offset)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> (i <span class="hljs-keyword">is</span> <span class="hljs-number">0</span> <span class="hljs-keyword">and</span> offset <span class="hljs-keyword">is</span> <span class="hljs-number">0</span>) <span class="hljs-keyword">or</span>
|
||||
(i <span class="hljs-keyword">is</span> $ <span class="hljs-keyword">and</span> offset + match.length <span class="hljs-keyword">is</span> value.length)
|
||||
@@ -684,6 +685,7 @@ borrow some basic heuristics from JavaScript and Ruby.</p>
|
||||
<span class="hljs-keyword">when</span> match = REGEX.exec @chunk
|
||||
[regex, body, closed] = match
|
||||
@validateEscapes body, isRegex: <span class="hljs-literal">yes</span>, offsetInChunk: <span class="hljs-number">1</span>
|
||||
body = @formatRegex body, delimiter: <span class="hljs-string">'/'</span>
|
||||
index = regex.length
|
||||
[..., prev] = @tokens
|
||||
<span class="hljs-keyword">if</span> prev
|
||||
@@ -742,6 +744,8 @@ can close multiple indents, so we need to know how far in we happen to be.</p>
|
||||
indent = match[<span class="hljs-number">0</span>]
|
||||
|
||||
@seenFor = <span class="hljs-literal">no</span>
|
||||
@seenImport = <span class="hljs-literal">no</span> <span class="hljs-keyword">unless</span> @importSpecifierList
|
||||
@seenExport = <span class="hljs-literal">no</span> <span class="hljs-keyword">unless</span> @exportSpecifierList
|
||||
|
||||
size = indent.length - <span class="hljs-number">1</span> - indent.lastIndexOf <span class="hljs-string">'\n'</span>
|
||||
noNewlines = @unfinished()
|
||||
@@ -923,7 +927,11 @@ parentheses that indicate a method call from regular parentheses, and so on.</p>
|
||||
@error message, origin[<span class="hljs-number">2</span>] <span class="hljs-keyword">if</span> message
|
||||
<span class="hljs-keyword">return</span> value.length <span class="hljs-keyword">if</span> skipToken
|
||||
|
||||
<span class="hljs-keyword">if</span> value <span class="hljs-keyword">is</span> <span class="hljs-string">'{'</span> <span class="hljs-keyword">and</span> prev?[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'EXPORT'</span>
|
||||
<span class="hljs-keyword">if</span> value <span class="hljs-keyword">is</span> <span class="hljs-string">'{'</span> <span class="hljs-keyword">and</span> @seenImport
|
||||
@importSpecifierList = <span class="hljs-literal">yes</span>
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> @importSpecifierList <span class="hljs-keyword">and</span> value <span class="hljs-keyword">is</span> <span class="hljs-string">'}'</span>
|
||||
@importSpecifierList = <span class="hljs-literal">no</span>
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> value <span class="hljs-keyword">is</span> <span class="hljs-string">'{'</span> <span class="hljs-keyword">and</span> prev?[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'EXPORT'</span>
|
||||
@exportSpecifierList = <span class="hljs-literal">yes</span>
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> @exportSpecifierList <span class="hljs-keyword">and</span> value <span class="hljs-keyword">is</span> <span class="hljs-string">'}'</span>
|
||||
@exportSpecifierList = <span class="hljs-literal">no</span>
|
||||
@@ -1255,7 +1263,7 @@ sane location data.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> converted = fn token[<span class="hljs-number">1</span>], i</pre></div></div>
|
||||
<div class="content"><div class='highlight'><pre> converted = fn.call <span class="hljs-keyword">this</span>, token[<span class="hljs-number">1</span>], i</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
@@ -1547,15 +1555,22 @@ not specified, the length of <code>value</code> will be used.</p>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> unfinished: <span class="hljs-function">-></span>
|
||||
LINE_CONTINUER.test(@chunk) <span class="hljs-keyword">or</span>
|
||||
@tag() <span class="hljs-keyword">in</span> [<span class="hljs-string">'\\'</span>, <span class="hljs-string">'.'</span>, <span class="hljs-string">'?.'</span>, <span class="hljs-string">'?::'</span>, <span class="hljs-string">'UNARY'</span>, <span class="hljs-string">'MATH'</span>, <span class="hljs-string">'UNARY_MATH'</span>, <span class="hljs-string">'+'</span>, <span class="hljs-string">'-'</span>,
|
||||
<span class="hljs-string">'**'</span>, <span class="hljs-string">'SHIFT'</span>, <span class="hljs-string">'RELATION'</span>, <span class="hljs-string">'COMPARE'</span>, <span class="hljs-string">'&'</span>, <span class="hljs-string">'^'</span>, <span class="hljs-string">'|'</span>, <span class="hljs-string">'&&'</span>, <span class="hljs-string">'||'</span>,
|
||||
<span class="hljs-string">'BIN?'</span>, <span class="hljs-string">'THROW'</span>, <span class="hljs-string">'EXTENDS'</span>]
|
||||
@tag() <span class="hljs-keyword">in</span> UNFINISHED
|
||||
|
||||
formatString: <span class="hljs-function"><span class="hljs-params">(str)</span> -></span>
|
||||
str.replace STRING_OMIT, <span class="hljs-string">'$1'</span>
|
||||
formatString: <span class="hljs-function"><span class="hljs-params">(str, options)</span> -></span>
|
||||
@replaceUnicodeCodePointEscapes str.replace(STRING_OMIT, <span class="hljs-string">'$1'</span>), options
|
||||
|
||||
formatHeregex: <span class="hljs-function"><span class="hljs-params">(str)</span> -></span>
|
||||
str.replace HEREGEX_OMIT, <span class="hljs-string">'$1$2'</span></pre></div></div>
|
||||
@formatRegex str.replace(HEREGEX_OMIT, <span class="hljs-string">'$1$2'</span>), delimiter: <span class="hljs-string">'///'</span>
|
||||
|
||||
formatRegex: <span class="hljs-function"><span class="hljs-params">(str, options)</span> -></span>
|
||||
@replaceUnicodeCodePointEscapes str, options
|
||||
|
||||
unicodeCodePointToUnicodeEscapes: <span class="hljs-function"><span class="hljs-params">(codePoint)</span> -></span>
|
||||
<span class="hljs-function"> <span class="hljs-title">toUnicodeEscape</span> = <span class="hljs-params">(val)</span> -></span>
|
||||
str = val.toString <span class="hljs-number">16</span>
|
||||
<span class="hljs-string">"\\u<span class="hljs-subst">#{repeat <span class="hljs-string">'0'</span>, <span class="hljs-number">4</span> - str.length}</span><span class="hljs-subst">#{str}</span>"</span>
|
||||
<span class="hljs-keyword">return</span> toUnicodeEscape(codePoint) <span class="hljs-keyword">if</span> codePoint < <span class="hljs-number">0x10000</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
@@ -1566,24 +1581,13 @@ not specified, the length of <code>value</code> will be used.</p>
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-59">¶</a>
|
||||
</div>
|
||||
<p>Validates escapes in strings and regexes.</p>
|
||||
<p>surrogate pair</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> validateEscapes: <span class="hljs-function"><span class="hljs-params">(str, options = {})</span> -></span>
|
||||
match = INVALID_ESCAPE.exec str
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> match
|
||||
[[], before, octal, hex, unicode] = match
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> options.isRegex <span class="hljs-keyword">and</span> octal <span class="hljs-keyword">and</span> octal.charAt(<span class="hljs-number">0</span>) <span class="hljs-keyword">isnt</span> <span class="hljs-string">'0'</span>
|
||||
message =
|
||||
<span class="hljs-keyword">if</span> octal
|
||||
<span class="hljs-string">"octal escape sequences are not allowed"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-string">"invalid escape sequence"</span>
|
||||
invalidEscape = <span class="hljs-string">"\\<span class="hljs-subst">#{octal <span class="hljs-keyword">or</span> hex <span class="hljs-keyword">or</span> unicode}</span>"</span>
|
||||
@error <span class="hljs-string">"<span class="hljs-subst">#{message}</span> <span class="hljs-subst">#{invalidEscape}</span>"</span>,
|
||||
offset: (options.offsetInChunk ? <span class="hljs-number">0</span>) + match.index + before.length
|
||||
length: invalidEscape.length</pre></div></div>
|
||||
<div class="content"><div class='highlight'><pre> high = Math.floor((codePoint - <span class="hljs-number">0x10000</span>) / <span class="hljs-number">0x400</span>) + <span class="hljs-number">0xD800</span>
|
||||
low = (codePoint - <span class="hljs-number">0x10000</span>) % <span class="hljs-number">0x400</span> + <span class="hljs-number">0xDC00</span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{toUnicodeEscape(high)}</span><span class="hljs-subst">#{toUnicodeEscape(low)}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
@@ -1594,6 +1598,63 @@ not specified, the length of <code>value</code> will be used.</p>
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-60">¶</a>
|
||||
</div>
|
||||
<p>Replace \u{…} with \uxxxx[\uxxxx] in strings and regexes</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> replaceUnicodeCodePointEscapes: <span class="hljs-function"><span class="hljs-params">(str, options)</span> -></span>
|
||||
str.replace UNICODE_CODE_POINT_ESCAPE, <span class="hljs-function"><span class="hljs-params">(match, escapedBackslash, codePointHex, offset)</span> =></span>
|
||||
<span class="hljs-keyword">return</span> escapedBackslash <span class="hljs-keyword">if</span> escapedBackslash
|
||||
|
||||
codePointDecimal = parseInt codePointHex, <span class="hljs-number">16</span>
|
||||
<span class="hljs-keyword">if</span> codePointDecimal > <span class="hljs-number">0x10ffff</span>
|
||||
@error <span class="hljs-string">"unicode code point escapes greater than \\u{10ffff} are not allowed"</span>,
|
||||
offset: offset + options.delimiter.length
|
||||
length: codePointHex.length + <span class="hljs-number">4</span>
|
||||
|
||||
@unicodeCodePointToUnicodeEscapes codePointDecimal</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-61">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-61">¶</a>
|
||||
</div>
|
||||
<p>Validates escapes in strings and regexes.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> validateEscapes: <span class="hljs-function"><span class="hljs-params">(str, options = {})</span> -></span>
|
||||
invalidEscapeRegex =
|
||||
<span class="hljs-keyword">if</span> options.isRegex
|
||||
REGEX_INVALID_ESCAPE
|
||||
<span class="hljs-keyword">else</span>
|
||||
STRING_INVALID_ESCAPE
|
||||
match = invalidEscapeRegex.exec str
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> match
|
||||
[[], before, octal, hex, unicodeCodePoint, unicode] = match
|
||||
message =
|
||||
<span class="hljs-keyword">if</span> octal
|
||||
<span class="hljs-string">"octal escape sequences are not allowed"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-string">"invalid escape sequence"</span>
|
||||
invalidEscape = <span class="hljs-string">"\\<span class="hljs-subst">#{octal <span class="hljs-keyword">or</span> hex <span class="hljs-keyword">or</span> unicodeCodePoint <span class="hljs-keyword">or</span> unicode}</span>"</span>
|
||||
@error <span class="hljs-string">"<span class="hljs-subst">#{message}</span> <span class="hljs-subst">#{invalidEscape}</span>"</span>,
|
||||
offset: (options.offsetInChunk ? <span class="hljs-number">0</span>) + match.index + before.length
|
||||
length: invalidEscape.length</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-62">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-62">¶</a>
|
||||
</div>
|
||||
<p>Constructs a string or regex by escaping certain characters.</p>
|
||||
|
||||
</div>
|
||||
@@ -1612,11 +1673,11 @@ not specified, the length of <code>value</code> will be used.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-61">
|
||||
<li id="section-63">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-61">¶</a>
|
||||
<a class="pilcrow" href="#section-63">¶</a>
|
||||
</div>
|
||||
<p>Ignore escaped backslashes.</p>
|
||||
|
||||
@@ -1635,11 +1696,11 @@ not specified, the length of <code>value</code> will be used.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-62">
|
||||
<li id="section-64">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-62">¶</a>
|
||||
<a class="pilcrow" href="#section-64">¶</a>
|
||||
</div>
|
||||
<p>Throws an error at either a given offset from the current chunk or at the
|
||||
location of a token (<code>token[2]</code>).</p>
|
||||
@@ -1658,11 +1719,11 @@ location of a token (<code>token[2]</code>).</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-63">
|
||||
<li id="section-65">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-63">¶</a>
|
||||
<a class="pilcrow" href="#section-65">¶</a>
|
||||
</div>
|
||||
<h2 id="helper-functions">Helper functions</h2>
|
||||
|
||||
@@ -1671,11 +1732,11 @@ location of a token (<code>token[2]</code>).</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-64">
|
||||
<li id="section-66">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-64">¶</a>
|
||||
<a class="pilcrow" href="#section-66">¶</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -1696,11 +1757,11 @@ exports.isUnassignable = isUnassignable</pre></div></div>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-65">
|
||||
<li id="section-67">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-65">¶</a>
|
||||
<a class="pilcrow" href="#section-67">¶</a>
|
||||
</div>
|
||||
<p><code>from</code> isn’t a CoffeeScript keyword, but it behaves like one in <code>import</code> and
|
||||
<code>export</code> statements (handled above) and in the declaration line of a <code>for</code>
|
||||
@@ -1715,11 +1776,11 @@ loop. Try to detect when <code>from</code> is a variable identifier and when it
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-66">
|
||||
<li id="section-68">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-66">¶</a>
|
||||
<a class="pilcrow" href="#section-68">¶</a>
|
||||
</div>
|
||||
<p><code>for i from from</code>, <code>for from from iterable</code></p>
|
||||
|
||||
@@ -1732,11 +1793,11 @@ loop. Try to detect when <code>from</code> is a variable identifier and when it
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-67">
|
||||
<li id="section-69">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-67">¶</a>
|
||||
<a class="pilcrow" href="#section-69">¶</a>
|
||||
</div>
|
||||
<p><code>for i from iterable</code></p>
|
||||
|
||||
@@ -1747,11 +1808,11 @@ loop. Try to detect when <code>from</code> is a variable identifier and when it
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-68">
|
||||
<li id="section-70">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-68">¶</a>
|
||||
<a class="pilcrow" href="#section-70">¶</a>
|
||||
</div>
|
||||
<p><code>for from…</code></p>
|
||||
|
||||
@@ -1763,11 +1824,11 @@ loop. Try to detect when <code>from</code> is a variable identifier and when it
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-69">
|
||||
<li id="section-71">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-69">¶</a>
|
||||
<a class="pilcrow" href="#section-71">¶</a>
|
||||
</div>
|
||||
<p><code>for {from}…</code>, <code>for [from]…</code>, <code>for {a, from}…</code>, <code>for {a: from}…</code></p>
|
||||
|
||||
@@ -1781,11 +1842,11 @@ loop. Try to detect when <code>from</code> is a variable identifier and when it
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-70">
|
||||
<li id="section-72">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-70">¶</a>
|
||||
<a class="pilcrow" href="#section-72">¶</a>
|
||||
</div>
|
||||
<h2 id="constants">Constants</h2>
|
||||
|
||||
@@ -1794,11 +1855,11 @@ loop. Try to detect when <code>from</code> is a variable identifier and when it
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-71">
|
||||
<li id="section-73">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-71">¶</a>
|
||||
<a class="pilcrow" href="#section-73">¶</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -1806,11 +1867,11 @@ loop. Try to detect when <code>from</code> is a variable identifier and when it
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-72">
|
||||
<li id="section-74">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-72">¶</a>
|
||||
<a class="pilcrow" href="#section-74">¶</a>
|
||||
</div>
|
||||
<p>Keywords that CoffeeScript shares in common with JavaScript.</p>
|
||||
|
||||
@@ -1828,11 +1889,11 @@ loop. Try to detect when <code>from</code> is a variable identifier and when it
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-73">
|
||||
<li id="section-75">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-73">¶</a>
|
||||
<a class="pilcrow" href="#section-75">¶</a>
|
||||
</div>
|
||||
<p>CoffeeScript-only keywords.</p>
|
||||
|
||||
@@ -1860,11 +1921,11 @@ COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat COFFEE_ALIASES</pre></div></div>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-74">
|
||||
<li id="section-76">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-74">¶</a>
|
||||
<a class="pilcrow" href="#section-76">¶</a>
|
||||
</div>
|
||||
<p>The list of keywords that are reserved by JavaScript, but not used, or are
|
||||
used by CoffeeScript internally. We throw an error when these are encountered,
|
||||
@@ -1883,11 +1944,11 @@ STRICT_PROSCRIBED = [<span class="hljs-string">'arguments'</span>, <span class="
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-75">
|
||||
<li id="section-77">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-75">¶</a>
|
||||
<a class="pilcrow" href="#section-77">¶</a>
|
||||
</div>
|
||||
<p>The superset of both JavaScript keywords and reserved words, none of which may
|
||||
be used as identifiers or properties.</p>
|
||||
@@ -1899,11 +1960,11 @@ be used as identifiers or properties.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-76">
|
||||
<li id="section-78">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-76">¶</a>
|
||||
<a class="pilcrow" href="#section-78">¶</a>
|
||||
</div>
|
||||
<p>The character code of the nasty Microsoft madness otherwise known as the BOM.</p>
|
||||
|
||||
@@ -1914,11 +1975,11 @@ be used as identifiers or properties.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-77">
|
||||
<li id="section-79">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-77">¶</a>
|
||||
<a class="pilcrow" href="#section-79">¶</a>
|
||||
</div>
|
||||
<p>Token matching regexes.</p>
|
||||
|
||||
@@ -1961,11 +2022,11 @@ HERE_JSTOKEN = <span class="hljs-regexp">///^ ``` ((?: [^`\\] | \\[\s\S] | `
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-78">
|
||||
<li id="section-80">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-78">¶</a>
|
||||
<a class="pilcrow" href="#section-80">¶</a>
|
||||
</div>
|
||||
<p>String-matching-regexes.</p>
|
||||
|
||||
@@ -1988,11 +2049,11 @@ HEREDOC_INDENT = <span class="hljs-regexp">/\n+([^\n\S]*)(?=\S)/g</span></pr
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-79">
|
||||
<li id="section-81">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-79">¶</a>
|
||||
<a class="pilcrow" href="#section-81">¶</a>
|
||||
</div>
|
||||
<p>Regex-matching-regexes.</p>
|
||||
|
||||
@@ -2009,7 +2070,7 @@ HEREDOC_INDENT = <span class="hljs-regexp">/\n+([^\n\S]*)(?=\S)/g</span></pr
|
||||
///</span>
|
||||
|
||||
REGEX_FLAGS = <span class="hljs-regexp">/^\w*/</span>
|
||||
VALID_FLAGS = <span class="hljs-regexp">/^(?!.*(.).*\1)[imgy]*$/</span>
|
||||
VALID_FLAGS = <span class="hljs-regexp">/^(?!.*(.).*\1)[imguy]*$/</span>
|
||||
|
||||
HEREGEX = <span class="hljs-regexp">/// ^(?: [^\\/<span class="hljs-comment">#] | \\[\s\S] | /(?!//) | \#(?!\{) )* ///</span>
|
||||
|
||||
@@ -2026,11 +2087,11 @@ POSSIBLY_DIVISION = <span class="hljs-regexp">/// ^ /=?\s ///</span></pre></di
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-80">
|
||||
<li id="section-82">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-80">¶</a>
|
||||
<a class="pilcrow" href="#section-82">¶</a>
|
||||
</div>
|
||||
<p>Other regexes.</p>
|
||||
|
||||
@@ -2040,14 +2101,30 @@ POSSIBLY_DIVISION = <span class="hljs-regexp">/// ^ /=?\s ///</span></pre></di
|
||||
|
||||
LINE_CONTINUER = <span class="hljs-regexp">/// ^ \s* (?: , | \??\.(?![.\d]) | :: ) ///</span>
|
||||
|
||||
INVALID_ESCAPE = <span class="hljs-regexp">///
|
||||
STRING_INVALID_ESCAPE = <span class="hljs-regexp">///
|
||||
( (?:^|[^\\]) (?:\\\\)* ) <span class="hljs-comment"># make sure the escape isn’t escaped</span>
|
||||
\\ (
|
||||
?: (0[0-7]|[1-7]) <span class="hljs-comment"># octal escape</span>
|
||||
| (x(?![\da-fA-F]{2}).{0,2}) <span class="hljs-comment"># hex escape</span>
|
||||
| (u(?![\da-fA-F]{4}).{0,4}) <span class="hljs-comment"># unicode escape</span>
|
||||
| (u\{(?![\da-fA-F]{1,}\})[^}]*\}?) <span class="hljs-comment"># unicode code point escape</span>
|
||||
| (u(?!\{|[\da-fA-F]{4}).{0,4}) <span class="hljs-comment"># unicode escape</span>
|
||||
)
|
||||
///</span>
|
||||
REGEX_INVALID_ESCAPE = <span class="hljs-regexp">///
|
||||
( (?:^|[^\\]) (?:\\\\)* ) <span class="hljs-comment"># make sure the escape isn’t escaped</span>
|
||||
\\ (
|
||||
?: (0[0-7]) <span class="hljs-comment"># octal escape</span>
|
||||
| (x(?![\da-fA-F]{2}).{0,2}) <span class="hljs-comment"># hex escape</span>
|
||||
| (u\{(?![\da-fA-F]{1,}\})[^}]*\}?) <span class="hljs-comment"># unicode code point escape</span>
|
||||
| (u(?!\{|[\da-fA-F]{4}).{0,4}) <span class="hljs-comment"># unicode escape</span>
|
||||
)
|
||||
///</span>
|
||||
|
||||
UNICODE_CODE_POINT_ESCAPE = <span class="hljs-regexp">///
|
||||
( \\\\ ) <span class="hljs-comment"># make sure the escape isn’t escaped</span>
|
||||
|
|
||||
\\u\{ ( [\da-fA-F]+ ) \}
|
||||
///</span>g
|
||||
|
||||
LEADING_BLANK_LINE = <span class="hljs-regexp">/^[^\n\S]*\n/</span>
|
||||
TRAILING_BLANK_LINE = <span class="hljs-regexp">/\n[^\n\S]*$/</span>
|
||||
@@ -2057,11 +2134,11 @@ TRAILING_SPACES = <span class="hljs-regexp">/\s+$/</span></pre></div></div>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-81">
|
||||
<li id="section-83">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-81">¶</a>
|
||||
<a class="pilcrow" href="#section-83">¶</a>
|
||||
</div>
|
||||
<p>Compound assignment tokens.</p>
|
||||
|
||||
@@ -2075,11 +2152,11 @@ TRAILING_SPACES = <span class="hljs-regexp">/\s+$/</span></pre></div></div>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-82">
|
||||
<li id="section-84">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-82">¶</a>
|
||||
<a class="pilcrow" href="#section-84">¶</a>
|
||||
</div>
|
||||
<p>Unary tokens.</p>
|
||||
|
||||
@@ -2092,11 +2169,11 @@ UNARY_MATH = [<span class="hljs-string">'!'</span>, <span class="hljs-string">'~
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-83">
|
||||
<li id="section-85">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-83">¶</a>
|
||||
<a class="pilcrow" href="#section-85">¶</a>
|
||||
</div>
|
||||
<p>Bit-shifting tokens.</p>
|
||||
|
||||
@@ -2107,11 +2184,11 @@ UNARY_MATH = [<span class="hljs-string">'!'</span>, <span class="hljs-string">'~
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-84">
|
||||
<li id="section-86">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-84">¶</a>
|
||||
<a class="pilcrow" href="#section-86">¶</a>
|
||||
</div>
|
||||
<p>Comparison tokens.</p>
|
||||
|
||||
@@ -2122,11 +2199,11 @@ UNARY_MATH = [<span class="hljs-string">'!'</span>, <span class="hljs-string">'~
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-85">
|
||||
<li id="section-87">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-85">¶</a>
|
||||
<a class="pilcrow" href="#section-87">¶</a>
|
||||
</div>
|
||||
<p>Mathematical tokens.</p>
|
||||
|
||||
@@ -2137,11 +2214,11 @@ UNARY_MATH = [<span class="hljs-string">'!'</span>, <span class="hljs-string">'~
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-86">
|
||||
<li id="section-88">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-86">¶</a>
|
||||
<a class="pilcrow" href="#section-88">¶</a>
|
||||
</div>
|
||||
<p>Relational tokens that are negatable with <code>not</code> prefix.</p>
|
||||
|
||||
@@ -2152,11 +2229,11 @@ UNARY_MATH = [<span class="hljs-string">'!'</span>, <span class="hljs-string">'~
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-87">
|
||||
<li id="section-89">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-87">¶</a>
|
||||
<a class="pilcrow" href="#section-89">¶</a>
|
||||
</div>
|
||||
<p>Boolean tokens.</p>
|
||||
|
||||
@@ -2167,11 +2244,11 @@ UNARY_MATH = [<span class="hljs-string">'!'</span>, <span class="hljs-string">'~
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-88">
|
||||
<li id="section-90">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-88">¶</a>
|
||||
<a class="pilcrow" href="#section-90">¶</a>
|
||||
</div>
|
||||
<p>Tokens which could legitimately be invoked or indexed. An opening
|
||||
parentheses or bracket following these tokens will be recorded as the start
|
||||
@@ -2188,11 +2265,11 @@ INDEXABLE = CALLABLE.concat [
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-89">
|
||||
<li id="section-91">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-89">¶</a>
|
||||
<a class="pilcrow" href="#section-91">¶</a>
|
||||
</div>
|
||||
<p>Tokens which a regular expression will never immediately follow (except spaced
|
||||
CALLABLEs in some cases), but which a division operator can.</p>
|
||||
@@ -2205,11 +2282,11 @@ CALLABLEs in some cases), but which a division operator can.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-90">
|
||||
<li id="section-92">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-90">¶</a>
|
||||
<a class="pilcrow" href="#section-92">¶</a>
|
||||
</div>
|
||||
<p>Tokens that, when immediately preceding a <code>WHEN</code>, indicate that the <code>WHEN</code>
|
||||
occurs at the start of a line. We disambiguate these from trailing whens to
|
||||
@@ -2222,11 +2299,11 @@ avoid an ambiguity in the grammar.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-91">
|
||||
<li id="section-93">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-91">¶</a>
|
||||
<a class="pilcrow" href="#section-93">¶</a>
|
||||
</div>
|
||||
<p>Additional indent in front of these is ignored.</p>
|
||||
|
||||
@@ -2236,6 +2313,23 @@ avoid an ambiguity in the grammar.</p>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-94">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-94">¶</a>
|
||||
</div>
|
||||
<p>Tokens that, when appearing at the end of a line, suppress a following TERMINATOR/INDENT token</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>UNFINISHED = [<span class="hljs-string">'\\'</span>, <span class="hljs-string">'.'</span>, <span class="hljs-string">'?.'</span>, <span class="hljs-string">'?::'</span>, <span class="hljs-string">'UNARY'</span>, <span class="hljs-string">'MATH'</span>, <span class="hljs-string">'UNARY_MATH'</span>, <span class="hljs-string">'+'</span>, <span class="hljs-string">'-'</span>,
|
||||
<span class="hljs-string">'**'</span>, <span class="hljs-string">'SHIFT'</span>, <span class="hljs-string">'RELATION'</span>, <span class="hljs-string">'COMPARE'</span>, <span class="hljs-string">'&'</span>, <span class="hljs-string">'^'</span>, <span class="hljs-string">'|'</span>, <span class="hljs-string">'&&'</span>, <span class="hljs-string">'||'</span>,
|
||||
<span class="hljs-string">'BIN?'</span>, <span class="hljs-string">'THROW'</span>, <span class="hljs-string">'EXTENDS'</span>, <span class="hljs-string">'DEFAULT'</span>]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -3941,7 +3941,7 @@ CoffeeScript operations into their JavaScript equivalents.</p>
|
||||
<a class="pilcrow" href="#section-155">¶</a>
|
||||
</div>
|
||||
<p>Am I capable of
|
||||
<a href="http://docs.python.org/reference/expressions.html#notin">Python-style comparison chaining</a>?</p>
|
||||
<a href="https://docs.python.org/3/reference/expressions.html#not-in">Python-style comparison chaining</a>?</p>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -4450,7 +4450,8 @@ parentheses, but no longer – you can put in as many as you please.</p>
|
||||
<span class="hljs-keyword">return</span> expr.compileToFragments o
|
||||
fragments = expr.compileToFragments o, LEVEL_PAREN
|
||||
bare = o.level < LEVEL_OP <span class="hljs-keyword">and</span> (expr <span class="hljs-keyword">instanceof</span> Op <span class="hljs-keyword">or</span> expr <span class="hljs-keyword">instanceof</span> Call <span class="hljs-keyword">or</span>
|
||||
(expr <span class="hljs-keyword">instanceof</span> For <span class="hljs-keyword">and</span> expr.returns))
|
||||
(expr <span class="hljs-keyword">instanceof</span> For <span class="hljs-keyword">and</span> expr.returns)) <span class="hljs-keyword">and</span> (o.level < LEVEL_COND <span class="hljs-keyword">or</span>
|
||||
fragments.length <= <span class="hljs-number">3</span>)
|
||||
<span class="hljs-keyword">if</span> bare <span class="hljs-keyword">then</span> fragments <span class="hljs-keyword">else</span> @wrapInBraces fragments</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
@@ -256,7 +256,7 @@ Unwrap that too.</p>
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> ast = <span class="hljs-keyword">new</span> Block [
|
||||
<span class="hljs-keyword">new</span> Assign (<span class="hljs-keyword">new</span> Value <span class="hljs-keyword">new</span> Literal <span class="hljs-string">'_'</span>), ast, <span class="hljs-string">'='</span>
|
||||
<span class="hljs-keyword">new</span> Assign (<span class="hljs-keyword">new</span> Value <span class="hljs-keyword">new</span> Literal <span class="hljs-string">'__'</span>), ast, <span class="hljs-string">'='</span>
|
||||
]
|
||||
js = ast.compile {bare: <span class="hljs-literal">yes</span>, locals: Object.keys(context), referencedVars}
|
||||
cb <span class="hljs-literal">null</span>, runInContext js, context, filename
|
||||
@@ -585,7 +585,7 @@ Unwrap that too.</p>
|
||||
|
||||
<span class="hljs-built_in">module</span>.exports =
|
||||
start: <span class="hljs-function"><span class="hljs-params">(opts = {})</span> -></span>
|
||||
[major, minor, build] = process.versions.node.split(<span class="hljs-string">'.'</span>).map (n) -> parseInt(n)
|
||||
[major, minor, build] = process.versions.node.split(<span class="hljs-string">'.'</span>).map (n) -> parseInt(n, <span class="hljs-number">10</span>)
|
||||
|
||||
<span class="hljs-keyword">if</span> major <span class="hljs-keyword">is</span> <span class="hljs-number">0</span> <span class="hljs-keyword">and</span> minor < <span class="hljs-number">8</span>
|
||||
<span class="hljs-built_in">console</span>.warn <span class="hljs-string">"Node 0.8.0+ required for CoffeeScript REPL"</span>
|
||||
|
||||
@@ -157,7 +157,7 @@ its internal array of tokens.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">exports</span>.<span class="hljs-title">Rewriter</span></span></pre></div></div>
|
||||
<div class="content"><div class='highlight'><pre>exports.Rewriter = <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Rewriter</span></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
@@ -168,11 +168,16 @@ its internal array of tokens.</p>
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
<p>Helpful snippet for debugging:</p>
|
||||
<pre><code><span class="hljs-built_in">console</span>.log (t[<span class="hljs-number">0</span>] + <span class="hljs-string">'/'</span> + t[<span class="hljs-number">1</span>] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> @tokens).join <span class="hljs-string">' '</span>
|
||||
</code></pre>
|
||||
<p>Rewrite the token stream in multiple passes, one logical filter at
|
||||
a time. This could certainly be changed into a single pass through the
|
||||
stream, with a big ol’ efficient switch, but it’s much nicer to work with
|
||||
like this. The order of these passes matters – indentation must be
|
||||
corrected before implicit parentheses can be wrapped around blocks of code.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> rewrite: <span class="hljs-function"><span class="hljs-params">(@tokens)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -182,16 +187,12 @@ its internal array of tokens.</p>
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
<p>Rewrite the token stream in multiple passes, one logical filter at
|
||||
a time. This could certainly be changed into a single pass through the
|
||||
stream, with a big ol’ efficient switch, but it’s much nicer to work with
|
||||
like this. The order of these passes matters – indentation must be
|
||||
corrected before implicit parentheses can be wrapped around blocks of code.</p>
|
||||
<p>Helpful snippet for debugging:
|
||||
console.log (t[0] + ‘/‘ + t[1] for t in @tokens).join ‘ ‘</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> rewrite: <span class="hljs-function"><span class="hljs-params">(@tokens)</span> -></span>
|
||||
@removeLeadingNewlines()
|
||||
<div class="content"><div class='highlight'><pre> @removeLeadingNewlines()
|
||||
@closeOpenCalls()
|
||||
@closeOpenIndexes()
|
||||
@normalizeLines()
|
||||
@@ -449,9 +450,12 @@ and spliced, when returning for getting a new token.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"> <span class="hljs-title">inImplicit</span> = -></span> stackTop()?[<span class="hljs-number">2</span>]?.ours
|
||||
<span class="hljs-function"> <span class="hljs-title">inImplicitCall</span> = -></span> inImplicit() <span class="hljs-keyword">and</span> stackTop()?[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'('</span>
|
||||
<span class="hljs-function"> <span class="hljs-title">inImplicitObject</span> = -></span> inImplicit() <span class="hljs-keyword">and</span> stackTop()?[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'{'</span></pre></div></div>
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"> <span class="hljs-title">isImplicit</span> = <span class="hljs-params">(stackItem)</span> -></span> stackItem?[<span class="hljs-number">2</span>]?.ours
|
||||
<span class="hljs-function"> <span class="hljs-title">isImplicitObject</span> = <span class="hljs-params">(stackItem)</span> -></span> isImplicit(stackItem) <span class="hljs-keyword">and</span> stackItem?[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'{'</span>
|
||||
<span class="hljs-function"> <span class="hljs-title">isImplicitCall</span> = <span class="hljs-params">(stackItem)</span> -></span> isImplicit(stackItem) <span class="hljs-keyword">and</span> stackItem?[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'('</span>
|
||||
<span class="hljs-function"> <span class="hljs-title">inImplicit</span> = -></span> isImplicit stackTop()
|
||||
<span class="hljs-function"> <span class="hljs-title">inImplicitCall</span> = -></span> isImplicitCall stackTop()
|
||||
<span class="hljs-function"> <span class="hljs-title">inImplicitObject</span> = -></span> isImplicitObject stackTop()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
@@ -472,7 +476,7 @@ class declaration or if-conditionals)</p>
|
||||
<span class="hljs-title">startImplicitCall</span> = <span class="hljs-params">(j)</span> -></span>
|
||||
idx = j ? i
|
||||
stack.push [<span class="hljs-string">'('</span>, idx, ours: <span class="hljs-literal">yes</span>]
|
||||
tokens.splice idx, <span class="hljs-number">0</span>, generate <span class="hljs-string">'CALL_START'</span>, <span class="hljs-string">'('</span>
|
||||
tokens.splice idx, <span class="hljs-number">0</span>, generate <span class="hljs-string">'CALL_START'</span>, <span class="hljs-string">'('</span>, [<span class="hljs-string">''</span>, <span class="hljs-string">'implicit function call'</span>, token[<span class="hljs-number">2</span>]]
|
||||
i += <span class="hljs-number">1</span> <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> j?
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">endImplicitCall</span> = -></span>
|
||||
@@ -509,7 +513,7 @@ class declaration or if-conditionals)</p>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> inImplicitCall() <span class="hljs-keyword">and</span> tag <span class="hljs-keyword">in</span> [<span class="hljs-string">'IF'</span>, <span class="hljs-string">'TRY'</span>, <span class="hljs-string">'FINALLY'</span>, <span class="hljs-string">'CATCH'</span>,
|
||||
<span class="hljs-string">'CLASS'</span>, <span class="hljs-string">'SWITCH'</span>]
|
||||
stack.push [<span class="hljs-string">'CONTROL'</span>, i, ours: <span class="hljs-literal">true</span>]
|
||||
stack.push [<span class="hljs-string">'CONTROL'</span>, i, ours: <span class="hljs-literal">yes</span>]
|
||||
<span class="hljs-keyword">return</span> forward(<span class="hljs-number">1</span>)
|
||||
|
||||
<span class="hljs-keyword">if</span> tag <span class="hljs-keyword">is</span> <span class="hljs-string">'INDENT'</span> <span class="hljs-keyword">and</span> inImplicit()</pre></div></div>
|
||||
@@ -734,8 +738,23 @@ like e.g.:</p>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>
|
||||
stackTop()[<span class="hljs-number">2</span>].sameLine = <span class="hljs-literal">no</span> <span class="hljs-keyword">if</span> inImplicitObject() <span class="hljs-keyword">and</span> tag <span class="hljs-keyword">in</span> LINEBREAKS
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-29">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-29">¶</a>
|
||||
</div>
|
||||
<p>Mark all enclosing objects as not sameLine</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> tag <span class="hljs-keyword">in</span> LINEBREAKS
|
||||
<span class="hljs-keyword">for</span> stackItem <span class="hljs-keyword">in</span> stack <span class="hljs-keyword">by</span> <span class="hljs-number">-1</span>
|
||||
<span class="hljs-keyword">break</span> <span class="hljs-keyword">unless</span> isImplicit stackItem
|
||||
stackItem[<span class="hljs-number">2</span>].sameLine = <span class="hljs-literal">no</span> <span class="hljs-keyword">if</span> isImplicitObject stackItem
|
||||
|
||||
newLine = prevTag <span class="hljs-keyword">is</span> <span class="hljs-string">'OUTDENT'</span> <span class="hljs-keyword">or</span> prevToken.newLine
|
||||
<span class="hljs-keyword">if</span> tag <span class="hljs-keyword">in</span> IMPLICIT_END <span class="hljs-keyword">or</span> tag <span class="hljs-keyword">in</span> CALL_CLOSERS <span class="hljs-keyword">and</span> newLine
|
||||
@@ -745,11 +764,11 @@ like e.g.:</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-29">
|
||||
<li id="section-30">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-29">¶</a>
|
||||
<a class="pilcrow" href="#section-30">¶</a>
|
||||
</div>
|
||||
<p>Close implicit calls when reached end of argument list</p>
|
||||
|
||||
@@ -761,11 +780,11 @@ like e.g.:</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-30">
|
||||
<li id="section-31">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-30">¶</a>
|
||||
<a class="pilcrow" href="#section-31">¶</a>
|
||||
</div>
|
||||
<p>Close implicit objects such as:
|
||||
return a: 1, b: 2 unless true</p>
|
||||
@@ -779,11 +798,11 @@ return a: 1, b: 2 unless true</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-31">
|
||||
<li id="section-32">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-31">¶</a>
|
||||
<a class="pilcrow" href="#section-32">¶</a>
|
||||
</div>
|
||||
<p>Close implicit objects when at end of line, line didn’t end with a comma
|
||||
and the implicit object didn’t start the line or the next line doesn’t look like
|
||||
@@ -801,11 +820,11 @@ the continuation of an object.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-32">
|
||||
<li id="section-33">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-32">¶</a>
|
||||
<a class="pilcrow" href="#section-33">¶</a>
|
||||
</div>
|
||||
<p>Close implicit object if comma is the last character
|
||||
and what comes after doesn’t look like it belongs.
|
||||
@@ -826,11 +845,11 @@ e = <span class="hljs-number">2</span>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-33">
|
||||
<li id="section-34">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-33">¶</a>
|
||||
<a class="pilcrow" href="#section-34">¶</a>
|
||||
</div>
|
||||
<p>When nextTag is OUTDENT the comma is insignificant and
|
||||
should just be ignored so embed it in the implicit object.</p>
|
||||
@@ -848,11 +867,11 @@ array further up the stack, so give it a chance.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-34">
|
||||
<li id="section-35">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-34">¶</a>
|
||||
<a class="pilcrow" href="#section-35">¶</a>
|
||||
</div>
|
||||
<p>Add location data to all tokens generated by the rewriter.</p>
|
||||
|
||||
@@ -878,11 +897,11 @@ array further up the stack, so give it a chance.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-35">
|
||||
<li id="section-36">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-35">¶</a>
|
||||
<a class="pilcrow" href="#section-36">¶</a>
|
||||
</div>
|
||||
<p>OUTDENT tokens should always be positioned at the last character of the
|
||||
previous token, so that AST nodes ending in an OUTDENT token end up with a
|
||||
@@ -906,11 +925,11 @@ location corresponding to the last “real” token under the node.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-36">
|
||||
<li id="section-37">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-36">¶</a>
|
||||
<a class="pilcrow" href="#section-37">¶</a>
|
||||
</div>
|
||||
<p>Because our grammar is LALR(1), it can’t handle some single-line
|
||||
expressions that lack ending delimiters. The <strong>Rewriter</strong> adds the implicit
|
||||
@@ -928,7 +947,8 @@ blocks are added.</p>
|
||||
<span class="hljs-keyword">not</span> (token[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'TERMINATOR'</span> <span class="hljs-keyword">and</span> @tag(i + <span class="hljs-number">1</span>) <span class="hljs-keyword">in</span> EXPRESSION_CLOSE) <span class="hljs-keyword">and</span>
|
||||
<span class="hljs-keyword">not</span> (token[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'ELSE'</span> <span class="hljs-keyword">and</span> starter <span class="hljs-keyword">isnt</span> <span class="hljs-string">'THEN'</span>) <span class="hljs-keyword">and</span>
|
||||
<span class="hljs-keyword">not</span> (token[<span class="hljs-number">0</span>] <span class="hljs-keyword">in</span> [<span class="hljs-string">'CATCH'</span>, <span class="hljs-string">'FINALLY'</span>] <span class="hljs-keyword">and</span> starter <span class="hljs-keyword">in</span> [<span class="hljs-string">'->'</span>, <span class="hljs-string">'=>'</span>]) <span class="hljs-keyword">or</span>
|
||||
token[<span class="hljs-number">0</span>] <span class="hljs-keyword">in</span> CALL_CLOSERS <span class="hljs-keyword">and</span> @tokens[i - <span class="hljs-number">1</span>].newLine
|
||||
token[<span class="hljs-number">0</span>] <span class="hljs-keyword">in</span> CALL_CLOSERS <span class="hljs-keyword">and</span>
|
||||
(@tokens[i - <span class="hljs-number">1</span>].newLine <span class="hljs-keyword">or</span> @tokens[i - <span class="hljs-number">1</span>][<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'OUTDENT'</span>)
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">action</span> = <span class="hljs-params">(token, i)</span> -></span>
|
||||
@tokens.splice (<span class="hljs-keyword">if</span> @tag(i - <span class="hljs-number">1</span>) <span class="hljs-keyword">is</span> <span class="hljs-string">','</span> <span class="hljs-keyword">then</span> i - <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> i), <span class="hljs-number">0</span>, outdent
|
||||
@@ -960,11 +980,11 @@ blocks are added.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-37">
|
||||
<li id="section-38">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-37">¶</a>
|
||||
<a class="pilcrow" href="#section-38">¶</a>
|
||||
</div>
|
||||
<p>Tag postfix conditionals as such, so that we can parse them with a
|
||||
different precedence.</p>
|
||||
@@ -993,11 +1013,11 @@ different precedence.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-38">
|
||||
<li id="section-39">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-38">¶</a>
|
||||
<a class="pilcrow" href="#section-39">¶</a>
|
||||
</div>
|
||||
<p>Generate the indentation tokens, based on another token on the same line.</p>
|
||||
|
||||
@@ -1018,11 +1038,11 @@ different precedence.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-39">
|
||||
<li id="section-40">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-39">¶</a>
|
||||
<a class="pilcrow" href="#section-40">¶</a>
|
||||
</div>
|
||||
<p>Look up a tag by token index.</p>
|
||||
|
||||
@@ -1033,26 +1053,14 @@ different precedence.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-40">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-40">¶</a>
|
||||
</div>
|
||||
<h2 id="constants">Constants</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-41">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-41">¶</a>
|
||||
</div>
|
||||
|
||||
<h2 id="constants">Constants</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
@@ -1064,6 +1072,18 @@ different precedence.</p>
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-42">¶</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-43">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-43">¶</a>
|
||||
</div>
|
||||
<p>List of the token pairs that must be balanced.</p>
|
||||
|
||||
</div>
|
||||
@@ -1083,11 +1103,11 @@ different precedence.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-43">
|
||||
<li id="section-44">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-43">¶</a>
|
||||
<a class="pilcrow" href="#section-44">¶</a>
|
||||
</div>
|
||||
<p>The inverse mappings of <code>BALANCED_PAIRS</code> we’re trying to fix up, so we can
|
||||
look things up from either end.</p>
|
||||
@@ -1099,11 +1119,11 @@ look things up from either end.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-44">
|
||||
<li id="section-45">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-44">¶</a>
|
||||
<a class="pilcrow" href="#section-45">¶</a>
|
||||
</div>
|
||||
<p>The tokens that signal the start/end of a balanced pair.</p>
|
||||
|
||||
@@ -1119,11 +1139,11 @@ EXPRESSION_END = []
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-45">
|
||||
<li id="section-46">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-45">¶</a>
|
||||
<a class="pilcrow" href="#section-46">¶</a>
|
||||
</div>
|
||||
<p>Tokens that indicate the close of a clause of an expression.</p>
|
||||
|
||||
@@ -1134,11 +1154,11 @@ EXPRESSION_END = []
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-46">
|
||||
<li id="section-47">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-46">¶</a>
|
||||
<a class="pilcrow" href="#section-47">¶</a>
|
||||
</div>
|
||||
<p>Tokens that, if followed by an <code>IMPLICIT_CALL</code>, indicate a function invocation.</p>
|
||||
|
||||
@@ -1149,11 +1169,11 @@ EXPRESSION_END = []
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-47">
|
||||
<li id="section-48">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-47">¶</a>
|
||||
<a class="pilcrow" href="#section-48">¶</a>
|
||||
</div>
|
||||
<p>If preceded by an <code>IMPLICIT_FUNC</code>, indicates a function invocation.</p>
|
||||
|
||||
@@ -1173,11 +1193,11 @@ IMPLICIT_UNSPACED_CALL = [<span class="hljs-string">'+'</span>, <span class="hlj
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-48">
|
||||
<li id="section-49">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-48">¶</a>
|
||||
<a class="pilcrow" href="#section-49">¶</a>
|
||||
</div>
|
||||
<p>Tokens that always mark the end of an implicit call for single-liners.</p>
|
||||
|
||||
@@ -1189,11 +1209,11 @@ IMPLICIT_UNSPACED_CALL = [<span class="hljs-string">'+'</span>, <span class="hlj
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-49">
|
||||
<li id="section-50">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-49">¶</a>
|
||||
<a class="pilcrow" href="#section-50">¶</a>
|
||||
</div>
|
||||
<p>Single-line flavors of block expressions that have unclosed endings.
|
||||
The grammar can’t disambiguate them, so we insert the implicit indentation.</p>
|
||||
@@ -1206,11 +1226,11 @@ SINGLE_CLOSERS = [<span class="hljs-string">'TERMINATOR'</span>, <span class="
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-50">
|
||||
<li id="section-51">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-50">¶</a>
|
||||
<a class="pilcrow" href="#section-51">¶</a>
|
||||
</div>
|
||||
<p>Tokens that end a line.</p>
|
||||
|
||||
@@ -1221,11 +1241,11 @@ SINGLE_CLOSERS = [<span class="hljs-string">'TERMINATOR'</span>, <span class="
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-51">
|
||||
<li id="section-52">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-51">¶</a>
|
||||
<a class="pilcrow" href="#section-52">¶</a>
|
||||
</div>
|
||||
<p>Tokens that close open calls when they follow a newline.</p>
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ column for the current line:</p>
|
||||
</div>
|
||||
<p>Note that SourceMap VLQ encoding is “backwards”. MIDI-style VLQ encoding puts
|
||||
the most-significant-bit (MSB) from the original value into the MSB of the VLQ
|
||||
encoded value (see <a href="http://en.wikipedia.org/wiki/File:Uintvar_coding.svg">Wikipedia</a>).
|
||||
encoded value (see <a href="https://en.wikipedia.org/wiki/File:Uintvar_coding.svg">Wikipedia</a>).
|
||||
SourceMap VLQ does things the other way around, with the least significat four
|
||||
bits of the original value encoded into the first byte of the VLQ encoded value.</p>
|
||||
|
||||
|
||||
@@ -1,399 +1,405 @@
|
||||
/**
|
||||
* CoffeeScript Compiler v1.12.4
|
||||
* CoffeeScript Compiler v1.12.7
|
||||
* http://coffeescript.org
|
||||
*
|
||||
* Copyright 2011, Jeremy Ashkenas
|
||||
* Released under the MIT License
|
||||
*/
|
||||
var $jscomp={scope:{},checkStringArgs:function(u,ya,qa){if(null==u)throw new TypeError("The 'this' value for String.prototype."+qa+" must not be null or undefined");if(ya instanceof RegExp)throw new TypeError("First argument to String.prototype."+qa+" must not be a regular expression");return u+""}};
|
||||
$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(u,ya,qa){if(qa.get||qa.set)throw new TypeError("ES3 does not support getters and setters.");u!=Array.prototype&&u!=Object.prototype&&(u[ya]=qa.value)};$jscomp.getGlobal=function(u){return"undefined"!=typeof window&&window===u?u:"undefined"!=typeof global&&null!=global?global:u};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.polyfill=function(u,ya,qa,g){if(ya){qa=$jscomp.global;u=u.split(".");for(g=0;g<u.length-1;g++){var ua=u[g];ua in qa||(qa[ua]={});qa=qa[ua]}u=u[u.length-1];g=qa[u];ya=ya(g);ya!=g&&null!=ya&&$jscomp.defineProperty(qa,u,{configurable:!0,writable:!0,value:ya})}};
|
||||
$jscomp.polyfill("String.prototype.repeat",function(u){return u?u:function(u){var qa=$jscomp.checkStringArgs(this,null,"repeat");if(0>u||1342177279<u)throw new RangeError("Invalid count value");u|=0;for(var g="";u;)if(u&1&&(g+=qa),u>>>=1)qa+=qa;return g}},"es6-impl","es3");$jscomp.findInternal=function(u,ya,qa){u instanceof String&&(u=String(u));for(var g=u.length,ua=0;ua<g;ua++){var xa=u[ua];if(ya.call(qa,xa,ua,u))return{i:ua,v:xa}}return{i:-1,v:void 0}};
|
||||
$jscomp.polyfill("Array.prototype.find",function(u){return u?u:function(u,qa){return $jscomp.findInternal(this,u,qa).v}},"es6-impl","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(u){return $jscomp.SYMBOL_PREFIX+(u||"")+$jscomp.symbolCounter_++};
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.checkStringArgs=function(u,xa,ya){if(null==u)throw new TypeError("The 'this' value for String.prototype."+ya+" must not be null or undefined");if(xa instanceof RegExp)throw new TypeError("First argument to String.prototype."+ya+" must not be a regular expression");return u+""};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(u,xa,ya){u!=Array.prototype&&u!=Object.prototype&&(u[xa]=ya.value)};$jscomp.getGlobal=function(u){return"undefined"!=typeof window&&window===u?u:"undefined"!=typeof global&&null!=global?global:u};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.polyfill=function(u,xa,ya,e){if(xa){ya=$jscomp.global;u=u.split(".");for(e=0;e<u.length-1;e++){var ra=u[e];ra in ya||(ya[ra]={});ya=ya[ra]}u=u[u.length-1];e=ya[u];xa=xa(e);xa!=e&&null!=xa&&$jscomp.defineProperty(ya,u,{configurable:!0,writable:!0,value:xa})}};
|
||||
$jscomp.polyfill("String.prototype.repeat",function(u){return u?u:function(u){var ya=$jscomp.checkStringArgs(this,null,"repeat");if(0>u||1342177279<u)throw new RangeError("Invalid count value");u|=0;for(var e="";u;)if(u&1&&(e+=ya),u>>>=1)ya+=ya;return e}},"es6","es3");$jscomp.findInternal=function(u,xa,ya){u instanceof String&&(u=String(u));for(var e=u.length,ra=0;ra<e;ra++){var r=u[ra];if(xa.call(ya,r,ra,u))return{i:ra,v:r}}return{i:-1,v:void 0}};
|
||||
$jscomp.polyfill("Array.prototype.find",function(u){return u?u:function(u,ya){return $jscomp.findInternal(this,u,ya).v}},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(u){return $jscomp.SYMBOL_PREFIX+(u||"")+$jscomp.symbolCounter_++};
|
||||
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var u=$jscomp.global.Symbol.iterator;u||(u=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[u]&&$jscomp.defineProperty(Array.prototype,u,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};
|
||||
$jscomp.arrayIterator=function(u){var ya=0;return $jscomp.iteratorPrototype(function(){return ya<u.length?{done:!1,value:u[ya++]}:{done:!0}})};$jscomp.iteratorPrototype=function(u){$jscomp.initSymbolIterator();u={next:u};u[$jscomp.global.Symbol.iterator]=function(){return this};return u};$jscomp.array=$jscomp.array||{};
|
||||
$jscomp.iteratorFromArray=function(u,ya){$jscomp.initSymbolIterator();u instanceof String&&(u+="");var qa=0,g={next:function(){if(qa<u.length){var ua=qa++;return{value:ya(ua,u[ua]),done:!1}}g.next=function(){return{done:!0,value:void 0}};return g.next()}};g[Symbol.iterator]=function(){return g};return g};$jscomp.polyfill("Array.prototype.keys",function(u){return u?u:function(){return $jscomp.iteratorFromArray(this,function(u){return u})}},"es6-impl","es3");
|
||||
(function(u){var ya=function(){function u(g){return u[g]}u["../../package.json"]={name:"coffee-script",description:"Unfancy JavaScript",keywords:["javascript","language","coffeescript","compiler"],author:"Jeremy Ashkenas",version:"1.12.4",license:"MIT",engines:{node:"\x3e\x3d0.8.0"},directories:{lib:"./lib/coffee-script"},main:"./lib/coffee-script/coffee-script",bin:{coffee:"./bin/coffee",cake:"./bin/cake"},files:["bin","lib","register.js","repl.js"],preferGlobal:!0,scripts:{test:"node ./bin/cake test",
|
||||
"test-harmony":"node --harmony ./bin/cake test"},homepage:"http://coffeescript.org",bugs:"https://github.com/jashkenas/coffeescript/issues",repository:{type:"git",url:"git://github.com/jashkenas/coffeescript.git"},devDependencies:{docco:"~0.7.0","google-closure-compiler-js":"^20170124.0.0","highlight.js":"~9.9.0",jison:"\x3e\x3d0.4.17",marked:"^0.3.6",underscore:"~1.8.3"}};u["./helpers"]=function(){var g={};(function(){var u,xa,q,a,c,Ca;g.starts=function(a,c,l){return c===a.substr(l,c.length)};g.ends=
|
||||
function(a,c,l){var f;f=c.length;return c===a.substr(a.length-f-(l||0),f)};g.repeat=c=function(a,c){var f;for(f="";0<c;)c&1&&(f+=a),c>>>=1,a+=a;return f};g.compact=function(a){var f,c,g,q;q=[];f=0;for(g=a.length;f<g;f++)(c=a[f])&&q.push(c);return q};g.count=function(a,c){var f,D;f=D=0;if(!c.length)return 1/0;for(;D=1+a.indexOf(c,D);)f++;return f};g.merge=function(a,c){return xa(xa({},a),c)};xa=g.extend=function(a,c){var f,D;for(f in c)D=c[f],a[f]=D;return a};g.flatten=q=function(a){var f,c,g,G;c=
|
||||
[];g=0;for(G=a.length;g<G;g++)f=a[g],"[object Array]"===Object.prototype.toString.call(f)?c=c.concat(q(f)):c.push(f);return c};g.del=function(a,c){var f;f=a[c];delete a[c];return f};g.some=null!=(a=Array.prototype.some)?a:function(a){var f,c,g;c=0;for(g=this.length;c<g;c++)if(f=this[c],a(f))return!0;return!1};g.invertLiterate=function(a){var f;f=!0;var c,g,q,F;q=a.split("\n");F=[];c=0;for(g=q.length;c<g;c++)a=q[c],f&&/^([ ]{4}|[ ]{0,3}\t)/.test(a)?F.push(a):(f=/^\s*$/.test(a))?F.push(a):F.push("# "+
|
||||
a);return F.join("\n")};u=function(a,c){return c?{first_line:a.first_line,first_column:a.first_column,last_line:c.last_line,last_column:c.last_column}:a};g.addLocationDataFn=function(a,c){return function(f){"object"===typeof f&&f.updateLocationDataIfMissing&&f.updateLocationDataIfMissing(u(a,c));return f}};g.locationDataToString=function(a){var f;"2"in a&&"first_line"in a[2]?f=a[2]:"first_line"in a&&(f=a);return f?f.first_line+1+":"+(f.first_column+1)+"-"+(f.last_line+1+":"+(f.last_column+1)):"No location data"};
|
||||
g.baseFileName=function(a,c,g){null==c&&(c=!1);null==g&&(g=!1);a=a.split(g?/\\|\//:/\//);a=a[a.length-1];if(!(c&&0<=a.indexOf(".")))return a;a=a.split(".");a.pop();"coffee"===a[a.length-1]&&1<a.length&&a.pop();return a.join(".")};g.isCoffee=function(a){return/\.((lit)?coffee|coffee\.md)$/.test(a)};g.isLiterate=function(a){return/\.(litcoffee|coffee\.md)$/.test(a)};g.throwSyntaxError=function(a,c){a=new SyntaxError(a);a.location=c;a.toString=Ca;a.stack=a.toString();throw a;};g.updateSyntaxError=function(a,
|
||||
c,g){a.toString===Ca&&(a.code||(a.code=c),a.filename||(a.filename=g),a.stack=a.toString());return a};Ca=function(){var a,g,l,q,G,F,x,v,M,u;if(!this.code||!this.location)return Error.prototype.toString.call(this);a=this.location;F=a.first_line;G=a.first_column;l=a.last_line;x=a.last_column;null==l&&(l=F);null==x&&(x=G);q=this.filename||"[stdin]";a=this.code.split("\n")[F];l=F===l?x+1:a.length;x=a.slice(0,G).replace(/[^\s]/g," ")+c("^",l-G);"undefined"!==typeof process&&null!==process&&(g=(null!=(v=
|
||||
process.stdout)?v.isTTY:void 0)&&!(null!=(M=process.env)&&M.NODE_DISABLE_COLORS));if(null!=(u=this.colorful)?u:g)g=function(a){return"\u001b[1;31m"+a+"\u001b[0m"},a=a.slice(0,G)+g(a.slice(G,l))+a.slice(l),x=g(x);return q+":"+(F+1)+":"+(G+1)+": error: "+this.message+"\n"+a+"\n"+x};g.nameWhitespaceCharacter=function(a){switch(a){case " ":return"space";case "\n":return"newline";case "\r":return"carriage return";case "\t":return"tab";default:return a}}}).call(this);return g}();u["./rewriter"]=function(){var g=
|
||||
{};(function(){var u,xa,q,a,c,Ca,f,D,l,w,G,F,x,v,M,N,J,r,E=[].indexOf||function(a){for(var c=0,f=this.length;c<f;c++)if(c in this&&this[c]===a)return c;return-1},O=[].slice;v=function(a,c,f){a=[a,c];a.generated=!0;f&&(a.origin=f);return a};g.Rewriter=function(){function m(){}m.prototype.rewrite=function(a){this.tokens=a;this.removeLeadingNewlines();this.closeOpenCalls();this.closeOpenIndexes();this.normalizeLines();this.tagPostfixConditionals();this.addImplicitBracesAndParens();this.addLocationDataToGeneratedTokens();
|
||||
this.fixOutdentLocationData();return this.tokens};m.prototype.scanTokens=function(a){var c,k,h;h=this.tokens;for(c=0;k=h[c];)c+=a.call(this,k,c,h);return!0};m.prototype.detectEnd=function(k,f,p){var h,t,m,g,H;H=this.tokens;for(h=0;g=H[k];){if(0===h&&f.call(this,g,k))return p.call(this,g,k);if(!g||0>h)return p.call(this,g,k-1);(t=g[0],0<=E.call(c,t))?h+=1:(m=g[0],0<=E.call(a,m))&&--h;k+=1}return k-1};m.prototype.removeLeadingNewlines=function(){var a,c,f,h,y;h=this.tokens;a=c=0;for(f=h.length;c<f&&
|
||||
(y=h[a][0],"TERMINATOR"===y);a=++c);if(a)return this.tokens.splice(0,a)};m.prototype.closeOpenCalls=function(){var a,c;c=function(a,c){var h;return")"===(h=a[0])||"CALL_END"===h||"OUTDENT"===a[0]&&")"===this.tag(c-1)};a=function(a,c){return this.tokens["OUTDENT"===a[0]?c-1:c][0]="CALL_END"};return this.scanTokens(function(f,h){"CALL_START"===f[0]&&this.detectEnd(h+1,c,a);return 1})};m.prototype.closeOpenIndexes=function(){var a,c;c=function(a,c){var h;return"]"===(h=a[0])||"INDEX_END"===h};a=function(a,
|
||||
c){return a[0]="INDEX_END"};return this.scanTokens(function(f,h){"INDEX_START"===f[0]&&this.detectEnd(h+1,c,a);return 1})};m.prototype.indexOfTag=function(){var a,c,f,h,g,m,A;c=arguments[0];g=2<=arguments.length?O.call(arguments,1):[];f=h=a=0;for(m=g.length;0<=m?h<m:h>m;f=0<=m?++h:--h){for(;"HERECOMMENT"===this.tag(c+f+a);)a+=2;if(null!=g[f]&&("string"===typeof g[f]&&(g[f]=[g[f]]),A=this.tag(c+f+a),0>E.call(g[f],A)))return-1}return c+f+a-1};m.prototype.looksObjectish=function(f){var k;if(-1<this.indexOfTag(f,
|
||||
"@",null,":")||-1<this.indexOfTag(f,null,":"))return!0;f=this.indexOfTag(f,c);return-1<f&&(k=null,this.detectEnd(f+1,function(c){var h;return h=c[0],0<=E.call(a,h)},function(a,c){return k=c}),":"===this.tag(k+1))?!0:!1};m.prototype.findTagsBackwards=function(f,g){var k,h,m,t,A,H,l;for(k=[];0<=f&&(k.length||(t=this.tag(f),0>E.call(g,t))&&((A=this.tag(f),0>E.call(c,A))||this.tokens[f].generated)&&(H=this.tag(f),0>E.call(G,H)));)(h=this.tag(f),0<=E.call(a,h))&&k.push(this.tag(f)),(m=this.tag(f),0<=E.call(c,
|
||||
m))&&k.length&&k.pop(),--f;return l=this.tag(f),0<=E.call(g,l)};m.prototype.addImplicitBracesAndParens=function(){var k,g;k=[];g=null;return this.scanTokens(function(m,h,t){var p,A,y,q,r,I,w,x,z,B,u,C,M,F,J,N,O,K;K=m[0];B=(u=0<h?t[h-1]:[])[0];z=(h<t.length-1?t[h+1]:[])[0];J=function(){return k[k.length-1]};N=h;y=function(a){return h-N+a};q=function(){var a,c;return null!=(a=J())?null!=(c=a[2])?c.ours:void 0:void 0};r=function(){var a;return q()&&"("===(null!=(a=J())?a[0]:void 0)};w=function(){var a;
|
||||
return q()&&"{"===(null!=(a=J())?a[0]:void 0)};I=function(){var a;return q&&"CONTROL"===(null!=(a=J())?a[0]:void 0)};O=function(a){var c;c=null!=a?a:h;k.push(["(",c,{ours:!0}]);t.splice(c,0,v("CALL_START","("));if(null==a)return h+=1};p=function(){k.pop();t.splice(h,0,v("CALL_END",")",["","end of input",m[2]]));return h+=1};x=function(a,c){var f;null==c&&(c=!0);f=null!=a?a:h;k.push(["{",f,{sameLine:!0,startsLine:c,ours:!0}]);c=new String("{");c.generated=!0;t.splice(f,0,v("{",c,m));if(null==a)return h+=
|
||||
1};A=function(a){a=null!=a?a:h;k.pop();t.splice(a,0,v("}","}",m));return h+=1};if(r()&&("IF"===K||"TRY"===K||"FINALLY"===K||"CATCH"===K||"CLASS"===K||"SWITCH"===K))return k.push(["CONTROL",h,{ours:!0}]),y(1);if("INDENT"===K&&q()){if("\x3d\x3e"!==B&&"-\x3e"!==B&&"["!==B&&"("!==B&&","!==B&&"{"!==B&&"TRY"!==B&&"ELSE"!==B&&"\x3d"!==B)for(;r();)p();I()&&k.pop();k.push([K,h]);return y(1)}if(0<=E.call(c,K))return k.push([K,h]),y(1);if(0<=E.call(a,K)){for(;q();)r()?p():w()?A():k.pop();g=k.pop()}if((0<=E.call(D,
|
||||
K)&&m.spaced||"?"===K&&0<h&&!t[h-1].spaced)&&(0<=E.call(Ca,z)||0<=E.call(l,z)&&(null==(C=t[h+1])||!C.spaced)&&(null==(M=t[h+1])||!M.newLine)))return"?"===K&&(K=m[0]="FUNC_EXIST"),O(h+1),y(2);if(0<=E.call(D,K)&&-1<this.indexOfTag(h+1,"INDENT")&&this.looksObjectish(h+2)&&!this.findTagsBackwards(h,"CLASS EXTENDS IF CATCH SWITCH LEADING_WHEN FOR WHILE UNTIL".split(" ")))return O(h+1),k.push(["INDENT",h+2]),y(3);if(":"===K){for(A=function(){var c;switch(!1){case c=this.tag(h-1),0>E.call(a,c):return g[1];
|
||||
case "@"!==this.tag(h-2):return h-2;default:return h-1}}.call(this);"HERECOMMENT"===this.tag(A-2);)A-=2;this.insideForDeclaration="FOR"===z;I=0===A||(F=this.tag(A-1),0<=E.call(G,F))||t[A-1].newLine;if(J()&&(w=J(),F=w[0],u=w[1],("{"===F||"INDENT"===F&&"{"===this.tag(u-1))&&(I||","===this.tag(A-1)||"{"===this.tag(A-1))))return y(1);x(A,!!I);return y(2)}w()&&0<=E.call(G,K)&&(J()[2].sameLine=!1);x="OUTDENT"===B||u.newLine;if(0<=E.call(f,K)||0<=E.call(xa,K)&&x)for(;q();)if(x=J(),F=x[0],u=x[1],F=x[2],x=
|
||||
F.sameLine,I=F.startsLine,r()&&","!==B)p();else if(w()&&!this.insideForDeclaration&&x&&"TERMINATOR"!==K&&":"!==B)A();else if(!w()||"TERMINATOR"!==K||","===B||I&&this.looksObjectish(h+1))break;else{if("HERECOMMENT"===z)return y(1);A()}if(!(","!==K||this.looksObjectish(h+1)||!w()||this.insideForDeclaration||"TERMINATOR"===z&&this.looksObjectish(h+2)))for(z="OUTDENT"===z?1:0;w();)A(h+z);return y(1)})};m.prototype.addLocationDataToGeneratedTokens=function(){return this.scanTokens(function(a,c,f){var h,
|
||||
k,m;if(a[2]||!a.generated&&!a.explicit)return 1;"{"===a[0]&&(h=null!=(m=f[c+1])?m[2]:void 0)?(k=h.first_line,h=h.first_column):(h=null!=(k=f[c-1])?k[2]:void 0)?(k=h.last_line,h=h.last_column):k=h=0;a[2]={first_line:k,first_column:h,last_line:k,last_column:h};return 1})};m.prototype.fixOutdentLocationData=function(){return this.scanTokens(function(a,c,f){if(!("OUTDENT"===a[0]||a.generated&&"CALL_END"===a[0]||a.generated&&"}"===a[0]))return 1;c=f[c-1][2];a[2]={first_line:c.last_line,first_column:c.last_column,
|
||||
last_line:c.last_line,last_column:c.last_column};return 1})};m.prototype.normalizeLines=function(){var a,c,f,h,m;m=f=h=null;c=function(a,c){var f,h,k,g;return";"!==a[1]&&(f=a[0],0<=E.call(F,f))&&!("TERMINATOR"===a[0]&&(h=this.tag(c+1),0<=E.call(q,h)))&&!("ELSE"===a[0]&&"THEN"!==m)&&!!("CATCH"!==(k=a[0])&&"FINALLY"!==k||"-\x3e"!==m&&"\x3d\x3e"!==m)||(g=a[0],0<=E.call(xa,g))&&this.tokens[c-1].newLine};a=function(a,c){return this.tokens.splice(","===this.tag(c-1)?c-1:c,0,h)};return this.scanTokens(function(k,
|
||||
g,t){var p,y,l;k=k[0];if("TERMINATOR"===k){if("ELSE"===this.tag(g+1)&&"OUTDENT"!==this.tag(g-1))return t.splice.apply(t,[g,1].concat(O.call(this.indentation()))),1;if(p=this.tag(g+1),0<=E.call(q,p))return t.splice(g,1),0}if("CATCH"===k)for(p=y=1;2>=y;p=++y)if("OUTDENT"===(l=this.tag(g+p))||"TERMINATOR"===l||"FINALLY"===l)return t.splice.apply(t,[g+p,0].concat(O.call(this.indentation()))),2+p;0<=E.call(x,k)&&"INDENT"!==this.tag(g+1)&&("ELSE"!==k||"IF"!==this.tag(g+1))&&(m=k,l=this.indentation(t[g]),
|
||||
f=l[0],h=l[1],"THEN"===m&&(f.fromThen=!0),t.splice(g+1,0,f),this.detectEnd(g+2,c,a),"THEN"===k&&t.splice(g,1));return 1})};m.prototype.tagPostfixConditionals=function(){var a,c,f;f=null;c=function(a,c){a=a[0];c=this.tokens[c-1][0];return"TERMINATOR"===a||"INDENT"===a&&0>E.call(x,c)};a=function(a,c){if("INDENT"!==a[0]||a.generated&&!a.fromThen)return f[0]="POST_"+f[0]};return this.scanTokens(function(h,k){if("IF"!==h[0])return 1;f=h;this.detectEnd(k+1,c,a);return 1})};m.prototype.indentation=function(a){var c,
|
||||
f;c=["INDENT",2];f=["OUTDENT",2];a?(c.generated=f.generated=!0,c.origin=f.origin=a):c.explicit=f.explicit=!0;return[c,f]};m.prototype.generate=v;m.prototype.tag=function(a){var c;return null!=(c=this.tokens[a])?c[0]:void 0};return m}();u=[["(",")"],["[","]"],["{","}"],["INDENT","OUTDENT"],["CALL_START","CALL_END"],["PARAM_START","PARAM_END"],["INDEX_START","INDEX_END"],["STRING_START","STRING_END"],["REGEX_START","REGEX_END"]];g.INVERSES=w={};c=[];a=[];M=0;for(J=u.length;M<J;M++)r=u[M],N=r[0],r=r[1],
|
||||
c.push(w[r]=N),a.push(w[N]=r);q=["CATCH","THEN","ELSE","FINALLY"].concat(a);D="IDENTIFIER PROPERTY SUPER ) CALL_END ] INDEX_END @ THIS".split(" ");Ca="IDENTIFIER PROPERTY NUMBER INFINITY NAN STRING STRING_START REGEX REGEX_START JS NEW PARAM_START CLASS IF TRY SWITCH THIS UNDEFINED NULL BOOL UNARY YIELD UNARY_MATH SUPER THROW @ -\x3e \x3d\x3e [ ( { -- ++".split(" ");l=["+","-"];f="POST_IF FOR WHILE UNTIL WHEN BY LOOP TERMINATOR".split(" ");x="ELSE -\x3e \x3d\x3e TRY FINALLY THEN".split(" ");F="TERMINATOR CATCH FINALLY ELSE OUTDENT LEADING_WHEN".split(" ");
|
||||
G=["TERMINATOR","INDENT","OUTDENT"];xa=[".","?.","::","?::"]}).call(this);return g}();u["./lexer"]=function(){var g={};(function(){var ua,xa,q,a,c,Ca,f,D,l,w,G,F,x,v,M,N,J,r,E,O,m,k,t,p,h,y,P,A,H,U,T,I,aa,S,z,B,W,C,Q,X,Y,V,Z,K,ba,R,qa,ya,Xa,ka,ca,ea,ga,ha,la,oa,L,ja,ra,da=[].indexOf||function(a){for(var c=0,f=this.length;c<f;c++)if(c in this&&this[c]===a)return c;return-1},ma=[].slice;L=u("./rewriter");C=L.Rewriter;m=L.INVERSES;L=u("./helpers");ea=L.count;ja=L.repeat;ga=L.invertLiterate;ra=L.throwSyntaxError;
|
||||
g.Lexer=function(){function g(){}g.prototype.tokenize=function(a,c){var f,ia,h,g;null==c&&(c={});this.literate=c.literate;this.outdebt=this.indebt=this.baseIndent=this.indent=0;this.indents=[];this.ends=[];this.tokens=[];this.exportSpecifierList=this.seenExport=this.seenImport=this.seenFor=!1;this.chunkLine=c.line||0;this.chunkColumn=c.column||0;a=this.clean(a);for(h=0;this.chunk=a.slice(h);)if(f=this.identifierToken()||this.commentToken()||this.whitespaceToken()||this.lineToken()||this.stringToken()||
|
||||
this.numberToken()||this.regexToken()||this.jsToken()||this.literalToken(),g=this.getLineAndColumnFromChunk(f),this.chunkLine=g[0],this.chunkColumn=g[1],h+=f,c.untilBalanced&&0===this.ends.length)return{tokens:this.tokens,index:h};this.closeIndentation();(ia=this.ends.pop())&&this.error("missing "+ia.tag,ia.origin[2]);return!1===c.rewrite?this.tokens:(new C).rewrite(this.tokens)};g.prototype.clean=function(a){a.charCodeAt(0)===ua&&(a=a.slice(1));a=a.replace(/\r/g,"").replace(qa,"");ca.test(a)&&(a=
|
||||
"\n"+a,this.chunkLine--);this.literate&&(a=ga(a));return a};g.prototype.identifierToken=function(){var f,g,k,m,p,y,l,A,q,v,r;if(!(g=J.exec(this.chunk)))return 0;p=g[0];k=g[1];g=g[2];m=k.length;y=void 0;if("own"===k&&"FOR"===this.tag())return this.token("OWN",k),k.length;if("from"===k&&"YIELD"===this.tag())return this.token("FROM",k),k.length;if("as"===k&&this.seenImport){if("*"===this.value())this.tokens[this.tokens.length-1][0]="IMPORT_ALL";else if(l=this.value(),0<=da.call(Ca,l))this.tokens[this.tokens.length-
|
||||
1][0]="IDENTIFIER";if("DEFAULT"===(A=this.tag())||"IMPORT_ALL"===A||"IDENTIFIER"===A)return this.token("AS",k),k.length}if("as"===k&&this.seenExport&&"IDENTIFIER"===this.tag())return this.token("AS",k),k.length;if("default"===k&&this.seenExport)return this.token("DEFAULT",k),k.length;l=this.tokens;l=l[l.length-1];r=g||null!=l&&("."===(q=l[0])||"?."===q||"::"===q||"?::"===q||!l.spaced&&"@"===l[0])?"PROPERTY":"IDENTIFIER";"IDENTIFIER"!==r||!(0<=da.call(t,k)||0<=da.call(Ca,k))||this.exportSpecifierList&&
|
||||
0<=da.call(Ca,k)?"IDENTIFIER"===r&&this.seenFor&&"from"===k&&ha(l)&&(r="FORFROM",this.seenFor=!1):(r=k.toUpperCase(),"WHEN"===r&&(v=this.tag(),0<=da.call(h,v))?r="LEADING_WHEN":"FOR"===r?this.seenFor=!0:"UNLESS"===r?r="IF":"IMPORT"===r?this.seenImport=!0:"EXPORT"===r?this.seenExport=!0:0<=da.call(ya,r)?r="UNARY":0<=da.call(B,r)&&("INSTANCEOF"!==r&&this.seenFor?(r="FOR"+r,this.seenFor=!1):(r="RELATION","!"===this.value()&&(y=this.tokens.pop(),k="!"+k))));"IDENTIFIER"===r&&0<=da.call(W,k)&&this.error("reserved word '"+
|
||||
k+"'",{length:k.length});"PROPERTY"!==r&&(0<=da.call(a,k)&&(f=k,k=c[k]),r=function(){switch(k){case "!":return"UNARY";case "\x3d\x3d":case "!\x3d":return"COMPARE";case "true":case "false":return"BOOL";case "break":case "continue":case "debugger":return"STATEMENT";case "\x26\x26":case "||":return k;default:return r}}());q=this.token(r,k,0,m);f&&(q.origin=[r,f,q[2]]);y&&(f=[y[2].first_line,y[2].first_column],q[2].first_line=f[0],q[2].first_column=f[1]);g&&(f=p.lastIndexOf(":"),this.token(":",":",f,
|
||||
g.length));return p.length};g.prototype.numberToken=function(){var a,c,f,g;if(!(c=U.exec(this.chunk)))return 0;f=c[0];c=f.length;switch(!1){case !/^0[BOX]/.test(f):this.error("radix prefix in '"+f+"' must be lowercase",{offset:1});break;case !/^(?!0x).*E/.test(f):this.error("exponential notation in '"+f+"' must be indicated with a lowercase 'e'",{offset:f.indexOf("E")});break;case !/^0\d*[89]/.test(f):this.error("decimal literal '"+f+"' must not be prefixed with '0'",{length:c});break;case !/^0\d+/.test(f):this.error("octal literal '"+
|
||||
f+"' must be prefixed with '0o'",{length:c})}a=function(){switch(f.charAt(1)){case "b":return 2;case "o":return 8;case "x":return 16;default:return null}}();a=null!=a?parseInt(f.slice(2),a):parseFloat(f);if("b"===(g=f.charAt(1))||"o"===g)f="0x"+a.toString(16);this.token(Infinity===a?"INFINITY":"NUMBER",f,0,c);return c};g.prototype.stringToken=function(){var a,c,f,g,h,k,m,t,l,r,y,q;l=(ba.exec(this.chunk)||[])[0];if(!l)return 0;this.tokens.length&&"from"===this.value()&&(this.seenImport||this.seenExport)&&
|
||||
(this.tokens[this.tokens.length-1][0]="FROM");f=function(){switch(l){case "'":return K;case '"':return V;case "'''":return x;case '"""':return G}}();g=3===l.length;f=this.matchWithInterpolations(f,l);q=f.tokens;h=f.index;a=q.length-1;f=l.charAt(0);if(g){m=null;for(g=function(){var a,c,f;f=[];k=a=0;for(c=q.length;a<c;k=++a)y=q[k],"NEOSTRING"===y[0]&&f.push(y[1]);return f}().join("#{}");c=F.exec(g);)if(c=c[1],null===m||0<(r=c.length)&&r<m.length)m=c;m&&(t=RegExp("\\n"+m,"g"));this.mergeInterpolationTokens(q,
|
||||
{delimiter:f},function(c){return function(f,g){f=c.formatString(f);t&&(f=f.replace(t,"\n"));0===g&&(f=f.replace(p,""));g===a&&(f=f.replace(R,""));return f}}(this))}else this.mergeInterpolationTokens(q,{delimiter:f},function(c){return function(f,g){f=c.formatString(f);return f=f.replace(X,function(c,h){return 0===g&&0===h||g===a&&h+c.length===f.length?"":" "})}}(this));return h};g.prototype.commentToken=function(){var a,c,g;if(!(g=this.chunk.match(f)))return 0;a=g[0];if(c=g[1])(g=w.exec(a))&&this.error("block comments cannot contain "+
|
||||
g[0],{offset:g.index,length:g[0].length}),0<=c.indexOf("\n")&&(c=c.replace(RegExp("\\n"+ja(" ",this.indent),"g"),"\n")),this.token("HERECOMMENT",c,0,a.length);return a.length};g.prototype.jsToken=function(){var a,c;if("`"!==this.chunk.charAt(0)||!(a=N.exec(this.chunk)||k.exec(this.chunk)))return 0;c=a[1].replace(/\\+(`|$)/g,function(a){return a.slice(-Math.ceil(a.length/2))});this.token("JS",c,0,a[0].length);return a[0].length};g.prototype.regexToken=function(){var a,c,f,g,h,k,m,t;switch(!1){case !(c=
|
||||
z.exec(this.chunk)):this.error("regular expressions cannot begin with "+c[2],{offset:c.index+c[1].length});break;case !(c=this.matchWithInterpolations(v,"///")):t=c.tokens;h=c.index;break;case !(c=aa.exec(this.chunk)):m=c[0];a=c[1];c=c[2];this.validateEscapes(a,{isRegex:!0,offsetInChunk:1});h=m.length;k=this.tokens;if(k=k[k.length-1])if(k.spaced&&(f=k[0],0<=da.call(xa,f))){if(!c||I.test(m))return 0}else if(g=k[0],0<=da.call(H,g))return 0;c||this.error("missing / (unclosed regex)");break;default:return 0}g=
|
||||
S.exec(this.chunk.slice(h))[0];f=h+g.length;c=this.makeToken("REGEX",null,0,f);switch(!1){case !!ka.test(g):this.error("invalid regular expression flags "+g,{offset:h,length:g.length});break;case !(m||1===t.length):null==a&&(a=this.formatHeregex(t[0][1]));this.token("REGEX",""+this.makeDelimitedLiteral(a,{delimiter:"/"})+g,0,f,c);break;default:this.token("REGEX_START","(",0,0,c),this.token("IDENTIFIER","RegExp",0,0),this.token("CALL_START","(",0,0),this.mergeInterpolationTokens(t,{delimiter:'"',double:!0},
|
||||
this.formatHeregex),g&&(this.token(",",",",h-1,0),this.token("STRING",'"'+g+'"',h-1,g.length)),this.token(")",")",f-1,0),this.token("REGEX_END",")",f-1,0)}return f};g.prototype.lineToken=function(){var a,c,f;if(!(c=A.exec(this.chunk)))return 0;c=c[0];this.seenFor=!1;f=c.length-1-c.lastIndexOf("\n");a=this.unfinished();if(f-this.indebt===this.indent)return a?this.suppressNewlines():this.newlineToken(0),c.length;if(f>this.indent){if(a)return this.indebt=f-this.indent,this.suppressNewlines(),c.length;
|
||||
if(!this.tokens.length)return this.baseIndent=this.indent=f,c.length;a=f-this.indent+this.outdebt;this.token("INDENT",a,c.length-f,f);this.indents.push(a);this.ends.push({tag:"OUTDENT"});this.outdebt=this.indebt=0;this.indent=f}else f<this.baseIndent?this.error("missing indentation",{offset:c.length}):(this.indebt=0,this.outdentToken(this.indent-f,a,c.length));return c.length};g.prototype.outdentToken=function(a,c,f){var g,h,k,m;for(g=this.indent-a;0<a;)(k=this.indents[this.indents.length-1])?k===
|
||||
this.outdebt?(a-=this.outdebt,this.outdebt=0):k<this.outdebt?(this.outdebt-=k,a-=k):(h=this.indents.pop()+this.outdebt,f&&(m=this.chunk[f],0<=da.call(r,m))&&(g-=h-a,a=h),this.outdebt=0,this.pair("OUTDENT"),this.token("OUTDENT",a,0,f),a-=h):a=0;h&&(this.outdebt-=a);for(;";"===this.value();)this.tokens.pop();"TERMINATOR"===this.tag()||c||this.token("TERMINATOR","\n",f,0);this.indent=g;return this};g.prototype.whitespaceToken=function(){var a,c;if(!(a=ca.exec(this.chunk))&&"\n"!==this.chunk.charAt(0))return 0;
|
||||
c=this.tokens;(c=c[c.length-1])&&(c[a?"spaced":"newLine"]=!0);return a?a[0].length:0};g.prototype.newlineToken=function(a){for(;";"===this.value();)this.tokens.pop();"TERMINATOR"!==this.tag()&&this.token("TERMINATOR","\n",a,0);return this};g.prototype.suppressNewlines=function(){"\\"===this.value()&&this.tokens.pop();return this};g.prototype.literalToken=function(){var a,c,f,g,h,k,t,p;(a=T.exec(this.chunk))?(a=a[0],q.test(a)&&this.tagParameters()):a=this.chunk.charAt(0);p=a;g=this.tokens;if((g=g[g.length-
|
||||
1])&&0<=da.call(["\x3d"].concat(ma.call(l)),a)&&(t=!1,"\x3d"!==a||"||"!==(f=g[1])&&"\x26\x26"!==f||g.spaced||(g[0]="COMPOUND_ASSIGN",g[1]+="\x3d",g=this.tokens[this.tokens.length-2],t=!0),g&&"PROPERTY"!==g[0]&&(f=null!=(c=g.origin)?c:g,(c=la(g[1],f[1]))&&this.error(c,f[2])),t))return a.length;"{"===a&&"EXPORT"===(null!=g?g[0]:void 0)?this.exportSpecifierList=!0:this.exportSpecifierList&&"}"===a&&(this.exportSpecifierList=!1);if(";"===a)this.seenFor=this.seenImport=this.seenExport=!1,p="TERMINATOR";
|
||||
else if("*"===a&&"EXPORT"===g[0])p="EXPORT_ALL";else if(0<=da.call(P,a))p="MATH";else if(0<=da.call(D,a))p="COMPARE";else if(0<=da.call(l,a))p="COMPOUND_ASSIGN";else if(0<=da.call(ya,a))p="UNARY";else if(0<=da.call(Xa,a))p="UNARY_MATH";else if(0<=da.call(Q,a))p="SHIFT";else if("?"===a&&null!=g&&g.spaced)p="BIN?";else if(g&&!g.spaced)if("("===a&&(h=g[0],0<=da.call(xa,h)))"?"===g[0]&&(g[0]="FUNC_EXIST"),p="CALL_START";else if("["===a&&(k=g[0],0<=da.call(E,k)))switch(p="INDEX_START",g[0]){case "?":g[0]=
|
||||
"INDEX_SOAK"}h=this.makeToken(p,a);switch(a){case "(":case "{":case "[":this.ends.push({tag:m[a],origin:h});break;case ")":case "}":case "]":this.pair(a)}this.tokens.push(h);return a.length};g.prototype.tagParameters=function(){var a,c,f,g;if(")"!==this.tag())return this;c=[];g=this.tokens;a=g.length;for(g[--a][0]="PARAM_END";f=g[--a];)switch(f[0]){case ")":c.push(f);break;case "(":case "CALL_START":if(c.length)c.pop();else return"("===f[0]&&(f[0]="PARAM_START"),this}return this};g.prototype.closeIndentation=
|
||||
function(){return this.outdentToken(this.indent)};g.prototype.matchWithInterpolations=function(a,c){var f,h,k,m,t,p,l,r;r=[];t=c.length;if(this.chunk.slice(0,t)!==c)return null;for(l=this.chunk.slice(t);;){m=a.exec(l)[0];this.validateEscapes(m,{isRegex:"/"===c.charAt(0),offsetInChunk:t});r.push(this.makeToken("NEOSTRING",m,t));l=l.slice(m.length);t+=m.length;if("#{"!==l.slice(0,2))break;f=this.getLineAndColumnFromChunk(t+1);m=f[0];f=f[1];f=(new g).tokenize(l.slice(1),{line:m,column:f,untilBalanced:!0});
|
||||
m=f.tokens;h=f.index;h+=1;p=m[0];f=m[m.length-1];p[0]=p[1]="(";f[0]=f[1]=")";f.origin=["","end of interpolation",f[2]];"TERMINATOR"===(null!=(k=m[1])?k[0]:void 0)&&m.splice(1,1);r.push(["TOKENS",m]);l=l.slice(h);t+=h}l.slice(0,c.length)!==c&&this.error("missing "+c,{length:c.length});a=r[0];k=r[r.length-1];a[2].first_column-=c.length;"\n"===k[1].substr(-1)?(k[2].last_line+=1,k[2].last_column=c.length-1):k[2].last_column+=c.length;0===k[1].length&&--k[2].last_column;return{tokens:r,index:t+c.length}};
|
||||
g.prototype.mergeInterpolationTokens=function(a,c,f){var g,h,k,m,t,p,l,r,y,q,A,ia;1<a.length&&(r=this.token("STRING_START","(",0,0));k=this.tokens.length;m=t=0;for(p=a.length;t<p;m=++t){q=a[m];g=q[0];ia=q[1];switch(g){case "TOKENS":if(2===ia.length)continue;l=ia[0];A=ia;break;case "NEOSTRING":g=f(q[1],m);if(0===g.length)if(0===m)h=this.tokens.length;else continue;2===m&&null!=h&&this.tokens.splice(h,2);q[0]="STRING";q[1]=this.makeDelimitedLiteral(g,c);l=q;A=[q]}this.tokens.length>k&&(m=this.token("+",
|
||||
"+"),m[2]={first_line:l[2].first_line,first_column:l[2].first_column,last_line:l[2].first_line,last_column:l[2].first_column});(y=this.tokens).push.apply(y,A)}if(r)return a=a[a.length-1],r.origin=["STRING",null,{first_line:r[2].first_line,first_column:r[2].first_column,last_line:a[2].last_line,last_column:a[2].last_column}],r=this.token("STRING_END",")"),r[2]={first_line:a[2].last_line,first_column:a[2].last_column,last_line:a[2].last_line,last_column:a[2].last_column}};g.prototype.pair=function(a){var c;
|
||||
c=this.ends;c=c[c.length-1];return a!==(c=null!=c?c.tag:void 0)?("OUTDENT"!==c&&this.error("unmatched "+a),c=this.indents,c=c[c.length-1],this.outdentToken(c,!0),this.pair(a)):this.ends.pop()};g.prototype.getLineAndColumnFromChunk=function(a){var c,f;if(0===a)return[this.chunkLine,this.chunkColumn];f=a>=this.chunk.length?this.chunk:this.chunk.slice(0,+(a-1)+1||9E9);a=ea(f,"\n");c=this.chunkColumn;0<a?(c=f.split("\n"),c=c[c.length-1],c=c.length):c+=f.length;return[this.chunkLine+a,c]};g.prototype.makeToken=
|
||||
function(a,c,f,g){var h,k;null==f&&(f=0);null==g&&(g=c.length);h={};k=this.getLineAndColumnFromChunk(f);h.first_line=k[0];h.first_column=k[1];f=this.getLineAndColumnFromChunk(f+(0<g?g-1:0));h.last_line=f[0];h.last_column=f[1];return[a,c,h]};g.prototype.token=function(a,c,f,g,h){a=this.makeToken(a,c,f,g);h&&(a.origin=h);this.tokens.push(a);return a};g.prototype.tag=function(){var a;a=this.tokens;a=a[a.length-1];return null!=a?a[0]:void 0};g.prototype.value=function(){var a;a=this.tokens;a=a[a.length-
|
||||
1];return null!=a?a[1]:void 0};g.prototype.unfinished=function(){var a;return y.test(this.chunk)||"\\"===(a=this.tag())||"."===a||"?."===a||"?::"===a||"UNARY"===a||"MATH"===a||"UNARY_MATH"===a||"+"===a||"-"===a||"**"===a||"SHIFT"===a||"RELATION"===a||"COMPARE"===a||"\x26"===a||"^"===a||"|"===a||"\x26\x26"===a||"||"===a||"BIN?"===a||"THROW"===a||"EXTENDS"===a};g.prototype.formatString=function(a){return a.replace(Z,"$1")};g.prototype.formatHeregex=function(a){return a.replace(M,"$1$2")};g.prototype.validateEscapes=
|
||||
function(a,c){var f,g,h,k,m;null==c&&(c={});if(g=O.exec(a))if(g[0],a=g[1],h=g[2],f=g[3],m=g[4],!c.isRegex||!h||"0"===h.charAt(0))return f="\\"+(h||f||m),this.error((h?"octal escape sequences are not allowed":"invalid escape sequence")+" "+f,{offset:(null!=(k=c.offsetInChunk)?k:0)+g.index+a.length,length:f.length})};g.prototype.makeDelimitedLiteral=function(a,c){null==c&&(c={});""===a&&"/"===c.delimiter&&(a="(?:)");a=a.replace(RegExp("(\\\\\\\\)|(\\\\0(?\x3d[1-7]))|\\\\?("+c.delimiter+")|\\\\?(?:(\\n)|(\\r)|(\\u2028)|(\\u2029))|(\\\\.)",
|
||||
"g"),function(a,f,g,h,k,m,t,p,l){switch(!1){case !f:return c.double?f+f:f;case !g:return"\\x00";case !h:return"\\"+h;case !k:return"\\n";case !m:return"\\r";case !t:return"\\u2028";case !p:return"\\u2029";case !l:return c.double?"\\"+l:l}});return""+c.delimiter+a+c.delimiter};g.prototype.error=function(a,c){var f,g,h,k,m;null==c&&(c={});c="first_line"in c?c:(k=this.getLineAndColumnFromChunk(null!=(h=c.offset)?h:0),g=k[0],f=k[1],k,{first_line:g,first_column:f,last_column:f+(null!=(m=c.length)?m:1)-
|
||||
1});return ra(a,c)};return g}();la=function(a,c){null==c&&(c=a);switch(!1){case 0>da.call(ma.call(t).concat(ma.call(Ca)),a):return"keyword '"+c+"' can't be assigned";case 0>da.call(Y,a):return"'"+c+"' can't be assigned";case 0>da.call(W,a):return"reserved word '"+c+"' can't be assigned";default:return!1}};g.isUnassignable=la;ha=function(a){var c;return"IDENTIFIER"===a[0]?("from"===a[1]&&(a[1][0]="IDENTIFIER",!0),!0):"FOR"===a[0]?!1:"{"===(c=a[1])||"["===c||","===c||":"===c?!1:!0};t="true false null this new delete typeof in instanceof return throw break continue debugger yield if else switch for while do try catch finally class extends super import export default".split(" ");
|
||||
Ca="undefined Infinity NaN then unless until loop of by when".split(" ");c={and:"\x26\x26",or:"||",is:"\x3d\x3d",isnt:"!\x3d",not:"!",yes:"true",no:"false",on:"true",off:"false"};a=function(){var a;a=[];for(oa in c)a.push(oa);return a}();Ca=Ca.concat(a);W="case function var void with const let enum native implements interface package private protected public static".split(" ");Y=["arguments","eval"];g.JS_FORBIDDEN=t.concat(W).concat(Y);ua=65279;J=/^(?!\d)((?:(?!\s)[$\w\x7f-\uffff])+)([^\n\S]*:(?!:))?/;
|
||||
U=/^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i;T=/^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>*\/%])\2=?|\?(\.|::)|\.{2,3})/;ca=/^[^\n\S]+/;f=/^###([^#][\s\S]*?)(?:###[^\n\S]*|###$)|^(?:\s*#(?!##[^#]).*)+/;q=/^[-=]>/;A=/^(?:\n[^\n\S]*)+/;k=/^`(?!``)((?:[^`\\]|\\[\s\S])*)`/;N=/^```((?:[^`\\]|\\[\s\S]|`(?!``))*)```/;ba=/^(?:'''|"""|'|")/;K=/^(?:[^\\']|\\[\s\S])*/;V=/^(?:[^\\"#]|\\[\s\S]|\#(?!\{))*/;x=/^(?:[^\\']|\\[\s\S]|'(?!''))*/;G=/^(?:[^\\"#]|\\[\s\S]|"(?!"")|\#(?!\{))*/;Z=/((?:\\\\)+)|\\[^\S\n]*\n\s*/g;
|
||||
X=/\s*\n\s*/g;F=/\n+([^\n\S]*)(?=\S)/g;aa=/^\/(?!\/)((?:[^[\/\n\\]|\\[^\n]|\[(?:\\[^\n]|[^\]\n\\])*\])*)(\/)?/;S=/^\w*/;ka=/^(?!.*(.).*\1)[imgy]*$/;v=/^(?:[^\\\/#]|\\[\s\S]|\/(?!\/\/)|\#(?!\{))*/;M=/((?:\\\\)+)|\\(\s)|\s+(?:#.*)?/g;z=/^(\/|\/{3}\s*)(\*)/;I=/^\/=?\s/;w=/\*\//;y=/^\s*(?:,|\??\.(?![.\d])|::)/;O=/((?:^|[^\\])(?:\\\\)*)\\(?:(0[0-7]|[1-7])|(x(?![\da-fA-F]{2}).{0,2})|(u(?![\da-fA-F]{4}).{0,4}))/;p=/^[^\n\S]*\n/;R=/\n[^\n\S]*$/;qa=/\s+$/;l="-\x3d +\x3d /\x3d *\x3d %\x3d ||\x3d \x26\x26\x3d ?\x3d \x3c\x3c\x3d \x3e\x3e\x3d \x3e\x3e\x3e\x3d \x26\x3d ^\x3d |\x3d **\x3d //\x3d %%\x3d".split(" ");
|
||||
ya=["NEW","TYPEOF","DELETE","DO"];Xa=["!","~"];Q=["\x3c\x3c","\x3e\x3e","\x3e\x3e\x3e"];D="\x3d\x3d !\x3d \x3c \x3e \x3c\x3d \x3e\x3d".split(" ");P=["*","/","%","//","%%"];B=["IN","OF","INSTANCEOF"];xa="IDENTIFIER PROPERTY ) ] ? @ THIS SUPER".split(" ");E=xa.concat("NUMBER INFINITY NAN STRING STRING_END REGEX REGEX_END BOOL NULL UNDEFINED } ::".split(" "));H=E.concat(["++","--"]);h=["INDENT","OUTDENT","TERMINATOR"];r=[")","}","]"]}).call(this);return g}();u["./parser"]=function(){var g={},ua={exports:g},
|
||||
xa=function(){function g(){this.yy={}}var a=function(a,n,pa,b){pa=pa||{};for(b=a.length;b--;pa[a[b]]=n);return pa},c=[1,22],u=[1,25],f=[1,83],D=[1,79],l=[1,84],w=[1,85],G=[1,81],F=[1,82],x=[1,56],v=[1,58],M=[1,59],N=[1,60],J=[1,61],r=[1,62],E=[1,49],O=[1,50],m=[1,32],k=[1,68],t=[1,69],p=[1,78],h=[1,47],y=[1,51],P=[1,52],A=[1,67],H=[1,65],U=[1,66],T=[1,64],I=[1,42],aa=[1,48],S=[1,63],z=[1,73],B=[1,74],W=[1,75],C=[1,76],Q=[1,46],X=[1,72],Y=[1,34],V=[1,35],Z=[1,36],K=[1,37],ba=[1,38],R=[1,39],xa=[1,
|
||||
86],ua=[1,6,32,42,131],qa=[1,101],ka=[1,89],ca=[1,88],ea=[1,87],ga=[1,90],ha=[1,91],la=[1,92],oa=[1,93],L=[1,94],ja=[1,95],ra=[1,96],da=[1,97],ma=[1,98],sa=[1,99],ia=[1,100],ya=[1,104],ta=[1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],Ja=[2,165],Ta=[1,110],Ga=[1,111],Ua=[1,112],Fa=[1,113],Pa=[1,115],Qa=[1,116],Na=[1,109],za=[1,6,32,42,131,133,135,139,156],na=[2,27],fa=[1,123],Ha=[1,121],Aa=[1,6,31,32,40,41,42,65,70,73,
|
||||
82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],Ia=[2,94],b=[1,6,31,32,42,46,65,70,73,82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],n=[2,73],pa=[1,128],e=[1,133],d=[1,134],va=[1,136],Ka=[1,6,31,32,40,41,42,55,65,70,73,82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,
|
||||
173,174],wa=[2,91],Gb=[1,6,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],ab=[2,63],Hb=[1,166],bb=[1,178],Wa=[1,180],Ib=[1,175],Oa=[1,182],ub=[1,184],La=[1,6,31,32,40,41,42,55,65,70,73,82,83,84,85,87,89,90,94,96,113,114,115,120,122,131,133,134,135,139,140,156,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175],Jb=[2,110],Kb=[1,6,31,32,40,41,42,58,65,70,73,82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,
|
||||
135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],Lb=[1,6,31,32,40,41,42,46,58,65,70,73,82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],Mb=[40,41,114],Nb=[1,241],vb=[1,240],Ma=[1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156],Ea=[2,71],Ob=[1,250],Va=[6,31,32,65,70],hb=[6,31,32,55,65,70,73],cb=[1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,159,160,164,166,
|
||||
167,168,169,170,171,172,173,174],Pb=[40,41,82,83,84,85,87,90,113,114],ib=[1,269],db=[2,62],jb=[1,279],Ya=[1,281],wb=[1,286],eb=[1,288],Qb=[2,186],xb=[1,6,31,32,40,41,42,55,65,70,73,82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,135,139,140,146,147,148,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],kb=[1,297],Ra=[6,31,32,70,115,120],Rb=[1,6,31,32,40,41,42,55,58,65,70,73,82,83,84,85,87,89,90,94,96,113,114,115,120,122,131,133,134,135,139,140,146,147,148,156,159,160,161,162,163,
|
||||
164,165,166,167,168,169,170,171,172,173,174,175],Sb=[1,6,31,32,42,65,70,73,89,94,115,120,122,131,140,156],Za=[1,6,31,32,42,65,70,73,89,94,115,120,122,131,134,140,156],lb=[146,147,148],mb=[70,146,147,148],nb=[6,31,94],Tb=[1,311],Ba=[6,31,32,70,94],Ub=[6,31,32,58,70,94],yb=[6,31,32,55,58,70,94],Vb=[1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,159,160,166,167,168,169,170,171,172,173,174],Wb=[12,28,34,38,40,41,44,45,48,49,50,51,52,53,61,62,63,67,68,89,92,95,97,105,112,117,118,119,
|
||||
125,129,130,133,135,137,139,149,155,157,158,159,160,161,162],Xb=[2,175],Sa=[6,31,32],fb=[2,72],Yb=[1,323],Zb=[1,324],$b=[1,6,31,32,42,65,70,73,89,94,115,120,122,127,128,131,133,134,135,139,140,151,153,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],ob=[32,151,153],ac=[1,6,32,42,65,70,73,89,94,115,120,122,131,134,140,156],pb=[1,350],zb=[1,356],Ab=[1,6,32,42,131,156],gb=[2,86],qb=[1,366],rb=[1,367],bc=[1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,151,156,159,160,163,
|
||||
164,165,166,167,168,169,170,171,172,173,174],Bb=[1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,135,139,140,156],cc=[1,380],dc=[1,381],Cb=[6,31,32,94],ec=[6,31,32,70],Db=[1,6,31,32,42,65,70,73,89,94,115,120,122,127,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],fc=[31,70],sb=[1,407],tb=[1,408],Eb=[1,414],Fb=[1,415],gc={trace:function(){},yy:{},symbols_:{error:2,Root:3,Body:4,Line:5,TERMINATOR:6,Expression:7,Statement:8,YieldReturn:9,Return:10,Comment:11,STATEMENT:12,
|
||||
Import:13,Export:14,Value:15,Invocation:16,Code:17,Operation:18,Assign:19,If:20,Try:21,While:22,For:23,Switch:24,Class:25,Throw:26,Yield:27,YIELD:28,FROM:29,Block:30,INDENT:31,OUTDENT:32,Identifier:33,IDENTIFIER:34,Property:35,PROPERTY:36,AlphaNumeric:37,NUMBER:38,String:39,STRING:40,STRING_START:41,STRING_END:42,Regex:43,REGEX:44,REGEX_START:45,REGEX_END:46,Literal:47,JS:48,UNDEFINED:49,NULL:50,BOOL:51,INFINITY:52,NAN:53,Assignable:54,"\x3d":55,AssignObj:56,ObjAssignable:57,":":58,SimpleObjAssignable:59,
|
||||
ThisProperty:60,RETURN:61,HERECOMMENT:62,PARAM_START:63,ParamList:64,PARAM_END:65,FuncGlyph:66,"-\x3e":67,"\x3d\x3e":68,OptComma:69,",":70,Param:71,ParamVar:72,"...":73,Array:74,Object:75,Splat:76,SimpleAssignable:77,Accessor:78,Parenthetical:79,Range:80,This:81,".":82,"?.":83,"::":84,"?::":85,Index:86,INDEX_START:87,IndexValue:88,INDEX_END:89,INDEX_SOAK:90,Slice:91,"{":92,AssignList:93,"}":94,CLASS:95,EXTENDS:96,IMPORT:97,ImportDefaultSpecifier:98,ImportNamespaceSpecifier:99,ImportSpecifierList:100,
|
||||
ImportSpecifier:101,AS:102,DEFAULT:103,IMPORT_ALL:104,EXPORT:105,ExportSpecifierList:106,EXPORT_ALL:107,ExportSpecifier:108,OptFuncExist:109,Arguments:110,Super:111,SUPER:112,FUNC_EXIST:113,CALL_START:114,CALL_END:115,ArgList:116,THIS:117,"@":118,"[":119,"]":120,RangeDots:121,"..":122,Arg:123,SimpleArgs:124,TRY:125,Catch:126,FINALLY:127,CATCH:128,THROW:129,"(":130,")":131,WhileSource:132,WHILE:133,WHEN:134,UNTIL:135,Loop:136,LOOP:137,ForBody:138,FOR:139,BY:140,ForStart:141,ForSource:142,ForVariables:143,
|
||||
OWN:144,ForValue:145,FORIN:146,FOROF:147,FORFROM:148,SWITCH:149,Whens:150,ELSE:151,When:152,LEADING_WHEN:153,IfBlock:154,IF:155,POST_IF:156,UNARY:157,UNARY_MATH:158,"-":159,"+":160,"--":161,"++":162,"?":163,MATH:164,"**":165,SHIFT:166,COMPARE:167,"\x26":168,"^":169,"|":170,"\x26\x26":171,"||":172,"BIN?":173,RELATION:174,COMPOUND_ASSIGN:175,$accept:0,$end:1},terminals_:{2:"error",6:"TERMINATOR",12:"STATEMENT",28:"YIELD",29:"FROM",31:"INDENT",32:"OUTDENT",34:"IDENTIFIER",36:"PROPERTY",38:"NUMBER",40:"STRING",
|
||||
41:"STRING_START",42:"STRING_END",44:"REGEX",45:"REGEX_START",46:"REGEX_END",48:"JS",49:"UNDEFINED",50:"NULL",51:"BOOL",52:"INFINITY",53:"NAN",55:"\x3d",58:":",61:"RETURN",62:"HERECOMMENT",63:"PARAM_START",65:"PARAM_END",67:"-\x3e",68:"\x3d\x3e",70:",",73:"...",82:".",83:"?.",84:"::",85:"?::",87:"INDEX_START",89:"INDEX_END",90:"INDEX_SOAK",92:"{",94:"}",95:"CLASS",96:"EXTENDS",97:"IMPORT",102:"AS",103:"DEFAULT",104:"IMPORT_ALL",105:"EXPORT",107:"EXPORT_ALL",112:"SUPER",113:"FUNC_EXIST",114:"CALL_START",
|
||||
115:"CALL_END",117:"THIS",118:"@",119:"[",120:"]",122:"..",125:"TRY",127:"FINALLY",128:"CATCH",129:"THROW",130:"(",131:")",133:"WHILE",134:"WHEN",135:"UNTIL",137:"LOOP",139:"FOR",140:"BY",144:"OWN",146:"FORIN",147:"FOROF",148:"FORFROM",149:"SWITCH",151:"ELSE",153:"LEADING_WHEN",155:"IF",156:"POST_IF",157:"UNARY",158:"UNARY_MATH",159:"-",160:"+",161:"--",162:"++",163:"?",164:"MATH",165:"**",166:"SHIFT",167:"COMPARE",168:"\x26",169:"^",170:"|",171:"\x26\x26",172:"||",173:"BIN?",174:"RELATION",175:"COMPOUND_ASSIGN"},
|
||||
productions_:[0,[3,0],[3,1],[4,1],[4,3],[4,2],[5,1],[5,1],[5,1],[8,1],[8,1],[8,1],[8,1],[8,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[27,1],[27,2],[27,3],[30,2],[30,3],[33,1],[35,1],[37,1],[37,1],[39,1],[39,3],[43,1],[43,3],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[19,3],[19,4],[19,5],[56,1],[56,3],[56,5],[56,3],[56,5],[56,1],[59,1],[59,1],[59,1],[57,1],[57,1],[10,2],[10,1],[9,3],[9,2],[11,1],[17,5],[17,2],[66,1],[66,1],[69,0],[69,1],[64,0],[64,
|
||||
1],[64,3],[64,4],[64,6],[71,1],[71,2],[71,3],[71,1],[72,1],[72,1],[72,1],[72,1],[76,2],[77,1],[77,2],[77,2],[77,1],[54,1],[54,1],[54,1],[15,1],[15,1],[15,1],[15,1],[15,1],[78,2],[78,2],[78,2],[78,2],[78,1],[78,1],[86,3],[86,2],[88,1],[88,1],[75,4],[93,0],[93,1],[93,3],[93,4],[93,6],[25,1],[25,2],[25,3],[25,4],[25,2],[25,3],[25,4],[25,5],[13,2],[13,4],[13,4],[13,5],[13,7],[13,6],[13,9],[100,1],[100,3],[100,4],[100,4],[100,6],[101,1],[101,3],[101,1],[101,3],[98,1],[99,3],[14,3],[14,5],[14,2],[14,4],
|
||||
[14,5],[14,6],[14,3],[14,4],[14,7],[106,1],[106,3],[106,4],[106,4],[106,6],[108,1],[108,3],[108,3],[108,1],[16,3],[16,3],[16,3],[16,1],[111,1],[111,2],[109,0],[109,1],[110,2],[110,4],[81,1],[81,1],[60,2],[74,2],[74,4],[121,1],[121,1],[80,5],[91,3],[91,2],[91,2],[91,1],[116,1],[116,3],[116,4],[116,4],[116,6],[123,1],[123,1],[123,1],[124,1],[124,3],[21,2],[21,3],[21,4],[21,5],[126,3],[126,3],[126,2],[26,2],[79,3],[79,5],[132,2],[132,4],[132,2],[132,4],[22,2],[22,2],[22,2],[22,1],[136,2],[136,2],[23,
|
||||
2],[23,2],[23,2],[138,2],[138,4],[138,2],[141,2],[141,3],[145,1],[145,1],[145,1],[145,1],[143,1],[143,3],[142,2],[142,2],[142,4],[142,4],[142,4],[142,6],[142,6],[142,2],[142,4],[24,5],[24,7],[24,4],[24,6],[150,1],[150,2],[152,3],[152,4],[154,3],[154,5],[20,1],[20,3],[20,3],[20,3],[18,2],[18,2],[18,2],[18,2],[18,2],[18,2],[18,2],[18,2],[18,2],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,5],[18,4],[18,3]],performAction:function(a,n,pa,b,c,e,d){a=
|
||||
e.length-1;switch(c){case 1:return this.$=b.addLocationDataFn(d[a],d[a])(new b.Block);case 2:return this.$=e[a];case 3:this.$=b.addLocationDataFn(d[a],d[a])(b.Block.wrap([e[a]]));break;case 4:this.$=b.addLocationDataFn(d[a-2],d[a])(e[a-2].push(e[a]));break;case 5:this.$=e[a-1];break;case 6:case 7:case 8:case 9:case 10:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 35:case 40:case 42:case 56:case 57:case 58:case 59:case 60:case 61:case 71:case 72:case 82:case 83:case 84:case 85:case 90:case 91:case 94:case 98:case 104:case 162:case 186:case 187:case 189:case 219:case 220:case 238:case 244:this.$=
|
||||
e[a];break;case 11:this.$=b.addLocationDataFn(d[a],d[a])(new b.StatementLiteral(e[a]));break;case 27:this.$=b.addLocationDataFn(d[a],d[a])(new b.Op(e[a],new b.Value(new b.Literal(""))));break;case 28:case 248:case 249:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Op(e[a-1],e[a]));break;case 29:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Op(e[a-2].concat(e[a-1]),e[a]));break;case 30:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Block);break;case 31:case 105:this.$=b.addLocationDataFn(d[a-2],d[a])(e[a-
|
||||
1]);break;case 32:this.$=b.addLocationDataFn(d[a],d[a])(new b.IdentifierLiteral(e[a]));break;case 33:this.$=b.addLocationDataFn(d[a],d[a])(new b.PropertyName(e[a]));break;case 34:this.$=b.addLocationDataFn(d[a],d[a])(new b.NumberLiteral(e[a]));break;case 36:this.$=b.addLocationDataFn(d[a],d[a])(new b.StringLiteral(e[a]));break;case 37:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.StringWithInterpolations(e[a-1]));break;case 38:this.$=b.addLocationDataFn(d[a],d[a])(new b.RegexLiteral(e[a]));break;
|
||||
case 39:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.RegexWithInterpolations(e[a-1].args));break;case 41:this.$=b.addLocationDataFn(d[a],d[a])(new b.PassthroughLiteral(e[a]));break;case 43:this.$=b.addLocationDataFn(d[a],d[a])(new b.UndefinedLiteral);break;case 44:this.$=b.addLocationDataFn(d[a],d[a])(new b.NullLiteral);break;case 45:this.$=b.addLocationDataFn(d[a],d[a])(new b.BooleanLiteral(e[a]));break;case 46:this.$=b.addLocationDataFn(d[a],d[a])(new b.InfinityLiteral(e[a]));break;case 47:this.$=
|
||||
b.addLocationDataFn(d[a],d[a])(new b.NaNLiteral);break;case 48:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Assign(e[a-2],e[a]));break;case 49:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.Assign(e[a-3],e[a]));break;case 50:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.Assign(e[a-4],e[a-1]));break;case 51:case 87:case 92:case 93:case 95:case 96:case 97:case 221:case 222:this.$=b.addLocationDataFn(d[a],d[a])(new b.Value(e[a]));break;case 52:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Assign(b.addLocationDataFn(d[a-
|
||||
2])(new b.Value(e[a-2])),e[a],"object",{operatorToken:b.addLocationDataFn(d[a-1])(new b.Literal(e[a-1]))}));break;case 53:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.Assign(b.addLocationDataFn(d[a-4])(new b.Value(e[a-4])),e[a-1],"object",{operatorToken:b.addLocationDataFn(d[a-3])(new b.Literal(e[a-3]))}));break;case 54:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Assign(b.addLocationDataFn(d[a-2])(new b.Value(e[a-2])),e[a],null,{operatorToken:b.addLocationDataFn(d[a-1])(new b.Literal(e[a-1]))}));
|
||||
break;case 55:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.Assign(b.addLocationDataFn(d[a-4])(new b.Value(e[a-4])),e[a-1],null,{operatorToken:b.addLocationDataFn(d[a-3])(new b.Literal(e[a-3]))}));break;case 62:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Return(e[a]));break;case 63:this.$=b.addLocationDataFn(d[a],d[a])(new b.Return);break;case 64:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.YieldReturn(e[a]));break;case 65:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.YieldReturn);break;case 66:this.$=
|
||||
b.addLocationDataFn(d[a],d[a])(new b.Comment(e[a]));break;case 67:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.Code(e[a-3],e[a],e[a-1]));break;case 68:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Code([],e[a],e[a-1]));break;case 69:this.$=b.addLocationDataFn(d[a],d[a])("func");break;case 70:this.$=b.addLocationDataFn(d[a],d[a])("boundfunc");break;case 73:case 110:this.$=b.addLocationDataFn(d[a],d[a])([]);break;case 74:case 111:case 130:case 150:case 181:case 223:this.$=b.addLocationDataFn(d[a],
|
||||
d[a])([e[a]]);break;case 75:case 112:case 131:case 151:case 182:this.$=b.addLocationDataFn(d[a-2],d[a])(e[a-2].concat(e[a]));break;case 76:case 113:case 132:case 152:case 183:this.$=b.addLocationDataFn(d[a-3],d[a])(e[a-3].concat(e[a]));break;case 77:case 114:case 134:case 154:case 185:this.$=b.addLocationDataFn(d[a-5],d[a])(e[a-5].concat(e[a-2]));break;case 78:this.$=b.addLocationDataFn(d[a],d[a])(new b.Param(e[a]));break;case 79:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Param(e[a-1],null,!0));
|
||||
break;case 80:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Param(e[a-2],e[a]));break;case 81:case 188:this.$=b.addLocationDataFn(d[a],d[a])(new b.Expansion);break;case 86:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Splat(e[a-1]));break;case 88:this.$=b.addLocationDataFn(d[a-1],d[a])(e[a-1].add(e[a]));break;case 89:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Value(e[a-1],[].concat(e[a])));break;case 99:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Access(e[a]));break;case 100:this.$=b.addLocationDataFn(d[a-
|
||||
1],d[a])(new b.Access(e[a],"soak"));break;case 101:this.$=b.addLocationDataFn(d[a-1],d[a])([b.addLocationDataFn(d[a-1])(new b.Access(new b.PropertyName("prototype"))),b.addLocationDataFn(d[a])(new b.Access(e[a]))]);break;case 102:this.$=b.addLocationDataFn(d[a-1],d[a])([b.addLocationDataFn(d[a-1])(new b.Access(new b.PropertyName("prototype"),"soak")),b.addLocationDataFn(d[a])(new b.Access(e[a]))]);break;case 103:this.$=b.addLocationDataFn(d[a],d[a])(new b.Access(new b.PropertyName("prototype")));
|
||||
break;case 106:this.$=b.addLocationDataFn(d[a-1],d[a])(b.extend(e[a],{soak:!0}));break;case 107:this.$=b.addLocationDataFn(d[a],d[a])(new b.Index(e[a]));break;case 108:this.$=b.addLocationDataFn(d[a],d[a])(new b.Slice(e[a]));break;case 109:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.Obj(e[a-2],e[a-3].generated));break;case 115:this.$=b.addLocationDataFn(d[a],d[a])(new b.Class);break;case 116:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Class(null,null,e[a]));break;case 117:this.$=b.addLocationDataFn(d[a-
|
||||
2],d[a])(new b.Class(null,e[a]));break;case 118:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.Class(null,e[a-1],e[a]));break;case 119:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Class(e[a]));break;case 120:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Class(e[a-1],null,e[a]));break;case 121:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.Class(e[a-2],e[a]));break;case 122:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.Class(e[a-3],e[a-1],e[a]));break;case 123:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.ImportDeclaration(null,
|
||||
e[a]));break;case 124:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.ImportDeclaration(new b.ImportClause(e[a-2],null),e[a]));break;case 125:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.ImportDeclaration(new b.ImportClause(null,e[a-2]),e[a]));break;case 126:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.ImportDeclaration(new b.ImportClause(null,new b.ImportSpecifierList([])),e[a]));break;case 127:this.$=b.addLocationDataFn(d[a-6],d[a])(new b.ImportDeclaration(new b.ImportClause(null,new b.ImportSpecifierList(e[a-
|
||||
4])),e[a]));break;case 128:this.$=b.addLocationDataFn(d[a-5],d[a])(new b.ImportDeclaration(new b.ImportClause(e[a-4],e[a-2]),e[a]));break;case 129:this.$=b.addLocationDataFn(d[a-8],d[a])(new b.ImportDeclaration(new b.ImportClause(e[a-7],new b.ImportSpecifierList(e[a-4])),e[a]));break;case 133:case 153:case 168:case 184:this.$=b.addLocationDataFn(d[a-3],d[a])(e[a-2]);break;case 135:this.$=b.addLocationDataFn(d[a],d[a])(new b.ImportSpecifier(e[a]));break;case 136:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.ImportSpecifier(e[a-
|
||||
2],e[a]));break;case 137:this.$=b.addLocationDataFn(d[a],d[a])(new b.ImportSpecifier(new b.Literal(e[a])));break;case 138:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.ImportSpecifier(new b.Literal(e[a-2]),e[a]));break;case 139:this.$=b.addLocationDataFn(d[a],d[a])(new b.ImportDefaultSpecifier(e[a]));break;case 140:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.ImportNamespaceSpecifier(new b.Literal(e[a-2]),e[a]));break;case 141:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.ExportNamedDeclaration(new b.ExportSpecifierList([])));
|
||||
break;case 142:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.ExportNamedDeclaration(new b.ExportSpecifierList(e[a-2])));break;case 143:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.ExportNamedDeclaration(e[a]));break;case 144:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.ExportNamedDeclaration(new b.Assign(e[a-2],e[a],null,{moduleDeclaration:"export"})));break;case 145:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.ExportNamedDeclaration(new b.Assign(e[a-3],e[a],null,{moduleDeclaration:"export"})));
|
||||
break;case 146:this.$=b.addLocationDataFn(d[a-5],d[a])(new b.ExportNamedDeclaration(new b.Assign(e[a-4],e[a-1],null,{moduleDeclaration:"export"})));break;case 147:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.ExportDefaultDeclaration(e[a]));break;case 148:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.ExportAllDeclaration(new b.Literal(e[a-2]),e[a]));break;case 149:this.$=b.addLocationDataFn(d[a-6],d[a])(new b.ExportNamedDeclaration(new b.ExportSpecifierList(e[a-4]),e[a]));break;case 155:this.$=b.addLocationDataFn(d[a],
|
||||
d[a])(new b.ExportSpecifier(e[a]));break;case 156:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.ExportSpecifier(e[a-2],e[a]));break;case 157:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.ExportSpecifier(e[a-2],new b.Literal(e[a])));break;case 158:this.$=b.addLocationDataFn(d[a],d[a])(new b.ExportSpecifier(new b.Literal(e[a])));break;case 159:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.TaggedTemplateCall(e[a-2],e[a],e[a-1]));break;case 160:case 161:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Call(e[a-
|
||||
2],e[a],e[a-1]));break;case 163:this.$=b.addLocationDataFn(d[a],d[a])(new b.SuperCall);break;case 164:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.SuperCall(e[a]));break;case 165:this.$=b.addLocationDataFn(d[a],d[a])(!1);break;case 166:this.$=b.addLocationDataFn(d[a],d[a])(!0);break;case 167:this.$=b.addLocationDataFn(d[a-1],d[a])([]);break;case 169:case 170:this.$=b.addLocationDataFn(d[a],d[a])(new b.Value(new b.ThisLiteral));break;case 171:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Value(b.addLocationDataFn(d[a-
|
||||
1])(new b.ThisLiteral),[b.addLocationDataFn(d[a])(new b.Access(e[a]))],"this"));break;case 172:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Arr([]));break;case 173:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.Arr(e[a-2]));break;case 174:this.$=b.addLocationDataFn(d[a],d[a])("inclusive");break;case 175:this.$=b.addLocationDataFn(d[a],d[a])("exclusive");break;case 176:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.Range(e[a-3],e[a-1],e[a-2]));break;case 177:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Range(e[a-
|
||||
2],e[a],e[a-1]));break;case 178:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Range(e[a-1],null,e[a]));break;case 179:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Range(null,e[a],e[a-1]));break;case 180:this.$=b.addLocationDataFn(d[a],d[a])(new b.Range(null,null,e[a]));break;case 190:this.$=b.addLocationDataFn(d[a-2],d[a])([].concat(e[a-2],e[a]));break;case 191:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Try(e[a]));break;case 192:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Try(e[a-1],e[a][0],
|
||||
e[a][1]));break;case 193:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.Try(e[a-2],null,null,e[a]));break;case 194:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.Try(e[a-3],e[a-2][0],e[a-2][1],e[a]));break;case 195:this.$=b.addLocationDataFn(d[a-2],d[a])([e[a-1],e[a]]);break;case 196:this.$=b.addLocationDataFn(d[a-2],d[a])([b.addLocationDataFn(d[a-1])(new b.Value(e[a-1])),e[a]]);break;case 197:this.$=b.addLocationDataFn(d[a-1],d[a])([null,e[a]]);break;case 198:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Throw(e[a]));
|
||||
break;case 199:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Parens(e[a-1]));break;case 200:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.Parens(e[a-2]));break;case 201:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.While(e[a]));break;case 202:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.While(e[a-2],{guard:e[a]}));break;case 203:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.While(e[a],{invert:!0}));break;case 204:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.While(e[a-2],{invert:!0,guard:e[a]}));
|
||||
break;case 205:this.$=b.addLocationDataFn(d[a-1],d[a])(e[a-1].addBody(e[a]));break;case 206:case 207:this.$=b.addLocationDataFn(d[a-1],d[a])(e[a].addBody(b.addLocationDataFn(d[a-1])(b.Block.wrap([e[a-1]]))));break;case 208:this.$=b.addLocationDataFn(d[a],d[a])(e[a]);break;case 209:this.$=b.addLocationDataFn(d[a-1],d[a])((new b.While(b.addLocationDataFn(d[a-1])(new b.BooleanLiteral("true")))).addBody(e[a]));break;case 210:this.$=b.addLocationDataFn(d[a-1],d[a])((new b.While(b.addLocationDataFn(d[a-
|
||||
1])(new b.BooleanLiteral("true")))).addBody(b.addLocationDataFn(d[a])(b.Block.wrap([e[a]]))));break;case 211:case 212:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.For(e[a-1],e[a]));break;case 213:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.For(e[a],e[a-1]));break;case 214:this.$=b.addLocationDataFn(d[a-1],d[a])({source:b.addLocationDataFn(d[a])(new b.Value(e[a]))});break;case 215:this.$=b.addLocationDataFn(d[a-3],d[a])({source:b.addLocationDataFn(d[a-2])(new b.Value(e[a-2])),step:e[a]});break;
|
||||
case 216:b=b.addLocationDataFn(d[a-1],d[a]);e[a].own=e[a-1].own;e[a].ownTag=e[a-1].ownTag;e[a].name=e[a-1][0];e[a].index=e[a-1][1];this.$=b(e[a]);break;case 217:this.$=b.addLocationDataFn(d[a-1],d[a])(e[a]);break;case 218:c=b.addLocationDataFn(d[a-2],d[a]);e[a].own=!0;e[a].ownTag=b.addLocationDataFn(d[a-1])(new b.Literal(e[a-1]));this.$=c(e[a]);break;case 224:this.$=b.addLocationDataFn(d[a-2],d[a])([e[a-2],e[a]]);break;case 225:this.$=b.addLocationDataFn(d[a-1],d[a])({source:e[a]});break;case 226:this.$=
|
||||
b.addLocationDataFn(d[a-1],d[a])({source:e[a],object:!0});break;case 227:this.$=b.addLocationDataFn(d[a-3],d[a])({source:e[a-2],guard:e[a]});break;case 228:this.$=b.addLocationDataFn(d[a-3],d[a])({source:e[a-2],guard:e[a],object:!0});break;case 229:this.$=b.addLocationDataFn(d[a-3],d[a])({source:e[a-2],step:e[a]});break;case 230:this.$=b.addLocationDataFn(d[a-5],d[a])({source:e[a-4],guard:e[a-2],step:e[a]});break;case 231:this.$=b.addLocationDataFn(d[a-5],d[a])({source:e[a-4],step:e[a-2],guard:e[a]});
|
||||
break;case 232:this.$=b.addLocationDataFn(d[a-1],d[a])({source:e[a],from:!0});break;case 233:this.$=b.addLocationDataFn(d[a-3],d[a])({source:e[a-2],guard:e[a],from:!0});break;case 234:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.Switch(e[a-3],e[a-1]));break;case 235:this.$=b.addLocationDataFn(d[a-6],d[a])(new b.Switch(e[a-5],e[a-3],e[a-1]));break;case 236:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.Switch(null,e[a-1]));break;case 237:this.$=b.addLocationDataFn(d[a-5],d[a])(new b.Switch(null,e[a-
|
||||
3],e[a-1]));break;case 239:this.$=b.addLocationDataFn(d[a-1],d[a])(e[a-1].concat(e[a]));break;case 240:this.$=b.addLocationDataFn(d[a-2],d[a])([[e[a-1],e[a]]]);break;case 241:this.$=b.addLocationDataFn(d[a-3],d[a])([[e[a-2],e[a-1]]]);break;case 242:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.If(e[a-1],e[a],{type:e[a-2]}));break;case 243:this.$=b.addLocationDataFn(d[a-4],d[a])(e[a-4].addElse(b.addLocationDataFn(d[a-2],d[a])(new b.If(e[a-1],e[a],{type:e[a-2]}))));break;case 245:this.$=b.addLocationDataFn(d[a-
|
||||
2],d[a])(e[a-2].addElse(e[a]));break;case 246:case 247:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.If(e[a],b.addLocationDataFn(d[a-2])(b.Block.wrap([e[a-2]])),{type:e[a-1],statement:!0}));break;case 250:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Op("-",e[a]));break;case 251:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Op("+",e[a]));break;case 252:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Op("--",e[a]));break;case 253:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Op("++",e[a]));break;case 254:this.$=
|
||||
b.addLocationDataFn(d[a-1],d[a])(new b.Op("--",e[a-1],null,!0));break;case 255:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Op("++",e[a-1],null,!0));break;case 256:this.$=b.addLocationDataFn(d[a-1],d[a])(new b.Existence(e[a-1]));break;case 257:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Op("+",e[a-2],e[a]));break;case 258:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Op("-",e[a-2],e[a]));break;case 259:case 260:case 261:case 262:case 263:case 264:case 265:case 266:case 267:case 268:this.$=b.addLocationDataFn(d[a-
|
||||
2],d[a])(new b.Op(e[a-1],e[a-2],e[a]));break;case 269:d=b.addLocationDataFn(d[a-2],d[a]);e="!"===e[a-1].charAt(0)?(new b.Op(e[a-1].slice(1),e[a-2],e[a])).invert():new b.Op(e[a-1],e[a-2],e[a]);this.$=d(e);break;case 270:this.$=b.addLocationDataFn(d[a-2],d[a])(new b.Assign(e[a-2],e[a],e[a-1]));break;case 271:this.$=b.addLocationDataFn(d[a-4],d[a])(new b.Assign(e[a-4],e[a-1],e[a-3]));break;case 272:this.$=b.addLocationDataFn(d[a-3],d[a])(new b.Assign(e[a-3],e[a],e[a-2]));break;case 273:this.$=b.addLocationDataFn(d[a-
|
||||
2],d[a])(new b.Extends(e[a-2],e[a]))}},table:[{1:[2,1],3:1,4:2,5:3,7:4,8:5,9:6,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:u,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,
|
||||
158:V,159:Z,160:K,161:ba,162:R},{1:[3]},{1:[2,2],6:xa},a(ua,[2,3]),a(ua,[2,6],{141:77,132:102,138:103,133:z,135:B,139:C,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(ua,[2,7],{141:77,132:105,138:106,133:z,135:B,139:C,156:ya}),a(ua,[2,8]),a(ta,[2,14],{109:107,78:108,86:114,40:Ja,41:Ja,114:Ja,82:Ta,83:Ga,84:Ua,85:Fa,87:Pa,90:Qa,113:Na}),a(ta,[2,15],{86:114,109:117,78:118,82:Ta,83:Ga,84:Ua,85:Fa,87:Pa,90:Qa,113:Na,114:Ja}),a(ta,[2,16]),a(ta,
|
||||
[2,17]),a(ta,[2,18]),a(ta,[2,19]),a(ta,[2,20]),a(ta,[2,21]),a(ta,[2,22]),a(ta,[2,23]),a(ta,[2,24]),a(ta,[2,25]),a(ta,[2,26]),a(za,[2,9]),a(za,[2,10]),a(za,[2,11]),a(za,[2,12]),a(za,[2,13]),a([1,6,32,42,131,133,135,139,156,163,164,165,166,167,168,169,170,171,172,173,174],na,{15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,66:33,77:40,154:41,132:43,136:44,138:45,74:53,75:54,37:55,43:57,33:70,60:71,141:77,39:80,7:120,
|
||||
8:122,12:c,28:fa,29:Ha,34:f,38:D,40:l,41:w,44:G,45:F,48:x,49:v,50:M,51:N,52:J,53:r,61:[1,119],62:O,63:m,67:k,68:t,92:p,95:h,97:y,105:P,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,137:W,149:Q,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R}),a(Aa,Ia,{55:[1,124]}),a(Aa,[2,95]),a(Aa,[2,96]),a(Aa,[2,97]),a(Aa,[2,98]),a(b,[2,162]),a([6,31,65,70],n,{64:125,71:126,72:127,33:129,60:130,74:131,75:132,34:f,73:pa,92:p,118:e,119:d}),{30:135,31:va},{7:137,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,
|
||||
20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:138,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,
|
||||
25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:139,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,
|
||||
34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:140,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,
|
||||
43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{15:142,16:143,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:144,60:71,74:53,75:54,77:141,79:28,80:29,81:30,92:p,111:31,112:A,117:H,118:U,119:T,
|
||||
130:S},{15:142,16:143,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:144,60:71,74:53,75:54,77:145,79:28,80:29,81:30,92:p,111:31,112:A,117:H,118:U,119:T,130:S},a(Ka,wa,{96:[1,149],161:[1,146],162:[1,147],175:[1,148]}),a(ta,[2,244],{151:[1,150]}),{30:151,31:va},{30:152,31:va},a(ta,[2,208]),{30:153,31:va},{7:154,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,31:[1,155],33:70,34:f,37:55,
|
||||
38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(Gb,[2,115],{47:27,79:28,80:29,81:30,111:31,74:53,75:54,37:55,43:57,33:70,60:71,39:80,15:142,16:143,54:144,30:156,77:158,31:va,34:f,38:D,40:l,41:w,44:G,45:F,48:x,49:v,50:M,
|
||||
51:N,52:J,53:r,92:p,96:[1,157],112:A,117:H,118:U,119:T,130:S}),{7:159,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,
|
||||
158:V,159:Z,160:K,161:ba,162:R},a(za,ab,{15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,66:33,77:40,154:41,132:43,136:44,138:45,74:53,75:54,37:55,43:57,33:70,60:71,141:77,39:80,8:122,7:160,12:c,28:fa,34:f,38:D,40:l,41:w,44:G,45:F,48:x,49:v,50:M,51:N,52:J,53:r,61:E,62:O,63:m,67:k,68:t,92:p,95:h,97:y,105:P,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,137:W,149:Q,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R}),a([1,6,
|
||||
31,32,42,70,94,131,133,135,139,156],[2,66]),{33:165,34:f,39:161,40:l,41:w,92:[1,164],98:162,99:163,104:Hb},{25:168,33:169,34:f,92:[1,167],95:h,103:[1,170],107:[1,171]},a(Ka,[2,92]),a(Ka,[2,93]),a(Aa,[2,40]),a(Aa,[2,41]),a(Aa,[2,42]),a(Aa,[2,43]),a(Aa,[2,44]),a(Aa,[2,45]),a(Aa,[2,46]),a(Aa,[2,47]),{4:172,5:3,7:4,8:5,9:6,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:u,31:[1,173],33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,
|
||||
48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:174,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,31:bb,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,
|
||||
53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,73:Wa,74:53,75:54,76:179,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,116:176,117:H,118:U,119:T,120:Ib,123:177,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(Aa,[2,169]),a(Aa,[2,170],{35:181,36:Oa}),a([1,6,31,32,42,46,65,70,73,82,83,84,85,87,89,90,94,113,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],[2,163],
|
||||
{110:183,114:ub}),{31:[2,69]},{31:[2,70]},a(La,[2,87]),a(La,[2,90]),{7:185,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,
|
||||
157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:186,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,
|
||||
162:R},{7:187,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:189,8:122,10:20,11:21,
|
||||
12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,30:188,31:va,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{33:194,34:f,60:195,74:196,75:197,80:190,
|
||||
92:p,118:e,119:T,143:191,144:[1,192],145:193},{142:198,146:[1,199],147:[1,200],148:[1,201]},a([6,31,70,94],Jb,{39:80,93:202,56:203,57:204,59:205,11:206,37:207,33:208,35:209,60:210,34:f,36:Oa,38:D,40:l,41:w,62:O,118:e}),a(Kb,[2,34]),a(Kb,[2,35]),a(Aa,[2,38]),{15:142,16:211,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:144,60:71,74:53,75:54,77:212,79:28,80:29,81:30,92:p,111:31,112:A,117:H,118:U,119:T,130:S},a([1,6,29,31,32,40,41,42,55,58,65,70,73,82,83,
|
||||
84,85,87,89,90,94,96,102,113,114,115,120,122,131,133,134,135,139,140,146,147,148,156,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175],[2,32]),a(Lb,[2,36]),{4:213,5:3,7:4,8:5,9:6,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:u,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,
|
||||
112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(ua,[2,5],{7:4,8:5,9:6,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,66:33,77:40,154:41,132:43,136:44,138:45,74:53,75:54,37:55,43:57,33:70,60:71,141:77,39:80,5:214,12:c,28:u,34:f,38:D,40:l,41:w,44:G,45:F,48:x,49:v,50:M,51:N,52:J,53:r,61:E,62:O,63:m,67:k,68:t,
|
||||
92:p,95:h,97:y,105:P,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,133:z,135:B,137:W,139:C,149:Q,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R}),a(ta,[2,256]),{7:215,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,
|
||||
129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:216,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,
|
||||
136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:217,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,
|
||||
149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:218,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,
|
||||
159:Z,160:K,161:ba,162:R},{7:219,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:220,
|
||||
8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:221,8:122,10:20,11:21,12:c,13:23,
|
||||
14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:222,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,
|
||||
20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:223,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,
|
||||
25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:224,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,
|
||||
34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:225,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,
|
||||
43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:226,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,
|
||||
50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:227,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,
|
||||
61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:228,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,
|
||||
74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(ta,[2,207]),a(ta,[2,212]),{7:229,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,
|
||||
75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(ta,[2,206]),a(ta,[2,211]),{39:230,40:l,41:w,110:231,114:ub},a(La,[2,88]),a(Mb,[2,166]),{35:232,36:Oa},{35:233,36:Oa},a(La,[2,103],{35:234,36:Oa}),{35:235,36:Oa},a(La,[2,104]),{7:237,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,
|
||||
28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,73:Nb,74:53,75:54,77:40,79:28,80:29,81:30,88:236,91:238,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,121:239,122:vb,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{86:242,87:Pa,90:Qa},{110:243,114:ub},a(La,[2,89]),a(ua,[2,65],{15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,
|
||||
24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,66:33,77:40,154:41,132:43,136:44,138:45,74:53,75:54,37:55,43:57,33:70,60:71,141:77,39:80,8:122,7:244,12:c,28:fa,34:f,38:D,40:l,41:w,44:G,45:F,48:x,49:v,50:M,51:N,52:J,53:r,61:E,62:O,63:m,67:k,68:t,92:p,95:h,97:y,105:P,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,133:ab,135:ab,139:ab,156:ab,137:W,149:Q,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R}),a(Ma,[2,28],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,
|
||||
166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),{7:245,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,
|
||||
158:V,159:Z,160:K,161:ba,162:R},{132:105,133:z,135:B,138:106,139:C,141:77,156:ya},a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,163,164,165,166,167,168,169,170,171,172,173,174],na,{15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,66:33,77:40,154:41,132:43,136:44,138:45,74:53,75:54,37:55,43:57,33:70,60:71,141:77,39:80,7:120,8:122,12:c,28:fa,29:Ha,34:f,38:D,40:l,41:w,44:G,45:F,48:x,49:v,50:M,
|
||||
51:N,52:J,53:r,61:E,62:O,63:m,67:k,68:t,92:p,95:h,97:y,105:P,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,137:W,149:Q,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R}),{6:[1,247],7:246,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,31:[1,248],33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,
|
||||
112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a([6,31],Ea,{69:251,65:[1,249],70:Ob}),a(Va,[2,74]),a(Va,[2,78],{55:[1,253],73:[1,252]}),a(Va,[2,81]),a(hb,[2,82]),a(hb,[2,83]),a(hb,[2,84]),a(hb,[2,85]),{35:181,36:Oa},{7:254,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,31:bb,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,
|
||||
47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,73:Wa,74:53,75:54,76:179,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,116:176,117:H,118:U,119:T,120:Ib,123:177,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(ta,[2,68]),{4:256,5:3,7:4,8:5,9:6,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:u,32:[1,255],33:70,34:f,37:55,
|
||||
38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,159,160,164,165,166,167,168,169,170,171,172,173,174],[2,248],{141:77,132:102,138:103,163:ea}),a(cb,
|
||||
[2,249],{141:77,132:102,138:103,163:ea,165:ha}),a(cb,[2,250],{141:77,132:102,138:103,163:ea,165:ha}),a(cb,[2,251],{141:77,132:102,138:103,163:ea,165:ha}),a(ta,[2,252],{40:wa,41:wa,82:wa,83:wa,84:wa,85:wa,87:wa,90:wa,113:wa,114:wa}),a(Mb,Ja,{109:107,78:108,86:114,82:Ta,83:Ga,84:Ua,85:Fa,87:Pa,90:Qa,113:Na}),{78:118,82:Ta,83:Ga,84:Ua,85:Fa,86:114,87:Pa,90:Qa,109:117,113:Na,114:Ja},a(Pb,Ia),a(ta,[2,253],{40:wa,41:wa,82:wa,83:wa,84:wa,85:wa,87:wa,90:wa,113:wa,114:wa}),a(ta,[2,254]),a(ta,[2,255]),{6:[1,
|
||||
259],7:257,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,31:[1,258],33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:260,8:122,10:20,
|
||||
11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{30:261,31:va,155:[1,262]},a(ta,[2,191],{126:263,
|
||||
127:[1,264],128:[1,265]}),a(ta,[2,205]),a(ta,[2,213]),{31:[1,266],132:102,133:z,135:B,138:103,139:C,141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia},{150:267,152:268,153:ib},a(ta,[2,116]),{7:270,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,
|
||||
68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(Gb,[2,119],{30:271,31:va,40:wa,41:wa,82:wa,83:wa,84:wa,85:wa,87:wa,90:wa,113:wa,114:wa,96:[1,272]}),a(Ma,[2,198],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(za,db,{141:77,132:102,138:103,159:ka,160:ca,
|
||||
163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(za,[2,123]),{29:[1,273],70:[1,274]},{29:[1,275]},{31:jb,33:280,34:f,94:[1,276],100:277,101:278,103:Ya},a([29,70],[2,139]),{102:[1,282]},{31:wb,33:287,34:f,94:[1,283],103:eb,106:284,108:285},a(za,[2,143]),{55:[1,289]},{7:290,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,
|
||||
51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{29:[1,291]},{6:xa,131:[1,292]},{4:293,5:3,7:4,8:5,9:6,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:u,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,
|
||||
49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a([6,31,70,120],Qb,{141:77,132:102,138:103,121:294,73:[1,295],122:vb,133:z,135:B,139:C,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(xb,[2,172]),a([6,31,120],
|
||||
Ea,{69:296,70:kb}),a(Ra,[2,181]),{7:254,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,31:bb,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,73:Wa,74:53,75:54,76:179,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,116:298,117:H,118:U,119:T,123:177,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,
|
||||
157:Y,158:V,159:Z,160:K,161:ba,162:R},a(Ra,[2,187]),a(Ra,[2,188]),a(Rb,[2,171]),a(Rb,[2,33]),a(b,[2,164]),{7:254,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,31:bb,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,73:Wa,74:53,75:54,76:179,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,115:[1,299],116:300,117:H,118:U,119:T,123:177,125:I,
|
||||
129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{30:301,31:va,132:102,133:z,135:B,138:103,139:C,141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia},a(Sb,[2,201],{141:77,132:102,138:103,133:z,134:[1,302],135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Sb,[2,203],{141:77,132:102,138:103,133:z,134:[1,303],
|
||||
135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(ta,[2,209]),a(Za,[2,210],{141:77,132:102,138:103,133:z,135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],[2,214],{140:[1,304]}),a(lb,[2,217]),{33:194,34:f,60:195,74:196,75:197,92:p,118:e,119:d,143:305,145:193},
|
||||
a(lb,[2,223],{70:[1,306]}),a(mb,[2,219]),a(mb,[2,220]),a(mb,[2,221]),a(mb,[2,222]),a(ta,[2,216]),{7:307,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,
|
||||
141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:308,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,
|
||||
158:V,159:Z,160:K,161:ba,162:R},{7:309,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},
|
||||
a(nb,Ea,{69:310,70:Tb}),a(Ba,[2,111]),a(Ba,[2,51],{58:[1,312]}),a(Ub,[2,60],{55:[1,313]}),a(Ba,[2,56]),a(Ub,[2,61]),a(yb,[2,57]),a(yb,[2,58]),a(yb,[2,59]),{46:[1,314],78:118,82:Ta,83:Ga,84:Ua,85:Fa,86:114,87:Pa,90:Qa,109:117,113:Na,114:Ja},a(Pb,wa),{6:xa,42:[1,315]},a(ua,[2,4]),a(Vb,[2,257],{141:77,132:102,138:103,163:ea,164:ga,165:ha}),a(Vb,[2,258],{141:77,132:102,138:103,163:ea,164:ga,165:ha}),a(cb,[2,259],{141:77,132:102,138:103,163:ea,165:ha}),a(cb,[2,260],{141:77,132:102,138:103,163:ea,165:ha}),
|
||||
a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,166,167,168,169,170,171,172,173,174],[2,261],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha}),a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,167,168,169,170,171,172,173],[2,262],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,174:ia}),a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,168,169,170,171,172,173],[2,263],{141:77,132:102,138:103,159:ka,160:ca,
|
||||
163:ea,164:ga,165:ha,166:la,167:oa,174:ia}),a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,169,170,171,172,173],[2,264],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,174:ia}),a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,170,171,172,173],[2,265],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,174:ia}),a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,171,172,
|
||||
173],[2,266],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,174:ia}),a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,172,173],[2,267],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,174:ia}),a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,173],[2,268],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,
|
||||
174:ia}),a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,140,156,167,168,169,170,171,172,173,174],[2,269],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la}),a(Za,[2,247],{141:77,132:102,138:103,133:z,135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Za,[2,246],{141:77,132:102,138:103,133:z,135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(b,
|
||||
[2,159]),a(b,[2,160]),a(La,[2,99]),a(La,[2,100]),a(La,[2,101]),a(La,[2,102]),{89:[1,316]},{73:Nb,89:[2,107],121:317,122:vb,132:102,133:z,135:B,138:103,139:C,141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia},{89:[2,108]},{7:318,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,
|
||||
60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,89:[2,180],92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(Wb,[2,174]),a(Wb,Xb),a(La,[2,106]),a(b,[2,161]),a(ua,[2,64],{141:77,132:102,138:103,133:db,135:db,139:db,156:db,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Ma,[2,29],{141:77,132:102,
|
||||
138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Ma,[2,48],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),{7:319,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,
|
||||
75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:320,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,
|
||||
92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{66:321,67:k,68:t},a(Sa,fb,{72:127,33:129,60:130,74:131,75:132,71:322,34:f,73:pa,92:p,118:e,119:d}),{6:Yb,31:Zb},a(Va,[2,79]),{7:325,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,
|
||||
51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(Ra,Qb,{141:77,132:102,138:103,73:[1,326],133:z,135:B,139:C,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a($b,[2,30]),{6:xa,32:[1,327]},a(Ma,[2,270],{141:77,132:102,
|
||||
138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),{7:328,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,
|
||||
138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:329,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,
|
||||
155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(Ma,[2,273],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(ta,[2,245]),{7:330,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,
|
||||
105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(ta,[2,192],{127:[1,331]}),{30:332,31:va},{30:335,31:va,33:333,34:f,75:334,92:p},{150:336,152:268,153:ib},{32:[1,337],151:[1,338],152:339,153:ib},a(ob,[2,238]),{7:341,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,
|
||||
47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,124:340,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(ac,[2,117],{141:77,132:102,138:103,30:342,31:va,133:z,135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(ta,[2,120]),{7:343,8:122,10:20,
|
||||
11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{39:344,40:l,41:w},{92:[1,346],99:345,104:Hb},{39:347,
|
||||
40:l,41:w},{29:[1,348]},a(nb,Ea,{69:349,70:pb}),a(Ba,[2,130]),{31:jb,33:280,34:f,100:351,101:278,103:Ya},a(Ba,[2,135],{102:[1,352]}),a(Ba,[2,137],{102:[1,353]}),{33:354,34:f},a(za,[2,141]),a(nb,Ea,{69:355,70:zb}),a(Ba,[2,150]),{31:wb,33:287,34:f,103:eb,106:357,108:285},a(Ba,[2,155],{102:[1,358]}),a(Ba,[2,158]),{6:[1,360],7:359,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,31:[1,361],33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,
|
||||
45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(Ab,[2,147],{141:77,132:102,138:103,133:z,135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),{39:362,40:l,41:w},a(Aa,[2,199]),{6:xa,32:[1,363]},
|
||||
{7:364,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a([12,28,34,38,40,41,44,45,48,
|
||||
49,50,51,52,53,61,62,63,67,68,92,95,97,105,112,117,118,119,125,129,130,133,135,137,139,149,155,157,158,159,160,161,162],Xb,{6:gb,31:gb,70:gb,120:gb}),{6:qb,31:rb,120:[1,365]},a([6,31,32,115,120],fb,{15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,66:33,77:40,154:41,132:43,136:44,138:45,74:53,75:54,37:55,43:57,33:70,60:71,141:77,39:80,8:122,76:179,7:254,123:368,12:c,28:fa,34:f,38:D,40:l,41:w,44:G,45:F,48:x,49:v,
|
||||
50:M,51:N,52:J,53:r,61:E,62:O,63:m,67:k,68:t,73:Wa,92:p,95:h,97:y,105:P,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,133:z,135:B,137:W,139:C,149:Q,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R}),a(Sa,Ea,{69:369,70:kb}),a(b,[2,167]),a([6,31,115],Ea,{69:370,70:kb}),a(bc,[2,242]),{7:371,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,
|
||||
62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:372,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,
|
||||
75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:373,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,
|
||||
92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(lb,[2,218]),{33:194,34:f,60:195,74:196,75:197,92:p,118:e,119:d,145:374},a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,135,139,156],[2,225],{141:77,132:102,138:103,134:[1,375],140:[1,376],159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Bb,[2,226],{141:77,132:102,
|
||||
138:103,134:[1,377],159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Bb,[2,232],{141:77,132:102,138:103,134:[1,378],159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),{6:cc,31:dc,94:[1,379]},a(Cb,fb,{39:80,57:204,59:205,11:206,37:207,33:208,35:209,60:210,56:382,34:f,36:Oa,38:D,40:l,41:w,62:O,118:e}),{7:383,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,
|
||||
26:18,27:19,28:fa,31:[1,384],33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:385,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,
|
||||
31:[1,386],33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(Aa,[2,39]),a(Lb,[2,37]),a(La,[2,105]),{7:387,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,
|
||||
26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,89:[2,178],92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{89:[2,179],132:102,133:z,135:B,138:103,139:C,141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,
|
||||
171:da,172:ma,173:sa,174:ia},a(Ma,[2,49],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),{32:[1,388],132:102,133:z,135:B,138:103,139:C,141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia},{30:389,31:va},a(Va,[2,75]),{33:129,34:f,60:130,71:390,72:127,73:pa,74:131,75:132,92:p,118:e,119:d},a(ec,n,{71:126,72:127,33:129,60:130,74:131,75:132,64:391,34:f,73:pa,92:p,118:e,
|
||||
119:d}),a(Va,[2,80],{141:77,132:102,138:103,133:z,135:B,139:C,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Ra,gb),a($b,[2,31]),{32:[1,392],132:102,133:z,135:B,138:103,139:C,141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia},a(Ma,[2,272],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),{30:393,31:va,132:102,
|
||||
133:z,135:B,138:103,139:C,141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia},{30:394,31:va},a(ta,[2,193]),{30:395,31:va},{30:396,31:va},a(Db,[2,197]),{32:[1,397],151:[1,398],152:339,153:ib},a(ta,[2,236]),{30:399,31:va},a(ob,[2,239]),{30:400,31:va,70:[1,401]},a(fc,[2,189],{141:77,132:102,138:103,133:z,135:B,139:C,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(ta,[2,118]),a(ac,[2,
|
||||
121],{141:77,132:102,138:103,30:402,31:va,133:z,135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(za,[2,124]),{29:[1,403]},{31:jb,33:280,34:f,100:404,101:278,103:Ya},a(za,[2,125]),{39:405,40:l,41:w},{6:sb,31:tb,94:[1,406]},a(Cb,fb,{33:280,101:409,34:f,103:Ya}),a(Sa,Ea,{69:410,70:pb}),{33:411,34:f},{33:412,34:f},{29:[2,140]},{6:Eb,31:Fb,94:[1,413]},a(Cb,fb,{33:287,108:416,34:f,103:eb}),a(Sa,Ea,{69:417,70:zb}),{33:418,34:f,103:[1,419]},
|
||||
a(Ab,[2,144],{141:77,132:102,138:103,133:z,135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),{7:420,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,
|
||||
129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:421,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,
|
||||
136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(za,[2,148]),{131:[1,422]},{120:[1,423],132:102,133:z,135:B,138:103,139:C,141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia},a(xb,[2,173]),{7:254,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,
|
||||
54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,73:Wa,74:53,75:54,76:179,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,123:424,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:254,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,31:bb,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,
|
||||
60:71,61:E,62:O,63:m,66:33,67:k,68:t,73:Wa,74:53,75:54,76:179,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,116:425,117:H,118:U,119:T,123:177,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(Ra,[2,182]),{6:qb,31:rb,32:[1,426]},{6:qb,31:rb,115:[1,427]},a(Za,[2,202],{141:77,132:102,138:103,133:z,135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Za,
|
||||
[2,204],{141:77,132:102,138:103,133:z,135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Za,[2,215],{141:77,132:102,138:103,133:z,135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(lb,[2,224]),{7:428,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,
|
||||
49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:429,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,
|
||||
60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:430,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,
|
||||
68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:431,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,
|
||||
80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(xb,[2,109]),{11:206,33:208,34:f,35:209,36:Oa,37:207,38:D,39:80,40:l,41:w,56:432,57:204,59:205,60:210,62:O,118:e},a(ec,Jb,{39:80,56:203,57:204,59:205,11:206,37:207,33:208,35:209,60:210,93:433,34:f,36:Oa,38:D,40:l,41:w,62:O,118:e}),a(Ba,[2,112]),a(Ba,[2,52],{141:77,132:102,138:103,133:z,135:B,139:C,156:qa,159:ka,
|
||||
160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),{7:434,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,
|
||||
149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},a(Ba,[2,54],{141:77,132:102,138:103,133:z,135:B,139:C,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),{7:435,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,
|
||||
81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{89:[2,177],132:102,133:z,135:B,138:103,139:C,141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia},a(ta,[2,50]),a(ta,[2,67]),a(Va,[2,76]),a(Sa,Ea,{69:436,70:Ob}),a(ta,[2,271]),a(bc,[2,243]),a(ta,[2,194]),a(Db,[2,195]),a(Db,[2,196]),a(ta,[2,234]),{30:437,31:va},
|
||||
{32:[1,438]},a(ob,[2,240],{6:[1,439]}),{7:440,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,
|
||||
162:R},a(ta,[2,122]),{39:441,40:l,41:w},a(nb,Ea,{69:442,70:pb}),a(za,[2,126]),{29:[1,443]},{33:280,34:f,101:444,103:Ya},{31:jb,33:280,34:f,100:445,101:278,103:Ya},a(Ba,[2,131]),{6:sb,31:tb,32:[1,446]},a(Ba,[2,136]),a(Ba,[2,138]),a(za,[2,142],{29:[1,447]}),{33:287,34:f,103:eb,108:448},{31:wb,33:287,34:f,103:eb,106:449,108:285},a(Ba,[2,151]),{6:Eb,31:Fb,32:[1,450]},a(Ba,[2,156]),a(Ba,[2,157]),a(Ab,[2,145],{141:77,132:102,138:103,133:z,135:B,139:C,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,
|
||||
169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),{32:[1,451],132:102,133:z,135:B,138:103,139:C,141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia},a(Aa,[2,200]),a(Aa,[2,176]),a(Ra,[2,183]),a(Sa,Ea,{69:452,70:kb}),a(Ra,[2,184]),a(b,[2,168]),a([1,6,31,32,42,65,70,73,89,94,115,120,122,131,133,134,135,139,156],[2,227],{141:77,132:102,138:103,140:[1,453],159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),
|
||||
a(Bb,[2,229],{141:77,132:102,138:103,134:[1,454],159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Ma,[2,228],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Ma,[2,233],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Ba,[2,113]),a(Sa,Ea,{69:455,70:Tb}),{32:[1,456],132:102,133:z,135:B,138:103,139:C,
|
||||
141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia},{32:[1,457],132:102,133:z,135:B,138:103,139:C,141:77,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia},{6:Yb,31:Zb,32:[1,458]},{32:[1,459]},a(ta,[2,237]),a(ob,[2,241]),a(fc,[2,190],{141:77,132:102,138:103,133:z,135:B,139:C,156:qa,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(za,
|
||||
[2,128]),{6:sb,31:tb,94:[1,460]},{39:461,40:l,41:w},a(Ba,[2,132]),a(Sa,Ea,{69:462,70:pb}),a(Ba,[2,133]),{39:463,40:l,41:w},a(Ba,[2,152]),a(Sa,Ea,{69:464,70:zb}),a(Ba,[2,153]),a(za,[2,146]),{6:qb,31:rb,32:[1,465]},{7:466,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,
|
||||
92:p,95:h,97:y,105:P,111:31,112:A,117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{7:467,8:122,10:20,11:21,12:c,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:fa,33:70,34:f,37:55,38:D,39:80,40:l,41:w,43:57,44:G,45:F,47:27,48:x,49:v,50:M,51:N,52:J,53:r,54:26,60:71,61:E,62:O,63:m,66:33,67:k,68:t,74:53,75:54,77:40,79:28,80:29,81:30,92:p,95:h,97:y,105:P,111:31,112:A,
|
||||
117:H,118:U,119:T,125:I,129:aa,130:S,132:43,133:z,135:B,136:44,137:W,138:45,139:C,141:77,149:Q,154:41,155:X,157:Y,158:V,159:Z,160:K,161:ba,162:R},{6:cc,31:dc,32:[1,468]},a(Ba,[2,53]),a(Ba,[2,55]),a(Va,[2,77]),a(ta,[2,235]),{29:[1,469]},a(za,[2,127]),{6:sb,31:tb,32:[1,470]},a(za,[2,149]),{6:Eb,31:Fb,32:[1,471]},a(Ra,[2,185]),a(Ma,[2,230],{141:77,132:102,138:103,159:ka,160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Ma,[2,231],{141:77,132:102,138:103,159:ka,
|
||||
160:ca,163:ea,164:ga,165:ha,166:la,167:oa,168:L,169:ja,170:ra,171:da,172:ma,173:sa,174:ia}),a(Ba,[2,114]),{39:472,40:l,41:w},a(Ba,[2,134]),a(Ba,[2,154]),a(za,[2,129])],defaultActions:{68:[2,69],69:[2,70],238:[2,108],354:[2,140]},parseError:function(a,b){if(b.recoverable)this.trace(a);else{var d=function(a,b){this.message=a;this.hash=b};d.prototype=Error;throw new d(a,b);}},parse:function(a){var b=[0],d=[null],e=[],n=this.table,pa="",c=0,f=0,g=0,h=e.slice.call(arguments,1),va=Object.create(this.lexer),
|
||||
k={},Ka;for(Ka in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ka)&&(k[Ka]=this.yy[Ka]);va.setInput(a,k);k.lexer=va;k.parser=this;"undefined"==typeof va.yylloc&&(va.yylloc={});Ka=va.yylloc;e.push(Ka);var m=va.options&&va.options.ranges;this.parseError="function"===typeof k.parseError?k.parseError:Object.getPrototypeOf(this).parseError;for(var t,p,Ia,l,r={},y,q;;){Ia=b[b.length-1];if(this.defaultActions[Ia])l=this.defaultActions[Ia];else{if(null===t||"undefined"==typeof t)t=va.lex()||1,"number"!==
|
||||
typeof t&&(t=this.symbols_[t]||t);l=n[Ia]&&n[Ia][t]}if("undefined"===typeof l||!l.length||!l[0]){var wa;q=[];for(y in n[Ia])this.terminals_[y]&&2<y&&q.push("'"+this.terminals_[y]+"'");wa=va.showPosition?"Parse error on line "+(c+1)+":\n"+va.showPosition()+"\nExpecting "+q.join(", ")+", got '"+(this.terminals_[t]||t)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==t?"end of input":"'"+(this.terminals_[t]||t)+"'");this.parseError(wa,{text:va.match,token:this.terminals_[t]||t,line:va.yylineno,loc:Ka,
|
||||
expected:q})}if(l[0]instanceof Array&&1<l.length)throw Error("Parse Error: multiple actions possible at state: "+Ia+", token: "+t);switch(l[0]){case 1:b.push(t);d.push(va.yytext);e.push(va.yylloc);b.push(l[1]);t=null;p?(t=p,p=null):(f=va.yyleng,pa=va.yytext,c=va.yylineno,Ka=va.yylloc,0<g&&g--);break;case 2:q=this.productions_[l[1]][1];r.$=d[d.length-q];r._$={first_line:e[e.length-(q||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(q||1)].first_column,last_column:e[e.length-
|
||||
1].last_column};m&&(r._$.range=[e[e.length-(q||1)].range[0],e[e.length-1].range[1]]);Ia=this.performAction.apply(r,[pa,f,c,k,l[1],d,e].concat(h));if("undefined"!==typeof Ia)return Ia;q&&(b=b.slice(0,-2*q),d=d.slice(0,-1*q),e=e.slice(0,-1*q));b.push(this.productions_[l[1]][0]);d.push(r.$);e.push(r._$);l=n[b[b.length-2]][b[b.length-1]];b.push(l);break;case 3:return!0}}}};g.prototype=gc;gc.Parser=g;return new g}();"undefined"!==typeof u&&"undefined"!==typeof g&&(g.parser=xa,g.Parser=xa.Parser,g.parse=
|
||||
function(){return xa.parse.apply(xa,arguments)},g.main=function(q){q[1]||(console.log("Usage: "+q[0]+" FILE"),process.exit(1));var a="",c=u("fs");"undefined"!==typeof c&&null!==c&&(a=c.readFileSync(u("path").normalize(q[1]),"utf8"));return g.parser.parse(a)},"undefined"!==typeof ua&&u.main===ua&&g.main(process.argv.slice(1)));return ua.exports}();u["./scope"]=function(){var g={};(function(){var u=[].indexOf||function(g){for(var q=0,a=this.length;q<a;q++)if(q in this&&this[q]===g)return q;return-1};
|
||||
g.Scope=function(){function g(g,a,c,u){var f,q;this.parent=g;this.expressions=a;this.method=c;this.referencedVars=u;this.variables=[{name:"arguments",type:"arguments"}];this.positions={};this.parent||(this.utilities={});this.root=null!=(f=null!=(q=this.parent)?q.root:void 0)?f:this}g.prototype.add=function(g,a,c){return this.shared&&!c?this.parent.add(g,a,c):Object.prototype.hasOwnProperty.call(this.positions,g)?this.variables[this.positions[g]].type=a:this.positions[g]=this.variables.push({name:g,
|
||||
type:a})-1};g.prototype.namedMethod=function(){var g;return null!=(g=this.method)&&g.name||!this.parent?this.method:this.parent.namedMethod()};g.prototype.find=function(g,a){null==a&&(a="var");if(this.check(g))return!0;this.add(g,a);return!1};g.prototype.parameter=function(g){if(!this.shared||!this.parent.check(g,!0))return this.add(g,"param")};g.prototype.check=function(g){var a;return!!(this.type(g)||null!=(a=this.parent)&&a.check(g))};g.prototype.temporary=function(g,a,c){null==c&&(c=!1);return c?
|
||||
(c=g.charCodeAt(0),g=122-c,c=String.fromCharCode(c+a%(g+1)),a=Math.floor(a/(g+1)),""+c+(a||"")):""+g+(a||"")};g.prototype.type=function(g){var a,c,q,f;q=this.variables;a=0;for(c=q.length;a<c;a++)if(f=q[a],f.name===g)return f.type;return null};g.prototype.freeVariable=function(g,a){var c,q,f;null==a&&(a={});for(c=0;;){f=this.temporary(g,c,a.single);if(!(this.check(f)||0<=u.call(this.root.referencedVars,f)))break;c++}(null!=(q=a.reserve)?q:1)&&this.add(f,"var",!0);return f};g.prototype.assign=function(g,
|
||||
a){this.add(g,{value:a,assigned:!0},!0);return this.hasAssignments=!0};g.prototype.hasDeclarations=function(){return!!this.declaredVariables().length};g.prototype.declaredVariables=function(){var g,a,c,u,f;u=this.variables;f=[];a=0;for(c=u.length;a<c;a++)g=u[a],"var"===g.type&&f.push(g.name);return f.sort()};g.prototype.assignedVariables=function(){var g,a,c,u,f;c=this.variables;u=[];g=0;for(a=c.length;g<a;g++)f=c[g],f.type.assigned&&u.push(f.name+" \x3d "+f.type.value);return u};return g}()}).call(this);
|
||||
return g}();u["./nodes"]=function(){var g={};(function(){var ua,qa,q,a,c,Ca,f,D,l,w,G,F,x,v,M,N,J,r,E,O,m,k,t,p,h,y,P,A,H,U,T,I,aa,S,z,B,W,C,Q,X,Y,V,Z,K,ba,R,ya,$a,Xa,ka,ca,ea,ga,ha,la,oa,L,ja,ra,da,ma,sa,ia,Da,ta,Ja,Ta,Ga,Ua,Fa,Pa,Qa,Na,za,na=function(a,b){function n(){this.constructor=a}for(var pa in b)fa.call(b,pa)&&(a[pa]=b[pa]);n.prototype=b.prototype;a.prototype=new n;a.__super__=b.prototype;return a},fa={}.hasOwnProperty,Ha=[].indexOf||function(a){for(var b=0,n=this.length;b<n;b++)if(b in this&&
|
||||
this[b]===a)return b;return-1},Aa=[].slice;Error.stackTraceLimit=Infinity;K=u("./scope").Scope;a=u("./lexer");Ga=a.isUnassignable;k=a.JS_FORBIDDEN;v=u("./helpers");da=v.compact;ia=v.flatten;sa=v.extend;Fa=v.merge;ma=v.del;a=v.addLocationDataFn;Ua=v.locationDataToString;Qa=v.throwSyntaxError;g.extend=sa;g.addLocationDataFn=a;ja=function(){return!0};I=function(){return!1};ea=function(){return this};T=function(){this.negated=!this.negated;return this};g.CodeFragment=w=function(){function a(a,n){var b;
|
||||
this.code=""+n;this.locationData=null!=a?a.locationData:void 0;this.type=(null!=a?null!=(b=a.constructor)?b.name:void 0:void 0)||"unknown"}a.prototype.toString=function(){return""+this.code+(this.locationData?": "+Ua(this.locationData):"")};return a}();Da=function(a){var b,n,pa,e;e=[];n=0;for(pa=a.length;n<pa;n++)b=a[n],e.push(b.code);return e.join("")};g.Base=a=function(){function a(){}a.prototype.compile=function(a,n){return Da(this.compileToFragments(a,n))};a.prototype.compileToFragments=function(a,
|
||||
n){a=sa({},a);n&&(a.level=n);n=this.unfoldSoak(a)||this;n.tab=a.indent;return a.level!==A&&n.isStatement(a)?n.compileClosure(a):n.compileNode(a)};a.prototype.compileClosure=function(a){var b,pa,e,d;(e=this.jumps())&&e.error("cannot use a pure statement in an expression");a.sharedScope=!0;e=new l([],c.wrap([this]));b=[];if((pa=this.contains(Ja))||this.contains(Ta))b=[new ga],pa?(pa="apply",b.push(new r("arguments"))):pa="call",e=new L(e,[new ua(new Q(pa))]);a=(new f(e,b)).compileNode(a);if(e.isGenerator||
|
||||
null!=(d=e.base)&&d.isGenerator)a.unshift(this.makeCode("(yield* ")),a.push(this.makeCode(")"));return a};a.prototype.cache=function(a,n,pa){var b;if(null!=pa?pa(this):this.isComplex())return pa=new r(a.scope.freeVariable("ref")),b=new q(pa,this),n?[b.compileToFragments(a,n),[this.makeCode(pa.value)]]:[b,pa];pa=n?this.compileToFragments(a,n):this;return[pa,pa]};a.prototype.cacheToCodeFragments=function(a){return[Da(a[0]),Da(a[1])]};a.prototype.makeReturn=function(a){var b;b=this.unwrapAll();return a?
|
||||
new f(new H(a+".push"),[b]):new V(b)};a.prototype.contains=function(a){var b;b=void 0;this.traverseChildren(!1,function(n){if(a(n))return b=n,!1});return b};a.prototype.lastNonComment=function(a){var b;for(b=a.length;b--;)if(!(a[b]instanceof G))return a[b];return null};a.prototype.toString=function(a,n){var b;null==a&&(a="");null==n&&(n=this.constructor.name);b="\n"+a+n;this.soak&&(b+="?");this.eachChild(function(e){return b+=e.toString(a+ca)});return b};a.prototype.eachChild=function(a){var b,pa,
|
||||
e,d,c,f,g;if(!this.children)return this;f=this.children;pa=0;for(d=f.length;pa<d;pa++)if(b=f[pa],this[b])for(g=ia([this[b]]),e=0,c=g.length;e<c;e++)if(b=g[e],!1===a(b))return this;return this};a.prototype.traverseChildren=function(a,n){return this.eachChild(function(b){if(!1!==n(b))return b.traverseChildren(a,n)})};a.prototype.invert=function(){return new B("!",this)};a.prototype.unwrapAll=function(){var a;for(a=this;a!==(a=a.unwrap()););return a};a.prototype.children=[];a.prototype.isStatement=I;
|
||||
a.prototype.jumps=I;a.prototype.isComplex=ja;a.prototype.isChainable=I;a.prototype.isAssignable=I;a.prototype.isNumber=I;a.prototype.unwrap=ea;a.prototype.unfoldSoak=I;a.prototype.assigns=I;a.prototype.updateLocationDataIfMissing=function(a){if(this.locationData)return this;this.locationData=a;return this.eachChild(function(b){return b.updateLocationDataIfMissing(a)})};a.prototype.error=function(a){return Qa(a,this.locationData)};a.prototype.makeCode=function(a){return new w(this,a)};a.prototype.wrapInBraces=
|
||||
function(a){return[].concat(this.makeCode("("),a,this.makeCode(")"))};a.prototype.joinFragmentArrays=function(a,n){var b,e,d,c,f;b=[];d=c=0;for(f=a.length;c<f;d=++c)e=a[d],d&&b.push(this.makeCode(n)),b=b.concat(e);return b};return a}();g.Block=c=function(a){function b(a){this.expressions=da(ia(a||[]))}na(b,a);b.prototype.children=["expressions"];b.prototype.push=function(a){this.expressions.push(a);return this};b.prototype.pop=function(){return this.expressions.pop()};b.prototype.unshift=function(a){this.expressions.unshift(a);
|
||||
return this};b.prototype.unwrap=function(){return 1===this.expressions.length?this.expressions[0]:this};b.prototype.isEmpty=function(){return!this.expressions.length};b.prototype.isStatement=function(a){var b,e,d,n;n=this.expressions;e=0;for(d=n.length;e<d;e++)if(b=n[e],b.isStatement(a))return!0;return!1};b.prototype.jumps=function(a){var b,e,d,n;n=this.expressions;e=0;for(d=n.length;e<d;e++)if(b=n[e],b=b.jumps(a))return b};b.prototype.makeReturn=function(a){var b,e;for(e=this.expressions.length;e--;)if(b=
|
||||
this.expressions[e],!(b instanceof G)){this.expressions[e]=b.makeReturn(a);b instanceof V&&!b.expression&&this.expressions.splice(e,1);break}return this};b.prototype.compileToFragments=function(a,pa){null==a&&(a={});return a.scope?b.__super__.compileToFragments.call(this,a,pa):this.compileRoot(a)};b.prototype.compileNode=function(a){var n,e,d,c,f,g,k;this.tab=a.indent;k=a.level===A;e=[];g=this.expressions;d=n=0;for(c=g.length;n<c;d=++n)f=g[d],f=f.unwrapAll(),f=f.unfoldSoak(a)||f,f instanceof b?e.push(f.compileNode(a)):
|
||||
k?(f.front=!0,d=f.compileToFragments(a),f.isStatement(a)||(d.unshift(this.makeCode(""+this.tab)),d.push(this.makeCode(";"))),e.push(d)):e.push(f.compileToFragments(a,h));if(k)return this.spaced?[].concat(this.joinFragmentArrays(e,"\n\n"),this.makeCode("\n")):this.joinFragmentArrays(e,"\n");n=e.length?this.joinFragmentArrays(e,", "):[this.makeCode("void 0")];return 1<e.length&&a.level>=h?this.wrapInBraces(n):n};b.prototype.compileRoot=function(a){var b,e,d,n,c;a.indent=a.bare?"":ca;a.level=A;this.spaced=
|
||||
!0;a.scope=new K(null,this,null,null!=(d=a.referencedVars)?d:[]);c=a.locals||[];d=0;for(e=c.length;d<e;d++)n=c[d],a.scope.parameter(n);d=[];if(!a.bare){var f;f=this.expressions;e=[];b=n=0;for(c=f.length;n<c;b=++n){b=f[b];if(!(b.unwrap()instanceof G))break;e.push(b)}n=this.expressions.slice(e.length);this.expressions=e;e.length&&(d=this.compileNode(Fa(a,{indent:""})),d.push(this.makeCode("\n")));this.expressions=n}e=this.compileWithDeclarations(a);return a.bare?e:[].concat(d,this.makeCode("(function() {\n"),
|
||||
e,this.makeCode("\n}).call(this);\n"))};b.prototype.compileWithDeclarations=function(a){var b,e,d,n,c,f;d=[];f=this.expressions;n=c=0;for(b=f.length;c<b&&(e=f[n],e=e.unwrap(),e instanceof G||e instanceof H);n=++c);a=Fa(a,{level:A});n&&(e=this.expressions.splice(n,9E9),d=[this.spaced,!1],c=d[0],this.spaced=d[1],c=[this.compileNode(a),c],d=c[0],this.spaced=c[1],this.expressions=e);e=this.compileNode(a);c=a.scope;c.expressions===this&&(b=a.scope.hasDeclarations(),a=c.hasAssignments,b||a?(n&&d.push(this.makeCode("\n")),
|
||||
d.push(this.makeCode(this.tab+"var ")),b&&d.push(this.makeCode(c.declaredVariables().join(", "))),a&&(b&&d.push(this.makeCode(",\n"+(this.tab+ca))),d.push(this.makeCode(c.assignedVariables().join(",\n"+(this.tab+ca))))),d.push(this.makeCode(";\n"+(this.spaced?"\n":"")))):d.length&&e.length&&d.push(this.makeCode("\n")));return d.concat(e)};b.wrap=function(a){return 1===a.length&&a[0]instanceof b?a[0]:new b(a)};return b}(a);g.Literal=H=function(a){function b(a){this.value=a}na(b,a);b.prototype.isComplex=
|
||||
I;b.prototype.assigns=function(a){return a===this.value};b.prototype.compileNode=function(a){return[this.makeCode(this.value)]};b.prototype.toString=function(){return" "+(this.isStatement()?b.__super__.toString.apply(this,arguments):this.constructor.name)+": "+this.value};return b}(a);g.NumberLiteral=S=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);return b}(H);g.InfinityLiteral=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,
|
||||
a);b.prototype.compileNode=function(){return[this.makeCode("2e308")]};return b}(S);g.NaNLiteral=function(a){function b(){b.__super__.constructor.call(this,"NaN")}na(b,a);b.prototype.compileNode=function(a){var b;b=[this.makeCode("0/0")];return a.level>=y?this.wrapInBraces(b):b};return b}(S);g.StringLiteral=$a=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);return b}(H);g.RegexLiteral=Y=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}
|
||||
na(b,a);return b}(H);g.PassthroughLiteral=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);return b}(H);g.IdentifierLiteral=r=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);b.prototype.isAssignable=ja;return b}(H);g.PropertyName=Q=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);b.prototype.isAssignable=ja;return b}(H);g.StatementLiteral=ya=function(a){function b(){return b.__super__.constructor.apply(this,
|
||||
arguments)}na(b,a);b.prototype.isStatement=ja;b.prototype.makeReturn=ea;b.prototype.jumps=function(a){if("break"===this.value&&!(null!=a&&a.loop||null!=a&&a.block)||"continue"===this.value&&(null==a||!a.loop))return this};b.prototype.compileNode=function(a){return[this.makeCode(""+this.tab+this.value+";")]};return b}(H);g.ThisLiteral=ga=function(a){function b(){b.__super__.constructor.call(this,"this")}na(b,a);b.prototype.compileNode=function(a){var b;a=null!=(b=a.scope.method)&&b.bound?a.scope.method.context:
|
||||
this.value;return[this.makeCode(a)]};return b}(H);g.UndefinedLiteral=oa=function(a){function b(){b.__super__.constructor.call(this,"undefined")}na(b,a);b.prototype.compileNode=function(a){return[this.makeCode(a.level>=t?"(void 0)":"void 0")]};return b}(H);g.NullLiteral=aa=function(a){function b(){b.__super__.constructor.call(this,"null")}na(b,a);return b}(H);g.BooleanLiteral=Ca=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);return b}(H);g.Return=V=function(a){function b(a){this.expression=
|
||||
a}na(b,a);b.prototype.children=["expression"];b.prototype.isStatement=ja;b.prototype.makeReturn=ea;b.prototype.jumps=ea;b.prototype.compileToFragments=function(a,pa){var e,d;e=null!=(d=this.expression)?d.makeReturn():void 0;return!e||e instanceof b?b.__super__.compileToFragments.call(this,a,pa):e.compileToFragments(a,pa)};b.prototype.compileNode=function(a){var b;b=[];b.push(this.makeCode(this.tab+("return"+(this.expression?" ":""))));this.expression&&(b=b.concat(this.expression.compileToFragments(a,
|
||||
P)));b.push(this.makeCode(";"));return b};return b}(a);g.YieldReturn=ra=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);b.prototype.compileNode=function(a){null==a.scope.parent&&this.error("yield can only occur inside functions");return b.__super__.compileNode.apply(this,arguments)};return b}(V);g.Value=L=function(a){function b(a,pa,e){if(!pa&&a instanceof b)return a;this.base=a;this.properties=pa||[];e&&(this[e]=!0);return this}na(b,a);b.prototype.children=["base",
|
||||
"properties"];b.prototype.add=function(a){this.properties=this.properties.concat(a);return this};b.prototype.hasProperties=function(){return!!this.properties.length};b.prototype.bareLiteral=function(a){return!this.properties.length&&this.base instanceof a};b.prototype.isArray=function(){return this.bareLiteral(qa)};b.prototype.isRange=function(){return this.bareLiteral(X)};b.prototype.isComplex=function(){return this.hasProperties()||this.base.isComplex()};b.prototype.isAssignable=function(){return this.hasProperties()||
|
||||
this.base.isAssignable()};b.prototype.isNumber=function(){return this.bareLiteral(S)};b.prototype.isString=function(){return this.bareLiteral($a)};b.prototype.isRegex=function(){return this.bareLiteral(Y)};b.prototype.isUndefined=function(){return this.bareLiteral(oa)};b.prototype.isNull=function(){return this.bareLiteral(aa)};b.prototype.isBoolean=function(){return this.bareLiteral(Ca)};b.prototype.isAtomic=function(){var a,b,e,d;d=this.properties.concat(this.base);a=0;for(b=d.length;a<b;a++)if(e=
|
||||
d[a],e.soak||e instanceof f)return!1;return!0};b.prototype.isNotCallable=function(){return this.isNumber()||this.isString()||this.isRegex()||this.isArray()||this.isRange()||this.isSplice()||this.isObject()||this.isUndefined()||this.isNull()||this.isBoolean()};b.prototype.isStatement=function(a){return!this.properties.length&&this.base.isStatement(a)};b.prototype.assigns=function(a){return!this.properties.length&&this.base.assigns(a)};b.prototype.jumps=function(a){return!this.properties.length&&this.base.jumps(a)};
|
||||
b.prototype.isObject=function(a){return this.properties.length?!1:this.base instanceof z&&(!a||this.base.generated)};b.prototype.isSplice=function(){var a;a=this.properties;return a[a.length-1]instanceof ba};b.prototype.looksStatic=function(a){var b;return this.base.value===a&&1===this.properties.length&&"prototype"!==(null!=(b=this.properties[0].name)?b.value:void 0)};b.prototype.unwrap=function(){return this.properties.length?this:this.base};b.prototype.cacheReference=function(a){var n,e,d,c;n=
|
||||
this.properties;d=n[n.length-1];if(2>this.properties.length&&!this.base.isComplex()&&(null==d||!d.isComplex()))return[this,this];n=new b(this.base,this.properties.slice(0,-1));n.isComplex()&&(e=new r(a.scope.freeVariable("base")),n=new b(new C(new q(e,n))));if(!d)return[n,e];d.isComplex()&&(c=new r(a.scope.freeVariable("name")),d=new m(new q(c,d.index)),c=new m(c));return[n.add(d),new b(e||n.base,[c||d])]};b.prototype.compileNode=function(a){var b,e,d,n,c;this.base.front=this.front;c=this.properties;
|
||||
b=this.base.compileToFragments(a,c.length?t:null);c.length&&Z.test(Da(b))&&b.push(this.makeCode("."));e=0;for(d=c.length;e<d;e++)n=c[e],b.push.apply(b,n.compileToFragments(a));return b};b.prototype.unfoldSoak=function(a){return null!=this.unfoldedSoak?this.unfoldedSoak:this.unfoldedSoak=function(n){return function(){var e,d,c,pa,f;if(d=n.base.unfoldSoak(a))return(e=d.body.properties).push.apply(e,n.properties),d;f=n.properties;d=e=0;for(c=f.length;e<c;d=++e)if(pa=f[d],pa.soak)return pa.soak=!1,e=
|
||||
new b(n.base,n.properties.slice(0,d)),c=new b(n.base,n.properties.slice(d)),e.isComplex()&&(d=new r(a.scope.freeVariable("ref")),e=new C(new q(d,e)),c.base=d),new E(new F(e),c,{soak:!0});return!1}}(this)()};return b}(a);g.Comment=G=function(a){function b(a){this.comment=a}na(b,a);b.prototype.isStatement=ja;b.prototype.makeReturn=ea;b.prototype.compileNode=function(a,b){var e;e=this.comment.replace(/^(\s*)#(?=\s)/gm,"$1 *");e="/*"+Pa(e,this.tab)+(0<=Ha.call(e,"\n")?"\n"+this.tab:"")+" */";(b||a.level)===
|
||||
A&&(e=a.indent+e);return[this.makeCode("\n"),this.makeCode(e)]};return b}(a);g.Call=f=function(a){function b(a,b,e){this.variable=a;this.args=null!=b?b:[];this.soak=e;this.isNew=!1;this.variable instanceof L&&this.variable.isNotCallable()&&this.variable.error("literal is not a function")}na(b,a);b.prototype.children=["variable","args"];b.prototype.updateLocationDataIfMissing=function(a){var n,e;this.locationData&&this.needsUpdatedStartLocation&&(this.locationData.first_line=a.first_line,this.locationData.first_column=
|
||||
a.first_column,n=(null!=(e=this.variable)?e.base:void 0)||this.variable,n.needsUpdatedStartLocation&&(this.variable.locationData.first_line=a.first_line,this.variable.locationData.first_column=a.first_column,n.updateLocationDataIfMissing(a)),delete this.needsUpdatedStartLocation);return b.__super__.updateLocationDataIfMissing.apply(this,arguments)};b.prototype.newInstance=function(){var a,c;a=(null!=(c=this.variable)?c.base:void 0)||this.variable;a instanceof b&&!a.isNew?a.newInstance():this.isNew=
|
||||
!0;this.needsUpdatedStartLocation=!0;return this};b.prototype.unfoldSoak=function(a){var n,e,d,c,f;if(this.soak){if(this instanceof ka)n=new H(this.superReference(a)),e=new L(n);else{if(e=Na(a,this,"variable"))return e;e=(new L(this.variable)).cacheReference(a);n=e[0];e=e[1]}e=new b(e,this.args);e.isNew=this.isNew;n=new H("typeof "+n.compile(a)+' \x3d\x3d\x3d "function"');return new E(n,new L(e),{soak:!0})}n=this;for(d=[];;)if(n.variable instanceof b)d.push(n),n=n.variable;else{if(!(n.variable instanceof
|
||||
L))break;d.push(n);if(!((n=n.variable.base)instanceof b))break}f=d.reverse();d=0;for(c=f.length;d<c;d++)n=f[d],e&&(n.variable instanceof b?n.variable=e:n.variable.base=e),e=Na(a,n,"variable");return e};b.prototype.compileNode=function(a){var b,e,d,n,c,f;null!=(d=this.variable)&&(d.front=this.front);d=R.compileSplattedArray(a,this.args,!0);if(d.length)return this.compileSplat(a,d);d=[];f=this.args;e=n=0;for(c=f.length;n<c;e=++n)b=f[e],e&&d.push(this.makeCode(", ")),d.push.apply(d,b.compileToFragments(a,
|
||||
h));b=[];this instanceof ka?(a=this.superReference(a)+(".call("+this.superThis(a)),d.length&&(a+=", "),b.push(this.makeCode(a))):(this.isNew&&b.push(this.makeCode("new ")),b.push.apply(b,this.variable.compileToFragments(a,t)),b.push(this.makeCode("(")));b.push.apply(b,d);b.push(this.makeCode(")"));return b};b.prototype.compileSplat=function(a,b){var e,d,n,c;if(this instanceof ka)return[].concat(this.makeCode(this.superReference(a)+".apply("+this.superThis(a)+", "),b,this.makeCode(")"));if(this.isNew)return e=
|
||||
this.tab+ca,[].concat(this.makeCode("(function(func, args, ctor) {\n"+e+"ctor.prototype \x3d func.prototype;\n"+e+"var child \x3d new ctor, result \x3d func.apply(child, args);\n"+e+"return Object(result) \x3d\x3d\x3d result ? result : child;\n"+this.tab+"})("),this.variable.compileToFragments(a,h),this.makeCode(", "),b,this.makeCode(", function(){})"));e=[];d=new L(this.variable);(n=d.properties.pop())&&d.isComplex()?(c=a.scope.freeVariable("ref"),e=e.concat(this.makeCode("("+c+" \x3d "),d.compileToFragments(a,
|
||||
h),this.makeCode(")"),n.compileToFragments(a))):(d=d.compileToFragments(a,t),Z.test(Da(d))&&(d=this.wrapInBraces(d)),n?(c=Da(d),d.push.apply(d,n.compileToFragments(a))):c="null",e=e.concat(d));return e.concat(this.makeCode(".apply("+c+", "),b,this.makeCode(")"))};return b}(a);g.SuperCall=ka=function(a){function b(a){b.__super__.constructor.call(this,null,null!=a?a:[new R(new r("arguments"))]);this.isBare=null!=a}na(b,a);b.prototype.superReference=function(a){var b,e,d,c,n,f,g;c=a.scope.namedMethod();
|
||||
if(null!=c&&c.klass){d=c.klass;n=c.name;g=c.variable;d.isComplex()&&(e=new r(a.scope.parent.freeVariable("base")),b=new L(new C(new q(e,d))),g.base=b,g.properties.splice(0,d.properties.length));if(n.isComplex()||n instanceof m&&n.index.isAssignable())f=new r(a.scope.parent.freeVariable("name")),n=new m(new q(f,n.index)),g.properties.pop(),g.properties.push(n);b=[new ua(new Q("__super__"))];c["static"]&&b.push(new ua(new Q("constructor")));b.push(null!=f?new m(f):n);return(new L(null!=e?e:d,b)).compile(a)}return null!=
|
||||
c&&c.ctor?c.name+".__super__.constructor":this.error("cannot call super outside of an instance method.")};b.prototype.superThis=function(a){return(a=a.scope.method)&&!a.klass&&a.context||"this"};return b}(f);g.RegexWithInterpolations=function(a){function b(a){null==a&&(a=[]);b.__super__.constructor.call(this,new L(new r("RegExp")),a,!1)}na(b,a);return b}(f);g.TaggedTemplateCall=function(a){function b(a,pa,e){pa instanceof $a&&(pa=new Xa(c.wrap([new L(pa)])));b.__super__.constructor.call(this,a,[pa],
|
||||
e)}na(b,a);b.prototype.compileNode=function(a){a.inTaggedTemplateCall=!0;return this.variable.compileToFragments(a,t).concat(this.args[0].compileToFragments(a,h))};return b}(f);g.Extends=N=function(a){function b(a,b){this.child=a;this.parent=b}na(b,a);b.prototype.children=["child","parent"];b.prototype.compileToFragments=function(a){return(new f(new L(new H(za("extend",a))),[this.child,this.parent])).compileToFragments(a)};return b}(a);g.Access=ua=function(a){function b(a,b){this.name=a;this.soak=
|
||||
"soak"===b}na(b,a);b.prototype.children=["name"];b.prototype.compileToFragments=function(a){var b,e;a=this.name.compileToFragments(a);b=this.name.unwrap();return b instanceof Q?(e=b.value,0<=Ha.call(k,e))?[this.makeCode('["')].concat(Aa.call(a),[this.makeCode('"]')]):[this.makeCode(".")].concat(Aa.call(a)):[this.makeCode("[")].concat(Aa.call(a),[this.makeCode("]")])};b.prototype.isComplex=I;return b}(a);g.Index=m=function(a){function b(a){this.index=a}na(b,a);b.prototype.children=["index"];b.prototype.compileToFragments=
|
||||
function(a){return[].concat(this.makeCode("["),this.index.compileToFragments(a,P),this.makeCode("]"))};b.prototype.isComplex=function(){return this.index.isComplex()};return b}(a);g.Range=X=function(a){function b(a,b,e){this.from=a;this.to=b;this.equals=(this.exclusive="exclusive"===e)?"":"\x3d"}na(b,a);b.prototype.children=["from","to"];b.prototype.compileVariables=function(a){var b,e;a=Fa(a,{top:!0});b=ma(a,"isComplex");e=this.cacheToCodeFragments(this.from.cache(a,h,b));this.fromC=e[0];this.fromVar=
|
||||
e[1];e=this.cacheToCodeFragments(this.to.cache(a,h,b));this.toC=e[0];this.toVar=e[1];if(e=ma(a,"step"))a=this.cacheToCodeFragments(e.cache(a,h,b)),this.step=a[0],this.stepVar=a[1];this.fromNum=this.from.isNumber()?Number(this.fromVar):null;this.toNum=this.to.isNumber()?Number(this.toVar):null;return this.stepNum=null!=e&&e.isNumber()?Number(this.stepVar):null};b.prototype.compileNode=function(a){var b,e,d,c,n,f,g,h,k,m;this.fromVar||this.compileVariables(a);if(!a.index)return this.compileArray(a);
|
||||
f=null!=this.fromNum&&null!=this.toNum;n=ma(a,"index");g=(a=ma(a,"name"))&&a!==n;m=n+" \x3d "+this.fromC;this.toC!==this.toVar&&(m+=", "+this.toC);this.step!==this.stepVar&&(m+=", "+this.step);c=[n+" \x3c"+this.equals,n+" \x3e"+this.equals];e=c[0];c=c[1];e=null!=this.stepNum?0<this.stepNum?e+" "+this.toVar:c+" "+this.toVar:f?(h=[this.fromNum,this.toNum],d=h[0],k=h[1],h,d<=k?e+" "+k:c+" "+k):(b=this.stepVar?this.stepVar+" \x3e 0":this.fromVar+" \x3c\x3d "+this.toVar,b+" ? "+e+" "+this.toVar+" : "+
|
||||
c+" "+this.toVar);b=this.stepVar?n+" +\x3d "+this.stepVar:f?g?d<=k?"++"+n:"--"+n:d<=k?n+"++":n+"--":g?b+" ? ++"+n+" : --"+n:b+" ? "+n+"++ : "+n+"--";g&&(m=a+" \x3d "+m);g&&(b=a+" \x3d "+b);return[this.makeCode(m+"; "+e+"; "+b)]};b.prototype.compileArray=function(a){var b,e,d,c,n,f,g,h,k;if((e=null!=this.fromNum&&null!=this.toNum)&&20>=Math.abs(this.fromNum-this.toNum))return b=function(){h=[];for(var a=f=this.fromNum,b=this.toNum;f<=b?a<=b:a>=b;f<=b?a++:a--)h.push(a);return h}.apply(this),this.exclusive&&
|
||||
b.pop(),[this.makeCode("["+b.join(", ")+"]")];c=this.tab+ca;d=a.scope.freeVariable("i",{single:!0});g=a.scope.freeVariable("results");n="\n"+c+g+" \x3d [];";e?(a.index=d,e=Da(this.compileNode(a))):(k=d+" \x3d "+this.fromC+(this.toC!==this.toVar?", "+this.toC:""),e=this.fromVar+" \x3c\x3d "+this.toVar,e="var "+k+"; "+e+" ? "+d+" \x3c"+this.equals+" "+this.toVar+" : "+d+" \x3e"+this.equals+" "+this.toVar+"; "+e+" ? "+d+"++ : "+d+"--");d="{ "+g+".push("+d+"); }\n"+c+"return "+g+";\n"+a.indent;a=function(a){return null!=
|
||||
a?a.contains(Ja):void 0};if(a(this.from)||a(this.to))b=", arguments";return[this.makeCode("(function() {"+n+"\n"+c+"for ("+e+")"+d+"}).apply(this"+(null!=b?b:"")+")")]};return b}(a);g.Slice=ba=function(a){function b(a){this.range=a;b.__super__.constructor.call(this)}na(b,a);b.prototype.children=["range"];b.prototype.compileNode=function(a){var b,e,d,c,n;b=this.range;c=b.to;d=(b=b.from)&&b.compileToFragments(a,P)||[this.makeCode("0")];c&&(b=c.compileToFragments(a,P),e=Da(b),this.range.exclusive||-1!==
|
||||
+e)&&(n=", "+(this.range.exclusive?e:c.isNumber()?""+(+e+1):(b=c.compileToFragments(a,t),"+"+Da(b)+" + 1 || 9e9")));return[this.makeCode(".slice("+Da(d)+(n||"")+")")]};return b}(a);g.Obj=z=function(a){function b(a,b){this.generated=null!=b?b:!1;this.objects=this.properties=a||[]}na(b,a);b.prototype.children=["properties"];b.prototype.compileNode=function(a){var b,e,d,c,n,f,g,h,k,m,t,l,p;p=this.properties;if(this.generated)for(e=0,b=p.length;e<b;e++)d=p[e],d instanceof L&&d.error("cannot have an implicit value in an implicit object");
|
||||
e=b=0;for(d=p.length;b<d&&!(l=p[e],(l.variable||l).base instanceof C);e=++b);d=e<p.length;n=a.indent+=ca;k=this.lastNonComment(this.properties);b=[];d&&(t=a.scope.freeVariable("obj"),b.push(this.makeCode("(\n"+n+t+" \x3d ")));b.push(this.makeCode("{"+(0===p.length||0===e?"}":"\n")));c=h=0;for(m=p.length;h<m;c=++h)l=p[c],c===e&&(0!==c&&b.push(this.makeCode("\n"+n+"}")),b.push(this.makeCode(",\n"))),g=c===p.length-1||c===e-1?"":l===k||l instanceof G?"\n":",\n",f=l instanceof G?"":n,d&&c<e&&(f+=ca),
|
||||
l instanceof q&&("object"!==l.context&&l.operatorToken.error("unexpected "+l.operatorToken.value),l.variable instanceof L&&l.variable.hasProperties()&&l.variable.error("invalid object key")),l instanceof L&&l["this"]&&(l=new q(l.properties[0].name,l,"object")),l instanceof G||(c<e?l instanceof q||(l=new q(l,l,"object")):(l instanceof q?(c=l.variable,l=l.value):(l=l.base.cache(a),c=l[0],l=l[1],c instanceof r&&(c=new Q(c.value))),l=new q(new L(new r(t),[new ua(c)]),l))),f&&b.push(this.makeCode(f)),
|
||||
b.push.apply(b,l.compileToFragments(a,A)),g&&b.push(this.makeCode(g));d?b.push(this.makeCode(",\n"+n+t+"\n"+this.tab+")")):0!==p.length&&b.push(this.makeCode("\n"+this.tab+"}"));return this.front&&!d?this.wrapInBraces(b):b};b.prototype.assigns=function(a){var b,e,d,c;c=this.properties;b=0;for(e=c.length;b<e;b++)if(d=c[b],d.assigns(a))return!0;return!1};return b}(a);g.Arr=qa=function(a){function b(a){this.objects=a||[]}na(b,a);b.prototype.children=["objects"];b.prototype.compileNode=function(a){var b,
|
||||
e,d,c,n;if(!this.objects.length)return[this.makeCode("[]")];a.indent+=ca;b=R.compileSplattedArray(a,this.objects);if(b.length)return b;b=[];var f;n=this.objects;f=[];d=0;for(c=n.length;d<c;d++)e=n[d],f.push(e.compileToFragments(a,h));d=c=0;for(n=f.length;c<n;d=++c)e=f[d],d&&b.push(this.makeCode(", ")),b.push.apply(b,e);0<=Da(b).indexOf("\n")?(b.unshift(this.makeCode("[\n"+a.indent)),b.push(this.makeCode("\n"+this.tab+"]"))):(b.unshift(this.makeCode("[")),b.push(this.makeCode("]")));return b};b.prototype.assigns=
|
||||
function(a){var b,e,d,c;c=this.objects;b=0;for(e=c.length;b<e;b++)if(d=c[b],d.assigns(a))return!0;return!1};return b}(a);g.Class=D=function(a){function b(a,b,e){this.variable=a;this.parent=b;this.body=null!=e?e:new c;this.boundFuncs=[];this.body.classBody=!0}na(b,a);b.prototype.children=["variable","parent","body"];b.prototype.defaultClassVariableName="_Class";b.prototype.determineName=function(){var a,b;if(!this.variable)return this.defaultClassVariableName;b=this.variable.properties;b=(a=b[b.length-
|
||||
1])?a instanceof ua&&a.name:this.variable.base;if(!(b instanceof r||b instanceof Q))return this.defaultClassVariableName;b=b.value;a||(a=Ga(b))&&this.variable.error(a);return 0<=Ha.call(k,b)?"_"+b:b};b.prototype.setContext=function(a){return this.body.traverseChildren(!1,function(b){if(b.classBody)return!1;if(b instanceof ga)return b.value=a;if(b instanceof l&&b.bound)return b.context=a})};b.prototype.addBoundFunctions=function(a){var b,e,d,c;c=this.boundFuncs;e=0;for(d=c.length;e<d;e++)b=c[e],b=
|
||||
(new L(new ga,[new ua(b)])).compile(a),this.ctor.body.unshift(new H(b+" \x3d "+za("bind",a)+"("+b+", this)"))};b.prototype.addProperties=function(a,b,e){var d,c,n,f;f=a.base.properties.slice(0);var g;for(g=[];d=f.shift();)d instanceof q&&(c=d.variable.base,delete d.context,n=d.value,"constructor"===c.value?(this.ctor&&d.error("cannot define more than one constructor in a class"),n.bound&&d.error("cannot define a constructor as a bound function"),n instanceof l?d=this.ctor=n:(this.externalCtor=e.classScope.freeVariable("ctor"),
|
||||
d=new q(new r(this.externalCtor),n))):d.variable["this"]?n["static"]=!0:(a=c.isComplex()?new m(c):new ua(c),d.variable=new L(new r(b),[new ua(new Q("prototype")),a]),n instanceof l&&n.bound&&(this.boundFuncs.push(c),n.bound=!1))),g.push(d);return da(g)};b.prototype.walkBody=function(a,f){return this.traverseChildren(!1,function(e){return function(d){var n,g,pa,h,k,m,l;n=!0;if(d instanceof b)return!1;if(d instanceof c){l=g=d.expressions;pa=h=0;for(k=l.length;h<k;pa=++h)m=l[pa],m instanceof q&&m.variable.looksStatic(a)?
|
||||
m.value["static"]=!0:m instanceof L&&m.isObject(!0)&&(n=!1,g[pa]=e.addProperties(m,a,f));d.expressions=ia(g)}return n&&!(d instanceof b)}}(this))};b.prototype.hoistDirectivePrologue=function(){var a,b,e;b=0;for(a=this.body.expressions;(e=a[b])&&e instanceof G||e instanceof L&&e.isString();)++b;return this.directives=a.splice(0,b)};b.prototype.ensureConstructor=function(a){this.ctor||(this.ctor=new l,this.externalCtor?this.ctor.body.push(new H(this.externalCtor+".apply(this, arguments)")):this.parent&&
|
||||
this.ctor.body.push(new H(a+".__super__.constructor.apply(this, arguments)")),this.ctor.body.makeReturn(),this.body.expressions.unshift(this.ctor));this.ctor.ctor=this.ctor.name=a;this.ctor.klass=null;return this.ctor.noReturn=!0};b.prototype.compileNode=function(a){var b,e,d,n,g;(e=this.body.jumps())&&e.error("Class bodies cannot contain pure statements");(b=this.body.contains(Ja))&&b.error("Class bodies shouldn't reference arguments");g=this.determineName();n=new r(g);e=new l([],c.wrap([this.body]));
|
||||
b=[];a.classScope=e.makeScope(a.scope);this.hoistDirectivePrologue();this.setContext(g);this.walkBody(g,a);this.ensureConstructor(g);this.addBoundFunctions(a);this.body.spaced=!0;this.body.expressions.push(n);this.parent&&(g=new r(a.classScope.freeVariable("superClass",{reserve:!1})),this.body.expressions.unshift(new N(n,g)),e.params.push(new W(g)),b.push(this.parent));(d=this.body.expressions).unshift.apply(d,this.directives);d=new C(new f(e,b));this.variable&&(d=new q(this.variable,d,null,{moduleDeclaration:this.moduleDeclaration}));
|
||||
return d.compileToFragments(a)};return b}(a);g.ModuleDeclaration=v=function(a){function b(a,b){this.clause=a;this.source=b;this.checkSource()}na(b,a);b.prototype.children=["clause","source"];b.prototype.isStatement=ja;b.prototype.jumps=ea;b.prototype.makeReturn=ea;b.prototype.checkSource=function(){if(null!=this.source&&this.source instanceof Xa)return this.source.error("the name of the module to be imported from must be an uninterpolated string")};b.prototype.checkScope=function(a,b){if(0!==a.indent.length)return this.error(b+
|
||||
" statements must be at top-level scope")};return b}(a);g.ImportDeclaration=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);b.prototype.compileNode=function(a){var b,e;this.checkScope(a,"import");a.importedSymbols=[];b=[];b.push(this.makeCode(this.tab+"import "));null!=this.clause&&b.push.apply(b,this.clause.compileNode(a));null!=(null!=(e=this.source)?e.value:void 0)&&(null!==this.clause&&b.push(this.makeCode(" from ")),b.push(this.makeCode(this.source.value)));
|
||||
b.push(this.makeCode(";"));return b};return b}(v);g.ImportClause=function(a){function b(a,b){this.defaultBinding=a;this.namedImports=b}na(b,a);b.prototype.children=["defaultBinding","namedImports"];b.prototype.compileNode=function(a){var b;b=[];null!=this.defaultBinding&&(b.push.apply(b,this.defaultBinding.compileNode(a)),null!=this.namedImports&&b.push(this.makeCode(", ")));null!=this.namedImports&&b.push.apply(b,this.namedImports.compileNode(a));return b};return b}(a);g.ExportDeclaration=v=function(a){function b(){return b.__super__.constructor.apply(this,
|
||||
arguments)}na(b,a);b.prototype.compileNode=function(a){var b,e;this.checkScope(a,"export");b=[];b.push(this.makeCode(this.tab+"export "));this instanceof M&&b.push(this.makeCode("default "));this instanceof M||!(this.clause instanceof q||this.clause instanceof D)||(this.clause instanceof D&&!this.clause.variable&&this.clause.error("anonymous classes cannot be exported"),b.push(this.makeCode("var ")),this.clause.moduleDeclaration="export");b=null!=this.clause.body&&this.clause.body instanceof c?b.concat(this.clause.compileToFragments(a,
|
||||
A)):b.concat(this.clause.compileNode(a));null!=(null!=(e=this.source)?e.value:void 0)&&b.push(this.makeCode(" from "+this.source.value));b.push(this.makeCode(";"));return b};return b}(v);g.ExportNamedDeclaration=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);return b}(v);g.ExportDefaultDeclaration=M=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);return b}(v);g.ExportAllDeclaration=function(a){function b(){return b.__super__.constructor.apply(this,
|
||||
arguments)}na(b,a);return b}(v);g.ModuleSpecifierList=v=function(a){function b(a){this.specifiers=a}na(b,a);b.prototype.children=["specifiers"];b.prototype.compileNode=function(a){var b,e,d,c,f;b=[];a.indent+=ca;var n;f=this.specifiers;n=[];d=0;for(c=f.length;d<c;d++)e=f[d],n.push(e.compileToFragments(a,h));if(0!==this.specifiers.length){b.push(this.makeCode("{\n"+a.indent));d=c=0;for(f=n.length;c<f;d=++c)e=n[d],d&&b.push(this.makeCode(",\n"+a.indent)),b.push.apply(b,e);b.push(this.makeCode("\n}"))}else b.push(this.makeCode("{}"));
|
||||
return b};return b}(a);g.ImportSpecifierList=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);return b}(v);g.ExportSpecifierList=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);return b}(v);g.ModuleSpecifier=U=function(a){function b(a,b,e){this.original=a;this.alias=b;this.moduleDeclarationType=e;this.identifier=null!=this.alias?this.alias.value:this.original.value}na(b,a);b.prototype.children=["original","alias"];b.prototype.compileNode=
|
||||
function(a){a.scope.find(this.identifier,this.moduleDeclarationType);a=[];a.push(this.makeCode(this.original.value));null!=this.alias&&a.push(this.makeCode(" as "+this.alias.value));return a};return b}(a);g.ImportSpecifier=v=function(a){function b(a,c){b.__super__.constructor.call(this,a,c,"import")}na(b,a);b.prototype.compileNode=function(a){var c;(c=this.identifier,0<=Ha.call(a.importedSymbols,c))||a.scope.check(this.identifier)?this.error("'"+this.identifier+"' has already been declared"):a.importedSymbols.push(this.identifier);
|
||||
return b.__super__.compileNode.call(this,a)};return b}(U);g.ImportDefaultSpecifier=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);return b}(v);g.ImportNamespaceSpecifier=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);return b}(v);g.ExportSpecifier=function(a){function b(a,c){b.__super__.constructor.call(this,a,c,"export")}na(b,a);return b}(U);g.Assign=q=function(a){function b(a,b,e,d){this.variable=a;this.value=b;this.context=
|
||||
e;null==d&&(d={});this.param=d.param;this.subpattern=d.subpattern;this.operatorToken=d.operatorToken;this.moduleDeclaration=d.moduleDeclaration}na(b,a);b.prototype.children=["variable","value"];b.prototype.isStatement=function(a){return(null!=a?a.level:void 0)===A&&null!=this.context&&(this.moduleDeclaration||0<=Ha.call(this.context,"?"))};b.prototype.checkAssignability=function(a,b){if(Object.prototype.hasOwnProperty.call(a.scope.positions,b.value)&&"import"===a.scope.variables[a.scope.positions[b.value]].type)return b.error("'"+
|
||||
b.value+"' is read-only")};b.prototype.assigns=function(a){return this["object"===this.context?"value":"variable"].assigns(a)};b.prototype.unfoldSoak=function(a){return Na(a,this,"variable")};b.prototype.compileNode=function(a){var b,e,d,c,f,g,n;if(e=this.variable instanceof L){if(this.variable.isArray()||this.variable.isObject())return this.compilePatternMatch(a);if(this.variable.isSplice())return this.compileSplice(a);if("||\x3d"===(c=this.context)||"\x26\x26\x3d"===c||"?\x3d"===c)return this.compileConditional(a);
|
||||
if("**\x3d"===(f=this.context)||"//\x3d"===f||"%%\x3d"===f)return this.compileSpecialMath(a)}this.value instanceof l&&(this.value["static"]?(this.value.klass=this.variable.base,this.value.name=this.variable.properties[0],this.value.variable=this.variable):2<=(null!=(g=this.variable.properties)?g.length:void 0)&&(g=this.variable.properties,c=3<=g.length?Aa.call(g,0,d=g.length-2):(d=0,[]),f=g[d++],d=g[d++],"prototype"===(null!=(n=f.name)?n.value:void 0)&&(this.value.klass=new L(this.variable.base,c),
|
||||
this.value.name=d,this.value.variable=this.variable)));this.context||(n=this.variable.unwrapAll(),n.isAssignable()||this.variable.error("'"+this.variable.compile(a)+"' can't be assigned"),"function"===typeof n.hasProperties&&n.hasProperties()||(this.moduleDeclaration?(this.checkAssignability(a,n),a.scope.add(n.value,this.moduleDeclaration)):this.param?a.scope.add(n.value,"var"):(this.checkAssignability(a,n),a.scope.find(n.value))));n=this.value.compileToFragments(a,h);e&&this.variable.base instanceof
|
||||
z&&(this.variable.front=!0);e=this.variable.compileToFragments(a,h);if("object"===this.context){if(b=Da(e),0<=Ha.call(k,b))e.unshift(this.makeCode('"')),e.push(this.makeCode('"'));return e.concat(this.makeCode(": "),n)}b=e.concat(this.makeCode(" "+(this.context||"\x3d")+" "),n);return a.level<=h?b:this.wrapInBraces(b)};b.prototype.compilePatternMatch=function(a){var c,e,d,f,g,n,k,l,t,p,q,v,u,w,C,z;w=a.level===A;l=this.value;v=this.variable.base.objects;if(!(u=v.length))return e=l.compileToFragments(a),
|
||||
a.level>=y?this.wrapInBraces(e):e;q=v[0];1===u&&q instanceof x&&q.error("Destructuring assignment has no target");n=this.variable.isObject();if(w&&1===u&&!(q instanceof R))return d=null,q instanceof b&&"object"===q.context?(e=q,f=e.variable,g=f.base,q=e.value,q instanceof b&&(d=q.value,q=q.variable)):(q instanceof b&&(d=q.value,q=q.variable),g=n?q["this"]?q.properties[0].name:new Q(q.unwrap().value):new S(0)),c=g.unwrap()instanceof Q,l=new L(l),l.properties.push(new (c?ua:m)(g)),(p=Ga(q.unwrap().value))&&
|
||||
q.error(p),d&&(l=new B("?",l,d)),(new b(q,l,null,{param:this.param})).compileToFragments(a,A);C=l.compileToFragments(a,h);z=Da(C);e=[];f=!1;l.unwrap()instanceof r&&!this.variable.assigns(z)||(e.push([this.makeCode((d=a.scope.freeVariable("ref"))+" \x3d ")].concat(Aa.call(C))),C=[this.makeCode(d)],z=d);d=l=0;for(t=v.length;l<t;d=++l){q=v[d];g=d;if(!f&&q instanceof R)p=q.name.unwrap().value,q=q.unwrap(),g=u+" \x3c\x3d "+z+".length ? "+za("slice",a)+".call("+z+", "+d,(c=u-d-1)?(k=a.scope.freeVariable("i",
|
||||
{single:!0}),g+=", "+k+" \x3d "+z+".length - "+c+") : ("+k+" \x3d "+d+", [])"):g+=") : []",g=new H(g),f=k+"++";else if(!f&&q instanceof x){if(c=u-d-1)1===c?f=z+".length - 1":(k=a.scope.freeVariable("i",{single:!0}),g=new H(k+" \x3d "+z+".length - "+c),f=k+"++",e.push(g.compileToFragments(a,h)));continue}else(q instanceof R||q instanceof x)&&q.error("multiple splats/expansions are disallowed in an assignment"),d=null,q instanceof b&&"object"===q.context?(g=q.variable,g=g.base,q=q.value,q instanceof
|
||||
b&&(d=q.value,q=q.variable)):(q instanceof b&&(d=q.value,q=q.variable),g=n?q["this"]?q.properties[0].name:new Q(q.unwrap().value):new H(f||g)),p=q.unwrap().value,c=g.unwrap()instanceof Q,g=new L(new H(z),[new (c?ua:m)(g)]),d&&(g=new B("?",g,d));null!=p&&(p=Ga(p))&&q.error(p);e.push((new b(q,g,null,{param:this.param,subpattern:!0})).compileToFragments(a,h))}w||this.subpattern||e.push(C);e=this.joinFragmentArrays(e,", ");return a.level<h?e:this.wrapInBraces(e)};b.prototype.compileConditional=function(a){var c,
|
||||
e;e=this.variable.cacheReference(a);c=e[0];e=e[1];c.properties.length||!(c.base instanceof H)||c.base instanceof ga||a.scope.check(c.base.value)||this.variable.error('the variable "'+c.base.value+"\" can't be assigned with "+this.context+" because it has not been declared before");if(0<=Ha.call(this.context,"?"))return a.isExistentialEquals=!0,(new E(new F(c),e,{type:"if"})).addElse(new b(e,this.value,"\x3d")).compileToFragments(a);c=(new B(this.context.slice(0,-1),c,new b(e,this.value,"\x3d"))).compileToFragments(a);
|
||||
return a.level<=h?c:this.wrapInBraces(c)};b.prototype.compileSpecialMath=function(a){var c,e;e=this.variable.cacheReference(a);c=e[0];e=e[1];return(new b(c,new B(this.context.slice(0,-1),e,this.value))).compileToFragments(a)};b.prototype.compileSplice=function(a){var b,e,d,c,f,g;c=this.variable.properties.pop().range;d=c.from;b=c.to;e=c.exclusive;g=this.variable.compile(a);d?(f=this.cacheToCodeFragments(d.cache(a,y)),c=f[0],f=f[1]):c=f="0";b?null!=d&&d.isNumber()&&b.isNumber()?(b=b.compile(a)-f,e||
|
||||
(b+=1)):(b=b.compile(a,t)+" - "+f,e||(b+=" + 1")):b="9e9";e=this.value.cache(a,h);d=e[0];e=e[1];b=[].concat(this.makeCode("[].splice.apply("+g+", ["+c+", "+b+"].concat("),d,this.makeCode(")), "),e);return a.level>A?this.wrapInBraces(b):b};return b}(a);g.Code=l=function(a){function b(a,b,e){this.params=a||[];this.body=b||new c;this.bound="boundfunc"===e;this.isGenerator=!!this.body.contains(function(a){return a instanceof B&&a.isYield()||a instanceof ra})}na(b,a);b.prototype.children=["params","body"];
|
||||
b.prototype.isStatement=function(){return!!this.ctor};b.prototype.jumps=I;b.prototype.makeScope=function(a){return new K(a,this.body,this)};b.prototype.compileNode=function(a){var g,e,d,n,h,k,m,l,p,y,A,u,v;this.bound&&null!=(e=a.scope.method)&&e.bound&&(this.context=a.scope.method.context);if(this.bound&&!this.context)return this.context="_this",e=new b([new W(new r(this.context))],new c([this])),e=new f(e,[new ga]),e.updateLocationDataIfMissing(this.locationData),e.compileNode(a);a.scope=ma(a,"classScope")||
|
||||
this.makeScope(a.scope);a.scope.shared=ma(a,"sharedScope");a.indent+=ca;delete a.bare;delete a.isExistentialEquals;e=[];g=[];l=this.params;n=0;for(k=l.length;n<k;n++)m=l[n],m instanceof x||a.scope.parameter(m.asReference(a));l=this.params;n=0;for(k=l.length;n<k;n++)if(m=l[n],m.splat||m instanceof x){n=this.params;h=0;for(m=n.length;h<m;h++)p=n[h],p instanceof x||!p.name.value||a.scope.add(p.name.value,"var",!0);h=new q(new L(new qa(function(){var b,d,e,c;e=this.params;c=[];d=0;for(b=e.length;d<b;d++)p=
|
||||
e[d],c.push(p.asReference(a));return c}.call(this))),new L(new r("arguments")));break}A=this.params;l=0;for(n=A.length;l<n;l++)m=A[l],m.isComplex()?(v=y=m.asReference(a),m.value&&(v=new B("?",y,m.value)),g.push(new q(new L(m.name),v,"\x3d",{param:!0}))):(y=m,m.value&&(k=new H(y.name.value+" \x3d\x3d null"),v=new q(new L(m.name),m.value,"\x3d"),g.push(new E(k,v)))),h||e.push(y);m=this.body.isEmpty();h&&g.unshift(h);g.length&&(d=this.body.expressions).unshift.apply(d,g);d=h=0;for(g=e.length;h<g;d=++h)p=
|
||||
e[d],e[d]=p.compileToFragments(a),a.scope.parameter(Da(e[d]));u=[];this.eachParamName(function(a,b){0<=Ha.call(u,a)&&b.error("multiple parameters named "+a);return u.push(a)});m||this.noReturn||this.body.makeReturn();d="function";this.isGenerator&&(d+="*");this.ctor&&(d+=" "+this.name);g=[this.makeCode(d+"(")];d=m=0;for(h=e.length;m<h;d=++m)p=e[d],d&&g.push(this.makeCode(", ")),g.push.apply(g,p);g.push(this.makeCode(") {"));this.body.isEmpty()||(g=g.concat(this.makeCode("\n"),this.body.compileWithDeclarations(a),
|
||||
this.makeCode("\n"+this.tab)));g.push(this.makeCode("}"));return this.ctor?[this.makeCode(this.tab)].concat(Aa.call(g)):this.front||a.level>=t?this.wrapInBraces(g):g};b.prototype.eachParamName=function(a){var b,e,d,c,f;c=this.params;f=[];b=0;for(e=c.length;b<e;b++)d=c[b],f.push(d.eachName(a));return f};b.prototype.traverseChildren=function(a,c){if(a)return b.__super__.traverseChildren.call(this,a,c)};return b}(a);g.Param=W=function(a){function b(a,b,e){this.name=a;this.value=b;this.splat=e;(a=Ga(this.name.unwrapAll().value))&&
|
||||
this.name.error(a);this.name instanceof z&&this.name.generated&&(a=this.name.objects[0].operatorToken,a.error("unexpected "+a.value))}na(b,a);b.prototype.children=["name","value"];b.prototype.compileToFragments=function(a){return this.name.compileToFragments(a,h)};b.prototype.asReference=function(a){var b;if(this.reference)return this.reference;b=this.name;b["this"]?(b=b.properties[0].name.value,0<=Ha.call(k,b)&&(b="_"+b),b=new r(a.scope.freeVariable(b))):b.isComplex()&&(b=new r(a.scope.freeVariable("arg")));
|
||||
b=new L(b);this.splat&&(b=new R(b));b.updateLocationDataIfMissing(this.locationData);return this.reference=b};b.prototype.isComplex=function(){return this.name.isComplex()};b.prototype.eachName=function(a,b){var e,d,c,f;null==b&&(b=this.name);e=function(b){return a("@"+b.properties[0].name.value,b)};if(b instanceof H)return a(b.value,b);if(b instanceof L)return e(b);b=null!=(d=b.objects)?d:[];d=0;for(c=b.length;d<c;d++)f=b[d],f instanceof q&&null==f.context&&(f=f.variable),f instanceof q?(f.value instanceof
|
||||
q&&(f=f.value),this.eachName(a,f.value.unwrap())):f instanceof R?(f=f.name.unwrap(),a(f.value,f)):f instanceof L?f.isArray()||f.isObject()?this.eachName(a,f.base):f["this"]?e(f):a(f.base.value,f.base):f instanceof x||f.error("illegal parameter "+f.compile())};return b}(a);g.Splat=R=function(a){function b(a){this.name=a.compile?a:new H(a)}na(b,a);b.prototype.children=["name"];b.prototype.isAssignable=ja;b.prototype.assigns=function(a){return this.name.assigns(a)};b.prototype.compileToFragments=function(a){return this.name.compileToFragments(a)};
|
||||
b.prototype.unwrap=function(){return this.name};b.compileSplattedArray=function(a,c,e){var d,f,g,n,k,m;for(n=-1;(d=c[++n])&&!(d instanceof b););if(n>=c.length)return[];if(1===c.length)return d=c[0],c=d.compileToFragments(a,h),e?c:[].concat(d.makeCode(za("slice",a)+".call("),c,d.makeCode(")"));e=c.slice(n);g=k=0;for(m=e.length;k<m;g=++k)d=e[g],f=d.compileToFragments(a,h),e[g]=d instanceof b?[].concat(d.makeCode(za("slice",a)+".call("),f,d.makeCode(")")):[].concat(d.makeCode("["),f,d.makeCode("]"));
|
||||
if(0===n)return d=c[0],a=d.joinFragmentArrays(e.slice(1),", "),e[0].concat(d.makeCode(".concat("),a,d.makeCode(")"));k=c.slice(0,n);m=[];f=0;for(g=k.length;f<g;f++)d=k[f],m.push(d.compileToFragments(a,h));d=c[0].joinFragmentArrays(m,", ");a=c[n].joinFragmentArrays(e,", ");e=c[c.length-1];return[].concat(c[0].makeCode("["),d,c[n].makeCode("].concat("),a,e.makeCode(")"))};return b}(a);g.Expansion=x=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);b.prototype.isComplex=
|
||||
I;b.prototype.compileNode=function(a){return this.error("Expansion must be used inside a destructuring assignment or parameter list")};b.prototype.asReference=function(a){return this};b.prototype.eachName=function(a){};return b}(a);g.While=v=function(a){function b(a,b){this.condition=null!=b&&b.invert?a.invert():a;this.guard=null!=b?b.guard:void 0}na(b,a);b.prototype.children=["condition","guard","body"];b.prototype.isStatement=ja;b.prototype.makeReturn=function(a){if(a)return b.__super__.makeReturn.apply(this,
|
||||
arguments);this.returns=!this.jumps({loop:!0});return this};b.prototype.addBody=function(a){this.body=a;return this};b.prototype.jumps=function(){var a,b,e,d;a=this.body.expressions;if(!a.length)return!1;b=0;for(d=a.length;b<d;b++)if(e=a[b],e=e.jumps({loop:!0}))return e;return!1};b.prototype.compileNode=function(a){var b,e,d;a.indent+=ca;d="";b=this.body;b.isEmpty()?b=this.makeCode(""):(this.returns&&(b.makeReturn(e=a.scope.freeVariable("results")),d=""+this.tab+e+" \x3d [];\n"),this.guard&&(1<b.expressions.length?
|
||||
b.expressions.unshift(new E((new C(this.guard)).invert(),new ya("continue"))):this.guard&&(b=c.wrap([new E(this.guard,b)]))),b=[].concat(this.makeCode("\n"),b.compileToFragments(a,A),this.makeCode("\n"+this.tab)));a=[].concat(this.makeCode(d+this.tab+"while ("),this.condition.compileToFragments(a,P),this.makeCode(") {"),b,this.makeCode("}"));this.returns&&a.push(this.makeCode("\n"+this.tab+"return "+e+";"));return a};return b}(a);g.Op=B=function(a){function b(a,b,g,n){if("in"===a)return new O(b,g);
|
||||
if("do"===a)return this.generateDo(b);if("new"===a){if(b instanceof f&&!b["do"]&&!b.isNew)return b.newInstance();if(b instanceof l&&b.bound||b["do"])b=new C(b)}this.operator=c[a]||a;this.first=b;this.second=g;this.flip=!!n;return this}var c,g;na(b,a);c={"\x3d\x3d":"\x3d\x3d\x3d","!\x3d":"!\x3d\x3d",of:"in",yieldfrom:"yield*"};g={"!\x3d\x3d":"\x3d\x3d\x3d","\x3d\x3d\x3d":"!\x3d\x3d"};b.prototype.children=["first","second"];b.prototype.isNumber=function(){var a;return this.isUnary()&&("+"===(a=this.operator)||
|
||||
"-"===a)&&this.first instanceof L&&this.first.isNumber()};b.prototype.isYield=function(){var a;return"yield"===(a=this.operator)||"yield*"===a};b.prototype.isUnary=function(){return!this.second};b.prototype.isComplex=function(){return!this.isNumber()};b.prototype.isChainable=function(){var a;return"\x3c"===(a=this.operator)||"\x3e"===a||"\x3e\x3d"===a||"\x3c\x3d"===a||"\x3d\x3d\x3d"===a||"!\x3d\x3d"===a};b.prototype.invert=function(){var a,d,c;if(this.isChainable()&&this.first.isChainable()){a=!0;
|
||||
for(d=this;d&&d.operator;)a&&(a=d.operator in g),d=d.first;if(!a)return(new C(this)).invert();for(d=this;d&&d.operator;)d.invert=!d.invert,d.operator=g[d.operator],d=d.first;return this}return(d=g[this.operator])?(this.operator=d,this.first.unwrap()instanceof b&&this.first.invert(),this):this.second?(new C(this)).invert():"!"===this.operator&&(a=this.first.unwrap())instanceof b&&("!"===(c=a.operator)||"in"===c||"instanceof"===c)?a:new b("!",this)};b.prototype.unfoldSoak=function(a){var b;return("++"===
|
||||
(b=this.operator)||"--"===b||"delete"===b)&&Na(a,this,"first")};b.prototype.generateDo=function(a){var b,e,c,g,n;g=[];n=(a instanceof q&&(b=a.value.unwrap())instanceof l?b:a).params||[];b=0;for(e=n.length;b<e;b++)c=n[b],c.value?(g.push(c.value),delete c.value):g.push(c);a=new f(a,g);a["do"]=!0;return a};b.prototype.compileNode=function(a){var b,e;b=this.isChainable()&&this.first.isChainable();b||(this.first.front=this.front);"delete"===this.operator&&a.scope.check(this.first.unwrapAll().value)&&this.error("delete operand may not be argument or var");
|
||||
("--"===(e=this.operator)||"++"===e)&&(e=Ga(this.first.unwrapAll().value))&&this.first.error(e);if(this.isYield())return this.compileYield(a);if(this.isUnary())return this.compileUnary(a);if(b)return this.compileChain(a);switch(this.operator){case "?":return this.compileExistence(a);case "**":return this.compilePower(a);case "//":return this.compileFloorDivision(a);case "%%":return this.compileModulo(a);default:return b=this.first.compileToFragments(a,y),e=this.second.compileToFragments(a,y),b=[].concat(b,
|
||||
this.makeCode(" "+this.operator+" "),e),a.level<=y?b:this.wrapInBraces(b)}};b.prototype.compileChain=function(a){var b;b=this.first.second.cache(a);this.first.second=b[0];b=b[1];a=this.first.compileToFragments(a,y).concat(this.makeCode(" "+(this.invert?"\x26\x26":"||")+" "),b.compileToFragments(a),this.makeCode(" "+this.operator+" "),this.second.compileToFragments(a,y));return this.wrapInBraces(a)};b.prototype.compileExistence=function(a){var b,e;this.first.isComplex()?(e=new r(a.scope.freeVariable("ref")),
|
||||
b=new C(new q(e,this.first))):e=b=this.first;return(new E(new F(b),e,{type:"if"})).addElse(this.second).compileToFragments(a)};b.prototype.compileUnary=function(a){var d,e,c;e=[];d=this.operator;e.push([this.makeCode(d)]);if("!"===d&&this.first instanceof F)return this.first.negated=!this.first.negated,this.first.compileToFragments(a);if(a.level>=t)return(new C(this)).compileToFragments(a);c="+"===d||"-"===d;("new"===d||"typeof"===d||"delete"===d||c&&this.first instanceof b&&this.first.operator===
|
||||
d)&&e.push([this.makeCode(" ")]);if(c&&this.first instanceof b||"new"===d&&this.first.isStatement(a))this.first=new C(this.first);e.push(this.first.compileToFragments(a,y));this.flip&&e.reverse();return this.joinFragmentArrays(e,"")};b.prototype.compileYield=function(a){var b,e,c;e=[];b=this.operator;null==a.scope.parent&&this.error("yield can only occur inside functions");0<=Ha.call(Object.keys(this.first),"expression")&&!(this.first instanceof ha)?null!=this.first.expression&&e.push(this.first.expression.compileToFragments(a,
|
||||
y)):(a.level>=P&&e.push([this.makeCode("(")]),e.push([this.makeCode(b)]),""!==(null!=(c=this.first.base)?c.value:void 0)&&e.push([this.makeCode(" ")]),e.push(this.first.compileToFragments(a,y)),a.level>=P&&e.push([this.makeCode(")")]));return this.joinFragmentArrays(e,"")};b.prototype.compilePower=function(a){var b;b=new L(new r("Math"),[new ua(new Q("pow"))]);return(new f(b,[this.first,this.second])).compileToFragments(a)};b.prototype.compileFloorDivision=function(a){var d,e;e=new L(new r("Math"),
|
||||
[new ua(new Q("floor"))]);d=this.second.isComplex()?new C(this.second):this.second;d=new b("/",this.first,d);return(new f(e,[d])).compileToFragments(a)};b.prototype.compileModulo=function(a){var b;b=new L(new H(za("modulo",a)));return(new f(b,[this.first,this.second])).compileToFragments(a)};b.prototype.toString=function(a){return b.__super__.toString.call(this,a,this.constructor.name+" "+this.operator)};return b}(a);g.In=O=function(a){function b(a,b){this.object=a;this.array=b}na(b,a);b.prototype.children=
|
||||
["object","array"];b.prototype.invert=T;b.prototype.compileNode=function(a){var b,e,d,c,f;if(this.array instanceof L&&this.array.isArray()&&this.array.base.objects.length){f=this.array.base.objects;e=0;for(d=f.length;e<d;e++)if(c=f[e],c instanceof R){b=!0;break}if(!b)return this.compileOrTest(a)}return this.compileLoopTest(a)};b.prototype.compileOrTest=function(a){var b,e,d,c,f,g,n,h,k,m;b=this.object.cache(a,y);k=b[0];n=b[1];e=this.negated?[" !\x3d\x3d "," \x26\x26 "]:[" \x3d\x3d\x3d "," || "];b=
|
||||
e[0];e=e[1];m=[];h=this.array.base.objects;d=f=0;for(g=h.length;f<g;d=++f)c=h[d],d&&m.push(this.makeCode(e)),m=m.concat(d?n:k,this.makeCode(b),c.compileToFragments(a,t));return a.level<y?m:this.wrapInBraces(m)};b.prototype.compileLoopTest=function(a){var b,e,d;b=this.object.cache(a,h);d=b[0];e=b[1];b=[].concat(this.makeCode(za("indexOf",a)+".call("),this.array.compileToFragments(a,h),this.makeCode(", "),e,this.makeCode(") "+(this.negated?"\x3c 0":"\x3e\x3d 0")));if(Da(d)===Da(e))return b;b=d.concat(this.makeCode(", "),
|
||||
b);return a.level<h?b:this.wrapInBraces(b)};b.prototype.toString=function(a){return b.__super__.toString.call(this,a,this.constructor.name+(this.negated?"!":""))};return b}(a);g.Try=function(a){function b(a,b,e,d){this.attempt=a;this.errorVariable=b;this.recovery=e;this.ensure=d}na(b,a);b.prototype.children=["attempt","recovery","ensure"];b.prototype.isStatement=ja;b.prototype.jumps=function(a){var b;return this.attempt.jumps(a)||(null!=(b=this.recovery)?b.jumps(a):void 0)};b.prototype.makeReturn=
|
||||
function(a){this.attempt&&(this.attempt=this.attempt.makeReturn(a));this.recovery&&(this.recovery=this.recovery.makeReturn(a));return this};b.prototype.compileNode=function(a){var b,e,d,c,f;a.indent+=ca;f=this.attempt.compileToFragments(a,A);b=this.recovery?(e=a.scope.freeVariable("error",{reserve:!1}),c=new r(e),this.errorVariable?(d=Ga(this.errorVariable.unwrapAll().value),d?this.errorVariable.error(d):void 0,this.recovery.unshift(new q(this.errorVariable,c))):void 0,[].concat(this.makeCode(" catch ("),
|
||||
c.compileToFragments(a),this.makeCode(") {\n"),this.recovery.compileToFragments(a,A),this.makeCode("\n"+this.tab+"}"))):this.ensure||this.recovery?[]:(e=a.scope.freeVariable("error",{reserve:!1}),[this.makeCode(" catch ("+e+") {}")]);a=this.ensure?[].concat(this.makeCode(" finally {\n"),this.ensure.compileToFragments(a,A),this.makeCode("\n"+this.tab+"}")):[];return[].concat(this.makeCode(this.tab+"try {\n"),f,this.makeCode("\n"+this.tab+"}"),b,a)};return b}(a);g.Throw=ha=function(a){function b(a){this.expression=
|
||||
a}na(b,a);b.prototype.children=["expression"];b.prototype.isStatement=ja;b.prototype.jumps=I;b.prototype.makeReturn=ea;b.prototype.compileNode=function(a){return[].concat(this.makeCode(this.tab+"throw "),this.expression.compileToFragments(a),this.makeCode(";"))};return b}(a);g.Existence=F=function(a){function b(a){this.expression=a}na(b,a);b.prototype.children=["expression"];b.prototype.invert=T;b.prototype.compileNode=function(a){var b,e,d;this.expression.front=this.front;d=this.expression.compile(a,
|
||||
y);this.expression.unwrap()instanceof r&&!a.scope.check(d)?(e=this.negated?["\x3d\x3d\x3d","||"]:["!\x3d\x3d","\x26\x26"],b=e[0],e=e[1],d="typeof "+d+" "+b+' "undefined" '+e+" "+d+" "+b+" null"):d=d+" "+(this.negated?"\x3d\x3d":"!\x3d")+" null";return[this.makeCode(a.level<=p?d:"("+d+")")]};return b}(a);g.Parens=C=function(a){function b(a){this.body=a}na(b,a);b.prototype.children=["body"];b.prototype.unwrap=function(){return this.body};b.prototype.isComplex=function(){return this.body.isComplex()};
|
||||
b.prototype.compileNode=function(a){var b,e;b=this.body.unwrap();if(b instanceof L&&b.isAtomic())return b.front=this.front,b.compileToFragments(a);e=b.compileToFragments(a,P);return a.level<y&&(b instanceof B||b instanceof f||b instanceof J&&b.returns)?e:this.wrapInBraces(e)};return b}(a);g.StringWithInterpolations=Xa=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}na(b,a);b.prototype.compileNode=function(a){var c,e,d,f,g;if(!a.inTaggedTemplateCall)return b.__super__.compileNode.apply(this,
|
||||
arguments);d=this.body.unwrap();e=[];d.traverseChildren(!1,function(a){if(a instanceof $a)e.push(a);else if(a instanceof C)return e.push(a),!1;return!0});d=[];d.push(this.makeCode("`"));f=0;for(g=e.length;f<g;f++)c=e[f],c instanceof $a?(c=c.value.slice(1,-1),c=c.replace(/(\\*)(`|\$\{)/g,function(a,b,d){return 0===b.length%2?b+"\\"+d:a}),d.push(this.makeCode(c))):(d.push(this.makeCode("${")),d.push.apply(d,c.compileToFragments(a,P)),d.push(this.makeCode("}")));d.push(this.makeCode("`"));return d};
|
||||
return b}(C);g.For=J=function(a){function b(a,b){this.source=b.source;this.guard=b.guard;this.step=b.step;this.name=b.name;this.index=b.index;this.body=c.wrap([a]);this.own=!!b.own;this.object=!!b.object;(this.from=!!b.from)&&this.index&&this.index.error("cannot use index with for-from");this.own&&!this.object&&b.ownTag.error("cannot use own with for-"+(this.from?"from":"in"));this.object&&(a=[this.index,this.name],this.name=a[0],this.index=a[1]);this.index instanceof L&&!this.index.isAssignable()&&
|
||||
this.index.error("index cannot be a pattern matching expression");this.range=this.source instanceof L&&this.source.base instanceof X&&!this.source.properties.length&&!this.from;this.pattern=this.name instanceof L;this.range&&this.index&&this.index.error("indexes do not apply to range loops");this.range&&this.pattern&&this.name.error("cannot pattern match over range loops");this.returns=!1}na(b,a);b.prototype.children=["body","source","guard","step"];b.prototype.compileNode=function(a){var b,e,d,f,
|
||||
g,k,n,m,l,t,p,y,v,u,w,z,B,x,D,I,P;b=c.wrap([this.body]);l=b.expressions;l=l[l.length-1];(null!=l?l.jumps():void 0)instanceof V&&(this.returns=!1);w=this.range?this.source.base:this.source;d=a.scope;this.pattern||(m=this.name&&this.name.compile(a,h));l=this.index&&this.index.compile(a,h);m&&!this.pattern&&d.find(m);!l||this.index instanceof L||d.find(l);this.returns&&(n=d.freeVariable("results"));this.from?this.pattern&&(p=d.freeVariable("x",{single:!0})):p=this.object&&l||d.freeVariable("i",{single:!0});
|
||||
y=(this.range||this.from)&&m||l||p;v=y!==p?y+" \x3d ":"";this.step&&!this.range&&(l=this.cacheToCodeFragments(this.step.cache(a,h,ta)),g=l[0],D=l[1],this.step.isNumber()&&(x=Number(D)));this.pattern&&(m=p);k=l=P="";t=this.tab+ca;this.range?f=w.compileToFragments(Fa(a,{index:p,name:m,step:this.step,isComplex:ta})):(I=this.source.compile(a,h),!m&&!this.own||this.source.unwrap()instanceof r||(k+=""+this.tab+(w=d.freeVariable("ref"))+" \x3d "+I+";\n",I=w),!m||this.pattern||this.from||(u=m+" \x3d "+I+
|
||||
"["+y+"]"),this.object||this.from||(g!==D&&(k+=""+this.tab+g+";\n"),m=0>x,this.step&&null!=x&&m||(e=d.freeVariable("len")),f=""+v+p+" \x3d 0, "+e+" \x3d "+I+".length",g=""+v+p+" \x3d "+I+".length - 1",e=p+" \x3c "+e,d=p+" \x3e\x3d 0",this.step?(null!=x?m&&(e=d,f=g):(e=D+" \x3e 0 ? "+e+" : "+d,f="("+D+" \x3e 0 ? ("+f+") : "+g+")"),p=p+" +\x3d "+D):p=""+(y!==p?"++"+p:p+"++"),f=[this.makeCode(f+"; "+e+"; "+v+p)]));this.returns&&(z=""+this.tab+n+" \x3d [];\n",B="\n"+this.tab+"return "+n+";",b.makeReturn(n));
|
||||
this.guard&&(1<b.expressions.length?b.expressions.unshift(new E((new C(this.guard)).invert(),new ya("continue"))):this.guard&&(b=c.wrap([new E(this.guard,b)])));this.pattern&&b.expressions.unshift(new q(this.name,this.from?new r(y):new H(I+"["+y+"]")));n=[].concat(this.makeCode(k),this.pluckDirectCall(a,b));u&&(P="\n"+t+u+";");this.object?(f=[this.makeCode(y+" in "+I)],this.own&&(l="\n"+t+"if (!"+za("hasProp",a)+".call("+I+", "+y+")) continue;")):this.from&&(f=[this.makeCode(y+" of "+I)]);(a=b.compileToFragments(Fa(a,
|
||||
{indent:t}),A))&&0<a.length&&(a=[].concat(this.makeCode("\n"),a,this.makeCode("\n")));return[].concat(n,this.makeCode(""+(z||"")+this.tab+"for ("),f,this.makeCode(") {"+l+P),a,this.makeCode(this.tab+"}"+(B||"")))};b.prototype.pluckDirectCall=function(a,b){var c,d,g,k,h,m,n,p,t,y,v,u,w,z,x;d=[];t=b.expressions;h=m=0;for(n=t.length;m<n;h=++m)if(g=t[h],g=g.unwrapAll(),g instanceof f&&(x=null!=(y=g.variable)?y.unwrapAll():void 0,x instanceof l||x instanceof L&&(null!=(v=x.base)?v.unwrapAll():void 0)instanceof
|
||||
l&&1===x.properties.length&&("call"===(u=null!=(w=x.properties[0].name)?w.value:void 0)||"apply"===u)))k=(null!=(z=x.base)?z.unwrapAll():void 0)||x,p=new r(a.scope.freeVariable("fn")),c=new L(p),x.base&&(c=[c,x],x.base=c[0],c=c[1]),b.expressions[h]=new f(c,g.args),d=d.concat(this.makeCode(this.tab),(new q(p,k)).compileToFragments(a,A),this.makeCode(";\n"));return d};return b}(v);g.Switch=function(a){function b(a,b,c){this.subject=a;this.cases=b;this.otherwise=c}na(b,a);b.prototype.children=["subject",
|
||||
"cases","otherwise"];b.prototype.isStatement=ja;b.prototype.jumps=function(a){var b,c,d,f,g;null==a&&(a={block:!0});f=this.cases;c=0;for(d=f.length;c<d;c++)if(b=f[c],b=b[1],b=b.jumps(a))return b;return null!=(g=this.otherwise)?g.jumps(a):void 0};b.prototype.makeReturn=function(a){var b,e,d,f,g;f=this.cases;b=0;for(e=f.length;b<e;b++)d=f[b],d[1].makeReturn(a);a&&(this.otherwise||(this.otherwise=new c([new H("void 0")])));null!=(g=this.otherwise)&&g.makeReturn(a);return this};b.prototype.compileNode=
|
||||
function(a){var b,c,d,f,g,k,h,m,n,l,p,t,q;h=a.indent+ca;m=a.indent=h+ca;k=[].concat(this.makeCode(this.tab+"switch ("),this.subject?this.subject.compileToFragments(a,P):this.makeCode("false"),this.makeCode(") {\n"));t=this.cases;g=n=0;for(l=t.length;n<l;g=++n){b=t[g];f=b[0];b=b[1];q=ia([f]);f=0;for(p=q.length;f<p;f++)d=q[f],this.subject||(d=d.invert()),k=k.concat(this.makeCode(h+"case "),d.compileToFragments(a,P),this.makeCode(":\n"));0<(c=b.compileToFragments(a,A)).length&&(k=k.concat(c,this.makeCode("\n")));
|
||||
if(g===this.cases.length-1&&!this.otherwise)break;g=this.lastNonComment(b.expressions);g instanceof V||g instanceof H&&g.jumps()&&"debugger"!==g.value||k.push(d.makeCode(m+"break;\n"))}this.otherwise&&this.otherwise.expressions.length&&k.push.apply(k,[this.makeCode(h+"default:\n")].concat(Aa.call(this.otherwise.compileToFragments(a,A)),[this.makeCode("\n")]));k.push(this.makeCode(this.tab+"}"));return k};return b}(a);g.If=E=function(a){function b(a,b,c){this.body=b;null==c&&(c={});this.condition=
|
||||
"unless"===c.type?a.invert():a;this.elseBody=null;this.isChain=!1;this.soak=c.soak}na(b,a);b.prototype.children=["condition","body","elseBody"];b.prototype.bodyNode=function(){var a;return null!=(a=this.body)?a.unwrap():void 0};b.prototype.elseBodyNode=function(){var a;return null!=(a=this.elseBody)?a.unwrap():void 0};b.prototype.addElse=function(a){this.isChain?this.elseBodyNode().addElse(a):(this.isChain=a instanceof b,this.elseBody=this.ensureBlock(a),this.elseBody.updateLocationDataIfMissing(a.locationData));
|
||||
return this};b.prototype.isStatement=function(a){var b;return(null!=a?a.level:void 0)===A||this.bodyNode().isStatement(a)||(null!=(b=this.elseBodyNode())?b.isStatement(a):void 0)};b.prototype.jumps=function(a){var b;return this.body.jumps(a)||(null!=(b=this.elseBody)?b.jumps(a):void 0)};b.prototype.compileNode=function(a){return this.isStatement(a)?this.compileStatement(a):this.compileExpression(a)};b.prototype.makeReturn=function(a){a&&(this.elseBody||(this.elseBody=new c([new H("void 0")])));this.body&&
|
||||
(this.body=new c([this.body.makeReturn(a)]));this.elseBody&&(this.elseBody=new c([this.elseBody.makeReturn(a)]));return this};b.prototype.ensureBlock=function(a){return a instanceof c?a:new c([a])};b.prototype.compileStatement=function(a){var c,e,d,f;c=ma(a,"chainChild");if(ma(a,"isExistentialEquals"))return(new b(this.condition.invert(),this.elseBodyNode(),{type:"if"})).compileToFragments(a);f=a.indent+ca;d=this.condition.compileToFragments(a,P);e=this.ensureBlock(this.body).compileToFragments(Fa(a,
|
||||
{indent:f}));e=[].concat(this.makeCode("if ("),d,this.makeCode(") {\n"),e,this.makeCode("\n"+this.tab+"}"));c||e.unshift(this.makeCode(this.tab));if(!this.elseBody)return e;c=e.concat(this.makeCode(" else "));this.isChain?(a.chainChild=!0,c=c.concat(this.elseBody.unwrap().compileToFragments(a,A))):c=c.concat(this.makeCode("{\n"),this.elseBody.compileToFragments(Fa(a,{indent:f}),A),this.makeCode("\n"+this.tab+"}"));return c};b.prototype.compileExpression=function(a){var b,c,d;d=this.condition.compileToFragments(a,
|
||||
p);c=this.bodyNode().compileToFragments(a,h);b=this.elseBodyNode()?this.elseBodyNode().compileToFragments(a,h):[this.makeCode("void 0")];b=d.concat(this.makeCode(" ? "),c,this.makeCode(" : "),b);return a.level>=p?this.wrapInBraces(b):b};b.prototype.unfoldSoak=function(){return this.soak&&this};return b}(a);la={extend:function(a){return"function(child, parent) { for (var key in parent) { if ("+za("hasProp",a)+".call(parent, key)) child[key] \x3d parent[key]; } function ctor() { this.constructor \x3d child; } ctor.prototype \x3d parent.prototype; child.prototype \x3d new ctor(); child.__super__ \x3d parent.prototype; return child; }"},
|
||||
bind:function(){return"function(fn, me){ return function(){ return fn.apply(me, arguments); }; }"},indexOf:function(){return"[].indexOf || function(item) { for (var i \x3d 0, l \x3d this.length; i \x3c l; i++) { if (i in this \x26\x26 this[i] \x3d\x3d\x3d item) return i; } return -1; }"},modulo:function(){return"function(a, b) { return (+a % (b \x3d +b) + b) % b; }"},hasProp:function(){return"{}.hasOwnProperty"},slice:function(){return"[].slice"}};A=1;P=2;h=3;p=4;y=5;t=6;ca=" ";Z=/^[+-]?\d+$/;za=
|
||||
function(a,b){var c,f;f=b.scope.root;if(a in f.utilities)return f.utilities[a];c=f.freeVariable(a);f.assign(c,la[a](b));return f.utilities[a]=c};Pa=function(a,b){a=a.replace(/\n/g,"$\x26"+b);return a.replace(/\s+$/,"")};Ja=function(a){return a instanceof r&&"arguments"===a.value};Ta=function(a){return a instanceof ga||a instanceof l&&a.bound||a instanceof ka};ta=function(a){return a.isComplex()||("function"===typeof a.isAssignable?a.isAssignable():void 0)};Na=function(a,b,c){if(a=b[c].unfoldSoak(a))return b[c]=
|
||||
a.body,a.body=new L(b),a}}).call(this);return g}();u["./sourcemap"]=function(){var g={};(function(){var u;u=function(){function g(g){this.line=g;this.columns=[]}g.prototype.add=function(g,a,c){var q;q=a[0];a=a[1];null==c&&(c={});if(!this.columns[g]||!c.noReplace)return this.columns[g]={line:this.line,column:g,sourceLine:q,sourceColumn:a}};g.prototype.sourceLocation=function(g){for(var a;!((a=this.columns[g])||0>=g);)g--;return a&&[a.sourceLine,a.sourceColumn]};return g}();g=function(){function g(){this.lines=
|
||||
[]}g.prototype.add=function(g,a,c){var q,f;null==c&&(c={});f=a[0];a=a[1];return((q=this.lines)[f]||(q[f]=new u(f))).add(a,g,c)};g.prototype.sourceLocation=function(g){var a,c;a=g[0];for(g=g[1];!((c=this.lines[a])||0>=a);)a--;return c&&c.sourceLocation(g)};g.prototype.generate=function(g,a){var c,q,f,u,l,w,G,F,x,v,M,N,J;null==g&&(g={});null==a&&(a=null);l=w=u=J=0;v=!1;c="";M=this.lines;f=q=0;for(G=M.length;q<G;f=++q)if(f=M[f])for(N=f.columns,f=0,F=N.length;f<F;f++)if(x=N[f]){for(;J<x.line;)u=0,v=!1,
|
||||
c+=";",J++;v&&(c+=",");c+=this.encodeVlq(x.column-u);u=x.column;c+=this.encodeVlq(0);c+=this.encodeVlq(x.sourceLine-w);w=x.sourceLine;c+=this.encodeVlq(x.sourceColumn-l);l=x.sourceColumn;v=!0}c={version:3,file:g.generatedFile||"",sourceRoot:g.sourceRoot||"",sources:g.sourceFiles||[""],names:[],mappings:c};g.inlineMap&&(c.sourcesContent=[a]);return c};g.prototype.encodeVlq=function(g){var a,c;a="";for(c=(Math.abs(g)<<1)+(0>g?1:0);c||!a;)g=c&31,(c>>=5)&&(g|=32),a+=this.encodeBase64(g);return a};g.prototype.encodeBase64=
|
||||
function(g){var a;if(!(a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[g]))throw Error("Cannot Base64 encode value: "+g);return a};return g}()}).call(this);return g}();u["./coffee-script"]=function(){var g={};(function(){var qa,xa,q,a,c,Ca,f,D,l,w,G,F,x,v,M,N,J,r,E,O={}.hasOwnProperty;D=u("fs");E=u("vm");M=u("path");qa=u("./lexer").Lexer;v=u("./parser").parser;w=u("./helpers");xa=u("./sourcemap");c=u("../../package.json");g.VERSION=c.version;g.FILE_EXTENSIONS=[".coffee",".litcoffee",
|
||||
".coffee.md"];g.helpers=w;q=function(a){switch(!1){case "function"!==typeof Buffer:return(new Buffer(a)).toString("base64");case "function"!==typeof btoa:return btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(a,c){return String.fromCharCode("0x"+c)}));default:throw Error("Unable to base64 encode inline sourcemap.");}};c=function(a){return function(c,f){null==f&&(f={});try{return a.call(this,c,f)}catch(p){if("string"!==typeof c)throw p;throw w.updateSyntaxError(p,c,f.filename);}}};r=
|
||||
{};J={};g.compile=a=c(function(a,c){var f,g,h,k,m,l,u,D,E,I,F,G,z;h=w.extend;c=h({},c);l=c.sourceMap||c.inlineMap||null==c.filename;h=c.filename||"\x3canonymous\x3e";r[h]=a;l&&(I=new xa);g=x.tokenize(a,c);k=c;E=[];m=0;for(u=g.length;m<u;m++)f=g[m],"IDENTIFIER"===f[0]&&E.push(f[1]);k.referencedVars=E;if(null==c.bare||!0!==c.bare)for(k=0,m=g.length;k<m;k++)if(f=g[k],"IMPORT"===(D=f[0])||"EXPORT"===D){c.bare=!0;break}m=v.parse(g).compileToFragments(c);g=0;c.header&&(g+=1);c.shiftLine&&(g+=1);f=0;D="";
|
||||
u=0;for(E=m.length;u<E;u++)k=m[u],l&&(k.locationData&&!/^[;\s]*$/.test(k.code)&&I.add([k.locationData.first_line,k.locationData.first_column],[g,f],{noReplace:!0}),F=w.count(k.code,"\n"),g+=F,f=F?k.code.length-(k.code.lastIndexOf("\n")+1):f+k.code.length),D+=k.code;c.header&&(f="Generated by CoffeeScript "+this.VERSION,D="// "+f+"\n"+D);l&&(z=I.generate(c,a),J[h]=I);c.inlineMap&&(a=q(JSON.stringify(z)),h="//# sourceURL\x3d"+(null!=(G=c.filename)?G:"coffeescript"),D=D+"\n"+("//# sourceMappingURL\x3ddata:application/json;base64,"+
|
||||
a)+"\n"+h);return c.sourceMap?{js:D,sourceMap:I,v3SourceMap:JSON.stringify(z,null,2)}:D});g.tokens=c(function(a,c){return x.tokenize(a,c)});g.nodes=c(function(a,c){return"string"===typeof a?v.parse(x.tokenize(a,c)):v.parse(a)});g.run=function(c,f){var g,k,h;null==f&&(f={});k=u.main;k.filename=process.argv[1]=f.filename?D.realpathSync(f.filename):"\x3canonymous\x3e";k.moduleCache&&(k.moduleCache={});g=null!=f.filename?M.dirname(D.realpathSync(f.filename)):D.realpathSync(".");k.paths=u("module")._nodeModulePaths(g);
|
||||
if(!w.isCoffee(k.filename)||u.extensions)c=a(c,f),c=null!=(h=c.js)?h:c;return k._compile(c,k.filename)};g.eval=function(c,f){var g,k,h,m,l,r,q,v,x,w;null==f&&(f={});if(c=c.trim()){m=null!=(l=E.Script.createContext)?l:E.createContext;l=null!=(h=E.isContext)?h:function(a){return f.sandbox instanceof m().constructor};if(m){if(null!=f.sandbox){if(l(f.sandbox))w=f.sandbox;else for(r in w=m(),l=f.sandbox,l)O.call(l,r)&&(h=l[r],w[r]=h);w.global=w.root=w.GLOBAL=w}else w=global;w.__filename=f.filename||"eval";
|
||||
w.__dirname=M.dirname(w.__filename);if(w===global&&!w.module&&!w.require){g=u("module");w.module=k=new g(f.modulename||"eval");w.require=h=function(a){return g._load(a,k,!0)};k.filename=w.__filename;x=Object.getOwnPropertyNames(u);l=0;for(q=x.length;l<q;l++)v=x[l],"paths"!==v&&"arguments"!==v&&"caller"!==v&&(h[v]=u[v]);h.paths=k.paths=g._nodeModulePaths(process.cwd());h.resolve=function(a){return g._resolveFilename(a,k)}}}l={};for(r in f)O.call(f,r)&&(h=f[r],l[r]=h);l.bare=!0;c=a(c,l);return w===
|
||||
global?E.runInThisContext(c):E.runInContext(c,w)}};g.register=function(){return u("./register")};if(u.extensions)for(N=this.FILE_EXTENSIONS,Ca=function(a){var c;return null!=(c=u.extensions)[a]?c[a]:c[a]=function(){throw Error("Use CoffeeScript.register() or require the coffee-script/register module to require "+a+" files.");}},G=0,F=N.length;G<F;G++)c=N[G],Ca(c);g._compileFile=function(c,f,g){var k,h;null==f&&(f=!1);null==g&&(g=!1);h=D.readFileSync(c,"utf8");h=65279===h.charCodeAt(0)?h.substring(1):
|
||||
h;try{k=a(h,{filename:c,sourceMap:f,inlineMap:g,sourceFiles:[c],literate:w.isLiterate(c)})}catch(y){throw w.updateSyntaxError(y,h,c);}return k};x=new qa;v.lexer={lex:function(){var a,c;(c=v.tokens[this.pos++])?(a=c[0],this.yytext=c[1],this.yylloc=c[2],v.errorToken=c.origin||c,this.yylineno=this.yylloc.first_line):a="";return a},setInput:function(a){v.tokens=a;return this.pos=0},upcomingInput:function(){return""}};v.yy=u("./nodes");v.yy.parseError=function(a,c){var f,g,h,k;h=v.errorToken;k=v.tokens;
|
||||
f=h[0];g=h[1];a=h[2];g=function(){switch(!1){case h!==k[k.length-1]:return"end of input";case "INDENT"!==f&&"OUTDENT"!==f:return"indentation";case "IDENTIFIER"!==f&&"NUMBER"!==f&&"INFINITY"!==f&&"STRING"!==f&&"STRING_START"!==f&&"REGEX"!==f&&"REGEX_START"!==f:return f.replace(/_START$/,"").toLowerCase();default:return w.nameWhitespaceCharacter(g)}}();return w.throwSyntaxError("unexpected "+g,a)};f=function(a,c){var f,g,h,k;a.isNative()?f="native":(a.isEval()?(g=a.getScriptNameOrSourceURL())||a.getEvalOrigin():
|
||||
g=a.getFileName(),g||(g="\x3canonymous\x3e"),h=a.getLineNumber(),f=a.getColumnNumber(),f=(c=c(g,h,f))?g+":"+c[0]+":"+c[1]:g+":"+h+":"+f);g=a.getFunctionName();h=a.isConstructor();if(a.isToplevel()||h)return h?"new "+(g||"\x3canonymous\x3e")+" ("+f+")":g?g+" ("+f+")":f;h=a.getMethodName();k=a.getTypeName();return g?(c=a="",k&&g.indexOf(k)&&(c=k+"."),h&&g.indexOf("."+h)!==g.length-h.length-1&&(a=" [as "+h+"]"),""+c+g+a+" ("+f+")"):k+"."+(h||"\x3canonymous\x3e")+" ("+f+")"};l=function(c){return null!=
|
||||
J[c]?J[c]:null!=J["\x3canonymous\x3e"]?J["\x3canonymous\x3e"]:null!=r[c]?(c=a(r[c],{filename:c,sourceMap:!0,literate:w.isLiterate(c)}),c.sourceMap):null};Error.prepareStackTrace=function(a,c){var k,m,h;h=function(a,c,f){var g;a=l(a);null!=a&&(g=a.sourceLocation([c-1,f-1]));return null!=g?[g[0]+1,g[1]+1]:null};m=function(){var a,l,m;m=[];a=0;for(l=c.length;a<l;a++){k=c[a];if(k.getFunction()===g.run)break;m.push(" at "+f(k,h))}return m}();return a.toString()+"\n"+m.join("\n")+"\n"}}).call(this);
|
||||
return g}();u["./browser"]=function(){(function(){var g,qa,xa,q=[].indexOf||function(a){for(var c=0,g=this.length;c<g;c++)if(c in this&&this[c]===a)return c;return-1};g=u("./coffee-script");g.require=u;qa=g.compile;g.eval=function(a,c){null==c&&(c={});null==c.bare&&(c.bare=!0);return eval(qa(a,c))};g.run=function(a,c){null==c&&(c={});c.bare=!0;c.shiftLine=!0;return Function(qa(a,c))()};"undefined"!==typeof window&&null!==window&&("undefined"!==typeof btoa&&null!==btoa&&"undefined"!==typeof JSON&&
|
||||
null!==JSON&&(qa=function(a,c){null==c&&(c={});c.inlineMap=!0;return g.compile(a,c)}),g.load=function(a,c,q,f){var u;null==q&&(q={});null==f&&(f=!1);q.sourceFiles=[a];u=window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLHTTP"):new window.XMLHttpRequest;u.open("GET",a,!0);"overrideMimeType"in u&&u.overrideMimeType("text/plain");u.onreadystatechange=function(){var l;if(4===u.readyState){if(0===(l=u.status)||200===l)l=[u.responseText,q],f||g.run.apply(g,l);else throw Error("Could not load "+
|
||||
a);if(c)return c(l)}};return u.send(null)},xa=function(){var a,c,u,f,D,l,w,G,F,x,v;v=window.document.getElementsByTagName("script");c=["text/coffeescript","text/literate-coffeescript"];a=function(){var a,f,g,l;l=[];a=0;for(f=v.length;a<f;a++)F=v[a],(g=F.type,0<=q.call(c,g))&&l.push(F);return l}();l=0;u=function(){var c;c=a[l];if(c instanceof Array)return g.run.apply(g,c),l++,u()};f=function(f,l){var q,r;q={literate:f.type===c[1]};if(r=f.src||f.getAttribute("data-src"))return g.load(r,function(c){a[l]=
|
||||
c;return u()},q,!0);q.sourceFiles=["embedded"];return a[l]=[f.innerHTML,q]};D=w=0;for(G=a.length;w<G;D=++w)x=a[D],f(x,D);return u()},window.addEventListener?window.addEventListener("DOMContentLoaded",xa,!1):window.attachEvent("onload",xa))}).call(this);return{}}();return u["./coffee-script"]}();"function"===typeof define&&define.amd?define(function(){return ya}):u.CoffeeScript=ya})(this);
|
||||
$jscomp.arrayIterator=function(u){var xa=0;return $jscomp.iteratorPrototype(function(){return xa<u.length?{done:!1,value:u[xa++]}:{done:!0}})};$jscomp.iteratorPrototype=function(u){$jscomp.initSymbolIterator();u={next:u};u[$jscomp.global.Symbol.iterator]=function(){return this};return u};
|
||||
$jscomp.iteratorFromArray=function(u,xa){$jscomp.initSymbolIterator();u instanceof String&&(u+="");var ya=0,e={next:function(){if(ya<u.length){var ra=ya++;return{value:xa(ra,u[ra]),done:!1}}e.next=function(){return{done:!0,value:void 0}};return e.next()}};e[Symbol.iterator]=function(){return e};return e};$jscomp.polyfill("Array.prototype.keys",function(u){return u?u:function(){return $jscomp.iteratorFromArray(this,function(u){return u})}},"es6","es3");
|
||||
(function(u){var xa=function(){function u(e){return u[e]}u["../../package.json"]={name:"coffee-script",description:"Unfancy JavaScript",keywords:["javascript","language","coffeescript","compiler"],author:"Jeremy Ashkenas",version:"1.12.7",license:"MIT",engines:{node:"\x3e\x3d0.8.0"},directories:{lib:"./lib/coffee-script"},main:"./lib/coffee-script/coffee-script",bin:{coffee:"./bin/coffee",cake:"./bin/cake"},files:["bin","lib","register.js","repl.js"],scripts:{test:"node ./bin/cake test","test-harmony":"node --harmony ./bin/cake test"},
|
||||
homepage:"http://coffeescript.org",bugs:"https://github.com/jashkenas/coffeescript/issues",repository:{type:"git",url:"git://github.com/jashkenas/coffeescript.git"},devDependencies:{docco:"~0.7.0","google-closure-compiler-js":"^20170626.0.0","highlight.js":"~9.12.0",jison:"\x3e\x3d0.4.17","markdown-it":"^8.3.1",underscore:"~1.8.3"}};u["./helpers"]=function(){var e={};(function(){var u,r,x;e.starts=function(a,k,t){return k===a.substr(t,k.length)};e.ends=function(a,k,t){var f=k.length;return k===a.substr(a.length-
|
||||
f-(t||0),f)};e.repeat=x=function(a,k){var f;for(f="";0<k;)k&1&&(f+=a),k>>>=1,a+=a;return f};e.compact=function(a){var f,b;var p=[];var x=0;for(b=a.length;x<b;x++)(f=a[x])&&p.push(f);return p};e.count=function(a,k){var f;var b=f=0;if(!k.length)return 1/0;for(;f=1+a.indexOf(k,f);)b++;return b};e.merge=function(f,k){return a(a({},f),k)};var a=e.extend=function(a,k){var f;for(f in k){var b=k[f];a[f]=b}return a};e.flatten=u=function(a){var f;var b=[];var x=0;for(f=a.length;x<f;x++){var e=a[x];"[object Array]"===
|
||||
Object.prototype.toString.call(e)?b=b.concat(u(e)):b.push(e)}return b};e.del=function(a,k){var f=a[k];delete a[k];return f};e.some=null!=(r=Array.prototype.some)?r:function(a){var f;var b=0;for(f=this.length;b<f;b++){var x=this[b];if(a(x))return!0}return!1};e.invertLiterate=function(a){var f=!0;var b;var x=a.split("\n");var e=[];var I=0;for(b=x.length;I<b;I++)a=x[I],f&&/^([ ]{4}|[ ]{0,3}\t)/.test(a)?e.push(a):(f=/^\s*$/.test(a))?e.push(a):e.push("# "+a);return e.join("\n")};var b=function(a,b){return b?
|
||||
{first_line:a.first_line,first_column:a.first_column,last_line:b.last_line,last_column:b.last_column}:a};e.addLocationDataFn=function(a,k){return function(f){"object"===typeof f&&f.updateLocationDataIfMissing&&f.updateLocationDataIfMissing(b(a,k));return f}};e.locationDataToString=function(a){var f;"2"in a&&"first_line"in a[2]?f=a[2]:"first_line"in a&&(f=a);return f?f.first_line+1+":"+(f.first_column+1)+"-"+(f.last_line+1+":"+(f.last_column+1)):"No location data"};e.baseFileName=function(a,b,x){null==
|
||||
b&&(b=!1);null==x&&(x=!1);a=a.split(x?/\\|\//:/\//);a=a[a.length-1];if(!(b&&0<=a.indexOf(".")))return a;a=a.split(".");a.pop();"coffee"===a[a.length-1]&&1<a.length&&a.pop();return a.join(".")};e.isCoffee=function(a){return/\.((lit)?coffee|coffee\.md)$/.test(a)};e.isLiterate=function(a){return/\.(litcoffee|coffee\.md)$/.test(a)};e.throwSyntaxError=function(a,b){a=new SyntaxError(a);a.location=b;a.toString=za;a.stack=a.toString();throw a;};e.updateSyntaxError=function(a,b,x){a.toString===za&&(a.code||
|
||||
(a.code=b),a.filename||(a.filename=x),a.stack=a.toString());return a};var za=function(){var a,b,e;if(!this.code||!this.location)return Error.prototype.toString.call(this);var p=this.location;var z=p.first_line;var I=p.first_column;var J=p.last_line;var F=p.last_column;null==J&&(J=z);null==F&&(F=I);var u=this.filename||"[stdin]";p=this.code.split("\n")[z];J=z===J?F+1:p.length;F=p.slice(0,I).replace(/[^\s]/g," ")+x("^",J-I);if("undefined"!==typeof process&&null!==process)var y=(null!=(a=process.stdout)?
|
||||
a.isTTY:void 0)&&!(null!=(b=process.env)&&b.NODE_DISABLE_COLORS);if(null!=(e=this.colorful)?e:y)y=function(a){return"\u001b[1;31m"+a+"\u001b[0m"},p=p.slice(0,I)+y(p.slice(I,J))+p.slice(J),F=y(F);return u+":"+(z+1)+":"+(I+1)+": error: "+this.message+"\n"+p+"\n"+F};e.nameWhitespaceCharacter=function(a){switch(a){case " ":return"space";case "\n":return"newline";case "\r":return"carriage return";case "\t":return"tab";default:return a}}}).call(this);return e}();u["./rewriter"]=function(){var e={};(function(){var u,
|
||||
r,x=[].indexOf||function(a){for(var c=0,b=this.length;c<b;c++)if(c in this&&this[c]===a)return c;return-1},a=[].slice;var b=function(a,c,b){a=[a,c];a.generated=!0;b&&(a.origin=b);return a};e.Rewriter=function(){function n(){}n.prototype.rewrite=function(a){this.tokens=a;this.removeLeadingNewlines();this.closeOpenCalls();this.closeOpenIndexes();this.normalizeLines();this.tagPostfixConditionals();this.addImplicitBracesAndParens();this.addLocationDataToGeneratedTokens();this.fixOutdentLocationData();
|
||||
return this.tokens};n.prototype.scanTokens=function(a){var c,b;var h=this.tokens;for(c=0;b=h[c];)c+=a.call(this,b,c,h);return!0};n.prototype.detectEnd=function(a,b,q){var c,w,n,L;var e=this.tokens;for(c=0;L=e[a];){if(0===c&&b.call(this,L,a))return q.call(this,L,a);if(!L||0>c)return q.call(this,L,a-1);(w=L[0],0<=x.call(f,w))?c+=1:(n=L[0],0<=x.call(k,n))&&--c;a+=1}return a-1};n.prototype.removeLeadingNewlines=function(){var a,b;var q=this.tokens;var h=a=0;for(b=q.length;a<b;h=++a){var f=q[h][0];if("TERMINATOR"!==
|
||||
f)break}if(h)return this.tokens.splice(0,h)};n.prototype.closeOpenCalls=function(){var a=function(a,c){var h;return")"===(h=a[0])||"CALL_END"===h||"OUTDENT"===a[0]&&")"===this.tag(c-1)};var b=function(a,c){return this.tokens["OUTDENT"===a[0]?c-1:c][0]="CALL_END"};return this.scanTokens(function(c,h){"CALL_START"===c[0]&&this.detectEnd(h+1,a,b);return 1})};n.prototype.closeOpenIndexes=function(){var a=function(a,c){var h;return"]"===(h=a[0])||"INDEX_END"===h};var b=function(a,c){return a[0]="INDEX_END"};
|
||||
return this.scanTokens(function(c,h){"INDEX_START"===c[0]&&this.detectEnd(h+1,a,b);return 1})};n.prototype.indexOfTag=function(){var c,b,f,h;var n=arguments[0];var k=2<=arguments.length?a.call(arguments,1):[];var e=b=c=0;for(f=k.length;0<=f?b<f:b>f;e=0<=f?++b:--b){for(;"HERECOMMENT"===this.tag(n+e+c);)c+=2;if(null!=k[e]&&("string"===typeof k[e]&&(k[e]=[k[e]]),h=this.tag(n+e+c),0>x.call(k[e],h)))return-1}return n+e+c-1};n.prototype.looksObjectish=function(a){if(-1<this.indexOfTag(a,"@",null,":")||
|
||||
-1<this.indexOfTag(a,null,":"))return!0;a=this.indexOfTag(a,f);if(-1<a){var c=null;this.detectEnd(a+1,function(a){var c;return c=a[0],0<=x.call(k,c)},function(a,b){return c=b});if(":"===this.tag(c+1))return!0}return!1};n.prototype.findTagsBackwards=function(a,b){var c,h,n,w,e,p,y;for(c=[];0<=a&&(c.length||(w=this.tag(a),0>x.call(b,w))&&((e=this.tag(a),0>x.call(f,e))||this.tokens[a].generated)&&(p=this.tag(a),0>x.call(Q,p)));)(h=this.tag(a),0<=x.call(k,h))&&c.push(this.tag(a)),(n=this.tag(a),0<=x.call(f,
|
||||
n))&&c.length&&c.pop(),--a;return y=this.tag(a),0<=x.call(b,y)};n.prototype.addImplicitBracesAndParens=function(){var a=[];var n=null;return this.scanTokens(function(c,h,e){var q,w,p,t;var H=c[0];var K=(q=0<h?e[h-1]:[])[0];var u=(h<e.length-1?e[h+1]:[])[0];var z=function(){return a[a.length-1]};var D=h;var A=function(a){return h-D+a};var I=function(a){var c;return null!=a?null!=(c=a[2])?c.ours:void 0:void 0};var E=function(a){return I(a)&&"{"===(null!=a?a[0]:void 0)};var G=function(a){return I(a)&&
|
||||
"("===(null!=a?a[0]:void 0)};var O=function(){return I(z())};var C=function(){return G(z())};var S=function(){return E(z())};var v=function(){var a;return O&&"CONTROL"===(null!=(a=z())?a[0]:void 0)};var X=function(f){var n=null!=f?f:h;a.push(["(",n,{ours:!0}]);e.splice(n,0,b("CALL_START","(",["","implicit function call",c[2]]));if(null==f)return h+=1};var R=function(){a.pop();e.splice(h,0,b("CALL_END",")",["","end of input",c[2]]));return h+=1};var M=function(f,n){null==n&&(n=!0);var q=null!=f?f:
|
||||
h;a.push(["{",q,{sameLine:!0,startsLine:n,ours:!0}]);n=new String("{");n.generated=!0;e.splice(q,0,b("{",n,c));if(null==f)return h+=1};var r=function(f){f=null!=f?f:h;a.pop();e.splice(f,0,b("}","}",c));return h+=1};if(C()&&("IF"===H||"TRY"===H||"FINALLY"===H||"CATCH"===H||"CLASS"===H||"SWITCH"===H))return a.push(["CONTROL",h,{ours:!0}]),A(1);if("INDENT"===H&&O()){if("\x3d\x3e"!==K&&"-\x3e"!==K&&"["!==K&&"("!==K&&","!==K&&"{"!==K&&"TRY"!==K&&"ELSE"!==K&&"\x3d"!==K)for(;C();)R();v()&&a.pop();a.push([H,
|
||||
h]);return A(1)}if(0<=x.call(f,H))return a.push([H,h]),A(1);if(0<=x.call(k,H)){for(;O();)C()?R():S()?r():a.pop();n=a.pop()}if((0<=x.call(J,H)&&c.spaced||"?"===H&&0<h&&!e[h-1].spaced)&&(0<=x.call(F,u)||0<=x.call(N,u)&&(null==(w=e[h+1])||!w.spaced)&&(null==(p=e[h+1])||!p.newLine)))return"?"===H&&(H=c[0]="FUNC_EXIST"),X(h+1),A(2);if(0<=x.call(J,H)&&-1<this.indexOfTag(h+1,"INDENT")&&this.looksObjectish(h+2)&&!this.findTagsBackwards(h,"CLASS EXTENDS IF CATCH SWITCH LEADING_WHEN FOR WHILE UNTIL".split(" ")))return X(h+
|
||||
1),a.push(["INDENT",h+2]),A(3);if(":"===H){for(r=function(){var a;switch(!1){case a=this.tag(h-1),0>x.call(k,a):return n[1];case "@"!==this.tag(h-2):return h-2;default:return h-1}}.call(this);"HERECOMMENT"===this.tag(r-2);)r-=2;this.insideForDeclaration="FOR"===u;q=0===r||(t=this.tag(r-1),0<=x.call(Q,t))||e[r-1].newLine;if(z()&&(S=z(),t=S[0],v=S[1],("{"===t||"INDENT"===t&&"{"===this.tag(v-1))&&(q||","===this.tag(r-1)||"{"===this.tag(r-1))))return A(1);M(r,!!q);return A(2)}if(0<=x.call(Q,H))for(M=
|
||||
a.length-1;0<=M;M+=-1){t=a[M];if(!I(t))break;E(t)&&(t[2].sameLine=!1)}M="OUTDENT"===K||q.newLine;if(0<=x.call(y,H)||0<=x.call(B,H)&&M)for(;O();)if(M=z(),t=M[0],v=M[1],q=M[2],M=q.sameLine,q=q.startsLine,C()&&","!==K)R();else if(S()&&!this.insideForDeclaration&&M&&"TERMINATOR"!==H&&":"!==K)r();else if(!S()||"TERMINATOR"!==H||","===K||q&&this.looksObjectish(h+1))break;else{if("HERECOMMENT"===u)return A(1);r()}if(!(","!==H||this.looksObjectish(h+1)||!S()||this.insideForDeclaration||"TERMINATOR"===u&&
|
||||
this.looksObjectish(h+2)))for(u="OUTDENT"===u?1:0;S();)r(h+u);return A(1)})};n.prototype.addLocationDataToGeneratedTokens=function(){return this.scanTokens(function(a,b,f){var c,n;if(a[2]||!a.generated&&!a.explicit)return 1;if("{"===a[0]&&(c=null!=(n=f[b+1])?n[2]:void 0)){var q=c.first_line;c=c.first_column}else(c=null!=(q=f[b-1])?q[2]:void 0)?(q=c.last_line,c=c.last_column):q=c=0;a[2]={first_line:q,first_column:c,last_line:q,last_column:c};return 1})};n.prototype.fixOutdentLocationData=function(){return this.scanTokens(function(a,
|
||||
b,f){if(!("OUTDENT"===a[0]||a.generated&&"CALL_END"===a[0]||a.generated&&"}"===a[0]))return 1;b=f[b-1][2];a[2]={first_line:b.last_line,first_column:b.last_column,last_line:b.last_line,last_column:b.last_column};return 1})};n.prototype.normalizeLines=function(){var b,f;var n=b=f=null;var h=function(a,b){var c,f,h,e;return";"!==a[1]&&(c=a[0],0<=x.call(O,c))&&!("TERMINATOR"===a[0]&&(f=this.tag(b+1),0<=x.call(I,f)))&&!("ELSE"===a[0]&&"THEN"!==n)&&!!("CATCH"!==(h=a[0])&&"FINALLY"!==h||"-\x3e"!==n&&"\x3d\x3e"!==
|
||||
n)||(e=a[0],0<=x.call(B,e))&&(this.tokens[b-1].newLine||"OUTDENT"===this.tokens[b-1][0])};var e=function(a,b){return this.tokens.splice(","===this.tag(b-1)?b-1:b,0,f)};return this.scanTokens(function(c,q,k){var w,p,t;c=c[0];if("TERMINATOR"===c){if("ELSE"===this.tag(q+1)&&"OUTDENT"!==this.tag(q-1))return k.splice.apply(k,[q,1].concat(a.call(this.indentation()))),1;if(w=this.tag(q+1),0<=x.call(I,w))return k.splice(q,1),0}if("CATCH"===c)for(w=p=1;2>=p;w=++p)if("OUTDENT"===(t=this.tag(q+w))||"TERMINATOR"===
|
||||
t||"FINALLY"===t)return k.splice.apply(k,[q+w,0].concat(a.call(this.indentation()))),2+w;0<=x.call(G,c)&&"INDENT"!==this.tag(q+1)&&("ELSE"!==c||"IF"!==this.tag(q+1))&&(n=c,t=this.indentation(k[q]),b=t[0],f=t[1],"THEN"===n&&(b.fromThen=!0),k.splice(q+1,0,b),this.detectEnd(q+2,h,e),"THEN"===c&&k.splice(q,1));return 1})};n.prototype.tagPostfixConditionals=function(){var a=null;var b=function(a,b){a=a[0];b=this.tokens[b-1][0];return"TERMINATOR"===a||"INDENT"===a&&0>x.call(G,b)};var f=function(b,c){if("INDENT"!==
|
||||
b[0]||b.generated&&!b.fromThen)return a[0]="POST_"+a[0]};return this.scanTokens(function(c,n){if("IF"!==c[0])return 1;a=c;this.detectEnd(n+1,b,f);return 1})};n.prototype.indentation=function(a){var b=["INDENT",2];var c=["OUTDENT",2];a?(b.generated=c.generated=!0,b.origin=c.origin=a):b.explicit=c.explicit=!0;return[b,c]};n.prototype.generate=b;n.prototype.tag=function(a){var b;return null!=(b=this.tokens[a])?b[0]:void 0};return n}();var za=[["(",")"],["[","]"],["{","}"],["INDENT","OUTDENT"],["CALL_START",
|
||||
"CALL_END"],["PARAM_START","PARAM_END"],["INDEX_START","INDEX_END"],["STRING_START","STRING_END"],["REGEX_START","REGEX_END"]];e.INVERSES=u={};var f=[];var k=[];var t=0;for(r=za.length;t<r;t++){var p=za[t];var z=p[0];p=p[1];f.push(u[p]=z);k.push(u[z]=p)}var I=["CATCH","THEN","ELSE","FINALLY"].concat(k);var J="IDENTIFIER PROPERTY SUPER ) CALL_END ] INDEX_END @ THIS".split(" ");var F="IDENTIFIER PROPERTY NUMBER INFINITY NAN STRING STRING_START REGEX REGEX_START JS NEW PARAM_START CLASS IF TRY SWITCH THIS UNDEFINED NULL BOOL UNARY YIELD UNARY_MATH SUPER THROW @ -\x3e \x3d\x3e [ ( { -- ++".split(" ");
|
||||
var N=["+","-"];var y="POST_IF FOR WHILE UNTIL WHEN BY LOOP TERMINATOR".split(" ");var G="ELSE -\x3e \x3d\x3e TRY FINALLY THEN".split(" ");var O="TERMINATOR CATCH FINALLY ELSE OUTDENT LEADING_WHEN".split(" ");var Q=["TERMINATOR","INDENT","OUTDENT"];var B=[".","?.","::","?::"]}).call(this);return e}();u["./lexer"]=function(){var e={};(function(){var ra,r=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1},x=[].slice;var a=u("./rewriter");var b=a.Rewriter;
|
||||
var za=a.INVERSES;a=u("./helpers");var f=a.count;var k=a.repeat;var t=a.invertLiterate;var p=a.throwSyntaxError;e.Lexer=function(){function a(){}a.prototype.tokenize=function(a,c){var f,Da;null==c&&(c={});this.literate=c.literate;this.outdebt=this.indebt=this.baseIndent=this.indent=0;this.indents=[];this.ends=[];this.tokens=[];this.exportSpecifierList=this.importSpecifierList=this.seenExport=this.seenImport=this.seenFor=!1;this.chunkLine=c.line||0;this.chunkColumn=c.column||0;a=this.clean(a);for(Da=
|
||||
0;this.chunk=a.slice(Da);){var n=this.identifierToken()||this.commentToken()||this.whitespaceToken()||this.lineToken()||this.stringToken()||this.numberToken()||this.regexToken()||this.jsToken()||this.literalToken();var h=this.getLineAndColumnFromChunk(n);this.chunkLine=h[0];this.chunkColumn=h[1];Da+=n;if(c.untilBalanced&&0===this.ends.length)return{tokens:this.tokens,index:Da}}this.closeIndentation();(f=this.ends.pop())&&this.error("missing "+f.tag,f.origin[2]);return!1===c.rewrite?this.tokens:(new b).rewrite(this.tokens)};
|
||||
a.prototype.clean=function(a){a.charCodeAt(0)===Q&&(a=a.slice(1));a=a.replace(/\r/g,"").replace(Y,"");w.test(a)&&(a="\n"+a,this.chunkLine--);this.literate&&(a=t(a));return a};a.prototype.identifierToken=function(){var a,b,c,f,n,h,q;if(!(a=B.exec(this.chunk)))return 0;var e=a[0];var k=a[1];a=a[2];var x=k.length;var w=void 0;if("own"===k&&"FOR"===this.tag())return this.token("OWN",k),k.length;if("from"===k&&"YIELD"===this.tag())return this.token("FROM",k),k.length;if("as"===k&&this.seenImport){if("*"===
|
||||
this.value())this.tokens[this.tokens.length-1][0]="IMPORT_ALL";else if(b=this.value(),0<=r.call(F,b))this.tokens[this.tokens.length-1][0]="IDENTIFIER";if("DEFAULT"===(c=this.tag())||"IMPORT_ALL"===c||"IDENTIFIER"===c)return this.token("AS",k),k.length}if("as"===k&&this.seenExport&&("IDENTIFIER"===(f=this.tag())||"DEFAULT"===f))return this.token("AS",k),k.length;if("default"===k&&this.seenExport&&("EXPORT"===(n=this.tag())||"AS"===n))return this.token("DEFAULT",k),k.length;b=this.tokens;b=b[b.length-
|
||||
1];var p=a||null!=b&&("."===(h=b[0])||"?."===h||"::"===h||"?::"===h||!b.spaced&&"@"===b[0])?"PROPERTY":"IDENTIFIER";"IDENTIFIER"!==p||!(0<=r.call(J,k)||0<=r.call(F,k))||this.exportSpecifierList&&0<=r.call(F,k)?"IDENTIFIER"===p&&this.seenFor&&"from"===k&&I(b)&&(p="FORFROM",this.seenFor=!1):(p=k.toUpperCase(),"WHEN"===p&&(q=this.tag(),0<=r.call(sa,q))?p="LEADING_WHEN":"FOR"===p?this.seenFor=!0:"UNLESS"===p?p="IF":"IMPORT"===p?this.seenImport=!0:"EXPORT"===p?this.seenExport=!0:0<=r.call(ia,p)?p="UNARY":
|
||||
0<=r.call(qa,p)&&("INSTANCEOF"!==p&&this.seenFor?(p="FOR"+p,this.seenFor=!1):(p="RELATION","!"===this.value()&&(w=this.tokens.pop(),k="!"+k))));"IDENTIFIER"===p&&0<=r.call(G,k)&&this.error("reserved word '"+k+"'",{length:k.length});if("PROPERTY"!==p){if(0<=r.call(y,k)){var t=k;k=N[k]}p=function(){switch(k){case "!":return"UNARY";case "\x3d\x3d":case "!\x3d":return"COMPARE";case "true":case "false":return"BOOL";case "break":case "continue":case "debugger":return"STATEMENT";case "\x26\x26":case "||":return k;
|
||||
default:return p}}()}h=this.token(p,k,0,x);t&&(h.origin=[p,t,h[2]]);w&&(t=[w[2].first_line,w[2].first_column],h[2].first_line=t[0],h[2].first_column=t[1]);a&&(t=e.lastIndexOf(":"),this.token(":",":",t,a.length));return e.length};a.prototype.numberToken=function(){var a,b;if(!(a=n.exec(this.chunk)))return 0;var c=a[0];a=c.length;switch(!1){case !/^0[BOX]/.test(c):this.error("radix prefix in '"+c+"' must be lowercase",{offset:1});break;case !/^(?!0x).*E/.test(c):this.error("exponential notation in '"+
|
||||
c+"' must be indicated with a lowercase 'e'",{offset:c.indexOf("E")});break;case !/^0\d*[89]/.test(c):this.error("decimal literal '"+c+"' must not be prefixed with '0'",{length:a});break;case !/^0\d+/.test(c):this.error("octal literal '"+c+"' must be prefixed with '0o'",{length:a})}var f=function(){switch(c.charAt(1)){case "b":return 2;case "o":return 8;case "x":return 16;default:return null}}();f=null!=f?parseInt(c.slice(2),f):parseFloat(c);if("b"===(b=c.charAt(1))||"o"===b)c="0x"+f.toString(16);
|
||||
this.token(Infinity===f?"INFINITY":"NUMBER",c,0,a);return a};a.prototype.stringToken=function(){var a,b,c,f,n;var h=(U.exec(this.chunk)||[])[0];if(!h)return 0;this.tokens.length&&"from"===this.value()&&(this.seenImport||this.seenExport)&&(this.tokens[this.tokens.length-1][0]="FROM");var k=function(){switch(h){case "'":return W;case '"':return H;case "'''":return Z;case '"""':return T}}();var q=3===h.length;k=this.matchWithInterpolations(k,h);var e=k.tokens;var p=k.index;var x=e.length-1;k=h.charAt(0);
|
||||
if(q){var w=null;for(q=function(){var a,c;var m=[];b=a=0;for(c=e.length;a<c;b=++a)n=e[b],"NEOSTRING"===n[0]&&m.push(n[1]);return m}().join("#{}");a=A.exec(q);)if(a=a[1],null===w||0<(f=a.length)&&f<w.length)w=a;w&&(c=RegExp("\\n"+w,"g"));this.mergeInterpolationTokens(e,{delimiter:k},function(a){return function(b,m){b=a.formatString(b,{delimiter:h});c&&(b=b.replace(c,"\n"));0===m&&(b=b.replace(Aa,""));m===x&&(b=b.replace(ma,""));return b}}(this))}else this.mergeInterpolationTokens(e,{delimiter:k},function(a){return function(b,
|
||||
m){b=a.formatString(b,{delimiter:h});return b=b.replace(D,function(a,d){return 0===m&&0===d||m===x&&d+a.length===b.length?"":" "})}}(this));return p};a.prototype.commentToken=function(){var a,b;if(!(b=this.chunk.match(q)))return 0;var c=b[0];if(a=b[1])(b=X.exec(c))&&this.error("block comments cannot contain "+b[0],{offset:b.index,length:b[0].length}),0<=a.indexOf("\n")&&(a=a.replace(RegExp("\\n"+k(" ",this.indent),"g"),"\n")),this.token("HERECOMMENT",a,0,c.length);return c.length};a.prototype.jsToken=
|
||||
function(){var a;if("`"!==this.chunk.charAt(0)||!(a=L.exec(this.chunk)||P.exec(this.chunk)))return 0;var b=a[1].replace(/\\+(`|$)/g,function(a){return a.slice(-Math.ceil(a.length/2))});this.token("JS",b,0,a[0].length);return a[0].length};a.prototype.regexToken=function(){var a,b,c;switch(!1){case !(a=S.exec(this.chunk)):this.error("regular expressions cannot begin with "+a[2],{offset:a.index+a[1].length});break;case !(a=this.matchWithInterpolations(ba,"///")):var f=a.tokens;var h=a.index;break;case !(a=
|
||||
ic.exec(this.chunk)):var n=a[0];var k=a[1];a=a[2];this.validateEscapes(k,{isRegex:!0,offsetInChunk:1});k=this.formatRegex(k,{delimiter:"/"});h=n.length;var q=this.tokens;if(q=q[q.length-1])if(q.spaced&&(b=q[0],0<=r.call(ha,b))){if(!a||v.test(n))return 0}else if(c=q[0],0<=r.call(oa,c))return 0;a||this.error("missing / (unclosed regex)");break;default:return 0}c=E.exec(this.chunk.slice(h))[0];b=h+c.length;a=this.makeToken("REGEX",null,0,b);switch(!1){case !!aa.test(c):this.error("invalid regular expression flags "+
|
||||
c,{offset:h,length:c.length});break;case !(n||1===f.length):null==k&&(k=this.formatHeregex(f[0][1]));this.token("REGEX",""+this.makeDelimitedLiteral(k,{delimiter:"/"})+c,0,b,a);break;default:this.token("REGEX_START","(",0,0,a),this.token("IDENTIFIER","RegExp",0,0),this.token("CALL_START","(",0,0),this.mergeInterpolationTokens(f,{delimiter:'"',double:!0},this.formatHeregex),c&&(this.token(",",",",h-1,0),this.token("STRING",'"'+c+'"',h-1,c.length)),this.token(")",")",b-1,0),this.token("REGEX_END",")",
|
||||
b-1,0)}return b};a.prototype.lineToken=function(){var a;if(!(a=K.exec(this.chunk)))return 0;a=a[0];this.seenFor=!1;this.importSpecifierList||(this.seenImport=!1);this.exportSpecifierList||(this.seenExport=!1);var b=a.length-1-a.lastIndexOf("\n");var c=this.unfinished();if(b-this.indebt===this.indent)return c?this.suppressNewlines():this.newlineToken(0),a.length;if(b>this.indent){if(c)return this.indebt=b-this.indent,this.suppressNewlines(),a.length;if(!this.tokens.length)return this.baseIndent=this.indent=
|
||||
b,a.length;c=b-this.indent+this.outdebt;this.token("INDENT",c,a.length-b,b);this.indents.push(c);this.ends.push({tag:"OUTDENT"});this.outdebt=this.indebt=0;this.indent=b}else b<this.baseIndent?this.error("missing indentation",{offset:a.length}):(this.indebt=0,this.outdentToken(this.indent-b,c,a.length));return a.length};a.prototype.outdentToken=function(a,b,c){var f,h,n;for(f=this.indent-a;0<a;)if(h=this.indents[this.indents.length-1])if(h===this.outdebt)a-=this.outdebt,this.outdebt=0;else if(h<this.outdebt)this.outdebt-=
|
||||
h,a-=h;else{var k=this.indents.pop()+this.outdebt;c&&(n=this.chunk[c],0<=r.call(ca,n))&&(f-=k-a,a=k);this.outdebt=0;this.pair("OUTDENT");this.token("OUTDENT",a,0,c);a-=k}else a=0;k&&(this.outdebt-=a);for(;";"===this.value();)this.tokens.pop();"TERMINATOR"===this.tag()||b||this.token("TERMINATOR","\n",c,0);this.indent=f;return this};a.prototype.whitespaceToken=function(){var a;if(!(a=w.exec(this.chunk))&&"\n"!==this.chunk.charAt(0))return 0;var b=this.tokens;(b=b[b.length-1])&&(b[a?"spaced":"newLine"]=
|
||||
!0);return a?a[0].length:0};a.prototype.newlineToken=function(a){for(;";"===this.value();)this.tokens.pop();"TERMINATOR"!==this.tag()&&this.token("TERMINATOR","\n",a,0);return this};a.prototype.suppressNewlines=function(){"\\"===this.value()&&this.tokens.pop();return this};a.prototype.literalToken=function(){var a,b,f,n,k;(a=c.exec(this.chunk))?(a=a[0],h.test(a)&&this.tagParameters()):a=this.chunk.charAt(0);var q=a;var e=this.tokens;if((e=e[e.length-1])&&0<=r.call(["\x3d"].concat(x.call(ea)),a)){var p=
|
||||
!1;"\x3d"!==a||"||"!==(f=e[1])&&"\x26\x26"!==f||e.spaced||(e[0]="COMPOUND_ASSIGN",e[1]+="\x3d",e=this.tokens[this.tokens.length-2],p=!0);e&&"PROPERTY"!==e[0]&&(f=null!=(b=e.origin)?b:e,(b=z(e[1],f[1]))&&this.error(b,f[2]));if(p)return a.length}"{"===a&&this.seenImport?this.importSpecifierList=!0:this.importSpecifierList&&"}"===a?this.importSpecifierList=!1:"{"===a&&"EXPORT"===(null!=e?e[0]:void 0)?this.exportSpecifierList=!0:this.exportSpecifierList&&"}"===a&&(this.exportSpecifierList=!1);if(";"===
|
||||
a)this.seenFor=this.seenImport=this.seenExport=!1,q="TERMINATOR";else if("*"===a&&"EXPORT"===e[0])q="EXPORT_ALL";else if(0<=r.call(pa,a))q="MATH";else if(0<=r.call(la,a))q="COMPARE";else if(0<=r.call(ea,a))q="COMPOUND_ASSIGN";else if(0<=r.call(ia,a))q="UNARY";else if(0<=r.call(fa,a))q="UNARY_MATH";else if(0<=r.call(ja,a))q="SHIFT";else if("?"===a&&null!=e&&e.spaced)q="BIN?";else if(e&&!e.spaced)if("("===a&&(n=e[0],0<=r.call(ha,n)))"?"===e[0]&&(e[0]="FUNC_EXIST"),q="CALL_START";else if("["===a&&(k=
|
||||
e[0],0<=r.call(ka,k)))switch(q="INDEX_START",e[0]){case "?":e[0]="INDEX_SOAK"}n=this.makeToken(q,a);switch(a){case "(":case "{":case "[":this.ends.push({tag:za[a],origin:n});break;case ")":case "}":case "]":this.pair(a)}this.tokens.push(n);return a.length};a.prototype.tagParameters=function(){var a;if(")"!==this.tag())return this;var b=[];var c=this.tokens;var f=c.length;for(c[--f][0]="PARAM_END";a=c[--f];)switch(a[0]){case ")":b.push(a);break;case "(":case "CALL_START":if(b.length)b.pop();else return"("===
|
||||
a[0]&&(a[0]="PARAM_START"),this}return this};a.prototype.closeIndentation=function(){return this.outdentToken(this.indent)};a.prototype.matchWithInterpolations=function(b,c){var f,h;var n=[];var k=c.length;if(this.chunk.slice(0,k)!==c)return null;for(h=this.chunk.slice(k);;){var e=b.exec(h)[0];this.validateEscapes(e,{isRegex:"/"===c.charAt(0),offsetInChunk:k});n.push(this.makeToken("NEOSTRING",e,k));h=h.slice(e.length);k+=e.length;if("#{"!==h.slice(0,2))break;var q=this.getLineAndColumnFromChunk(k+
|
||||
1);e=q[0];q=q[1];q=(new a).tokenize(h.slice(1),{line:e,column:q,untilBalanced:!0});e=q.tokens;var p=q.index;p+=1;var x=e[0];q=e[e.length-1];x[0]=x[1]="(";q[0]=q[1]=")";q.origin=["","end of interpolation",q[2]];"TERMINATOR"===(null!=(f=e[1])?f[0]:void 0)&&e.splice(1,1);n.push(["TOKENS",e]);h=h.slice(p);k+=p}h.slice(0,c.length)!==c&&this.error("missing "+c,{length:c.length});b=n[0];f=n[n.length-1];b[2].first_column-=c.length;"\n"===f[1].substr(-1)?(f[2].last_line+=1,f[2].last_column=c.length-1):f[2].last_column+=
|
||||
c.length;0===f[1].length&&--f[2].last_column;return{tokens:n,index:k+c.length}};a.prototype.mergeInterpolationTokens=function(a,b,c){var f,h,n,k;1<a.length&&(n=this.token("STRING_START","(",0,0));var e=this.tokens.length;var q=f=0;for(h=a.length;f<h;q=++f){var p=a[q];var x=p[0];var w=p[1];switch(x){case "TOKENS":if(2===w.length)continue;var t=w[0];var Ia=w;break;case "NEOSTRING":x=c.call(this,p[1],q);if(0===x.length)if(0===q)var m=this.tokens.length;else continue;2===q&&null!=m&&this.tokens.splice(m,
|
||||
2);p[0]="STRING";p[1]=this.makeDelimitedLiteral(x,b);t=p;Ia=[p]}this.tokens.length>e&&(q=this.token("+","+"),q[2]={first_line:t[2].first_line,first_column:t[2].first_column,last_line:t[2].first_line,last_column:t[2].first_column});(k=this.tokens).push.apply(k,Ia)}if(n)return a=a[a.length-1],n.origin=["STRING",null,{first_line:n[2].first_line,first_column:n[2].first_column,last_line:a[2].last_line,last_column:a[2].last_column}],n=this.token("STRING_END",")"),n[2]={first_line:a[2].last_line,first_column:a[2].last_column,
|
||||
last_line:a[2].last_line,last_column:a[2].last_column}};a.prototype.pair=function(a){var b=this.ends;b=b[b.length-1];return a!==(b=null!=b?b.tag:void 0)?("OUTDENT"!==b&&this.error("unmatched "+a),b=this.indents,b=b[b.length-1],this.outdentToken(b,!0),this.pair(a)):this.ends.pop()};a.prototype.getLineAndColumnFromChunk=function(a){if(0===a)return[this.chunkLine,this.chunkColumn];var b=a>=this.chunk.length?this.chunk:this.chunk.slice(0,+(a-1)+1||9E9);a=f(b,"\n");var c=this.chunkColumn;0<a?(c=b.split("\n"),
|
||||
c=c[c.length-1],c=c.length):c+=b.length;return[this.chunkLine+a,c]};a.prototype.makeToken=function(a,b,c,f){null==c&&(c=0);null==f&&(f=b.length);var h={};var n=this.getLineAndColumnFromChunk(c);h.first_line=n[0];h.first_column=n[1];c=this.getLineAndColumnFromChunk(c+(0<f?f-1:0));h.last_line=c[0];h.last_column=c[1];return[a,b,h]};a.prototype.token=function(a,b,c,f,h){a=this.makeToken(a,b,c,f);h&&(a.origin=h);this.tokens.push(a);return a};a.prototype.tag=function(){var a=this.tokens;a=a[a.length-1];
|
||||
return null!=a?a[0]:void 0};a.prototype.value=function(){var a=this.tokens;a=a[a.length-1];return null!=a?a[1]:void 0};a.prototype.unfinished=function(){var a;return R.test(this.chunk)||(a=this.tag(),0<=r.call(xa,a))};a.prototype.formatString=function(a,b){return this.replaceUnicodeCodePointEscapes(a.replace(V,"$1"),b)};a.prototype.formatHeregex=function(a){return this.formatRegex(a.replace(C,"$1$2"),{delimiter:"///"})};a.prototype.formatRegex=function(a,b){return this.replaceUnicodeCodePointEscapes(a,
|
||||
b)};a.prototype.unicodeCodePointToUnicodeEscapes=function(a){var b=function(a){a=a.toString(16);return"\\u"+k("0",4-a.length)+a};if(65536>a)return b(a);var c=Math.floor((a-65536)/1024)+55296;a=(a-65536)%1024+56320;return""+b(c)+b(a)};a.prototype.replaceUnicodeCodePointEscapes=function(a,b){return a.replace(ta,function(a){return function(c,f,h,n){if(f)return f;c=parseInt(h,16);1114111<c&&a.error("unicode code point escapes greater than \\u{10ffff} are not allowed",{offset:n+b.delimiter.length,length:h.length+
|
||||
4});return a.unicodeCodePointToUnicodeEscapes(c)}}(this))};a.prototype.validateEscapes=function(a,b){var c,f;null==b&&(b={});if(c=(b.isRegex?ya:M).exec(a)){c[0];a=c[1];var h=c[2];var n=c[3];var k=c[4];var e=c[5];n="\\"+(h||n||k||e);return this.error((h?"octal escape sequences are not allowed":"invalid escape sequence")+" "+n,{offset:(null!=(f=b.offsetInChunk)?f:0)+c.index+a.length,length:n.length})}};a.prototype.makeDelimitedLiteral=function(a,b){null==b&&(b={});""===a&&"/"===b.delimiter&&(a="(?:)");
|
||||
a=a.replace(RegExp("(\\\\\\\\)|(\\\\0(?\x3d[1-7]))|\\\\?("+b.delimiter+")|\\\\?(?:(\\n)|(\\r)|(\\u2028)|(\\u2029))|(\\\\.)","g"),function(a,c,f,h,n,k,e,q,p){switch(!1){case !c:return b.double?c+c:c;case !f:return"\\x00";case !h:return"\\"+h;case !n:return"\\n";case !k:return"\\r";case !e:return"\\u2028";case !q:return"\\u2029";case !p:return b.double?"\\"+p:p}});return""+b.delimiter+a+b.delimiter};a.prototype.error=function(a,b){var c,f,h,n,k;null==b&&(b={});b="first_line"in b?b:(n=this.getLineAndColumnFromChunk(null!=
|
||||
(h=b.offset)?h:0),f=n[0],c=n[1],n,{first_line:f,first_column:c,last_column:c+(null!=(k=b.length)?k:1)-1});return p(a,b)};return a}();var z=function(a,b){null==b&&(b=a);switch(!1){case 0>r.call(x.call(J).concat(x.call(F)),a):return"keyword '"+b+"' can't be assigned";case 0>r.call(O,a):return"'"+b+"' can't be assigned";case 0>r.call(G,a):return"reserved word '"+b+"' can't be assigned";default:return!1}};e.isUnassignable=z;var I=function(a){var b;return"IDENTIFIER"===a[0]?("from"===a[1]&&(a[1][0]="IDENTIFIER",
|
||||
!0),!0):"FOR"===a[0]?!1:"{"===(b=a[1])||"["===b||","===b||":"===b?!1:!0};var J="true false null this new delete typeof in instanceof return throw break continue debugger yield if else switch for while do try catch finally class extends super import export default".split(" ");var F="undefined Infinity NaN then unless until loop of by when".split(" ");var N={and:"\x26\x26",or:"||",is:"\x3d\x3d",isnt:"!\x3d",not:"!",yes:"true",no:"false",on:"true",off:"false"};var y=function(){var a=[];for(ra in N)a.push(ra);
|
||||
return a}();F=F.concat(y);var G="case function var void with const let enum native implements interface package private protected public static".split(" ");var O=["arguments","eval"];e.JS_FORBIDDEN=J.concat(G).concat(O);var Q=65279;var B=/^(?!\d)((?:(?!\s)[$\w\x7f-\uffff])+)([^\n\S]*:(?!:))?/;var n=/^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i;var c=/^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>*\/%])\2=?|\?(\.|::)|\.{2,3})/;var w=/^[^\n\S]+/;var q=/^###([^#][\s\S]*?)(?:###[^\n\S]*|###$)|^(?:\s*#(?!##[^#]).*)+/;
|
||||
var h=/^[-=]>/;var K=/^(?:\n[^\n\S]*)+/;var P=/^`(?!``)((?:[^`\\]|\\[\s\S])*)`/;var L=/^```((?:[^`\\]|\\[\s\S]|`(?!``))*)```/;var U=/^(?:'''|"""|'|")/;var W=/^(?:[^\\']|\\[\s\S])*/;var H=/^(?:[^\\"#]|\\[\s\S]|\#(?!\{))*/;var Z=/^(?:[^\\']|\\[\s\S]|'(?!''))*/;var T=/^(?:[^\\"#]|\\[\s\S]|"(?!"")|\#(?!\{))*/;var V=/((?:\\\\)+)|\\[^\S\n]*\n\s*/g;var D=/\s*\n\s*/g;var A=/\n+([^\n\S]*)(?=\S)/g;var ic=/^\/(?!\/)((?:[^[\/\n\\]|\\[^\n]|\[(?:\\[^\n]|[^\]\n\\])*\])*)(\/)?/;var E=/^\w*/;var aa=/^(?!.*(.).*\1)[imguy]*$/;
|
||||
var ba=/^(?:[^\\\/#]|\\[\s\S]|\/(?!\/\/)|\#(?!\{))*/;var C=/((?:\\\\)+)|\\(\s)|\s+(?:#.*)?/g;var S=/^(\/|\/{3}\s*)(\*)/;var v=/^\/=?\s/;var X=/\*\//;var R=/^\s*(?:,|\??\.(?![.\d])|::)/;var M=/((?:^|[^\\])(?:\\\\)*)\\(?:(0[0-7]|[1-7])|(x(?![\da-fA-F]{2}).{0,2})|(u\{(?![\da-fA-F]{1,}\})[^}]*\}?)|(u(?!\{|[\da-fA-F]{4}).{0,4}))/;var ya=/((?:^|[^\\])(?:\\\\)*)\\(?:(0[0-7])|(x(?![\da-fA-F]{2}).{0,2})|(u\{(?![\da-fA-F]{1,}\})[^}]*\}?)|(u(?!\{|[\da-fA-F]{4}).{0,4}))/;var ta=/(\\\\)|\\u\{([\da-fA-F]+)\}/g;
|
||||
var Aa=/^[^\n\S]*\n/;var ma=/\n[^\n\S]*$/;var Y=/\s+$/;var ea="-\x3d +\x3d /\x3d *\x3d %\x3d ||\x3d \x26\x26\x3d ?\x3d \x3c\x3c\x3d \x3e\x3e\x3d \x3e\x3e\x3e\x3d \x26\x3d ^\x3d |\x3d **\x3d //\x3d %%\x3d".split(" ");var ia=["NEW","TYPEOF","DELETE","DO"];var fa=["!","~"];var ja=["\x3c\x3c","\x3e\x3e","\x3e\x3e\x3e"];var la="\x3d\x3d !\x3d \x3c \x3e \x3c\x3d \x3e\x3d".split(" ");var pa=["*","/","%","//","%%"];var qa=["IN","OF","INSTANCEOF"];var ha="IDENTIFIER PROPERTY ) ] ? @ THIS SUPER".split(" ");
|
||||
var ka=ha.concat("NUMBER INFINITY NAN STRING STRING_END REGEX REGEX_END BOOL NULL UNDEFINED } ::".split(" "));var oa=ka.concat(["++","--"]);var sa=["INDENT","OUTDENT","TERMINATOR"];var ca=[")","}","]"];var xa="\\ . ?. ?:: UNARY MATH UNARY_MATH + - ** SHIFT RELATION COMPARE \x26 ^ | \x26\x26 || BIN? THROW EXTENDS DEFAULT".split(" ")}).call(this);return e}();u["./parser"]=function(){var e={},ra={exports:e},r=function(){function e(){this.yy={}}var a=function(a,l,m,d){m=m||{};for(d=a.length;d--;m[a[d]]=
|
||||
l);return m},b=[1,22],u=[1,25],f=[1,83],k=[1,79],t=[1,84],p=[1,85],z=[1,81],I=[1,82],J=[1,56],F=[1,58],N=[1,59],y=[1,60],G=[1,61],O=[1,62],Q=[1,49],B=[1,50],n=[1,32],c=[1,68],w=[1,69],q=[1,78],h=[1,47],K=[1,51],P=[1,52],L=[1,67],U=[1,65],W=[1,66],H=[1,64],Z=[1,42],T=[1,48],V=[1,63],D=[1,73],A=[1,74],r=[1,75],E=[1,76],aa=[1,46],ba=[1,72],C=[1,34],S=[1,35],v=[1,36],X=[1,37],R=[1,38],M=[1,39],ra=[1,86],ta=[1,6,32,42,131],Aa=[1,101],ma=[1,89],Y=[1,88],ea=[1,87],ia=[1,90],fa=[1,91],ja=[1,92],la=[1,93],
|
||||
pa=[1,94],qa=[1,95],ha=[1,96],ka=[1,97],oa=[1,98],sa=[1,99],ca=[1,100],ya=[1,104],na=[1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],Da=[2,167],va=[1,110],xa=[1,111],Ha=[1,112],Ka=[1,113],Fa=[1,115],Ra=[1,116],La=[1,109],Ga=[1,6,32,42,131,133,135,139,156],Wa=[2,27],da=[1,123],Za=[1,121],Ea=[1,6,31,32,40,41,42,66,71,74,82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,
|
||||
169,170,171,172,173,174],Ia=[2,95],m=[1,6,31,32,42,46,66,71,74,82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],l=[2,74],d=[1,128],Ca=[1,133],Ja=[1,134],ua=[1,136],Na=[1,6,31,32,40,41,42,55,66,71,74,82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],wa=[2,92],Gb=[1,6,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,159,160,163,164,
|
||||
165,166,167,168,169,170,171,172,173,174],$a=[2,64],Hb=[1,161],Ib=[1,167],ab=[1,179],Va=[1,181],Jb=[1,176],Qa=[1,183],ub=[1,185],Oa=[1,6,31,32,40,41,42,55,66,71,74,82,83,84,85,87,89,90,94,96,113,114,115,120,122,131,133,134,135,139,140,156,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175],Kb=[2,111],Lb=[1,6,31,32,40,41,42,58,66,71,74,82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],Mb=[1,6,31,32,40,41,
|
||||
42,46,58,66,71,74,82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],Nb=[40,41,114],Ob=[1,242],vb=[1,241],Pa=[1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156],Ma=[2,72],Pb=[1,251],Ua=[6,31,32,66,71],hb=[6,31,32,55,66,71,74],bb=[1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,159,160,164,166,167,168,169,170,171,172,173,174],Qb=[40,41,82,83,84,85,87,90,113,114],ib=[1,270],cb=[2,62],
|
||||
jb=[1,281],Xa=[1,283],wb=[1,288],db=[1,290],Rb=[2,188],xb=[1,6,31,32,40,41,42,55,66,71,74,82,83,84,85,87,89,90,94,113,114,115,120,122,131,133,134,135,139,140,146,147,148,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],kb=[1,299],Sa=[6,31,32,71,115,120],Sb=[1,6,31,32,40,41,42,55,58,66,71,74,82,83,84,85,87,89,90,94,96,113,114,115,120,122,131,133,134,135,139,140,146,147,148,156,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175],Tb=[1,6,31,32,42,66,71,74,89,94,115,120,122,
|
||||
131,140,156],Ya=[1,6,31,32,42,66,71,74,89,94,115,120,122,131,134,140,156],lb=[146,147,148],mb=[71,146,147,148],nb=[6,31,94],Ub=[1,313],Ba=[6,31,32,71,94],Vb=[6,31,32,58,71,94],yb=[6,31,32,55,58,71,94],Wb=[1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,159,160,166,167,168,169,170,171,172,173,174],Xb=[12,28,34,38,40,41,44,45,48,49,50,51,52,53,61,63,64,68,69,89,92,95,97,105,112,117,118,119,125,129,130,133,135,137,139,149,155,157,158,159,160,161,162],Yb=[2,177],Ta=[6,31,32],eb=[2,
|
||||
73],Zb=[1,325],$b=[1,326],ac=[1,6,31,32,42,66,71,74,89,94,115,120,122,127,128,131,133,134,135,139,140,151,153,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],ob=[32,151,153],bc=[1,6,32,42,66,71,74,89,94,115,120,122,131,134,140,156],pb=[1,353],zb=[1,359],Ab=[1,6,32,42,131,156],fb=[2,87],qb=[1,370],rb=[1,371],cc=[1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,151,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],Bb=[1,6,31,32,42,66,71,74,89,94,115,120,122,131,
|
||||
133,135,139,140,156],dc=[1,384],ec=[1,385],Cb=[6,31,32,94],fc=[6,31,32,71],Db=[1,6,31,32,42,66,71,74,89,94,115,120,122,127,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],gc=[31,71],sb=[1,411],tb=[1,412],Eb=[1,418],Fb=[1,419],hc={trace:function(){},yy:{},symbols_:{error:2,Root:3,Body:4,Line:5,TERMINATOR:6,Expression:7,Statement:8,YieldReturn:9,Return:10,Comment:11,STATEMENT:12,Import:13,Export:14,Value:15,Invocation:16,Code:17,Operation:18,Assign:19,If:20,Try:21,
|
||||
While:22,For:23,Switch:24,Class:25,Throw:26,Yield:27,YIELD:28,FROM:29,Block:30,INDENT:31,OUTDENT:32,Identifier:33,IDENTIFIER:34,Property:35,PROPERTY:36,AlphaNumeric:37,NUMBER:38,String:39,STRING:40,STRING_START:41,STRING_END:42,Regex:43,REGEX:44,REGEX_START:45,REGEX_END:46,Literal:47,JS:48,UNDEFINED:49,NULL:50,BOOL:51,INFINITY:52,NAN:53,Assignable:54,"\x3d":55,AssignObj:56,ObjAssignable:57,":":58,SimpleObjAssignable:59,ThisProperty:60,RETURN:61,Object:62,HERECOMMENT:63,PARAM_START:64,ParamList:65,
|
||||
PARAM_END:66,FuncGlyph:67,"-\x3e":68,"\x3d\x3e":69,OptComma:70,",":71,Param:72,ParamVar:73,"...":74,Array:75,Splat:76,SimpleAssignable:77,Accessor:78,Parenthetical:79,Range:80,This:81,".":82,"?.":83,"::":84,"?::":85,Index:86,INDEX_START:87,IndexValue:88,INDEX_END:89,INDEX_SOAK:90,Slice:91,"{":92,AssignList:93,"}":94,CLASS:95,EXTENDS:96,IMPORT:97,ImportDefaultSpecifier:98,ImportNamespaceSpecifier:99,ImportSpecifierList:100,ImportSpecifier:101,AS:102,DEFAULT:103,IMPORT_ALL:104,EXPORT:105,ExportSpecifierList:106,
|
||||
EXPORT_ALL:107,ExportSpecifier:108,OptFuncExist:109,Arguments:110,Super:111,SUPER:112,FUNC_EXIST:113,CALL_START:114,CALL_END:115,ArgList:116,THIS:117,"@":118,"[":119,"]":120,RangeDots:121,"..":122,Arg:123,SimpleArgs:124,TRY:125,Catch:126,FINALLY:127,CATCH:128,THROW:129,"(":130,")":131,WhileSource:132,WHILE:133,WHEN:134,UNTIL:135,Loop:136,LOOP:137,ForBody:138,FOR:139,BY:140,ForStart:141,ForSource:142,ForVariables:143,OWN:144,ForValue:145,FORIN:146,FOROF:147,FORFROM:148,SWITCH:149,Whens:150,ELSE:151,
|
||||
When:152,LEADING_WHEN:153,IfBlock:154,IF:155,POST_IF:156,UNARY:157,UNARY_MATH:158,"-":159,"+":160,"--":161,"++":162,"?":163,MATH:164,"**":165,SHIFT:166,COMPARE:167,"\x26":168,"^":169,"|":170,"\x26\x26":171,"||":172,"BIN?":173,RELATION:174,COMPOUND_ASSIGN:175,$accept:0,$end:1},terminals_:{2:"error",6:"TERMINATOR",12:"STATEMENT",28:"YIELD",29:"FROM",31:"INDENT",32:"OUTDENT",34:"IDENTIFIER",36:"PROPERTY",38:"NUMBER",40:"STRING",41:"STRING_START",42:"STRING_END",44:"REGEX",45:"REGEX_START",46:"REGEX_END",
|
||||
48:"JS",49:"UNDEFINED",50:"NULL",51:"BOOL",52:"INFINITY",53:"NAN",55:"\x3d",58:":",61:"RETURN",63:"HERECOMMENT",64:"PARAM_START",66:"PARAM_END",68:"-\x3e",69:"\x3d\x3e",71:",",74:"...",82:".",83:"?.",84:"::",85:"?::",87:"INDEX_START",89:"INDEX_END",90:"INDEX_SOAK",92:"{",94:"}",95:"CLASS",96:"EXTENDS",97:"IMPORT",102:"AS",103:"DEFAULT",104:"IMPORT_ALL",105:"EXPORT",107:"EXPORT_ALL",112:"SUPER",113:"FUNC_EXIST",114:"CALL_START",115:"CALL_END",117:"THIS",118:"@",119:"[",120:"]",122:"..",125:"TRY",127:"FINALLY",
|
||||
128:"CATCH",129:"THROW",130:"(",131:")",133:"WHILE",134:"WHEN",135:"UNTIL",137:"LOOP",139:"FOR",140:"BY",144:"OWN",146:"FORIN",147:"FOROF",148:"FORFROM",149:"SWITCH",151:"ELSE",153:"LEADING_WHEN",155:"IF",156:"POST_IF",157:"UNARY",158:"UNARY_MATH",159:"-",160:"+",161:"--",162:"++",163:"?",164:"MATH",165:"**",166:"SHIFT",167:"COMPARE",168:"\x26",169:"^",170:"|",171:"\x26\x26",172:"||",173:"BIN?",174:"RELATION",175:"COMPOUND_ASSIGN"},productions_:[0,[3,0],[3,1],[4,1],[4,3],[4,2],[5,1],[5,1],[5,1],[8,
|
||||
1],[8,1],[8,1],[8,1],[8,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[27,1],[27,2],[27,3],[30,2],[30,3],[33,1],[35,1],[37,1],[37,1],[39,1],[39,3],[43,1],[43,3],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[19,3],[19,4],[19,5],[56,1],[56,3],[56,5],[56,3],[56,5],[56,1],[59,1],[59,1],[59,1],[57,1],[57,1],[10,2],[10,4],[10,1],[9,3],[9,2],[11,1],[17,5],[17,2],[67,1],[67,1],[70,0],[70,1],[65,0],[65,1],[65,3],[65,4],[65,6],[72,1],[72,2],[72,3],[72,1],[73,1],
|
||||
[73,1],[73,1],[73,1],[76,2],[77,1],[77,2],[77,2],[77,1],[54,1],[54,1],[54,1],[15,1],[15,1],[15,1],[15,1],[15,1],[78,2],[78,2],[78,2],[78,2],[78,1],[78,1],[86,3],[86,2],[88,1],[88,1],[62,4],[93,0],[93,1],[93,3],[93,4],[93,6],[25,1],[25,2],[25,3],[25,4],[25,2],[25,3],[25,4],[25,5],[13,2],[13,4],[13,4],[13,5],[13,7],[13,6],[13,9],[100,1],[100,3],[100,4],[100,4],[100,6],[101,1],[101,3],[101,1],[101,3],[98,1],[99,3],[14,3],[14,5],[14,2],[14,4],[14,5],[14,6],[14,3],[14,4],[14,7],[106,1],[106,3],[106,4],
|
||||
[106,4],[106,6],[108,1],[108,3],[108,3],[108,1],[108,3],[16,3],[16,3],[16,3],[16,1],[111,1],[111,2],[109,0],[109,1],[110,2],[110,4],[81,1],[81,1],[60,2],[75,2],[75,4],[121,1],[121,1],[80,5],[91,3],[91,2],[91,2],[91,1],[116,1],[116,3],[116,4],[116,4],[116,6],[123,1],[123,1],[123,1],[124,1],[124,3],[21,2],[21,3],[21,4],[21,5],[126,3],[126,3],[126,2],[26,2],[79,3],[79,5],[132,2],[132,4],[132,2],[132,4],[22,2],[22,2],[22,2],[22,1],[136,2],[136,2],[23,2],[23,2],[23,2],[138,2],[138,4],[138,2],[141,2],[141,
|
||||
3],[145,1],[145,1],[145,1],[145,1],[143,1],[143,3],[142,2],[142,2],[142,4],[142,4],[142,4],[142,6],[142,6],[142,2],[142,4],[24,5],[24,7],[24,4],[24,6],[150,1],[150,2],[152,3],[152,4],[154,3],[154,5],[20,1],[20,3],[20,3],[20,3],[18,2],[18,2],[18,2],[18,2],[18,2],[18,2],[18,2],[18,2],[18,2],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,5],[18,4],[18,3]],performAction:function(a,l,m,d,Ca,b,g){a=b.length-1;switch(Ca){case 1:return this.$=d.addLocationDataFn(g[a],
|
||||
g[a])(new d.Block);case 2:return this.$=b[a];case 3:this.$=d.addLocationDataFn(g[a],g[a])(d.Block.wrap([b[a]]));break;case 4:this.$=d.addLocationDataFn(g[a-2],g[a])(b[a-2].push(b[a]));break;case 5:this.$=b[a-1];break;case 6:case 7:case 8:case 9:case 10:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 35:case 40:case 42:case 56:case 57:case 58:case 59:case 60:case 61:case 72:case 73:case 83:case 84:case 85:case 86:case 91:case 92:case 95:case 99:case 105:case 164:case 188:case 189:case 191:case 221:case 222:case 240:case 246:this.$=
|
||||
b[a];break;case 11:this.$=d.addLocationDataFn(g[a],g[a])(new d.StatementLiteral(b[a]));break;case 27:this.$=d.addLocationDataFn(g[a],g[a])(new d.Op(b[a],new d.Value(new d.Literal(""))));break;case 28:case 250:case 251:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Op(b[a-1],b[a]));break;case 29:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Op(b[a-2].concat(b[a-1]),b[a]));break;case 30:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Block);break;case 31:case 106:this.$=d.addLocationDataFn(g[a-2],g[a])(b[a-
|
||||
1]);break;case 32:this.$=d.addLocationDataFn(g[a],g[a])(new d.IdentifierLiteral(b[a]));break;case 33:this.$=d.addLocationDataFn(g[a],g[a])(new d.PropertyName(b[a]));break;case 34:this.$=d.addLocationDataFn(g[a],g[a])(new d.NumberLiteral(b[a]));break;case 36:this.$=d.addLocationDataFn(g[a],g[a])(new d.StringLiteral(b[a]));break;case 37:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.StringWithInterpolations(b[a-1]));break;case 38:this.$=d.addLocationDataFn(g[a],g[a])(new d.RegexLiteral(b[a]));break;
|
||||
case 39:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.RegexWithInterpolations(b[a-1].args));break;case 41:this.$=d.addLocationDataFn(g[a],g[a])(new d.PassthroughLiteral(b[a]));break;case 43:this.$=d.addLocationDataFn(g[a],g[a])(new d.UndefinedLiteral);break;case 44:this.$=d.addLocationDataFn(g[a],g[a])(new d.NullLiteral);break;case 45:this.$=d.addLocationDataFn(g[a],g[a])(new d.BooleanLiteral(b[a]));break;case 46:this.$=d.addLocationDataFn(g[a],g[a])(new d.InfinityLiteral(b[a]));break;case 47:this.$=
|
||||
d.addLocationDataFn(g[a],g[a])(new d.NaNLiteral);break;case 48:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Assign(b[a-2],b[a]));break;case 49:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.Assign(b[a-3],b[a]));break;case 50:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.Assign(b[a-4],b[a-1]));break;case 51:case 88:case 93:case 94:case 96:case 97:case 98:case 223:case 224:this.$=d.addLocationDataFn(g[a],g[a])(new d.Value(b[a]));break;case 52:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Assign(d.addLocationDataFn(g[a-
|
||||
2])(new d.Value(b[a-2])),b[a],"object",{operatorToken:d.addLocationDataFn(g[a-1])(new d.Literal(b[a-1]))}));break;case 53:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.Assign(d.addLocationDataFn(g[a-4])(new d.Value(b[a-4])),b[a-1],"object",{operatorToken:d.addLocationDataFn(g[a-3])(new d.Literal(b[a-3]))}));break;case 54:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Assign(d.addLocationDataFn(g[a-2])(new d.Value(b[a-2])),b[a],null,{operatorToken:d.addLocationDataFn(g[a-1])(new d.Literal(b[a-1]))}));
|
||||
break;case 55:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.Assign(d.addLocationDataFn(g[a-4])(new d.Value(b[a-4])),b[a-1],null,{operatorToken:d.addLocationDataFn(g[a-3])(new d.Literal(b[a-3]))}));break;case 62:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Return(b[a]));break;case 63:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.Return(new d.Value(b[a-1])));break;case 64:this.$=d.addLocationDataFn(g[a],g[a])(new d.Return);break;case 65:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.YieldReturn(b[a]));
|
||||
break;case 66:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.YieldReturn);break;case 67:this.$=d.addLocationDataFn(g[a],g[a])(new d.Comment(b[a]));break;case 68:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.Code(b[a-3],b[a],b[a-1]));break;case 69:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Code([],b[a],b[a-1]));break;case 70:this.$=d.addLocationDataFn(g[a],g[a])("func");break;case 71:this.$=d.addLocationDataFn(g[a],g[a])("boundfunc");break;case 74:case 111:this.$=d.addLocationDataFn(g[a],g[a])([]);
|
||||
break;case 75:case 112:case 131:case 151:case 183:case 225:this.$=d.addLocationDataFn(g[a],g[a])([b[a]]);break;case 76:case 113:case 132:case 152:case 184:this.$=d.addLocationDataFn(g[a-2],g[a])(b[a-2].concat(b[a]));break;case 77:case 114:case 133:case 153:case 185:this.$=d.addLocationDataFn(g[a-3],g[a])(b[a-3].concat(b[a]));break;case 78:case 115:case 135:case 155:case 187:this.$=d.addLocationDataFn(g[a-5],g[a])(b[a-5].concat(b[a-2]));break;case 79:this.$=d.addLocationDataFn(g[a],g[a])(new d.Param(b[a]));
|
||||
break;case 80:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Param(b[a-1],null,!0));break;case 81:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Param(b[a-2],b[a]));break;case 82:case 190:this.$=d.addLocationDataFn(g[a],g[a])(new d.Expansion);break;case 87:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Splat(b[a-1]));break;case 89:this.$=d.addLocationDataFn(g[a-1],g[a])(b[a-1].add(b[a]));break;case 90:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Value(b[a-1],[].concat(b[a])));break;case 100:this.$=
|
||||
d.addLocationDataFn(g[a-1],g[a])(new d.Access(b[a]));break;case 101:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Access(b[a],"soak"));break;case 102:this.$=d.addLocationDataFn(g[a-1],g[a])([d.addLocationDataFn(g[a-1])(new d.Access(new d.PropertyName("prototype"))),d.addLocationDataFn(g[a])(new d.Access(b[a]))]);break;case 103:this.$=d.addLocationDataFn(g[a-1],g[a])([d.addLocationDataFn(g[a-1])(new d.Access(new d.PropertyName("prototype"),"soak")),d.addLocationDataFn(g[a])(new d.Access(b[a]))]);break;
|
||||
case 104:this.$=d.addLocationDataFn(g[a],g[a])(new d.Access(new d.PropertyName("prototype")));break;case 107:this.$=d.addLocationDataFn(g[a-1],g[a])(d.extend(b[a],{soak:!0}));break;case 108:this.$=d.addLocationDataFn(g[a],g[a])(new d.Index(b[a]));break;case 109:this.$=d.addLocationDataFn(g[a],g[a])(new d.Slice(b[a]));break;case 110:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.Obj(b[a-2],b[a-3].generated));break;case 116:this.$=d.addLocationDataFn(g[a],g[a])(new d.Class);break;case 117:this.$=d.addLocationDataFn(g[a-
|
||||
1],g[a])(new d.Class(null,null,b[a]));break;case 118:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Class(null,b[a]));break;case 119:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.Class(null,b[a-1],b[a]));break;case 120:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Class(b[a]));break;case 121:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Class(b[a-1],null,b[a]));break;case 122:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.Class(b[a-2],b[a]));break;case 123:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.Class(b[a-
|
||||
3],b[a-1],b[a]));break;case 124:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.ImportDeclaration(null,b[a]));break;case 125:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.ImportDeclaration(new d.ImportClause(b[a-2],null),b[a]));break;case 126:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.ImportDeclaration(new d.ImportClause(null,b[a-2]),b[a]));break;case 127:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.ImportDeclaration(new d.ImportClause(null,new d.ImportSpecifierList([])),b[a]));break;case 128:this.$=
|
||||
d.addLocationDataFn(g[a-6],g[a])(new d.ImportDeclaration(new d.ImportClause(null,new d.ImportSpecifierList(b[a-4])),b[a]));break;case 129:this.$=d.addLocationDataFn(g[a-5],g[a])(new d.ImportDeclaration(new d.ImportClause(b[a-4],b[a-2]),b[a]));break;case 130:this.$=d.addLocationDataFn(g[a-8],g[a])(new d.ImportDeclaration(new d.ImportClause(b[a-7],new d.ImportSpecifierList(b[a-4])),b[a]));break;case 134:case 154:case 170:case 186:this.$=d.addLocationDataFn(g[a-3],g[a])(b[a-2]);break;case 136:this.$=
|
||||
d.addLocationDataFn(g[a],g[a])(new d.ImportSpecifier(b[a]));break;case 137:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.ImportSpecifier(b[a-2],b[a]));break;case 138:this.$=d.addLocationDataFn(g[a],g[a])(new d.ImportSpecifier(new d.Literal(b[a])));break;case 139:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.ImportSpecifier(new d.Literal(b[a-2]),b[a]));break;case 140:this.$=d.addLocationDataFn(g[a],g[a])(new d.ImportDefaultSpecifier(b[a]));break;case 141:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.ImportNamespaceSpecifier(new d.Literal(b[a-
|
||||
2]),b[a]));break;case 142:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.ExportNamedDeclaration(new d.ExportSpecifierList([])));break;case 143:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.ExportNamedDeclaration(new d.ExportSpecifierList(b[a-2])));break;case 144:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.ExportNamedDeclaration(b[a]));break;case 145:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.ExportNamedDeclaration(new d.Assign(b[a-2],b[a],null,{moduleDeclaration:"export"})));break;case 146:this.$=
|
||||
d.addLocationDataFn(g[a-4],g[a])(new d.ExportNamedDeclaration(new d.Assign(b[a-3],b[a],null,{moduleDeclaration:"export"})));break;case 147:this.$=d.addLocationDataFn(g[a-5],g[a])(new d.ExportNamedDeclaration(new d.Assign(b[a-4],b[a-1],null,{moduleDeclaration:"export"})));break;case 148:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.ExportDefaultDeclaration(b[a]));break;case 149:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.ExportAllDeclaration(new d.Literal(b[a-2]),b[a]));break;case 150:this.$=d.addLocationDataFn(g[a-
|
||||
6],g[a])(new d.ExportNamedDeclaration(new d.ExportSpecifierList(b[a-4]),b[a]));break;case 156:this.$=d.addLocationDataFn(g[a],g[a])(new d.ExportSpecifier(b[a]));break;case 157:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.ExportSpecifier(b[a-2],b[a]));break;case 158:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.ExportSpecifier(b[a-2],new d.Literal(b[a])));break;case 159:this.$=d.addLocationDataFn(g[a],g[a])(new d.ExportSpecifier(new d.Literal(b[a])));break;case 160:this.$=d.addLocationDataFn(g[a-
|
||||
2],g[a])(new d.ExportSpecifier(new d.Literal(b[a-2]),b[a]));break;case 161:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.TaggedTemplateCall(b[a-2],b[a],b[a-1]));break;case 162:case 163:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Call(b[a-2],b[a],b[a-1]));break;case 165:this.$=d.addLocationDataFn(g[a],g[a])(new d.SuperCall);break;case 166:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.SuperCall(b[a]));break;case 167:this.$=d.addLocationDataFn(g[a],g[a])(!1);break;case 168:this.$=d.addLocationDataFn(g[a],
|
||||
g[a])(!0);break;case 169:this.$=d.addLocationDataFn(g[a-1],g[a])([]);break;case 171:case 172:this.$=d.addLocationDataFn(g[a],g[a])(new d.Value(new d.ThisLiteral));break;case 173:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Value(d.addLocationDataFn(g[a-1])(new d.ThisLiteral),[d.addLocationDataFn(g[a])(new d.Access(b[a]))],"this"));break;case 174:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Arr([]));break;case 175:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.Arr(b[a-2]));break;case 176:this.$=d.addLocationDataFn(g[a],
|
||||
g[a])("inclusive");break;case 177:this.$=d.addLocationDataFn(g[a],g[a])("exclusive");break;case 178:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.Range(b[a-3],b[a-1],b[a-2]));break;case 179:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Range(b[a-2],b[a],b[a-1]));break;case 180:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Range(b[a-1],null,b[a]));break;case 181:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Range(null,b[a],b[a-1]));break;case 182:this.$=d.addLocationDataFn(g[a],g[a])(new d.Range(null,
|
||||
null,b[a]));break;case 192:this.$=d.addLocationDataFn(g[a-2],g[a])([].concat(b[a-2],b[a]));break;case 193:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Try(b[a]));break;case 194:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Try(b[a-1],b[a][0],b[a][1]));break;case 195:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.Try(b[a-2],null,null,b[a]));break;case 196:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.Try(b[a-3],b[a-2][0],b[a-2][1],b[a]));break;case 197:this.$=d.addLocationDataFn(g[a-2],g[a])([b[a-
|
||||
1],b[a]]);break;case 198:this.$=d.addLocationDataFn(g[a-2],g[a])([d.addLocationDataFn(g[a-1])(new d.Value(b[a-1])),b[a]]);break;case 199:this.$=d.addLocationDataFn(g[a-1],g[a])([null,b[a]]);break;case 200:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Throw(b[a]));break;case 201:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Parens(b[a-1]));break;case 202:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.Parens(b[a-2]));break;case 203:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.While(b[a]));break;case 204:this.$=
|
||||
d.addLocationDataFn(g[a-3],g[a])(new d.While(b[a-2],{guard:b[a]}));break;case 205:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.While(b[a],{invert:!0}));break;case 206:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.While(b[a-2],{invert:!0,guard:b[a]}));break;case 207:this.$=d.addLocationDataFn(g[a-1],g[a])(b[a-1].addBody(b[a]));break;case 208:case 209:this.$=d.addLocationDataFn(g[a-1],g[a])(b[a].addBody(d.addLocationDataFn(g[a-1])(d.Block.wrap([b[a-1]]))));break;case 210:this.$=d.addLocationDataFn(g[a],
|
||||
g[a])(b[a]);break;case 211:this.$=d.addLocationDataFn(g[a-1],g[a])((new d.While(d.addLocationDataFn(g[a-1])(new d.BooleanLiteral("true")))).addBody(b[a]));break;case 212:this.$=d.addLocationDataFn(g[a-1],g[a])((new d.While(d.addLocationDataFn(g[a-1])(new d.BooleanLiteral("true")))).addBody(d.addLocationDataFn(g[a])(d.Block.wrap([b[a]]))));break;case 213:case 214:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.For(b[a-1],b[a]));break;case 215:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.For(b[a],b[a-
|
||||
1]));break;case 216:this.$=d.addLocationDataFn(g[a-1],g[a])({source:d.addLocationDataFn(g[a])(new d.Value(b[a]))});break;case 217:this.$=d.addLocationDataFn(g[a-3],g[a])({source:d.addLocationDataFn(g[a-2])(new d.Value(b[a-2])),step:b[a]});break;case 218:d=d.addLocationDataFn(g[a-1],g[a]);b[a].own=b[a-1].own;b[a].ownTag=b[a-1].ownTag;b[a].name=b[a-1][0];b[a].index=b[a-1][1];this.$=d(b[a]);break;case 219:this.$=d.addLocationDataFn(g[a-1],g[a])(b[a]);break;case 220:Ca=d.addLocationDataFn(g[a-2],g[a]);
|
||||
b[a].own=!0;b[a].ownTag=d.addLocationDataFn(g[a-1])(new d.Literal(b[a-1]));this.$=Ca(b[a]);break;case 226:this.$=d.addLocationDataFn(g[a-2],g[a])([b[a-2],b[a]]);break;case 227:this.$=d.addLocationDataFn(g[a-1],g[a])({source:b[a]});break;case 228:this.$=d.addLocationDataFn(g[a-1],g[a])({source:b[a],object:!0});break;case 229:this.$=d.addLocationDataFn(g[a-3],g[a])({source:b[a-2],guard:b[a]});break;case 230:this.$=d.addLocationDataFn(g[a-3],g[a])({source:b[a-2],guard:b[a],object:!0});break;case 231:this.$=
|
||||
d.addLocationDataFn(g[a-3],g[a])({source:b[a-2],step:b[a]});break;case 232:this.$=d.addLocationDataFn(g[a-5],g[a])({source:b[a-4],guard:b[a-2],step:b[a]});break;case 233:this.$=d.addLocationDataFn(g[a-5],g[a])({source:b[a-4],step:b[a-2],guard:b[a]});break;case 234:this.$=d.addLocationDataFn(g[a-1],g[a])({source:b[a],from:!0});break;case 235:this.$=d.addLocationDataFn(g[a-3],g[a])({source:b[a-2],guard:b[a],from:!0});break;case 236:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.Switch(b[a-3],b[a-1]));
|
||||
break;case 237:this.$=d.addLocationDataFn(g[a-6],g[a])(new d.Switch(b[a-5],b[a-3],b[a-1]));break;case 238:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.Switch(null,b[a-1]));break;case 239:this.$=d.addLocationDataFn(g[a-5],g[a])(new d.Switch(null,b[a-3],b[a-1]));break;case 241:this.$=d.addLocationDataFn(g[a-1],g[a])(b[a-1].concat(b[a]));break;case 242:this.$=d.addLocationDataFn(g[a-2],g[a])([[b[a-1],b[a]]]);break;case 243:this.$=d.addLocationDataFn(g[a-3],g[a])([[b[a-2],b[a-1]]]);break;case 244:this.$=
|
||||
d.addLocationDataFn(g[a-2],g[a])(new d.If(b[a-1],b[a],{type:b[a-2]}));break;case 245:this.$=d.addLocationDataFn(g[a-4],g[a])(b[a-4].addElse(d.addLocationDataFn(g[a-2],g[a])(new d.If(b[a-1],b[a],{type:b[a-2]}))));break;case 247:this.$=d.addLocationDataFn(g[a-2],g[a])(b[a-2].addElse(b[a]));break;case 248:case 249:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.If(b[a],d.addLocationDataFn(g[a-2])(d.Block.wrap([b[a-2]])),{type:b[a-1],statement:!0}));break;case 252:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Op("-",
|
||||
b[a]));break;case 253:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Op("+",b[a]));break;case 254:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Op("--",b[a]));break;case 255:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Op("++",b[a]));break;case 256:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Op("--",b[a-1],null,!0));break;case 257:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Op("++",b[a-1],null,!0));break;case 258:this.$=d.addLocationDataFn(g[a-1],g[a])(new d.Existence(b[a-1]));break;case 259:this.$=
|
||||
d.addLocationDataFn(g[a-2],g[a])(new d.Op("+",b[a-2],b[a]));break;case 260:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Op("-",b[a-2],b[a]));break;case 261:case 262:case 263:case 264:case 265:case 266:case 267:case 268:case 269:case 270:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Op(b[a-1],b[a-2],b[a]));break;case 271:g=d.addLocationDataFn(g[a-2],g[a]);b="!"===b[a-1].charAt(0)?(new d.Op(b[a-1].slice(1),b[a-2],b[a])).invert():new d.Op(b[a-1],b[a-2],b[a]);this.$=g(b);break;case 272:this.$=d.addLocationDataFn(g[a-
|
||||
2],g[a])(new d.Assign(b[a-2],b[a],b[a-1]));break;case 273:this.$=d.addLocationDataFn(g[a-4],g[a])(new d.Assign(b[a-4],b[a-1],b[a-3]));break;case 274:this.$=d.addLocationDataFn(g[a-3],g[a])(new d.Assign(b[a-3],b[a],b[a-2]));break;case 275:this.$=d.addLocationDataFn(g[a-2],g[a])(new d.Extends(b[a-2],b[a]))}},table:[{1:[2,1],3:1,4:2,5:3,7:4,8:5,9:6,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:u,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,
|
||||
44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{1:[3]},{1:[2,2],6:ra},a(ta,[2,3]),a(ta,[2,6],{141:77,132:102,138:103,133:D,135:A,139:E,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(ta,
|
||||
[2,7],{141:77,132:105,138:106,133:D,135:A,139:E,156:ya}),a(ta,[2,8]),a(na,[2,14],{109:107,78:108,86:114,40:Da,41:Da,114:Da,82:va,83:xa,84:Ha,85:Ka,87:Fa,90:Ra,113:La}),a(na,[2,15],{86:114,109:117,78:118,82:va,83:xa,84:Ha,85:Ka,87:Fa,90:Ra,113:La,114:Da}),a(na,[2,16]),a(na,[2,17]),a(na,[2,18]),a(na,[2,19]),a(na,[2,20]),a(na,[2,21]),a(na,[2,22]),a(na,[2,23]),a(na,[2,24]),a(na,[2,25]),a(na,[2,26]),a(Ga,[2,9]),a(Ga,[2,10]),a(Ga,[2,11]),a(Ga,[2,12]),a(Ga,[2,13]),a([1,6,32,42,131,133,135,139,156,163,164,
|
||||
165,166,167,168,169,170,171,172,173,174],Wa,{15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,67:33,77:40,154:41,132:43,136:44,138:45,75:53,62:54,37:55,43:57,33:70,60:71,141:77,39:80,7:120,8:122,12:b,28:da,29:Za,34:f,38:k,40:t,41:p,44:z,45:I,48:J,49:F,50:N,51:y,52:G,53:O,61:[1,119],63:B,64:n,68:c,69:w,92:q,95:h,97:K,105:P,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,137:r,149:aa,155:ba,157:C,158:S,159:v,160:X,161:R,
|
||||
162:M}),a(Ea,Ia,{55:[1,124]}),a(Ea,[2,96]),a(Ea,[2,97]),a(Ea,[2,98]),a(Ea,[2,99]),a(m,[2,164]),a([6,31,66,71],l,{65:125,72:126,73:127,33:129,60:130,75:131,62:132,34:f,74:d,92:q,118:Ca,119:Ja}),{30:135,31:ua},{7:137,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,
|
||||
95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:138,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,
|
||||
117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:139,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,
|
||||
130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:140,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,
|
||||
137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{15:142,16:143,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:144,60:71,62:54,75:53,77:141,79:28,80:29,81:30,92:q,111:31,112:L,117:U,118:W,119:H,130:V},{15:142,16:143,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:144,60:71,62:54,75:53,77:145,79:28,80:29,81:30,92:q,111:31,112:L,117:U,118:W,119:H,130:V},a(Na,wa,{96:[1,149],161:[1,
|
||||
146],162:[1,147],175:[1,148]}),a(na,[2,246],{151:[1,150]}),{30:151,31:ua},{30:152,31:ua},a(na,[2,210]),{30:153,31:ua},{7:154,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,31:[1,155],33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,
|
||||
135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Gb,[2,116],{47:27,79:28,80:29,81:30,111:31,75:53,62:54,37:55,43:57,33:70,60:71,39:80,15:142,16:143,54:144,30:156,77:158,31:ua,34:f,38:k,40:t,41:p,44:z,45:I,48:J,49:F,50:N,51:y,52:G,53:O,92:q,96:[1,157],112:L,117:U,118:W,119:H,130:V}),{7:159,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,
|
||||
45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Ga,$a,{15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,67:33,77:40,154:41,132:43,136:44,138:45,75:53,62:54,37:55,
|
||||
43:57,33:70,60:71,141:77,39:80,8:122,7:160,12:b,28:da,31:Hb,34:f,38:k,40:t,41:p,44:z,45:I,48:J,49:F,50:N,51:y,52:G,53:O,61:Q,63:B,64:n,68:c,69:w,92:q,95:h,97:K,105:P,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,137:r,149:aa,155:ba,157:C,158:S,159:v,160:X,161:R,162:M}),a([1,6,31,32,42,71,94,131,133,135,139,156],[2,67]),{33:166,34:f,39:162,40:t,41:p,92:[1,165],98:163,99:164,104:Ib},{25:169,33:170,34:f,92:[1,168],95:h,103:[1,171],107:[1,172]},a(Na,[2,93]),a(Na,[2,94]),a(Ea,[2,40]),a(Ea,[2,41]),a(Ea,[2,
|
||||
42]),a(Ea,[2,43]),a(Ea,[2,44]),a(Ea,[2,45]),a(Ea,[2,46]),a(Ea,[2,47]),{4:173,5:3,7:4,8:5,9:6,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:u,31:[1,174],33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,
|
||||
149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:175,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,31:ab,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,74:Va,75:53,76:180,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,116:177,117:U,118:W,119:H,120:Jb,123:178,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,
|
||||
139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Ea,[2,171]),a(Ea,[2,172],{35:182,36:Qa}),a([1,6,31,32,42,46,66,71,74,82,83,84,85,87,89,90,94,113,115,120,122,131,133,134,135,139,140,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],[2,165],{110:184,114:ub}),{31:[2,70]},{31:[2,71]},a(Oa,[2,88]),a(Oa,[2,91]),{7:186,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,
|
||||
43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:187,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,
|
||||
50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:188,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,
|
||||
61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:190,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,30:189,31:ua,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,
|
||||
64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{33:195,34:f,60:196,62:198,75:197,80:191,92:q,118:Ca,119:H,143:192,144:[1,193],145:194},{142:199,146:[1,200],147:[1,201],148:[1,202]},a([6,31,71,94],Kb,{39:80,93:203,56:204,57:205,59:206,11:207,37:208,33:209,35:210,60:211,34:f,36:Qa,38:k,40:t,41:p,63:B,118:Ca}),a(Lb,[2,
|
||||
34]),a(Lb,[2,35]),a(Ea,[2,38]),{15:142,16:212,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:144,60:71,62:54,75:53,77:213,79:28,80:29,81:30,92:q,111:31,112:L,117:U,118:W,119:H,130:V},a([1,6,29,31,32,40,41,42,55,58,66,71,74,82,83,84,85,87,89,90,94,96,102,113,114,115,120,122,131,133,134,135,139,140,146,147,148,156,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175],[2,32]),a(Mb,[2,36]),{4:214,5:3,7:4,8:5,9:6,10:20,11:21,12:b,13:23,14:24,
|
||||
15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:u,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(ta,[2,5],{7:4,8:5,9:6,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,
|
||||
24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,67:33,77:40,154:41,132:43,136:44,138:45,75:53,62:54,37:55,43:57,33:70,60:71,141:77,39:80,5:215,12:b,28:u,34:f,38:k,40:t,41:p,44:z,45:I,48:J,49:F,50:N,51:y,52:G,53:O,61:Q,63:B,64:n,68:c,69:w,92:q,95:h,97:K,105:P,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,133:D,135:A,137:r,139:E,149:aa,155:ba,157:C,158:S,159:v,160:X,161:R,162:M}),a(na,[2,258]),{7:216,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,
|
||||
21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:217,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,
|
||||
26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:218,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,
|
||||
37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:219,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,
|
||||
44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:220,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,
|
||||
51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:221,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,
|
||||
62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:222,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,
|
||||
75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:223,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,
|
||||
92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:224,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,
|
||||
117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:225,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,
|
||||
130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:226,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,
|
||||
137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:227,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,
|
||||
154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:228,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,
|
||||
160:X,161:R,162:M},{7:229,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(na,[2,209]),
|
||||
a(na,[2,214]),{7:230,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(na,[2,208]),a(na,
|
||||
[2,213]),{39:231,40:t,41:p,110:232,114:ub},a(Oa,[2,89]),a(Nb,[2,168]),{35:233,36:Qa},{35:234,36:Qa},a(Oa,[2,104],{35:235,36:Qa}),{35:236,36:Qa},a(Oa,[2,105]),{7:238,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,74:Ob,75:53,77:40,79:28,80:29,81:30,88:237,91:239,92:q,95:h,97:K,105:P,111:31,112:L,
|
||||
117:U,118:W,119:H,121:240,122:vb,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{86:243,87:Fa,90:Ra},{110:244,114:ub},a(Oa,[2,90]),a(ta,[2,66],{15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,67:33,77:40,154:41,132:43,136:44,138:45,75:53,62:54,37:55,43:57,33:70,60:71,141:77,39:80,8:122,7:245,12:b,28:da,31:Hb,34:f,38:k,40:t,41:p,44:z,
|
||||
45:I,48:J,49:F,50:N,51:y,52:G,53:O,61:Q,63:B,64:n,68:c,69:w,92:q,95:h,97:K,105:P,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,133:$a,135:$a,139:$a,156:$a,137:r,149:aa,155:ba,157:C,158:S,159:v,160:X,161:R,162:M}),a(Pa,[2,28],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),{7:246,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,
|
||||
43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{132:105,133:D,135:A,138:106,139:E,141:77,156:ya},a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,163,164,165,166,167,168,169,170,171,172,173,174],Wa,{15:7,16:8,17:9,18:10,
|
||||
19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,67:33,77:40,154:41,132:43,136:44,138:45,75:53,62:54,37:55,43:57,33:70,60:71,141:77,39:80,7:120,8:122,12:b,28:da,29:Za,34:f,38:k,40:t,41:p,44:z,45:I,48:J,49:F,50:N,51:y,52:G,53:O,61:Q,63:B,64:n,68:c,69:w,92:q,95:h,97:K,105:P,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,137:r,149:aa,155:ba,157:C,158:S,159:v,160:X,161:R,162:M}),{6:[1,248],7:247,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,
|
||||
17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,31:[1,249],33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a([6,31],Ma,{70:252,66:[1,250],71:Pb}),a(Ua,[2,75]),a(Ua,[2,79],{55:[1,
|
||||
254],74:[1,253]}),a(Ua,[2,82]),a(hb,[2,83]),a(hb,[2,84]),a(hb,[2,85]),a(hb,[2,86]),{35:182,36:Qa},{7:255,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,31:ab,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,74:Va,75:53,76:180,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,116:177,117:U,118:W,119:H,120:Jb,123:178,125:Z,129:T,130:V,
|
||||
132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(na,[2,69]),{4:257,5:3,7:4,8:5,9:6,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:u,32:[1,256],33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,
|
||||
132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,159,160,164,165,166,167,168,169,170,171,172,173,174],[2,250],{141:77,132:102,138:103,163:ea}),a(bb,[2,251],{141:77,132:102,138:103,163:ea,165:fa}),a(bb,[2,252],{141:77,132:102,138:103,163:ea,165:fa}),a(bb,[2,253],{141:77,132:102,138:103,163:ea,165:fa}),a(na,[2,254],{40:wa,41:wa,82:wa,83:wa,84:wa,85:wa,87:wa,90:wa,113:wa,
|
||||
114:wa}),a(Nb,Da,{109:107,78:108,86:114,82:va,83:xa,84:Ha,85:Ka,87:Fa,90:Ra,113:La}),{78:118,82:va,83:xa,84:Ha,85:Ka,86:114,87:Fa,90:Ra,109:117,113:La,114:Da},a(Qb,Ia),a(na,[2,255],{40:wa,41:wa,82:wa,83:wa,84:wa,85:wa,87:wa,90:wa,113:wa,114:wa}),a(na,[2,256]),a(na,[2,257]),{6:[1,260],7:258,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,31:[1,259],33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,
|
||||
53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:261,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,
|
||||
64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{30:262,31:ua,155:[1,263]},a(na,[2,193],{126:264,127:[1,265],128:[1,266]}),a(na,[2,207]),a(na,[2,215]),{31:[1,267],132:102,133:D,135:A,138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},{150:268,
|
||||
152:269,153:ib},a(na,[2,117]),{7:271,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},
|
||||
a(Gb,[2,120],{30:272,31:ua,40:wa,41:wa,82:wa,83:wa,84:wa,85:wa,87:wa,90:wa,113:wa,114:wa,96:[1,273]}),a(Pa,[2,200],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Ga,cb,{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),{62:274,92:q},a(Ga,[2,124]),{29:[1,275],71:[1,276]},{29:[1,277]},{31:jb,33:282,34:f,94:[1,278],100:279,101:280,103:Xa},a([29,71],[2,
|
||||
140]),{102:[1,284]},{31:wb,33:289,34:f,94:[1,285],103:db,106:286,108:287},a(Ga,[2,144]),{55:[1,291]},{7:292,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,
|
||||
139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{29:[1,293]},{6:ra,131:[1,294]},{4:295,5:3,7:4,8:5,9:6,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:u,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,
|
||||
138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a([6,31,71,120],Rb,{141:77,132:102,138:103,121:296,74:[1,297],122:vb,133:D,135:A,139:E,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(xb,[2,174]),a([6,31,120],Ma,{70:298,71:kb}),a(Sa,[2,183]),{7:255,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,31:ab,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,
|
||||
44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,74:Va,75:53,76:180,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,116:300,117:U,118:W,119:H,123:178,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Sa,[2,189]),a(Sa,[2,190]),a(Sb,[2,173]),a(Sb,[2,33]),a(m,[2,166]),{7:255,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,
|
||||
25:17,26:18,27:19,28:da,31:ab,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,74:Va,75:53,76:180,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,115:[1,301],116:302,117:U,118:W,119:H,123:178,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{30:303,31:ua,132:102,133:D,135:A,138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,
|
||||
164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},a(Tb,[2,203],{141:77,132:102,138:103,133:D,134:[1,304],135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Tb,[2,205],{141:77,132:102,138:103,133:D,134:[1,305],135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(na,[2,211]),a(Ya,[2,212],{141:77,132:102,138:103,133:D,135:A,139:E,159:ma,160:Y,163:ea,164:ia,
|
||||
165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,156,159,160,163,164,165,166,167,168,169,170,171,172,173,174],[2,216],{140:[1,306]}),a(lb,[2,219]),{33:195,34:f,60:196,62:198,75:197,92:q,118:Ca,119:Ja,143:307,145:194},a(lb,[2,225],{71:[1,308]}),a(mb,[2,221]),a(mb,[2,222]),a(mb,[2,223]),a(mb,[2,224]),a(na,[2,218]),{7:309,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,
|
||||
26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:310,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,
|
||||
37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:311,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,
|
||||
44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(nb,Ma,{70:312,71:Ub}),a(Ba,[2,112]),a(Ba,[2,51],{58:[1,314]}),a(Vb,[2,60],{55:[1,315]}),a(Ba,[2,56]),a(Vb,[2,61]),a(yb,[2,57]),a(yb,[2,58]),a(yb,[2,59]),{46:[1,316],78:118,82:va,83:xa,84:Ha,85:Ka,
|
||||
86:114,87:Fa,90:Ra,109:117,113:La,114:Da},a(Qb,wa),{6:ra,42:[1,317]},a(ta,[2,4]),a(Wb,[2,259],{141:77,132:102,138:103,163:ea,164:ia,165:fa}),a(Wb,[2,260],{141:77,132:102,138:103,163:ea,164:ia,165:fa}),a(bb,[2,261],{141:77,132:102,138:103,163:ea,165:fa}),a(bb,[2,262],{141:77,132:102,138:103,163:ea,165:fa}),a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,166,167,168,169,170,171,172,173,174],[2,263],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa}),a([1,6,31,32,42,66,
|
||||
71,74,89,94,115,120,122,131,133,134,135,139,140,156,167,168,169,170,171,172,173],[2,264],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,174:ca}),a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,168,169,170,171,172,173],[2,265],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,174:ca}),a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,169,170,171,172,173],[2,266],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,
|
||||
166:ja,167:la,168:pa,174:ca}),a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,170,171,172,173],[2,267],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,174:ca}),a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,171,172,173],[2,268],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,174:ca}),a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,172,173],[2,269],
|
||||
{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,174:ca}),a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,173],[2,270],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,174:ca}),a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,140,156,167,168,169,170,171,172,173,174],[2,271],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja}),a(Ya,[2,249],
|
||||
{141:77,132:102,138:103,133:D,135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Ya,[2,248],{141:77,132:102,138:103,133:D,135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(m,[2,161]),a(m,[2,162]),a(Oa,[2,100]),a(Oa,[2,101]),a(Oa,[2,102]),a(Oa,[2,103]),{89:[1,318]},{74:Ob,89:[2,108],121:319,122:vb,132:102,133:D,135:A,138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,
|
||||
166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},{89:[2,109]},{7:320,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,89:[2,182],92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,
|
||||
149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Xb,[2,176]),a(Xb,Yb),a(Oa,[2,107]),a(m,[2,163]),a(ta,[2,65],{141:77,132:102,138:103,133:cb,135:cb,139:cb,156:cb,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Pa,[2,29],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Pa,[2,48],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,
|
||||
170:ha,171:ka,172:oa,173:sa,174:ca}),{7:321,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,
|
||||
162:M},{7:322,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{67:323,68:c,69:w},a(Ta,
|
||||
eb,{73:127,33:129,60:130,75:131,62:132,72:324,34:f,74:d,92:q,118:Ca,119:Ja}),{6:Zb,31:$b},a(Ua,[2,80]),{7:327,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,
|
||||
139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Sa,Rb,{141:77,132:102,138:103,74:[1,328],133:D,135:A,139:E,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(ac,[2,30]),{6:ra,32:[1,329]},a(Pa,[2,272],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),{7:330,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,
|
||||
25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:331,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,
|
||||
34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Pa,[2,275],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(na,[2,247]),{7:332,8:122,
|
||||
10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(na,[2,194],{127:[1,333]}),{30:334,31:ua},
|
||||
{30:337,31:ua,33:335,34:f,62:336,92:q},{150:338,152:269,153:ib},{32:[1,339],151:[1,340],152:341,153:ib},a(ob,[2,240]),{7:343,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,124:342,125:Z,129:T,130:V,132:43,133:D,
|
||||
135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(bc,[2,118],{141:77,132:102,138:103,30:344,31:ua,133:D,135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(na,[2,121]),{7:345,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,
|
||||
61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{32:[1,346]},{39:347,40:t,41:p},{92:[1,349],99:348,104:Ib},{39:350,40:t,41:p},{29:[1,351]},a(nb,Ma,{70:352,71:pb}),a(Ba,[2,131]),{31:jb,33:282,34:f,100:354,101:280,103:Xa},a(Ba,[2,136],{102:[1,355]}),a(Ba,[2,138],{102:[1,356]}),{33:357,34:f},a(Ga,[2,142]),
|
||||
a(nb,Ma,{70:358,71:zb}),a(Ba,[2,151]),{31:wb,33:289,34:f,103:db,106:360,108:287},a(Ba,[2,156],{102:[1,361]}),a(Ba,[2,159],{102:[1,362]}),{6:[1,364],7:363,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,31:[1,365],33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,
|
||||
125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Ab,[2,148],{141:77,132:102,138:103,133:D,135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),{39:366,40:t,41:p},a(Ea,[2,201]),{6:ra,32:[1,367]},{7:368,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,
|
||||
45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a([12,28,34,38,40,41,44,45,48,49,50,51,52,53,61,63,64,68,69,92,95,97,105,112,117,118,119,125,129,130,133,135,137,139,149,155,157,158,159,160,161,162],Yb,{6:fb,31:fb,71:fb,120:fb}),{6:qb,31:rb,120:[1,369]},
|
||||
a([6,31,32,115,120],eb,{15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,10:20,11:21,13:23,14:24,54:26,47:27,79:28,80:29,81:30,111:31,67:33,77:40,154:41,132:43,136:44,138:45,75:53,62:54,37:55,43:57,33:70,60:71,141:77,39:80,8:122,76:180,7:255,123:372,12:b,28:da,34:f,38:k,40:t,41:p,44:z,45:I,48:J,49:F,50:N,51:y,52:G,53:O,61:Q,63:B,64:n,68:c,69:w,74:Va,92:q,95:h,97:K,105:P,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,133:D,135:A,137:r,139:E,149:aa,155:ba,157:C,158:S,159:v,160:X,
|
||||
161:R,162:M}),a(Ta,Ma,{70:373,71:kb}),a(m,[2,169]),a([6,31,115],Ma,{70:374,71:kb}),a(cc,[2,244]),{7:375,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,
|
||||
141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:376,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,
|
||||
158:S,159:v,160:X,161:R,162:M},{7:377,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},
|
||||
a(lb,[2,220]),{33:195,34:f,60:196,62:198,75:197,92:q,118:Ca,119:Ja,145:378},a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,135,139,156],[2,227],{141:77,132:102,138:103,134:[1,379],140:[1,380],159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Bb,[2,228],{141:77,132:102,138:103,134:[1,381],159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Bb,[2,234],{141:77,132:102,138:103,134:[1,382],159:ma,160:Y,
|
||||
163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),{6:dc,31:ec,94:[1,383]},a(Cb,eb,{39:80,57:205,59:206,11:207,37:208,33:209,35:210,60:211,56:386,34:f,36:Qa,38:k,40:t,41:p,63:B,118:Ca}),{7:387,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,31:[1,388],33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,
|
||||
79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:389,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,31:[1,390],33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,
|
||||
92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Ea,[2,39]),a(Mb,[2,37]),a(Oa,[2,106]),{7:391,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,
|
||||
81:30,89:[2,180],92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{89:[2,181],132:102,133:D,135:A,138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},a(Pa,[2,49],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),{32:[1,392],
|
||||
132:102,133:D,135:A,138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},{30:393,31:ua},a(Ua,[2,76]),{33:129,34:f,60:130,62:132,72:394,73:127,74:d,75:131,92:q,118:Ca,119:Ja},a(fc,l,{72:126,73:127,33:129,60:130,75:131,62:132,65:395,34:f,74:d,92:q,118:Ca,119:Ja}),a(Ua,[2,81],{141:77,132:102,138:103,133:D,135:A,139:E,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Sa,fb),
|
||||
a(ac,[2,31]),{32:[1,396],132:102,133:D,135:A,138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},a(Pa,[2,274],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),{30:397,31:ua,132:102,133:D,135:A,138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},{30:398,31:ua},a(na,[2,195]),{30:399,
|
||||
31:ua},{30:400,31:ua},a(Db,[2,199]),{32:[1,401],151:[1,402],152:341,153:ib},a(na,[2,238]),{30:403,31:ua},a(ob,[2,241]),{30:404,31:ua,71:[1,405]},a(gc,[2,191],{141:77,132:102,138:103,133:D,135:A,139:E,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(na,[2,119]),a(bc,[2,122],{141:77,132:102,138:103,30:406,31:ua,133:D,135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Ga,[2,63]),a(Ga,
|
||||
[2,125]),{29:[1,407]},{31:jb,33:282,34:f,100:408,101:280,103:Xa},a(Ga,[2,126]),{39:409,40:t,41:p},{6:sb,31:tb,94:[1,410]},a(Cb,eb,{33:282,101:413,34:f,103:Xa}),a(Ta,Ma,{70:414,71:pb}),{33:415,34:f},{33:416,34:f},{29:[2,141]},{6:Eb,31:Fb,94:[1,417]},a(Cb,eb,{33:289,108:420,34:f,103:db}),a(Ta,Ma,{70:421,71:zb}),{33:422,34:f,103:[1,423]},{33:424,34:f},a(Ab,[2,145],{141:77,132:102,138:103,133:D,135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),
|
||||
{7:425,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:426,8:122,10:20,11:21,12:b,
|
||||
13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Ga,[2,149]),{131:[1,427]},{120:[1,428],132:102,133:D,135:A,
|
||||
138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},a(xb,[2,175]),{7:255,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,74:Va,75:53,76:180,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,123:429,
|
||||
125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:255,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,31:ab,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,74:Va,75:53,76:180,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,116:430,117:U,118:W,119:H,123:178,
|
||||
125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Sa,[2,184]),{6:qb,31:rb,32:[1,431]},{6:qb,31:rb,115:[1,432]},a(Ya,[2,204],{141:77,132:102,138:103,133:D,135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Ya,[2,206],{141:77,132:102,138:103,133:D,135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Ya,
|
||||
[2,217],{141:77,132:102,138:103,133:D,135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(lb,[2,226]),{7:433,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,
|
||||
119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:434,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,
|
||||
133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:435,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,
|
||||
139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:436,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,
|
||||
157:C,158:S,159:v,160:X,161:R,162:M},a(xb,[2,110]),{11:207,33:209,34:f,35:210,36:Qa,37:208,38:k,39:80,40:t,41:p,56:437,57:205,59:206,60:211,63:B,118:Ca},a(fc,Kb,{39:80,56:204,57:205,59:206,11:207,37:208,33:209,35:210,60:211,93:438,34:f,36:Qa,38:k,40:t,41:p,63:B,118:Ca}),a(Ba,[2,113]),a(Ba,[2,52],{141:77,132:102,138:103,133:D,135:A,139:E,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),{7:439,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,
|
||||
18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(Ba,[2,54],{141:77,132:102,138:103,133:D,135:A,139:E,156:Aa,159:ma,160:Y,163:ea,164:ia,
|
||||
165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),{7:440,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,
|
||||
157:C,158:S,159:v,160:X,161:R,162:M},{89:[2,179],132:102,133:D,135:A,138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},a(na,[2,50]),a(na,[2,68]),a(Ua,[2,77]),a(Ta,Ma,{70:441,71:Pb}),a(na,[2,273]),a(cc,[2,245]),a(na,[2,196]),a(Db,[2,197]),a(Db,[2,198]),a(na,[2,236]),{30:442,31:ua},{32:[1,443]},a(ob,[2,242],{6:[1,444]}),{7:445,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,
|
||||
26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,161:R,162:M},a(na,[2,123]),{39:446,40:t,41:p},a(nb,Ma,{70:447,71:pb}),a(Ga,[2,127]),{29:[1,448]},{33:282,34:f,101:449,103:Xa},{31:jb,33:282,34:f,100:450,
|
||||
101:280,103:Xa},a(Ba,[2,132]),{6:sb,31:tb,32:[1,451]},a(Ba,[2,137]),a(Ba,[2,139]),a(Ga,[2,143],{29:[1,452]}),{33:289,34:f,103:db,108:453},{31:wb,33:289,34:f,103:db,106:454,108:287},a(Ba,[2,152]),{6:Eb,31:Fb,32:[1,455]},a(Ba,[2,157]),a(Ba,[2,158]),a(Ba,[2,160]),a(Ab,[2,146],{141:77,132:102,138:103,133:D,135:A,139:E,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),{32:[1,456],132:102,133:D,135:A,138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,164:ia,
|
||||
165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},a(Ea,[2,202]),a(Ea,[2,178]),a(Sa,[2,185]),a(Ta,Ma,{70:457,71:kb}),a(Sa,[2,186]),a(m,[2,170]),a([1,6,31,32,42,66,71,74,89,94,115,120,122,131,133,134,135,139,156],[2,229],{141:77,132:102,138:103,140:[1,458],159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Bb,[2,231],{141:77,132:102,138:103,134:[1,459],159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,
|
||||
173:sa,174:ca}),a(Pa,[2,230],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Pa,[2,235],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Ba,[2,114]),a(Ta,Ma,{70:460,71:Ub}),{32:[1,461],132:102,133:D,135:A,138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},{32:[1,462],132:102,
|
||||
133:D,135:A,138:103,139:E,141:77,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca},{6:Zb,31:$b,32:[1,463]},{32:[1,464]},a(na,[2,239]),a(ob,[2,243]),a(gc,[2,192],{141:77,132:102,138:103,133:D,135:A,139:E,156:Aa,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Ga,[2,129]),{6:sb,31:tb,94:[1,465]},{39:466,40:t,41:p},a(Ba,[2,133]),a(Ta,Ma,{70:467,71:pb}),a(Ba,[2,134]),{39:468,40:t,41:p},a(Ba,[2,153]),
|
||||
a(Ta,Ma,{70:469,71:zb}),a(Ba,[2,154]),a(Ga,[2,147]),{6:qb,31:rb,32:[1,470]},{7:471,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,
|
||||
155:ba,157:C,158:S,159:v,160:X,161:R,162:M},{7:472,8:122,10:20,11:21,12:b,13:23,14:24,15:7,16:8,17:9,18:10,19:11,20:12,21:13,22:14,23:15,24:16,25:17,26:18,27:19,28:da,33:70,34:f,37:55,38:k,39:80,40:t,41:p,43:57,44:z,45:I,47:27,48:J,49:F,50:N,51:y,52:G,53:O,54:26,60:71,61:Q,62:54,63:B,64:n,67:33,68:c,69:w,75:53,77:40,79:28,80:29,81:30,92:q,95:h,97:K,105:P,111:31,112:L,117:U,118:W,119:H,125:Z,129:T,130:V,132:43,133:D,135:A,136:44,137:r,138:45,139:E,141:77,149:aa,154:41,155:ba,157:C,158:S,159:v,160:X,
|
||||
161:R,162:M},{6:dc,31:ec,32:[1,473]},a(Ba,[2,53]),a(Ba,[2,55]),a(Ua,[2,78]),a(na,[2,237]),{29:[1,474]},a(Ga,[2,128]),{6:sb,31:tb,32:[1,475]},a(Ga,[2,150]),{6:Eb,31:Fb,32:[1,476]},a(Sa,[2,187]),a(Pa,[2,232],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Pa,[2,233],{141:77,132:102,138:103,159:ma,160:Y,163:ea,164:ia,165:fa,166:ja,167:la,168:pa,169:qa,170:ha,171:ka,172:oa,173:sa,174:ca}),a(Ba,[2,115]),{39:477,40:t,41:p},a(Ba,
|
||||
[2,135]),a(Ba,[2,155]),a(Ga,[2,130])],defaultActions:{68:[2,70],69:[2,71],239:[2,109],357:[2,141]},parseError:function(a,d){if(d.recoverable)this.trace(a);else{var b=function(a,d){this.message=a;this.hash=d};b.prototype=Error;throw new b(a,d);}},parse:function(a){var d=[0],b=[null],l=[],m=this.table,Ca="",g=0,Ja=0,c=0,f=l.slice.call(arguments,1),ua=Object.create(this.lexer),h={};for(n in this.yy)Object.prototype.hasOwnProperty.call(this.yy,n)&&(h[n]=this.yy[n]);ua.setInput(a,h);h.lexer=ua;h.parser=
|
||||
this;"undefined"==typeof ua.yylloc&&(ua.yylloc={});var n=ua.yylloc;l.push(n);var k=ua.options&&ua.options.ranges;this.parseError="function"===typeof h.parseError?h.parseError:Object.getPrototypeOf(this).parseError;for(var e,q,Na,Ia,p={},wa,x;;){Na=d[d.length-1];if(this.defaultActions[Na])Ia=this.defaultActions[Na];else{if(null===e||"undefined"==typeof e)e=ua.lex()||1,"number"!==typeof e&&(e=this.symbols_[e]||e);Ia=m[Na]&&m[Na][e]}if("undefined"===typeof Ia||!Ia.length||!Ia[0]){x=[];for(wa in m[Na])this.terminals_[wa]&&
|
||||
2<wa&&x.push("'"+this.terminals_[wa]+"'");var w=ua.showPosition?"Parse error on line "+(g+1)+":\n"+ua.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[e]||e)+"'":"Parse error on line "+(g+1)+": Unexpected "+(1==e?"end of input":"'"+(this.terminals_[e]||e)+"'");this.parseError(w,{text:ua.match,token:this.terminals_[e]||e,line:ua.yylineno,loc:n,expected:x})}if(Ia[0]instanceof Array&&1<Ia.length)throw Error("Parse Error: multiple actions possible at state: "+Na+", token: "+e);switch(Ia[0]){case 1:d.push(e);
|
||||
b.push(ua.yytext);l.push(ua.yylloc);d.push(Ia[1]);e=null;q?(e=q,q=null):(Ja=ua.yyleng,Ca=ua.yytext,g=ua.yylineno,n=ua.yylloc,0<c&&c--);break;case 2:x=this.productions_[Ia[1]][1];p.$=b[b.length-x];p._$={first_line:l[l.length-(x||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(x||1)].first_column,last_column:l[l.length-1].last_column};k&&(p._$.range=[l[l.length-(x||1)].range[0],l[l.length-1].range[1]]);Na=this.performAction.apply(p,[Ca,Ja,g,h,Ia[1],b,l].concat(f));if("undefined"!==
|
||||
typeof Na)return Na;x&&(d=d.slice(0,-2*x),b=b.slice(0,-1*x),l=l.slice(0,-1*x));d.push(this.productions_[Ia[1]][0]);b.push(p.$);l.push(p._$);Ia=m[d[d.length-2]][d[d.length-1]];d.push(Ia);break;case 3:return!0}}}};e.prototype=hc;hc.Parser=e;return new e}();"undefined"!==typeof u&&"undefined"!==typeof e&&(e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)},e.main=function(x){x[1]||(console.log("Usage: "+x[0]+" FILE"),process.exit(1));var a="",b=u("fs");"undefined"!==typeof b&&
|
||||
null!==b&&(a=b.readFileSync(u("path").normalize(x[1]),"utf8"));return e.parser.parse(a)},"undefined"!==typeof ra&&u.main===ra&&e.main(process.argv.slice(1)));return ra.exports}();u["./scope"]=function(){var e={};(function(){var u=[].indexOf||function(e){for(var x=0,a=this.length;x<a;x++)if(x in this&&this[x]===e)return x;return-1};e.Scope=function(){function e(e,a,b,r){var f,k;this.parent=e;this.expressions=a;this.method=b;this.referencedVars=r;this.variables=[{name:"arguments",type:"arguments"}];
|
||||
this.positions={};this.parent||(this.utilities={});this.root=null!=(f=null!=(k=this.parent)?k.root:void 0)?f:this}e.prototype.add=function(e,a,b){return this.shared&&!b?this.parent.add(e,a,b):Object.prototype.hasOwnProperty.call(this.positions,e)?this.variables[this.positions[e]].type=a:this.positions[e]=this.variables.push({name:e,type:a})-1};e.prototype.namedMethod=function(){var e;return null!=(e=this.method)&&e.name||!this.parent?this.method:this.parent.namedMethod()};e.prototype.find=function(e,
|
||||
a){null==a&&(a="var");if(this.check(e))return!0;this.add(e,a);return!1};e.prototype.parameter=function(e){if(!this.shared||!this.parent.check(e,!0))return this.add(e,"param")};e.prototype.check=function(e){var a;return!!(this.type(e)||null!=(a=this.parent)&&a.check(e))};e.prototype.temporary=function(e,a,b){null==b&&(b=!1);return b?(b=e.charCodeAt(0),e=122-b,b=String.fromCharCode(b+a%(e+1)),a=Math.floor(a/(e+1)),""+b+(a||"")):""+e+(a||"")};e.prototype.type=function(e){var a;var b=this.variables;var x=
|
||||
0;for(a=b.length;x<a;x++){var f=b[x];if(f.name===e)return f.type}return null};e.prototype.freeVariable=function(e,a){var b,x;null==a&&(a={});for(b=0;;){var f=this.temporary(e,b,a.single);if(!(this.check(f)||0<=u.call(this.root.referencedVars,f)))break;b++}(null!=(x=a.reserve)?x:1)&&this.add(f,"var",!0);return f};e.prototype.assign=function(e,a){this.add(e,{value:a,assigned:!0},!0);return this.hasAssignments=!0};e.prototype.hasDeclarations=function(){return!!this.declaredVariables().length};e.prototype.declaredVariables=
|
||||
function(){var e;var a=this.variables;var b=[];var r=0;for(e=a.length;r<e;r++){var f=a[r];"var"===f.type&&b.push(f.name)}return b.sort()};e.prototype.assignedVariables=function(){var e;var a=this.variables;var b=[];var r=0;for(e=a.length;r<e;r++){var f=a[r];f.type.assigned&&b.push(f.name+" \x3d "+f.type.value)}return b};return e}()}).call(this);return e}();u["./nodes"]=function(){var e={};(function(){var ra,r,x,a,b,za,f,k,t,p,z,I,J,F,N,y,G,O,Q,B,n,c,w,q,h,K,P,L,U,W,H,Z,T,V,D,A,xa,E,aa,ba,C,S,v=function(a,
|
||||
b){function l(){this.constructor=a}for(var d in b)X.call(b,d)&&(a[d]=b[d]);l.prototype=b.prototype;a.prototype=new l;a.__super__=b.prototype;return a},X={}.hasOwnProperty,R=[].indexOf||function(a){for(var b=0,l=this.length;b<l;b++)if(b in this&&this[b]===a)return b;return-1},M=[].slice;Error.stackTraceLimit=Infinity;var ya=u("./scope").Scope;var ta=u("./lexer");var Aa=ta.isUnassignable;var ma=ta.JS_FORBIDDEN;var Y=u("./helpers");var ea=Y.compact;var ia=Y.flatten;var fa=Y.extend;var ja=Y.merge;var la=
|
||||
Y.del;ta=Y.addLocationDataFn;var pa=Y.locationDataToString;var qa=Y.throwSyntaxError;e.extend=fa;e.addLocationDataFn=ta;var ha=function(){return!0};var ka=function(){return!1};var oa=function(){return this};var sa=function(){this.negated=!this.negated;return this};e.CodeFragment=t=function(){function a(a,b){var d;this.code=""+b;this.locationData=null!=a?a.locationData:void 0;this.type=(null!=a?null!=(d=a.constructor)?d.name:void 0:void 0)||"unknown"}a.prototype.toString=function(){return""+this.code+
|
||||
(this.locationData?": "+pa(this.locationData):"")};return a}();var ca=function(a){var b;var l=[];var d=0;for(b=a.length;d<b;d++){var Ca=a[d];l.push(Ca.code)}return l.join("")};e.Base=ta=function(){function b(){}b.prototype.compile=function(a,b){return ca(this.compileToFragments(a,b))};b.prototype.compileToFragments=function(a,b){a=fa({},a);b&&(a.level=b);b=this.unfoldSoak(a)||this;b.tab=a.indent;return a.level!==na&&b.isStatement(a)?b.compileClosure(a):b.compileNode(a)};b.prototype.compileClosure=
|
||||
function(b){var l,d,m;(d=this.jumps())&&d.error("cannot use a pure statement in an expression");b.sharedScope=!0;d=new k([],a.wrap([this]));var Ja=[];if((l=this.contains(Wa))||this.contains(da))Ja=[new E],l?(l="apply",Ja.push(new y("arguments"))):l="call",d=new C(d,[new ra(new L(l))]);b=(new za(d,Ja)).compileNode(b);if(d.isGenerator||null!=(m=d.base)&&m.isGenerator)b.unshift(this.makeCode("(yield* ")),b.push(this.makeCode(")"));return b};b.prototype.cache=function(a,b,d){if(null!=d?d(this):this.isComplex()){d=
|
||||
new y(a.scope.freeVariable("ref"));var l=new x(d,this);return b?[l.compileToFragments(a,b),[this.makeCode(d.value)]]:[l,d]}d=b?this.compileToFragments(a,b):this;return[d,d]};b.prototype.cacheToCodeFragments=function(a){return[ca(a[0]),ca(a[1])]};b.prototype.makeReturn=function(a){var b=this.unwrapAll();return a?new za(new B(a+".push"),[b]):new H(b)};b.prototype.contains=function(a){var b=void 0;this.traverseChildren(!1,function(d){if(a(d))return b=d,!1});return b};b.prototype.lastNonComment=function(a){var b;
|
||||
for(b=a.length;b--;)if(!(a[b]instanceof p))return a[b];return null};b.prototype.toString=function(a,b){null==a&&(a="");null==b&&(b=this.constructor.name);var d="\n"+a+b;this.soak&&(d+="?");this.eachChild(function(b){return d+=b.toString(a+Fa)});return d};b.prototype.eachChild=function(a){var b,d;if(!this.children)return this;var m=this.children;var Ja=0;for(b=m.length;Ja<b;Ja++){var c=m[Ja];if(this[c]){var e=ia([this[c]]);var f=0;for(d=e.length;f<d;f++)if(c=e[f],!1===a(c))return this}}return this};
|
||||
b.prototype.traverseChildren=function(a,b){return this.eachChild(function(d){if(!1!==b(d))return d.traverseChildren(a,b)})};b.prototype.invert=function(){return new h("!",this)};b.prototype.unwrapAll=function(){var a;for(a=this;a!==(a=a.unwrap()););return a};b.prototype.children=[];b.prototype.isStatement=ka;b.prototype.jumps=ka;b.prototype.isComplex=ha;b.prototype.isChainable=ka;b.prototype.isAssignable=ka;b.prototype.isNumber=ka;b.prototype.unwrap=oa;b.prototype.unfoldSoak=ka;b.prototype.assigns=
|
||||
ka;b.prototype.updateLocationDataIfMissing=function(a){if(this.locationData)return this;this.locationData=a;return this.eachChild(function(b){return b.updateLocationDataIfMissing(a)})};b.prototype.error=function(a){return qa(a,this.locationData)};b.prototype.makeCode=function(a){return new t(this,a)};b.prototype.wrapInBraces=function(a){return[].concat(this.makeCode("("),a,this.makeCode(")"))};b.prototype.joinFragmentArrays=function(a,b){var d,l;var m=[];var c=d=0;for(l=a.length;d<l;c=++d){var e=
|
||||
a[c];c&&m.push(this.makeCode(b));m=m.concat(e)}return m};return b}();e.Block=a=function(a){function b(a){this.expressions=ea(ia(a||[]))}v(b,a);b.prototype.children=["expressions"];b.prototype.push=function(a){this.expressions.push(a);return this};b.prototype.pop=function(){return this.expressions.pop()};b.prototype.unshift=function(a){this.expressions.unshift(a);return this};b.prototype.unwrap=function(){return 1===this.expressions.length?this.expressions[0]:this};b.prototype.isEmpty=function(){return!this.expressions.length};
|
||||
b.prototype.isStatement=function(a){var d;var b=this.expressions;var l=0;for(d=b.length;l<d;l++){var m=b[l];if(m.isStatement(a))return!0}return!1};b.prototype.jumps=function(a){var d;var b=this.expressions;var l=0;for(d=b.length;l<d;l++){var m=b[l];if(m=m.jumps(a))return m}};b.prototype.makeReturn=function(a){var d;for(d=this.expressions.length;d--;){var b=this.expressions[d];if(!(b instanceof p)){this.expressions[d]=b.makeReturn(a);b instanceof H&&!b.expression&&this.expressions.splice(d,1);break}}return this};
|
||||
b.prototype.compileToFragments=function(a,d){null==a&&(a={});return a.scope?b.__super__.compileToFragments.call(this,a,d):this.compileRoot(a)};b.prototype.compileNode=function(a){var d,l;this.tab=a.indent;var m=a.level===na;var c=[];var e=this.expressions;var f=d=0;for(l=e.length;d<l;f=++d){var h=e[f];h=h.unwrapAll();h=h.unfoldSoak(a)||h;h instanceof b?c.push(h.compileNode(a)):m?(h.front=!0,f=h.compileToFragments(a),h.isStatement(a)||(f.unshift(this.makeCode(""+this.tab)),f.push(this.makeCode(";"))),
|
||||
c.push(f)):c.push(h.compileToFragments(a,va))}if(m)return this.spaced?[].concat(this.joinFragmentArrays(c,"\n\n"),this.makeCode("\n")):this.joinFragmentArrays(c,"\n");d=c.length?this.joinFragmentArrays(c,", "):[this.makeCode("void 0")];return 1<c.length&&a.level>=va?this.wrapInBraces(d):d};b.prototype.compileRoot=function(a){var d,b;a.indent=a.bare?"":Fa;a.level=na;this.spaced=!0;a.scope=new ya(null,this,null,null!=(b=a.referencedVars)?b:[]);var l=a.locals||[];b=0;for(d=l.length;b<d;b++){var m=l[b];
|
||||
a.scope.parameter(m)}b=[];if(!a.bare){var c=this.expressions;d=[];var e=m=0;for(l=c.length;m<l;e=++m){e=c[e];if(!(e.unwrap()instanceof p))break;d.push(e)}m=this.expressions.slice(d.length);this.expressions=d;d.length&&(b=this.compileNode(ja(a,{indent:""})),b.push(this.makeCode("\n")));this.expressions=m}d=this.compileWithDeclarations(a);return a.bare?d:[].concat(b,this.makeCode("(function() {\n"),d,this.makeCode("\n}).call(this);\n"))};b.prototype.compileWithDeclarations=function(a){var d,b;var l=
|
||||
[];var m=this.expressions;var c=b=0;for(d=m.length;b<d;c=++b){var e=m[c];e=e.unwrap();if(!(e instanceof p||e instanceof B))break}a=ja(a,{level:na});c&&(e=this.expressions.splice(c,9E9),l=[this.spaced,!1],b=l[0],this.spaced=l[1],b=[this.compileNode(a),b],l=b[0],this.spaced=b[1],this.expressions=e);e=this.compileNode(a);b=a.scope;b.expressions===this&&(d=a.scope.hasDeclarations(),a=b.hasAssignments,d||a?(c&&l.push(this.makeCode("\n")),l.push(this.makeCode(this.tab+"var ")),d&&l.push(this.makeCode(b.declaredVariables().join(", "))),
|
||||
a&&(d&&l.push(this.makeCode(",\n"+(this.tab+Fa))),l.push(this.makeCode(b.assignedVariables().join(",\n"+(this.tab+Fa))))),l.push(this.makeCode(";\n"+(this.spaced?"\n":"")))):l.length&&e.length&&l.push(this.makeCode("\n")));return l.concat(e)};b.wrap=function(a){return 1===a.length&&a[0]instanceof b?a[0]:new b(a)};return b}(ta);e.Literal=B=function(a){function b(a){this.value=a}v(b,a);b.prototype.isComplex=ka;b.prototype.assigns=function(a){return a===this.value};b.prototype.compileNode=function(a){return[this.makeCode(this.value)]};
|
||||
b.prototype.toString=function(){return" "+(this.isStatement()?b.__super__.toString.apply(this,arguments):this.constructor.name)+": "+this.value};return b}(ta);e.NumberLiteral=w=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);return b}(B);e.InfinityLiteral=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);b.prototype.compileNode=function(){return[this.makeCode("2e308")]};return b}(w);e.NaNLiteral=function(a){function b(){b.__super__.constructor.call(this,
|
||||
"NaN")}v(b,a);b.prototype.compileNode=function(a){var d=[this.makeCode("0/0")];return a.level>=Ha?this.wrapInBraces(d):d};return b}(w);e.StringLiteral=D=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);return b}(B);e.RegexLiteral=W=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);return b}(B);e.PassthroughLiteral=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);return b}(B);e.IdentifierLiteral=
|
||||
y=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);b.prototype.isAssignable=ha;return b}(B);e.PropertyName=L=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);b.prototype.isAssignable=ha;return b}(B);e.StatementLiteral=V=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);b.prototype.isStatement=ha;b.prototype.makeReturn=oa;b.prototype.jumps=function(a){if("break"===this.value&&!(null!=a&&a.loop||
|
||||
null!=a&&a.block)||"continue"===this.value&&(null==a||!a.loop))return this};b.prototype.compileNode=function(a){return[this.makeCode(""+this.tab+this.value+";")]};return b}(B);e.ThisLiteral=E=function(a){function b(){b.__super__.constructor.call(this,"this")}v(b,a);b.prototype.compileNode=function(a){var d;a=null!=(d=a.scope.method)&&d.bound?a.scope.method.context:this.value;return[this.makeCode(a)]};return b}(B);e.UndefinedLiteral=ba=function(a){function b(){b.__super__.constructor.call(this,"undefined")}
|
||||
v(b,a);b.prototype.compileNode=function(a){return[this.makeCode(a.level>=Ka?"(void 0)":"void 0")]};return b}(B);e.NullLiteral=c=function(a){function b(){b.__super__.constructor.call(this,"null")}v(b,a);return b}(B);e.BooleanLiteral=b=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);return b}(B);e.Return=H=function(a){function b(a){this.expression=a}v(b,a);b.prototype.children=["expression"];b.prototype.isStatement=ha;b.prototype.makeReturn=oa;b.prototype.jumps=
|
||||
oa;b.prototype.compileToFragments=function(a,d){var l;var m=null!=(l=this.expression)?l.makeReturn():void 0;return!m||m instanceof b?b.__super__.compileToFragments.call(this,a,d):m.compileToFragments(a,d)};b.prototype.compileNode=function(a){var d=[];d.push(this.makeCode(this.tab+("return"+(this.expression?" ":""))));this.expression&&(d=d.concat(this.expression.compileToFragments(a,Da)));d.push(this.makeCode(";"));return d};return b}(ta);e.YieldReturn=S=function(a){function b(){return b.__super__.constructor.apply(this,
|
||||
arguments)}v(b,a);b.prototype.compileNode=function(a){null==a.scope.parent&&this.error("yield can only occur inside functions");return b.__super__.compileNode.apply(this,arguments)};return b}(H);e.Value=C=function(a){function m(a,b,Ca){if(!b&&a instanceof m)return a;this.base=a;this.properties=b||[];Ca&&(this[Ca]=!0);return this}v(m,a);m.prototype.children=["base","properties"];m.prototype.add=function(a){this.properties=this.properties.concat(a);return this};m.prototype.hasProperties=function(){return!!this.properties.length};
|
||||
m.prototype.bareLiteral=function(a){return!this.properties.length&&this.base instanceof a};m.prototype.isArray=function(){return this.bareLiteral(r)};m.prototype.isRange=function(){return this.bareLiteral(U)};m.prototype.isComplex=function(){return this.hasProperties()||this.base.isComplex()};m.prototype.isAssignable=function(){return this.hasProperties()||this.base.isAssignable()};m.prototype.isNumber=function(){return this.bareLiteral(w)};m.prototype.isString=function(){return this.bareLiteral(D)};
|
||||
m.prototype.isRegex=function(){return this.bareLiteral(W)};m.prototype.isUndefined=function(){return this.bareLiteral(ba)};m.prototype.isNull=function(){return this.bareLiteral(c)};m.prototype.isBoolean=function(){return this.bareLiteral(b)};m.prototype.isAtomic=function(){var a;var b=this.properties.concat(this.base);var m=0;for(a=b.length;m<a;m++){var c=b[m];if(c.soak||c instanceof za)return!1}return!0};m.prototype.isNotCallable=function(){return this.isNumber()||this.isString()||this.isRegex()||
|
||||
this.isArray()||this.isRange()||this.isSplice()||this.isObject()||this.isUndefined()||this.isNull()||this.isBoolean()};m.prototype.isStatement=function(a){return!this.properties.length&&this.base.isStatement(a)};m.prototype.assigns=function(a){return!this.properties.length&&this.base.assigns(a)};m.prototype.jumps=function(a){return!this.properties.length&&this.base.jumps(a)};m.prototype.isObject=function(a){return this.properties.length?!1:this.base instanceof q&&(!a||this.base.generated)};m.prototype.isSplice=
|
||||
function(){var a=this.properties;return a[a.length-1]instanceof Z};m.prototype.looksStatic=function(a){var b;return this.base.value===a&&1===this.properties.length&&"prototype"!==(null!=(b=this.properties[0].name)?b.value:void 0)};m.prototype.unwrap=function(){return this.properties.length?this:this.base};m.prototype.cacheReference=function(a){var b=this.properties;var l=b[b.length-1];if(2>this.properties.length&&!this.base.isComplex()&&(null==l||!l.isComplex()))return[this,this];b=new m(this.base,
|
||||
this.properties.slice(0,-1));if(b.isComplex()){var c=new y(a.scope.freeVariable("base"));b=new m(new P(new x(c,b)))}if(!l)return[b,c];if(l.isComplex()){var e=new y(a.scope.freeVariable("name"));l=new Q(new x(e,l.index));e=new Q(e)}return[b.add(l),new m(c||b.base,[e||l])]};m.prototype.compileNode=function(a){var b;this.base.front=this.front;var l=this.properties;var m=this.base.compileToFragments(a,l.length?Ka:null);l.length&&Ra.test(ca(m))&&m.push(this.makeCode("."));var c=0;for(b=l.length;c<b;c++){var e=
|
||||
l[c];m.push.apply(m,e.compileToFragments(a))}return m};m.prototype.unfoldSoak=function(a){return null!=this.unfoldedSoak?this.unfoldedSoak:this.unfoldedSoak=function(b){return function(){var d,l,c;if(l=b.base.unfoldSoak(a))return(d=l.body.properties).push.apply(d,b.properties),l;var e=b.properties;l=d=0;for(c=e.length;d<c;l=++d){var f=e[l];if(f.soak)return f.soak=!1,d=new m(b.base,b.properties.slice(0,l)),c=new m(b.base,b.properties.slice(l)),d.isComplex()&&(l=new y(a.scope.freeVariable("ref")),d=
|
||||
new P(new x(l,d)),c.base=l),new G(new z(d),c,{soak:!0})}return!1}}(this)()};return m}(ta);e.Comment=p=function(a){function b(a){this.comment=a}v(b,a);b.prototype.isStatement=ha;b.prototype.makeReturn=oa;b.prototype.compileNode=function(a,b){var d=this.comment.replace(/^(\s*)#(?=\s)/gm,"$1 *");d="/*"+Ga(d,this.tab)+(0<=R.call(d,"\n")?"\n"+this.tab:"")+" */";(b||a.level)===na&&(d=a.indent+d);return[this.makeCode("\n"),this.makeCode(d)]};return b}(ta);e.Call=za=function(a){function b(a,b,m){this.variable=
|
||||
a;this.args=null!=b?b:[];this.soak=m;this.isNew=!1;this.variable instanceof C&&this.variable.isNotCallable()&&this.variable.error("literal is not a function")}v(b,a);b.prototype.children=["variable","args"];b.prototype.updateLocationDataIfMissing=function(a){var d;if(this.locationData&&this.needsUpdatedStartLocation){this.locationData.first_line=a.first_line;this.locationData.first_column=a.first_column;var l=(null!=(d=this.variable)?d.base:void 0)||this.variable;l.needsUpdatedStartLocation&&(this.variable.locationData.first_line=
|
||||
a.first_line,this.variable.locationData.first_column=a.first_column,l.updateLocationDataIfMissing(a));delete this.needsUpdatedStartLocation}return b.__super__.updateLocationDataIfMissing.apply(this,arguments)};b.prototype.newInstance=function(){var a;var d=(null!=(a=this.variable)?a.base:void 0)||this.variable;d instanceof b&&!d.isNew?d.newInstance():this.isNew=!0;this.needsUpdatedStartLocation=!0;return this};b.prototype.unfoldSoak=function(a){var d,l;if(this.soak){if(this instanceof xa){var m=new B(this.superReference(a));
|
||||
var c=new C(m)}else{if(c=Ea(a,this,"variable"))return c;c=(new C(this.variable)).cacheReference(a);m=c[0];c=c[1]}c=new b(c,this.args);c.isNew=this.isNew;m=new B("typeof "+m.compile(a)+' \x3d\x3d\x3d "function"');return new G(m,new C(c),{soak:!0})}m=this;for(d=[];;)if(m.variable instanceof b)d.push(m),m=m.variable;else{if(!(m.variable instanceof C))break;d.push(m);if(!((m=m.variable.base)instanceof b))break}var e=d.reverse();d=0;for(l=e.length;d<l;d++)m=e[d],c&&(m.variable instanceof b?m.variable=
|
||||
c:m.variable.base=c),c=Ea(a,m,"variable");return c};b.prototype.compileNode=function(a){var b,l,m;null!=(b=this.variable)&&(b.front=this.front);b=T.compileSplattedArray(a,this.args,!0);if(b.length)return this.compileSplat(a,b);b=[];var c=this.args;var e=l=0;for(m=c.length;l<m;e=++l){var f=c[e];e&&b.push(this.makeCode(", "));b.push.apply(b,f.compileToFragments(a,va))}f=[];this instanceof xa?(a=this.superReference(a)+(".call("+this.superThis(a)),b.length&&(a+=", "),f.push(this.makeCode(a))):(this.isNew&&
|
||||
f.push(this.makeCode("new ")),f.push.apply(f,this.variable.compileToFragments(a,Ka)),f.push(this.makeCode("(")));f.push.apply(f,b);f.push(this.makeCode(")"));return f};b.prototype.compileSplat=function(a,b){var d;if(this instanceof xa)return[].concat(this.makeCode(this.superReference(a)+".apply("+this.superThis(a)+", "),b,this.makeCode(")"));if(this.isNew){var l=this.tab+Fa;return[].concat(this.makeCode("(function(func, args, ctor) {\n"+l+"ctor.prototype \x3d func.prototype;\n"+l+"var child \x3d new ctor, result \x3d func.apply(child, args);\n"+
|
||||
l+"return Object(result) \x3d\x3d\x3d result ? result : child;\n"+this.tab+"})("),this.variable.compileToFragments(a,va),this.makeCode(", "),b,this.makeCode(", function(){})"))}l=[];var m=new C(this.variable);if((d=m.properties.pop())&&m.isComplex()){var c=a.scope.freeVariable("ref");l=l.concat(this.makeCode("("+c+" \x3d "),m.compileToFragments(a,va),this.makeCode(")"),d.compileToFragments(a))}else m=m.compileToFragments(a,Ka),Ra.test(ca(m))&&(m=this.wrapInBraces(m)),d?(c=ca(m),m.push.apply(m,d.compileToFragments(a))):
|
||||
c="null",l=l.concat(m);return l.concat(this.makeCode(".apply("+c+", "),b,this.makeCode(")"))};return b}(ta);e.SuperCall=xa=function(a){function b(a){b.__super__.constructor.call(this,null,null!=a?a:[new T(new y("arguments"))]);this.isBare=null!=a}v(b,a);b.prototype.superReference=function(a){var b=a.scope.namedMethod();if(null!=b&&b.klass){var l=b.klass;var m=b.name;var c=b.variable;if(l.isComplex()){var e=new y(a.scope.parent.freeVariable("base"));var f=new C(new P(new x(e,l)));c.base=f;c.properties.splice(0,
|
||||
l.properties.length)}if(m.isComplex()||m instanceof Q&&m.index.isAssignable()){var h=new y(a.scope.parent.freeVariable("name"));m=new Q(new x(h,m.index));c.properties.pop();c.properties.push(m)}f=[new ra(new L("__super__"))];b["static"]&&f.push(new ra(new L("constructor")));f.push(null!=h?new Q(h):m);return(new C(null!=e?e:l,f)).compile(a)}return null!=b&&b.ctor?b.name+".__super__.constructor":this.error("cannot call super outside of an instance method.")};b.prototype.superThis=function(a){return(a=
|
||||
a.scope.method)&&!a.klass&&a.context||"this"};return b}(za);e.RegexWithInterpolations=function(a){function b(a){null==a&&(a=[]);b.__super__.constructor.call(this,new C(new y("RegExp")),a,!1)}v(b,a);return b}(za);e.TaggedTemplateCall=function(b){function m(b,d,c){d instanceof D&&(d=new A(a.wrap([new C(d)])));m.__super__.constructor.call(this,b,[d],c)}v(m,b);m.prototype.compileNode=function(a){a.inTaggedTemplateCall=!0;return this.variable.compileToFragments(a,Ka).concat(this.args[0].compileToFragments(a,
|
||||
va))};return m}(za);e.Extends=F=function(a){function b(a,b){this.child=a;this.parent=b}v(b,a);b.prototype.children=["child","parent"];b.prototype.compileToFragments=function(a){return(new za(new C(new B(La("extend",a))),[this.child,this.parent])).compileToFragments(a)};return b}(ta);e.Access=ra=function(a){function b(a,b){this.name=a;this.soak="soak"===b}v(b,a);b.prototype.children=["name"];b.prototype.compileToFragments=function(a){var b;a=this.name.compileToFragments(a);var l=this.name.unwrap();
|
||||
return l instanceof L?(b=l.value,0<=R.call(ma,b))?[this.makeCode('["')].concat(M.call(a),[this.makeCode('"]')]):[this.makeCode(".")].concat(M.call(a)):[this.makeCode("[")].concat(M.call(a),[this.makeCode("]")])};b.prototype.isComplex=ka;return b}(ta);e.Index=Q=function(a){function b(a){this.index=a}v(b,a);b.prototype.children=["index"];b.prototype.compileToFragments=function(a){return[].concat(this.makeCode("["),this.index.compileToFragments(a,Da),this.makeCode("]"))};b.prototype.isComplex=function(){return this.index.isComplex()};
|
||||
return b}(ta);e.Range=U=function(a){function b(a,b,c){this.from=a;this.to=b;this.equals=(this.exclusive="exclusive"===c)?"":"\x3d"}v(b,a);b.prototype.children=["from","to"];b.prototype.compileVariables=function(a){a=ja(a,{top:!0});var b=la(a,"isComplex");var l=this.cacheToCodeFragments(this.from.cache(a,va,b));this.fromC=l[0];this.fromVar=l[1];l=this.cacheToCodeFragments(this.to.cache(a,va,b));this.toC=l[0];this.toVar=l[1];if(l=la(a,"step"))a=this.cacheToCodeFragments(l.cache(a,va,b)),this.step=a[0],
|
||||
this.stepVar=a[1];this.fromNum=this.from.isNumber()?Number(this.fromVar):null;this.toNum=this.to.isNumber()?Number(this.toVar):null;return this.stepNum=null!=l&&l.isNumber()?Number(this.stepVar):null};b.prototype.compileNode=function(a){var b,l,c,m;this.fromVar||this.compileVariables(a);if(!a.index)return this.compileArray(a);var e=null!=this.fromNum&&null!=this.toNum;var f=la(a,"index");var h=(a=la(a,"name"))&&a!==f;var n=f+" \x3d "+this.fromC;this.toC!==this.toVar&&(n+=", "+this.toC);this.step!==
|
||||
this.stepVar&&(n+=", "+this.step);var k=[f+" \x3c"+this.equals,f+" \x3e"+this.equals];var q=k[0];k=k[1];q=null!=this.stepNum?0<this.stepNum?q+" "+this.toVar:k+" "+this.toVar:e?(c=[this.fromNum,this.toNum],l=c[0],m=c[1],c,l<=m?q+" "+m:k+" "+m):(b=this.stepVar?this.stepVar+" \x3e 0":this.fromVar+" \x3c\x3d "+this.toVar,b+" ? "+q+" "+this.toVar+" : "+k+" "+this.toVar);b=this.stepVar?f+" +\x3d "+this.stepVar:e?h?l<=m?"++"+f:"--"+f:l<=m?f+"++":f+"--":h?b+" ? ++"+f+" : --"+f:b+" ? "+f+"++ : "+f+"--";h&&
|
||||
(n=a+" \x3d "+n);h&&(b=a+" \x3d "+b);return[this.makeCode(n+"; "+q+"; "+b)]};b.prototype.compileArray=function(a){var b,l,c;if((b=null!=this.fromNum&&null!=this.toNum)&&20>=Math.abs(this.fromNum-this.toNum)){var m=function(){c=[];for(var a=l=this.fromNum,b=this.toNum;l<=b?a<=b:a>=b;l<=b?a++:a--)c.push(a);return c}.apply(this);this.exclusive&&m.pop();return[this.makeCode("["+m.join(", ")+"]")]}var e=this.tab+Fa;var f=a.scope.freeVariable("i",{single:!0});var h=a.scope.freeVariable("results");var n=
|
||||
"\n"+e+h+" \x3d [];";if(b)a.index=f,b=ca(this.compileNode(a));else{var k=f+" \x3d "+this.fromC+(this.toC!==this.toVar?", "+this.toC:"");b=this.fromVar+" \x3c\x3d "+this.toVar;b="var "+k+"; "+b+" ? "+f+" \x3c"+this.equals+" "+this.toVar+" : "+f+" \x3e"+this.equals+" "+this.toVar+"; "+b+" ? "+f+"++ : "+f+"--"}f="{ "+h+".push("+f+"); }\n"+e+"return "+h+";\n"+a.indent;a=function(a){return null!=a?a.contains(Wa):void 0};if(a(this.from)||a(this.to))m=", arguments";return[this.makeCode("(function() {"+n+
|
||||
"\n"+e+"for ("+b+")"+f+"}).apply(this"+(null!=m?m:"")+")")]};return b}(ta);e.Slice=Z=function(a){function b(a){this.range=a;b.__super__.constructor.call(this)}v(b,a);b.prototype.children=["range"];b.prototype.compileNode=function(a){var b=this.range;var l=b.to;var c=(b=b.from)&&b.compileToFragments(a,Da)||[this.makeCode("0")];if(l){b=l.compileToFragments(a,Da);var m=ca(b);if(this.range.exclusive||-1!==+m)var e=", "+(this.range.exclusive?m:l.isNumber()?""+(+m+1):(b=l.compileToFragments(a,Ka),"+"+ca(b)+
|
||||
" + 1 || 9e9"))}return[this.makeCode(".slice("+ca(c)+(e||"")+")")]};return b}(ta);e.Obj=q=function(a){function b(a,b){this.generated=null!=b?b:!1;this.objects=this.properties=a||[]}v(b,a);b.prototype.children=["properties"];b.prototype.compileNode=function(a){var b,l,c;var m=this.properties;if(this.generated){var e=0;for(b=m.length;e<b;e++){var f=m[e];f instanceof C&&f.error("cannot have an implicit value in an implicit object")}}e=b=0;for(f=m.length;b<f;e=++b){var h=m[e];if((h.variable||h).base instanceof
|
||||
P)break}f=e<m.length;var n=a.indent+=Fa;var k=this.lastNonComment(this.properties);b=[];if(f){var q=a.scope.freeVariable("obj");b.push(this.makeCode("(\n"+n+q+" \x3d "))}b.push(this.makeCode("{"+(0===m.length||0===e?"}":"\n")));var w=l=0;for(c=m.length;l<c;w=++l){h=m[w];w===e&&(0!==w&&b.push(this.makeCode("\n"+n+"}")),b.push(this.makeCode(",\n")));var t=w===m.length-1||w===e-1?"":h===k||h instanceof p?"\n":",\n";var r=h instanceof p?"":n;f&&w<e&&(r+=Fa);h instanceof x&&("object"!==h.context&&h.operatorToken.error("unexpected "+
|
||||
h.operatorToken.value),h.variable instanceof C&&h.variable.hasProperties()&&h.variable.error("invalid object key"));h instanceof C&&h["this"]&&(h=new x(h.properties[0].name,h,"object"));h instanceof p||(w<e?h instanceof x||(h=new x(h,h,"object")):(h instanceof x?(w=h.variable,h=h.value):(h=h.base.cache(a),w=h[0],h=h[1],w instanceof y&&(w=new L(w.value))),h=new x(new C(new y(q),[new ra(w)]),h)));r&&b.push(this.makeCode(r));b.push.apply(b,h.compileToFragments(a,na));t&&b.push(this.makeCode(t))}f?b.push(this.makeCode(",\n"+
|
||||
n+q+"\n"+this.tab+")")):0!==m.length&&b.push(this.makeCode("\n"+this.tab+"}"));return this.front&&!f?this.wrapInBraces(b):b};b.prototype.assigns=function(a){var b;var l=this.properties;var c=0;for(b=l.length;c<b;c++){var m=l[c];if(m.assigns(a))return!0}return!1};return b}(ta);e.Arr=r=function(a){function b(a){this.objects=a||[]}v(b,a);b.prototype.children=["objects"];b.prototype.compileNode=function(a){var b;if(!this.objects.length)return[this.makeCode("[]")];a.indent+=Fa;var l=T.compileSplattedArray(a,
|
||||
this.objects);if(l.length)return l;l=[];var c=this.objects;var m=[];var e=0;for(b=c.length;e<b;e++){var f=c[e];m.push(f.compileToFragments(a,va))}e=b=0;for(c=m.length;b<c;e=++b)f=m[e],e&&l.push(this.makeCode(", ")),l.push.apply(l,f);0<=ca(l).indexOf("\n")?(l.unshift(this.makeCode("[\n"+a.indent)),l.push(this.makeCode("\n"+this.tab+"]"))):(l.unshift(this.makeCode("[")),l.push(this.makeCode("]")));return l};b.prototype.assigns=function(a){var b;var l=this.objects;var c=0;for(b=l.length;c<b;c++){var m=
|
||||
l[c];if(m.assigns(a))return!0}return!1};return b}(ta);e.Class=f=function(b){function c(b,d,c){this.variable=b;this.parent=d;this.body=null!=c?c:new a;this.boundFuncs=[];this.body.classBody=!0}v(c,b);c.prototype.children=["variable","parent","body"];c.prototype.defaultClassVariableName="_Class";c.prototype.determineName=function(){var a;if(!this.variable)return this.defaultClassVariableName;var b=this.variable.properties;b=(a=b[b.length-1])?a instanceof ra&&a.name:this.variable.base;if(!(b instanceof
|
||||
y||b instanceof L))return this.defaultClassVariableName;b=b.value;a||(a=Aa(b))&&this.variable.error(a);return 0<=R.call(ma,b)?"_"+b:b};c.prototype.setContext=function(a){return this.body.traverseChildren(!1,function(b){if(b.classBody)return!1;if(b instanceof E)return b.value=a;if(b instanceof k&&b.bound)return b.context=a})};c.prototype.addBoundFunctions=function(a){var b;var l=this.boundFuncs;var c=0;for(b=l.length;c<b;c++){var m=l[c];m=(new C(new E,[new ra(m)])).compile(a);this.ctor.body.unshift(new B(m+
|
||||
" \x3d "+La("bind",a)+"("+m+", this)"))}};c.prototype.addProperties=function(a,b,c){var d;var l=a.base.properties.slice(0);var m;for(m=[];d=l.shift();){if(d instanceof x){var e=d.variable.base;delete d.context;var f=d.value;"constructor"===e.value?(this.ctor&&d.error("cannot define more than one constructor in a class"),f.bound&&d.error("cannot define a constructor as a bound function"),f instanceof k?d=this.ctor=f:(this.externalCtor=c.classScope.freeVariable("ctor"),d=new x(new y(this.externalCtor),
|
||||
f))):d.variable["this"]?f["static"]=!0:(a=e.isComplex()?new Q(e):new ra(e),d.variable=new C(new y(b),[new ra(new L("prototype")),a]),f instanceof k&&f.bound&&(this.boundFuncs.push(e),f.bound=!1))}m.push(d)}return ea(m)};c.prototype.walkBody=function(b,d){return this.traverseChildren(!1,function(l){return function(m){var e,f,h;var Ca=!0;if(m instanceof c)return!1;if(m instanceof a){var n=e=m.expressions;var k=f=0;for(h=n.length;f<h;k=++f){var q=n[k];q instanceof x&&q.variable.looksStatic(b)?q.value["static"]=
|
||||
!0:q instanceof C&&q.isObject(!0)&&(Ca=!1,e[k]=l.addProperties(q,b,d))}m.expressions=ia(e)}return Ca&&!(m instanceof c)}}(this))};c.prototype.hoistDirectivePrologue=function(){var a,b;var c=0;for(a=this.body.expressions;(b=a[c])&&b instanceof p||b instanceof C&&b.isString();)++c;return this.directives=a.splice(0,c)};c.prototype.ensureConstructor=function(a){this.ctor||(this.ctor=new k,this.externalCtor?this.ctor.body.push(new B(this.externalCtor+".apply(this, arguments)")):this.parent&&this.ctor.body.push(new B(a+
|
||||
".__super__.constructor.apply(this, arguments)")),this.ctor.body.makeReturn(),this.body.expressions.unshift(this.ctor));this.ctor.ctor=this.ctor.name=a;this.ctor.klass=null;return this.ctor.noReturn=!0};c.prototype.compileNode=function(b){var d,l,c;(l=this.body.jumps())&&l.error("Class bodies cannot contain pure statements");(d=this.body.contains(Wa))&&d.error("Class bodies shouldn't reference arguments");var m=this.determineName();var e=new y(m);l=new k([],a.wrap([this.body]));d=[];b.classScope=
|
||||
l.makeScope(b.scope);this.hoistDirectivePrologue();this.setContext(m);this.walkBody(m,b);this.ensureConstructor(m);this.addBoundFunctions(b);this.body.spaced=!0;this.body.expressions.push(e);this.parent&&(m=new y(b.classScope.freeVariable("superClass",{reserve:!1})),this.body.expressions.unshift(new F(e,m)),l.params.push(new K(m)),d.push(this.parent));(c=this.body.expressions).unshift.apply(c,this.directives);c=new P(new za(l,d));this.variable&&(c=new x(this.variable,c,null,{moduleDeclaration:this.moduleDeclaration}));
|
||||
return c.compileToFragments(b)};return c}(ta);e.ModuleDeclaration=Y=function(a){function b(a,b){this.clause=a;this.source=b;this.checkSource()}v(b,a);b.prototype.children=["clause","source"];b.prototype.isStatement=ha;b.prototype.jumps=oa;b.prototype.makeReturn=oa;b.prototype.checkSource=function(){if(null!=this.source&&this.source instanceof A)return this.source.error("the name of the module to be imported from must be an uninterpolated string")};b.prototype.checkScope=function(a,b){if(0!==a.indent.length)return this.error(b+
|
||||
" statements must be at top-level scope")};return b}(ta);e.ImportDeclaration=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);b.prototype.compileNode=function(a){var b;this.checkScope(a,"import");a.importedSymbols=[];var l=[];l.push(this.makeCode(this.tab+"import "));null!=this.clause&&l.push.apply(l,this.clause.compileNode(a));null!=(null!=(b=this.source)?b.value:void 0)&&(null!==this.clause&&l.push(this.makeCode(" from ")),l.push(this.makeCode(this.source.value)));
|
||||
l.push(this.makeCode(";"));return l};return b}(Y);e.ImportClause=function(a){function b(a,b){this.defaultBinding=a;this.namedImports=b}v(b,a);b.prototype.children=["defaultBinding","namedImports"];b.prototype.compileNode=function(a){var b=[];null!=this.defaultBinding&&(b.push.apply(b,this.defaultBinding.compileNode(a)),null!=this.namedImports&&b.push(this.makeCode(", ")));null!=this.namedImports&&b.push.apply(b,this.namedImports.compileNode(a));return b};return b}(ta);e.ExportDeclaration=Y=function(b){function c(){return c.__super__.constructor.apply(this,
|
||||
arguments)}v(c,b);c.prototype.compileNode=function(b){var d;this.checkScope(b,"export");var l=[];l.push(this.makeCode(this.tab+"export "));this instanceof J&&l.push(this.makeCode("default "));this instanceof J||!(this.clause instanceof x||this.clause instanceof f)||(this.clause instanceof f&&!this.clause.variable&&this.clause.error("anonymous classes cannot be exported"),l.push(this.makeCode("var ")),this.clause.moduleDeclaration="export");l=null!=this.clause.body&&this.clause.body instanceof a?l.concat(this.clause.compileToFragments(b,
|
||||
na)):l.concat(this.clause.compileNode(b));null!=(null!=(d=this.source)?d.value:void 0)&&l.push(this.makeCode(" from "+this.source.value));l.push(this.makeCode(";"));return l};return c}(Y);e.ExportNamedDeclaration=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);return b}(Y);e.ExportDefaultDeclaration=J=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);return b}(Y);e.ExportAllDeclaration=function(a){function b(){return b.__super__.constructor.apply(this,
|
||||
arguments)}v(b,a);return b}(Y);e.ModuleSpecifierList=Y=function(a){function b(a){this.specifiers=a}v(b,a);b.prototype.children=["specifiers"];b.prototype.compileNode=function(a){var b;var l=[];a.indent+=Fa;var c=this.specifiers;var m=[];var e=0;for(b=c.length;e<b;e++){var f=c[e];m.push(f.compileToFragments(a,va))}if(0!==this.specifiers.length){l.push(this.makeCode("{\n"+a.indent));e=b=0;for(c=m.length;b<c;e=++b)f=m[e],e&&l.push(this.makeCode(",\n"+a.indent)),l.push.apply(l,f);l.push(this.makeCode("\n}"))}else l.push(this.makeCode("{}"));
|
||||
return l};return b}(ta);e.ImportSpecifierList=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);return b}(Y);e.ExportSpecifierList=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);return b}(Y);e.ModuleSpecifier=n=function(a){function b(a,b,c){this.original=a;this.alias=b;this.moduleDeclarationType=c;this.identifier=null!=this.alias?this.alias.value:this.original.value}v(b,a);b.prototype.children=["original","alias"];b.prototype.compileNode=
|
||||
function(a){a.scope.find(this.identifier,this.moduleDeclarationType);a=[];a.push(this.makeCode(this.original.value));null!=this.alias&&a.push(this.makeCode(" as "+this.alias.value));return a};return b}(ta);e.ImportSpecifier=Y=function(a){function b(a,d){b.__super__.constructor.call(this,a,d,"import")}v(b,a);b.prototype.compileNode=function(a){var d;(d=this.identifier,0<=R.call(a.importedSymbols,d))||a.scope.check(this.identifier)?this.error("'"+this.identifier+"' has already been declared"):a.importedSymbols.push(this.identifier);
|
||||
return b.__super__.compileNode.call(this,a)};return b}(n);e.ImportDefaultSpecifier=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);return b}(Y);e.ImportNamespaceSpecifier=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);return b}(Y);e.ExportSpecifier=function(a){function b(a,d){b.__super__.constructor.call(this,a,d,"export")}v(b,a);return b}(n);e.Assign=x=function(a){function b(a,b,c,e){this.variable=a;this.value=b;this.context=
|
||||
c;null==e&&(e={});this.param=e.param;this.subpattern=e.subpattern;this.operatorToken=e.operatorToken;this.moduleDeclaration=e.moduleDeclaration}v(b,a);b.prototype.children=["variable","value"];b.prototype.isStatement=function(a){return(null!=a?a.level:void 0)===na&&null!=this.context&&(this.moduleDeclaration||0<=R.call(this.context,"?"))};b.prototype.checkAssignability=function(a,b){if(Object.prototype.hasOwnProperty.call(a.scope.positions,b.value)&&"import"===a.scope.variables[a.scope.positions[b.value]].type)return b.error("'"+
|
||||
b.value+"' is read-only")};b.prototype.assigns=function(a){return this["object"===this.context?"value":"variable"].assigns(a)};b.prototype.unfoldSoak=function(a){return Ea(a,this,"variable")};b.prototype.compileNode=function(a){var b,c,l,e,f,m,h;if(c=this.variable instanceof C){if(this.variable.isArray()||this.variable.isObject())return this.compilePatternMatch(a);if(this.variable.isSplice())return this.compileSplice(a);if("||\x3d"===(e=this.context)||"\x26\x26\x3d"===e||"?\x3d"===e)return this.compileConditional(a);
|
||||
if("**\x3d"===(f=this.context)||"//\x3d"===f||"%%\x3d"===f)return this.compileSpecialMath(a)}this.value instanceof k&&(this.value["static"]?(this.value.klass=this.variable.base,this.value.name=this.variable.properties[0],this.value.variable=this.variable):2<=(null!=(m=this.variable.properties)?m.length:void 0)&&(m=this.variable.properties,e=3<=m.length?M.call(m,0,l=m.length-2):(l=0,[]),f=m[l++],l=m[l++],"prototype"===(null!=(h=f.name)?h.value:void 0)&&(this.value.klass=new C(this.variable.base,e),
|
||||
this.value.name=l,this.value.variable=this.variable)));this.context||(h=this.variable.unwrapAll(),h.isAssignable()||this.variable.error("'"+this.variable.compile(a)+"' can't be assigned"),"function"===typeof h.hasProperties&&h.hasProperties()||(this.moduleDeclaration?(this.checkAssignability(a,h),a.scope.add(h.value,this.moduleDeclaration)):this.param?a.scope.add(h.value,"var"):(this.checkAssignability(a,h),a.scope.find(h.value))));h=this.value.compileToFragments(a,va);c&&this.variable.base instanceof
|
||||
q&&(this.variable.front=!0);c=this.variable.compileToFragments(a,va);if("object"===this.context){if(b=ca(c),0<=R.call(ma,b))c.unshift(this.makeCode('"')),c.push(this.makeCode('"'));return c.concat(this.makeCode(": "),h)}b=c.concat(this.makeCode(" "+(this.context||"\x3d")+" "),h);return a.level<=va?b:this.wrapInBraces(b)};b.prototype.compilePatternMatch=function(a){var d,c,l;var e=a.level===na;var f=this.value;var m=this.variable.base.objects;if(!(l=m.length)){var n=f.compileToFragments(a);return a.level>=
|
||||
Ha?this.wrapInBraces(n):n}var k=m[0];1===l&&k instanceof I&&k.error("Destructuring assignment has no target");var q=this.variable.isObject();if(e&&1===l&&!(k instanceof T)){var p=null;if(k instanceof b&&"object"===k.context){n=k;var t=n.variable;var r=t.base;k=n.value;k instanceof b&&(p=k.value,k=k.variable)}else k instanceof b&&(p=k.value,k=k.variable),r=q?k["this"]?k.properties[0].name:new L(k.unwrap().value):new w(0);var x=r.unwrap()instanceof L;f=new C(f);f.properties.push(new (x?ra:Q)(r));(c=
|
||||
Aa(k.unwrap().value))&&k.error(c);p&&(f=new h("?",f,p));return(new b(k,f,null,{param:this.param})).compileToFragments(a,na)}var v=f.compileToFragments(a,va);var u=ca(v);n=[];t=!1;f.unwrap()instanceof y&&!this.variable.assigns(u)||(n.push([this.makeCode((p=a.scope.freeVariable("ref"))+" \x3d ")].concat(M.call(v))),v=[this.makeCode(p)],u=p);p=f=0;for(d=m.length;f<d;p=++f){k=m[p];r=p;if(!t&&k instanceof T){c=k.name.unwrap().value;k=k.unwrap();r=l+" \x3c\x3d "+u+".length ? "+La("slice",a)+".call("+u+
|
||||
", "+p;if(x=l-p-1){var K=a.scope.freeVariable("i",{single:!0});r+=", "+K+" \x3d "+u+".length - "+x+") : ("+K+" \x3d "+p+", [])"}else r+=") : []";r=new B(r);t=K+"++"}else if(!t&&k instanceof I){if(x=l-p-1)1===x?t=u+".length - 1":(K=a.scope.freeVariable("i",{single:!0}),r=new B(K+" \x3d "+u+".length - "+x),t=K+"++",n.push(r.compileToFragments(a,va)));continue}else(k instanceof T||k instanceof I)&&k.error("multiple splats/expansions are disallowed in an assignment"),p=null,k instanceof b&&"object"===
|
||||
k.context?(r=k.variable,r=r.base,k=k.value,k instanceof b&&(p=k.value,k=k.variable)):(k instanceof b&&(p=k.value,k=k.variable),r=q?k["this"]?k.properties[0].name:new L(k.unwrap().value):new B(t||r)),c=k.unwrap().value,x=r.unwrap()instanceof L,r=new C(new B(u),[new (x?ra:Q)(r)]),p&&(r=new h("?",r,p));null!=c&&(c=Aa(c))&&k.error(c);n.push((new b(k,r,null,{param:this.param,subpattern:!0})).compileToFragments(a,va))}e||this.subpattern||n.push(v);n=this.joinFragmentArrays(n,", ");return a.level<va?n:this.wrapInBraces(n)};
|
||||
b.prototype.compileConditional=function(a){var d=this.variable.cacheReference(a);var c=d[0];d=d[1];c.properties.length||!(c.base instanceof B)||c.base instanceof E||a.scope.check(c.base.value)||this.variable.error('the variable "'+c.base.value+"\" can't be assigned with "+this.context+" because it has not been declared before");if(0<=R.call(this.context,"?"))return a.isExistentialEquals=!0,(new G(new z(c),d,{type:"if"})).addElse(new b(d,this.value,"\x3d")).compileToFragments(a);c=(new h(this.context.slice(0,
|
||||
-1),c,new b(d,this.value,"\x3d"))).compileToFragments(a);return a.level<=va?c:this.wrapInBraces(c)};b.prototype.compileSpecialMath=function(a){var d=this.variable.cacheReference(a);var c=d[0];d=d[1];return(new b(c,new h(this.context.slice(0,-1),d,this.value))).compileToFragments(a)};b.prototype.compileSplice=function(a){var b=this.variable.properties.pop().range;var c=b.from;var l=b.to;var e=b.exclusive;var f=this.variable.compile(a);if(c){var m=this.cacheToCodeFragments(c.cache(a,Ha));b=m[0];m=m[1]}else b=
|
||||
m="0";l?null!=c&&c.isNumber()&&l.isNumber()?(l=l.compile(a)-m,e||(l+=1)):(l=l.compile(a,Ka)+" - "+m,e||(l+=" + 1")):l="9e9";e=this.value.cache(a,va);c=e[0];e=e[1];l=[].concat(this.makeCode("[].splice.apply("+f+", ["+b+", "+l+"].concat("),c,this.makeCode(")), "),e);return a.level>na?this.wrapInBraces(l):l};return b}(ta);e.Code=k=function(b){function c(b,d,c){this.params=b||[];this.body=d||new a;this.bound="boundfunc"===c;this.isGenerator=!!this.body.contains(function(a){return a instanceof h&&a.isYield()||
|
||||
a instanceof S})}v(c,b);c.prototype.children=["params","body"];c.prototype.isStatement=function(){return!!this.ctor};c.prototype.jumps=ka;c.prototype.makeScope=function(a){return new ya(a,this.body,this)};c.prototype.compileNode=function(b){var d,l,e,f;this.bound&&null!=(d=b.scope.method)&&d.bound&&(this.context=b.scope.method.context);if(this.bound&&!this.context)return this.context="_this",d=new c([new K(new y(this.context))],new a([this])),d=new za(d,[new E]),d.updateLocationDataIfMissing(this.locationData),
|
||||
d.compileNode(b);b.scope=la(b,"classScope")||this.makeScope(b.scope);b.scope.shared=la(b,"sharedScope");b.indent+=Fa;delete b.bare;delete b.isExistentialEquals;d=[];var m=[];var k=this.params;var n=0;for(e=k.length;n<e;n++){var q=k[n];q instanceof I||b.scope.parameter(q.asReference(b))}k=this.params;n=0;for(e=k.length;n<e;n++)if(q=k[n],q.splat||q instanceof I){n=this.params;var p=0;for(q=n.length;p<q;p++){var w=n[p];w instanceof I||!w.name.value||b.scope.add(w.name.value,"var",!0)}p=new x(new C(new r(function(){var a;
|
||||
var d=this.params;var c=[];var l=0;for(a=d.length;l<a;l++)w=d[l],c.push(w.asReference(b));return c}.call(this))),new C(new y("arguments")));break}var t=this.params;k=0;for(n=t.length;k<n;k++){q=t[k];if(q.isComplex()){var v=f=q.asReference(b);q.value&&(v=new h("?",f,q.value));m.push(new x(new C(q.name),v,"\x3d",{param:!0}))}else f=q,q.value&&(e=new B(f.name.value+" \x3d\x3d null"),v=new x(new C(q.name),q.value,"\x3d"),m.push(new G(e,v)));p||d.push(f)}q=this.body.isEmpty();p&&m.unshift(p);m.length&&
|
||||
(l=this.body.expressions).unshift.apply(l,m);l=p=0;for(m=d.length;p<m;l=++p)w=d[l],d[l]=w.compileToFragments(b),b.scope.parameter(ca(d[l]));var u=[];this.eachParamName(function(a,b){0<=R.call(u,a)&&b.error("multiple parameters named "+a);return u.push(a)});q||this.noReturn||this.body.makeReturn();l="function";this.isGenerator&&(l+="*");this.ctor&&(l+=" "+this.name);m=[this.makeCode(l+"(")];l=q=0;for(p=d.length;q<p;l=++q)w=d[l],l&&m.push(this.makeCode(", ")),m.push.apply(m,w);m.push(this.makeCode(") {"));
|
||||
this.body.isEmpty()||(m=m.concat(this.makeCode("\n"),this.body.compileWithDeclarations(b),this.makeCode("\n"+this.tab)));m.push(this.makeCode("}"));return this.ctor?[this.makeCode(this.tab)].concat(M.call(m)):this.front||b.level>=Ka?this.wrapInBraces(m):m};c.prototype.eachParamName=function(a){var b;var c=this.params;var l=[];var e=0;for(b=c.length;e<b;e++){var f=c[e];l.push(f.eachName(a))}return l};c.prototype.traverseChildren=function(a,b){if(a)return c.__super__.traverseChildren.call(this,a,b)};
|
||||
return c}(ta);e.Param=K=function(a){function b(a,b,c){this.name=a;this.value=b;this.splat=c;(a=Aa(this.name.unwrapAll().value))&&this.name.error(a);this.name instanceof q&&this.name.generated&&(a=this.name.objects[0].operatorToken,a.error("unexpected "+a.value))}v(b,a);b.prototype.children=["name","value"];b.prototype.compileToFragments=function(a){return this.name.compileToFragments(a,va)};b.prototype.asReference=function(a){if(this.reference)return this.reference;var b=this.name;b["this"]?(b=b.properties[0].name.value,
|
||||
0<=R.call(ma,b)&&(b="_"+b),b=new y(a.scope.freeVariable(b))):b.isComplex()&&(b=new y(a.scope.freeVariable("arg")));b=new C(b);this.splat&&(b=new T(b));b.updateLocationDataIfMissing(this.locationData);return this.reference=b};b.prototype.isComplex=function(){return this.name.isComplex()};b.prototype.eachName=function(a,b){var d,c;null==b&&(b=this.name);var l=function(b){return a("@"+b.properties[0].name.value,b)};if(b instanceof B)return a(b.value,b);if(b instanceof C)return l(b);b=null!=(d=b.objects)?
|
||||
d:[];d=0;for(c=b.length;d<c;d++){var e=b[d];e instanceof x&&null==e.context&&(e=e.variable);e instanceof x?(e.value instanceof x&&(e=e.value),this.eachName(a,e.value.unwrap())):e instanceof T?(e=e.name.unwrap(),a(e.value,e)):e instanceof C?e.isArray()||e.isObject()?this.eachName(a,e.base):e["this"]?l(e):a(e.base.value,e.base):e instanceof I||e.error("illegal parameter "+e.compile())}};return b}(ta);e.Splat=T=function(a){function b(a){this.name=a.compile?a:new B(a)}v(b,a);b.prototype.children=["name"];
|
||||
b.prototype.isAssignable=ha;b.prototype.assigns=function(a){return this.name.assigns(a)};b.prototype.compileToFragments=function(a){return this.name.compileToFragments(a)};b.prototype.unwrap=function(){return this.name};b.compileSplattedArray=function(a,d,c){var e,l,f,m;for(l=-1;(e=d[++l])&&!(e instanceof b););if(l>=d.length)return[];if(1===d.length)return e=d[0],d=e.compileToFragments(a,va),c?d:[].concat(e.makeCode(La("slice",a)+".call("),d,e.makeCode(")"));c=d.slice(l);var h=f=0;for(m=c.length;f<
|
||||
m;h=++f){e=c[h];var k=e.compileToFragments(a,va);c[h]=e instanceof b?[].concat(e.makeCode(La("slice",a)+".call("),k,e.makeCode(")")):[].concat(e.makeCode("["),k,e.makeCode("]"))}if(0===l)return e=d[0],a=e.joinFragmentArrays(c.slice(1),", "),c[0].concat(e.makeCode(".concat("),a,e.makeCode(")"));f=d.slice(0,l);m=[];k=0;for(h=f.length;k<h;k++)e=f[k],m.push(e.compileToFragments(a,va));e=d[0].joinFragmentArrays(m,", ");a=d[l].joinFragmentArrays(c,", ");c=d[d.length-1];return[].concat(d[0].makeCode("["),
|
||||
e,d[l].makeCode("].concat("),a,c.makeCode(")"))};return b}(ta);e.Expansion=I=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);b.prototype.isComplex=ka;b.prototype.compileNode=function(a){return this.error("Expansion must be used inside a destructuring assignment or parameter list")};b.prototype.asReference=function(a){return this};b.prototype.eachName=function(a){};return b}(ta);e.While=Y=function(b){function c(a,b){this.condition=null!=b&&b.invert?a.invert():a;
|
||||
this.guard=null!=b?b.guard:void 0}v(c,b);c.prototype.children=["condition","guard","body"];c.prototype.isStatement=ha;c.prototype.makeReturn=function(a){if(a)return c.__super__.makeReturn.apply(this,arguments);this.returns=!this.jumps({loop:!0});return this};c.prototype.addBody=function(a){this.body=a;return this};c.prototype.jumps=function(){var a;var b=this.body.expressions;if(!b.length)return!1;var c=0;for(a=b.length;c<a;c++){var e=b[c];if(e=e.jumps({loop:!0}))return e}return!1};c.prototype.compileNode=
|
||||
function(b){var d;b.indent+=Fa;var c="";var e=this.body;e.isEmpty()?e=this.makeCode(""):(this.returns&&(e.makeReturn(d=b.scope.freeVariable("results")),c=""+this.tab+d+" \x3d [];\n"),this.guard&&(1<e.expressions.length?e.expressions.unshift(new G((new P(this.guard)).invert(),new V("continue"))):this.guard&&(e=a.wrap([new G(this.guard,e)]))),e=[].concat(this.makeCode("\n"),e.compileToFragments(b,na),this.makeCode("\n"+this.tab)));b=[].concat(this.makeCode(c+this.tab+"while ("),this.condition.compileToFragments(b,
|
||||
Da),this.makeCode(") {"),e,this.makeCode("}"));this.returns&&b.push(this.makeCode("\n"+this.tab+"return "+d+";"));return b};return c}(ta);e.Op=h=function(a){function b(a,b,d,e){if("in"===a)return new O(b,d);if("do"===a)return this.generateDo(b);if("new"===a){if(b instanceof za&&!b["do"]&&!b.isNew)return b.newInstance();if(b instanceof k&&b.bound||b["do"])b=new P(b)}this.operator=c[a]||a;this.first=b;this.second=d;this.flip=!!e;return this}v(b,a);var c={"\x3d\x3d":"\x3d\x3d\x3d","!\x3d":"!\x3d\x3d",
|
||||
of:"in",yieldfrom:"yield*"};var d={"!\x3d\x3d":"\x3d\x3d\x3d","\x3d\x3d\x3d":"!\x3d\x3d"};b.prototype.children=["first","second"];b.prototype.isNumber=function(){var a;return this.isUnary()&&("+"===(a=this.operator)||"-"===a)&&this.first instanceof C&&this.first.isNumber()};b.prototype.isYield=function(){var a;return"yield"===(a=this.operator)||"yield*"===a};b.prototype.isUnary=function(){return!this.second};b.prototype.isComplex=function(){return!this.isNumber()};b.prototype.isChainable=function(){var a;
|
||||
return"\x3c"===(a=this.operator)||"\x3e"===a||"\x3e\x3d"===a||"\x3c\x3d"===a||"\x3d\x3d\x3d"===a||"!\x3d\x3d"===a};b.prototype.invert=function(){var a,c;if(this.isChainable()&&this.first.isChainable()){var e=!0;for(a=this;a&&a.operator;)e&&(e=a.operator in d),a=a.first;if(!e)return(new P(this)).invert();for(a=this;a&&a.operator;)a.invert=!a.invert,a.operator=d[a.operator],a=a.first;return this}return(a=d[this.operator])?(this.operator=a,this.first.unwrap()instanceof b&&this.first.invert(),this):this.second?
|
||||
(new P(this)).invert():"!"===this.operator&&(e=this.first.unwrap())instanceof b&&("!"===(c=e.operator)||"in"===c||"instanceof"===c)?e:new b("!",this)};b.prototype.unfoldSoak=function(a){var b;return("++"===(b=this.operator)||"--"===b||"delete"===b)&&Ea(a,this,"first")};b.prototype.generateDo=function(a){var b,d;var c=[];var e=(a instanceof x&&(b=a.value.unwrap())instanceof k?b:a).params||[];b=0;for(d=e.length;b<d;b++){var l=e[b];l.value?(c.push(l.value),delete l.value):c.push(l)}a=new za(a,c);a["do"]=
|
||||
!0;return a};b.prototype.compileNode=function(a){var b;var d=this.isChainable()&&this.first.isChainable();d||(this.first.front=this.front);"delete"===this.operator&&a.scope.check(this.first.unwrapAll().value)&&this.error("delete operand may not be argument or var");("--"===(b=this.operator)||"++"===b)&&(b=Aa(this.first.unwrapAll().value))&&this.first.error(b);if(this.isYield())return this.compileYield(a);if(this.isUnary())return this.compileUnary(a);if(d)return this.compileChain(a);switch(this.operator){case "?":return this.compileExistence(a);
|
||||
case "**":return this.compilePower(a);case "//":return this.compileFloorDivision(a);case "%%":return this.compileModulo(a);default:return d=this.first.compileToFragments(a,Ha),b=this.second.compileToFragments(a,Ha),d=[].concat(d,this.makeCode(" "+this.operator+" "),b),a.level<=Ha?d:this.wrapInBraces(d)}};b.prototype.compileChain=function(a){var b=this.first.second.cache(a);this.first.second=b[0];b=b[1];a=this.first.compileToFragments(a,Ha).concat(this.makeCode(" "+(this.invert?"\x26\x26":"||")+" "),
|
||||
b.compileToFragments(a),this.makeCode(" "+this.operator+" "),this.second.compileToFragments(a,Ha));return this.wrapInBraces(a)};b.prototype.compileExistence=function(a){if(this.first.isComplex()){var b=new y(a.scope.freeVariable("ref"));var d=new P(new x(b,this.first))}else b=d=this.first;return(new G(new z(d),b,{type:"if"})).addElse(this.second).compileToFragments(a)};b.prototype.compileUnary=function(a){var d=[];var c=this.operator;d.push([this.makeCode(c)]);if("!"===c&&this.first instanceof z)return this.first.negated=
|
||||
!this.first.negated,this.first.compileToFragments(a);if(a.level>=Ka)return(new P(this)).compileToFragments(a);var e="+"===c||"-"===c;("new"===c||"typeof"===c||"delete"===c||e&&this.first instanceof b&&this.first.operator===c)&&d.push([this.makeCode(" ")]);if(e&&this.first instanceof b||"new"===c&&this.first.isStatement(a))this.first=new P(this.first);d.push(this.first.compileToFragments(a,Ha));this.flip&&d.reverse();return this.joinFragmentArrays(d,"")};b.prototype.compileYield=function(a){var b;
|
||||
var d=[];var c=this.operator;null==a.scope.parent&&this.error("yield can only occur inside functions");0<=R.call(Object.keys(this.first),"expression")&&!(this.first instanceof aa)?null!=this.first.expression&&d.push(this.first.expression.compileToFragments(a,Ha)):(a.level>=Da&&d.push([this.makeCode("(")]),d.push([this.makeCode(c)]),""!==(null!=(b=this.first.base)?b.value:void 0)&&d.push([this.makeCode(" ")]),d.push(this.first.compileToFragments(a,Ha)),a.level>=Da&&d.push([this.makeCode(")")]));return this.joinFragmentArrays(d,
|
||||
"")};b.prototype.compilePower=function(a){var b=new C(new y("Math"),[new ra(new L("pow"))]);return(new za(b,[this.first,this.second])).compileToFragments(a)};b.prototype.compileFloorDivision=function(a){var d=new C(new y("Math"),[new ra(new L("floor"))]);var c=this.second.isComplex()?new P(this.second):this.second;c=new b("/",this.first,c);return(new za(d,[c])).compileToFragments(a)};b.prototype.compileModulo=function(a){var b=new C(new B(La("modulo",a)));return(new za(b,[this.first,this.second])).compileToFragments(a)};
|
||||
b.prototype.toString=function(a){return b.__super__.toString.call(this,a,this.constructor.name+" "+this.operator)};return b}(ta);e.In=O=function(a){function b(a,b){this.object=a;this.array=b}v(b,a);b.prototype.children=["object","array"];b.prototype.invert=sa;b.prototype.compileNode=function(a){var b;if(this.array instanceof C&&this.array.isArray()&&this.array.base.objects.length){var c=this.array.base.objects;var e=0;for(b=c.length;e<b;e++){var l=c[e];if(l instanceof T){var f=!0;break}}if(!f)return this.compileOrTest(a)}return this.compileLoopTest(a)};
|
||||
b.prototype.compileOrTest=function(a){var b,c;var e=this.object.cache(a,Ha);var f=e[0];var l=e[1];var h=this.negated?[" !\x3d\x3d "," \x26\x26 "]:[" \x3d\x3d\x3d "," || "];e=h[0];h=h[1];var m=[];var k=this.array.base.objects;var n=b=0;for(c=k.length;b<c;n=++b){var q=k[n];n&&m.push(this.makeCode(h));m=m.concat(n?l:f,this.makeCode(e),q.compileToFragments(a,Ka))}return a.level<Ha?m:this.wrapInBraces(m)};b.prototype.compileLoopTest=function(a){var b=this.object.cache(a,va);var c=b[0];var e=b[1];b=[].concat(this.makeCode(La("indexOf",
|
||||
a)+".call("),this.array.compileToFragments(a,va),this.makeCode(", "),e,this.makeCode(") "+(this.negated?"\x3c 0":"\x3e\x3d 0")));if(ca(c)===ca(e))return b;b=c.concat(this.makeCode(", "),b);return a.level<va?b:this.wrapInBraces(b)};b.prototype.toString=function(a){return b.__super__.toString.call(this,a,this.constructor.name+(this.negated?"!":""))};return b}(ta);e.Try=function(a){function b(a,b,c,e){this.attempt=a;this.errorVariable=b;this.recovery=c;this.ensure=e}v(b,a);b.prototype.children=["attempt",
|
||||
"recovery","ensure"];b.prototype.isStatement=ha;b.prototype.jumps=function(a){var b;return this.attempt.jumps(a)||(null!=(b=this.recovery)?b.jumps(a):void 0)};b.prototype.makeReturn=function(a){this.attempt&&(this.attempt=this.attempt.makeReturn(a));this.recovery&&(this.recovery=this.recovery.makeReturn(a));return this};b.prototype.compileNode=function(a){var b,c,e;a.indent+=Fa;var f=this.attempt.compileToFragments(a,na);var l=this.recovery?(b=a.scope.freeVariable("error",{reserve:!1}),e=new y(b),
|
||||
this.errorVariable?(c=Aa(this.errorVariable.unwrapAll().value),c?this.errorVariable.error(c):void 0,this.recovery.unshift(new x(this.errorVariable,e))):void 0,[].concat(this.makeCode(" catch ("),e.compileToFragments(a),this.makeCode(") {\n"),this.recovery.compileToFragments(a,na),this.makeCode("\n"+this.tab+"}"))):this.ensure||this.recovery?[]:(b=a.scope.freeVariable("error",{reserve:!1}),[this.makeCode(" catch ("+b+") {}")]);a=this.ensure?[].concat(this.makeCode(" finally {\n"),this.ensure.compileToFragments(a,
|
||||
na),this.makeCode("\n"+this.tab+"}")):[];return[].concat(this.makeCode(this.tab+"try {\n"),f,this.makeCode("\n"+this.tab+"}"),l,a)};return b}(ta);e.Throw=aa=function(a){function b(a){this.expression=a}v(b,a);b.prototype.children=["expression"];b.prototype.isStatement=ha;b.prototype.jumps=ka;b.prototype.makeReturn=oa;b.prototype.compileNode=function(a){return[].concat(this.makeCode(this.tab+"throw "),this.expression.compileToFragments(a),this.makeCode(";"))};return b}(ta);e.Existence=z=function(a){function b(a){this.expression=
|
||||
a}v(b,a);b.prototype.children=["expression"];b.prototype.invert=sa;b.prototype.compileNode=function(a){this.expression.front=this.front;var b=this.expression.compile(a,Ha);if(this.expression.unwrap()instanceof y&&!a.scope.check(b)){var c=this.negated?["\x3d\x3d\x3d","||"]:["!\x3d\x3d","\x26\x26"];var e=c[0];c=c[1];b="typeof "+b+" "+e+' "undefined" '+c+" "+b+" "+e+" null"}else b=b+" "+(this.negated?"\x3d\x3d":"!\x3d")+" null";return[this.makeCode(a.level<=gb?b:"("+b+")")]};return b}(ta);e.Parens=P=
|
||||
function(a){function b(a){this.body=a}v(b,a);b.prototype.children=["body"];b.prototype.unwrap=function(){return this.body};b.prototype.isComplex=function(){return this.body.isComplex()};b.prototype.compileNode=function(a){var b=this.body.unwrap();if(b instanceof C&&b.isAtomic())return b.front=this.front,b.compileToFragments(a);var c=b.compileToFragments(a,Da);return a.level<Ha&&(b instanceof h||b instanceof za||b instanceof N&&b.returns)&&(a.level<gb||3>=c.length)?c:this.wrapInBraces(c)};return b}(ta);
|
||||
e.StringWithInterpolations=A=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}v(b,a);b.prototype.compileNode=function(a){var d;if(!a.inTaggedTemplateCall)return b.__super__.compileNode.apply(this,arguments);var c=this.body.unwrap();var e=[];c.traverseChildren(!1,function(a){if(a instanceof D)e.push(a);else if(a instanceof P)return e.push(a),!1;return!0});c=[];c.push(this.makeCode("`"));var f=0;for(d=e.length;f<d;f++){var l=e[f];l instanceof D?(l=l.value.slice(1,-1),l=
|
||||
l.replace(/(\\*)(`|\$\{)/g,function(a,b,d){return 0===b.length%2?b+"\\"+d:a}),c.push(this.makeCode(l))):(c.push(this.makeCode("${")),c.push.apply(c,l.compileToFragments(a,Da)),c.push(this.makeCode("}")))}c.push(this.makeCode("`"));return c};return b}(P);e.For=N=function(b){function c(b,d){this.source=d.source;this.guard=d.guard;this.step=d.step;this.name=d.name;this.index=d.index;this.body=a.wrap([b]);this.own=!!d.own;this.object=!!d.object;(this.from=!!d.from)&&this.index&&this.index.error("cannot use index with for-from");
|
||||
this.own&&!this.object&&d.ownTag.error("cannot use own with for-"+(this.from?"from":"in"));this.object&&(b=[this.index,this.name],this.name=b[0],this.index=b[1]);this.index instanceof C&&!this.index.isAssignable()&&this.index.error("index cannot be a pattern matching expression");this.range=this.source instanceof C&&this.source.base instanceof U&&!this.source.properties.length&&!this.from;this.pattern=this.name instanceof C;this.range&&this.index&&this.index.error("indexes do not apply to range loops");
|
||||
this.range&&this.pattern&&this.name.error("cannot pattern match over range loops");this.returns=!1}v(c,b);c.prototype.children=["body","source","guard","step"];c.prototype.compileNode=function(b){var d,c,e,f,l,h,k;var n=a.wrap([this.body]);var m=n.expressions;m=m[m.length-1];(null!=m?m.jumps():void 0)instanceof H&&(this.returns=!1);var q=this.range?this.source.base:this.source;var p=b.scope;this.pattern||(e=this.name&&this.name.compile(b,va));m=this.index&&this.index.compile(b,va);e&&!this.pattern&&
|
||||
p.find(e);!m||this.index instanceof C||p.find(m);this.returns&&(c=p.freeVariable("results"));this.from?this.pattern&&(f=p.freeVariable("x",{single:!0})):f=this.object&&m||p.freeVariable("i",{single:!0});var w=(this.range||this.from)&&e||m||f;var r=w!==f?w+" \x3d ":"";if(this.step&&!this.range){m=this.cacheToCodeFragments(this.step.cache(b,va,Za));var t=m[0];var v=m[1];this.step.isNumber()&&(h=Number(v))}this.pattern&&(e=f);var u=m=k="";var K=this.tab+Fa;if(this.range)var A=q.compileToFragments(ja(b,
|
||||
{index:f,name:e,step:this.step,isComplex:Za}));else{var z=this.source.compile(b,va);!e&&!this.own||this.source.unwrap()instanceof y||(u+=""+this.tab+(q=p.freeVariable("ref"))+" \x3d "+z+";\n",z=q);!e||this.pattern||this.from||(l=e+" \x3d "+z+"["+w+"]");this.object||this.from||(t!==v&&(u+=""+this.tab+t+";\n"),e=0>h,this.step&&null!=h&&e||(d=p.freeVariable("len")),A=""+r+f+" \x3d 0, "+d+" \x3d "+z+".length",t=""+r+f+" \x3d "+z+".length - 1",d=f+" \x3c "+d,p=f+" \x3e\x3d 0",this.step?(null!=h?e&&(d=
|
||||
p,A=t):(d=v+" \x3e 0 ? "+d+" : "+p,A="("+v+" \x3e 0 ? ("+A+") : "+t+")"),f=f+" +\x3d "+v):f=""+(w!==f?"++"+f:f+"++"),A=[this.makeCode(A+"; "+d+"; "+r+f)])}if(this.returns){var U=""+this.tab+c+" \x3d [];\n";var D="\n"+this.tab+"return "+c+";";n.makeReturn(c)}this.guard&&(1<n.expressions.length?n.expressions.unshift(new G((new P(this.guard)).invert(),new V("continue"))):this.guard&&(n=a.wrap([new G(this.guard,n)])));this.pattern&&n.expressions.unshift(new x(this.name,this.from?new y(w):new B(z+"["+
|
||||
w+"]")));c=[].concat(this.makeCode(u),this.pluckDirectCall(b,n));l&&(k="\n"+K+l+";");this.object?(A=[this.makeCode(w+" in "+z)],this.own&&(m="\n"+K+"if (!"+La("hasProp",b)+".call("+z+", "+w+")) continue;")):this.from&&(A=[this.makeCode(w+" of "+z)]);(b=n.compileToFragments(ja(b,{indent:K}),na))&&0<b.length&&(b=[].concat(this.makeCode("\n"),b,this.makeCode("\n")));return[].concat(c,this.makeCode(""+(U||"")+this.tab+"for ("),A,this.makeCode(") {"+m+k),b,this.makeCode(this.tab+"}"+(D||"")))};c.prototype.pluckDirectCall=
|
||||
function(a,b){var d,c,e,f,h,l,n;var m=[];var q=b.expressions;var p=d=0;for(c=q.length;d<c;p=++d){var w=q[p];w=w.unwrapAll();if(w instanceof za){var r=null!=(e=w.variable)?e.unwrapAll():void 0;if(r instanceof k||r instanceof C&&(null!=(f=r.base)?f.unwrapAll():void 0)instanceof k&&1===r.properties.length&&("call"===(h=null!=(l=r.properties[0].name)?l.value:void 0)||"apply"===h)){var t=(null!=(n=r.base)?n.unwrapAll():void 0)||r;var v=new y(a.scope.freeVariable("fn"));var u=new C(v);r.base&&(u=[u,r],
|
||||
r.base=u[0],u=u[1]);b.expressions[p]=new za(u,w.args);m=m.concat(this.makeCode(this.tab),(new x(v,t)).compileToFragments(a,na),this.makeCode(";\n"))}}}return m};return c}(Y);e.Switch=function(b){function c(a,b,c){this.subject=a;this.cases=b;this.otherwise=c}v(c,b);c.prototype.children=["subject","cases","otherwise"];c.prototype.isStatement=ha;c.prototype.jumps=function(a){var b,c;null==a&&(a={block:!0});var e=this.cases;var f=0;for(b=e.length;f<b;f++){var h=e[f];h=h[1];if(h=h.jumps(a))return h}return null!=
|
||||
(c=this.otherwise)?c.jumps(a):void 0};c.prototype.makeReturn=function(b){var d,c;var e=this.cases;var f=0;for(d=e.length;f<d;f++){var h=e[f];h[1].makeReturn(b)}b&&(this.otherwise||(this.otherwise=new a([new B("void 0")])));null!=(c=this.otherwise)&&c.makeReturn(b);return this};c.prototype.compileNode=function(a){var b,c,e,f;var h=a.indent+Fa;var l=a.indent=h+Fa;var k=[].concat(this.makeCode(this.tab+"switch ("),this.subject?this.subject.compileToFragments(a,Da):this.makeCode("false"),this.makeCode(") {\n"));
|
||||
var n=this.cases;var m=c=0;for(e=n.length;c<e;m=++c){var q=n[m];var p=q[0];q=q[1];var w=ia([p]);p=0;for(f=w.length;p<f;p++){var r=w[p];this.subject||(r=r.invert());k=k.concat(this.makeCode(h+"case "),r.compileToFragments(a,Da),this.makeCode(":\n"))}0<(b=q.compileToFragments(a,na)).length&&(k=k.concat(b,this.makeCode("\n")));if(m===this.cases.length-1&&!this.otherwise)break;m=this.lastNonComment(q.expressions);m instanceof H||m instanceof B&&m.jumps()&&"debugger"!==m.value||k.push(r.makeCode(l+"break;\n"))}this.otherwise&&
|
||||
this.otherwise.expressions.length&&k.push.apply(k,[this.makeCode(h+"default:\n")].concat(M.call(this.otherwise.compileToFragments(a,na)),[this.makeCode("\n")]));k.push(this.makeCode(this.tab+"}"));return k};return c}(ta);e.If=G=function(b){function c(a,b,c){this.body=b;null==c&&(c={});this.condition="unless"===c.type?a.invert():a;this.elseBody=null;this.isChain=!1;this.soak=c.soak}v(c,b);c.prototype.children=["condition","body","elseBody"];c.prototype.bodyNode=function(){var a;return null!=(a=this.body)?
|
||||
a.unwrap():void 0};c.prototype.elseBodyNode=function(){var a;return null!=(a=this.elseBody)?a.unwrap():void 0};c.prototype.addElse=function(a){this.isChain?this.elseBodyNode().addElse(a):(this.isChain=a instanceof c,this.elseBody=this.ensureBlock(a),this.elseBody.updateLocationDataIfMissing(a.locationData));return this};c.prototype.isStatement=function(a){var b;return(null!=a?a.level:void 0)===na||this.bodyNode().isStatement(a)||(null!=(b=this.elseBodyNode())?b.isStatement(a):void 0)};c.prototype.jumps=
|
||||
function(a){var b;return this.body.jumps(a)||(null!=(b=this.elseBody)?b.jumps(a):void 0)};c.prototype.compileNode=function(a){return this.isStatement(a)?this.compileStatement(a):this.compileExpression(a)};c.prototype.makeReturn=function(b){b&&(this.elseBody||(this.elseBody=new a([new B("void 0")])));this.body&&(this.body=new a([this.body.makeReturn(b)]));this.elseBody&&(this.elseBody=new a([this.elseBody.makeReturn(b)]));return this};c.prototype.ensureBlock=function(b){return b instanceof a?b:new a([b])};
|
||||
c.prototype.compileStatement=function(a){var b=la(a,"chainChild");if(la(a,"isExistentialEquals"))return(new c(this.condition.invert(),this.elseBodyNode(),{type:"if"})).compileToFragments(a);var e=a.indent+Fa;var f=this.condition.compileToFragments(a,Da);var h=this.ensureBlock(this.body).compileToFragments(ja(a,{indent:e}));h=[].concat(this.makeCode("if ("),f,this.makeCode(") {\n"),h,this.makeCode("\n"+this.tab+"}"));b||h.unshift(this.makeCode(this.tab));if(!this.elseBody)return h;b=h.concat(this.makeCode(" else "));
|
||||
this.isChain?(a.chainChild=!0,b=b.concat(this.elseBody.unwrap().compileToFragments(a,na))):b=b.concat(this.makeCode("{\n"),this.elseBody.compileToFragments(ja(a,{indent:e}),na),this.makeCode("\n"+this.tab+"}"));return b};c.prototype.compileExpression=function(a){var b=this.condition.compileToFragments(a,gb);var c=this.bodyNode().compileToFragments(a,va);var e=this.elseBodyNode()?this.elseBodyNode().compileToFragments(a,va):[this.makeCode("void 0")];e=b.concat(this.makeCode(" ? "),c,this.makeCode(" : "),
|
||||
e);return a.level>=gb?this.wrapInBraces(e):e};c.prototype.unfoldSoak=function(){return this.soak&&this};return c}(ta);var jc={extend:function(a){return"function(child, parent) { for (var key in parent) { if ("+La("hasProp",a)+".call(parent, key)) child[key] \x3d parent[key]; } function ctor() { this.constructor \x3d child; } ctor.prototype \x3d parent.prototype; child.prototype \x3d new ctor(); child.__super__ \x3d parent.prototype; return child; }"},bind:function(){return"function(fn, me){ return function(){ return fn.apply(me, arguments); }; }"},
|
||||
indexOf:function(){return"[].indexOf || function(item) { for (var i \x3d 0, l \x3d this.length; i \x3c l; i++) { if (i in this \x26\x26 this[i] \x3d\x3d\x3d item) return i; } return -1; }"},modulo:function(){return"function(a, b) { return (+a % (b \x3d +b) + b) % b; }"},hasProp:function(){return"{}.hasOwnProperty"},slice:function(){return"[].slice"}};var na=1;var Da=2;var va=3;var gb=4;var Ha=5;var Ka=6;var Fa=" ";var Ra=/^[+-]?\d+$/;var La=function(a,b){var c=b.scope.root;if(a in c.utilities)return c.utilities[a];
|
||||
var d=c.freeVariable(a);c.assign(d,jc[a](b));return c.utilities[a]=d};var Ga=function(a,b){a=a.replace(/\n/g,"$\x26"+b);return a.replace(/\s+$/,"")};var Wa=function(a){return a instanceof y&&"arguments"===a.value};var da=function(a){return a instanceof E||a instanceof k&&a.bound||a instanceof xa};var Za=function(a){return a.isComplex()||("function"===typeof a.isAssignable?a.isAssignable():void 0)};var Ea=function(a,b,c){if(a=b[c].unfoldSoak(a))return b[c]=a.body,a.body=new C(b),a}}).call(this);return e}();
|
||||
u["./sourcemap"]=function(){var e={};(function(){var u=function(){function e(e){this.line=e;this.columns=[]}e.prototype.add=function(e,a,b){var r=a[0];a=a[1];null==b&&(b={});if(!this.columns[e]||!b.noReplace)return this.columns[e]={line:this.line,column:e,sourceLine:r,sourceColumn:a}};e.prototype.sourceLocation=function(e){for(var a;!((a=this.columns[e])||0>=e);)e--;return a&&[a.sourceLine,a.sourceColumn]};return e}();e=function(){function e(){this.lines=[]}e.prototype.add=function(e,a,b){var r;null==
|
||||
b&&(b={});var f=a[0];a=a[1];return((r=this.lines)[f]||(r[f]=new u(f))).add(a,e,b)};e.prototype.sourceLocation=function(e){var a;var b=e[0];for(e=e[1];!((a=this.lines[b])||0>=b);)b--;return a&&a.sourceLocation(e)};e.prototype.generate=function(e,a){var b,r,f,k,t,p,u;null==e&&(e={});null==a&&(a=null);var x=f=r=u=0;var J=!1;var F="";var N=this.lines;var y=b=0;for(k=N.length;b<k;y=++b)if(y=N[y]){var G=y.columns;y=0;for(t=G.length;y<t;y++)if(p=G[y]){for(;u<p.line;)r=0,J=!1,F+=";",u++;J&&(F+=",");F+=this.encodeVlq(p.column-
|
||||
r);r=p.column;F+=this.encodeVlq(0);F+=this.encodeVlq(p.sourceLine-f);f=p.sourceLine;F+=this.encodeVlq(p.sourceColumn-x);x=p.sourceColumn;J=!0}}F={version:3,file:e.generatedFile||"",sourceRoot:e.sourceRoot||"",sources:e.sourceFiles||[""],names:[],mappings:F};e.inlineMap&&(F.sourcesContent=[a]);return F};e.prototype.encodeVlq=function(e){var a;var b="";for(a=(Math.abs(e)<<1)+(0>e?1:0);a||!b;)e=a&31,(a>>=5)&&(e|=32),b+=this.encodeBase64(e);return b};e.prototype.encodeBase64=function(e){var a;if(!(a=
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e]))throw Error("Cannot Base64 encode value: "+e);return a};return e}()}).call(this);return e}();u["./coffee-script"]=function(){var e={};(function(){var ra,r,x={}.hasOwnProperty;var a=u("fs");var b=u("vm");var za=u("path");var f=u("./lexer").Lexer;var k=u("./parser").parser;var t=u("./helpers");var p=u("./sourcemap");var z=u("../../package.json");e.VERSION=z.version;e.FILE_EXTENSIONS=[".coffee",".litcoffee",".coffee.md"];e.helpers=
|
||||
t;var I=function(a){switch(!1){case "function"!==typeof Buffer:return(new Buffer(a)).toString("base64");case "function"!==typeof btoa:return btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(a,b){return String.fromCharCode("0x"+b)}));default:throw Error("Unable to base64 encode inline sourcemap.");}};z=function(a){return function(b,e){null==e&&(e={});try{return a.call(this,b,e)}catch(h){var c=h;if("string"!==typeof b)throw c;throw t.updateSyntaxError(c,b,e.filename);}}};var J={};var F=
|
||||
{};e.compile=ra=z(function(a,b){var c,e,f,n;var r=t.extend;b=r({},b);var u=b.sourceMap||b.inlineMap||null==b.filename;r=b.filename||"\x3canonymous\x3e";J[r]=a;u&&(f=new p);var y=O.tokenize(a,b);var x=b;var z=[];var B=0;for(c=y.length;B<c;B++){var G=y[B];"IDENTIFIER"===G[0]&&z.push(G[1])}x.referencedVars=z;if(null==b.bare||!0!==b.bare)for(x=0,B=y.length;x<B;x++)if(G=y[x],"IMPORT"===(e=G[0])||"EXPORT"===e){b.bare=!0;break}B=k.parse(y).compileToFragments(b);y=0;b.header&&(y+=1);b.shiftLine&&(y+=1);G=
|
||||
0;e="";c=0;for(z=B.length;c<z;c++){x=B[c];if(u){x.locationData&&!/^[;\s]*$/.test(x.code)&&f.add([x.locationData.first_line,x.locationData.first_column],[y,G],{noReplace:!0});var N=t.count(x.code,"\n");y+=N;G=N?x.code.length-(x.code.lastIndexOf("\n")+1):G+x.code.length}e+=x.code}b.header&&(G="Generated by CoffeeScript "+this.VERSION,e="// "+G+"\n"+e);if(u){var D=f.generate(b,a);F[r]=f}b.inlineMap&&(a=I(JSON.stringify(D)),r="//# sourceURL\x3d"+(null!=(n=b.filename)?n:"coffeescript"),e=e+"\n"+("//# sourceMappingURL\x3ddata:application/json;base64,"+
|
||||
a)+"\n"+r);return b.sourceMap?{js:e,sourceMap:f,v3SourceMap:JSON.stringify(D,null,2)}:e});e.tokens=z(function(a,b){return O.tokenize(a,b)});e.nodes=z(function(a,b){return"string"===typeof a?k.parse(O.tokenize(a,b)):k.parse(a)});e.run=function(b,c){var e;null==c&&(c={});var f=u.main;f.filename=process.argv[1]=c.filename?a.realpathSync(c.filename):"\x3canonymous\x3e";f.moduleCache&&(f.moduleCache={});var h=null!=c.filename?za.dirname(a.realpathSync(c.filename)):a.realpathSync(".");f.paths=u("module")._nodeModulePaths(h);
|
||||
if(!t.isCoffee(f.filename)||u.extensions)b=ra(b,c),b=null!=(e=b.js)?e:b;return f._compile(b,f.filename)};e.eval=function(a,c){var e,f,h,k,n;null==c&&(c={});if(a=a.trim()){var p=null!=(h=b.Script.createContext)?h:b.createContext;h=null!=(f=b.isContext)?f:function(a){return c.sandbox instanceof p().constructor};if(p){if(null!=c.sandbox){if(h(c.sandbox))var r=c.sandbox;else for(k in r=p(),h=c.sandbox,h)x.call(h,k)&&(f=h[k],r[k]=f);r.global=r.root=r.GLOBAL=r}else r=global;r.__filename=c.filename||"eval";
|
||||
r.__dirname=za.dirname(r.__filename);if(r===global&&!r.module&&!r.require){var t=u("module");r.module=e=new t(c.modulename||"eval");r.require=f=function(a){return t._load(a,e,!0)};e.filename=r.__filename;var y=Object.getOwnPropertyNames(u);h=0;for(n=y.length;h<n;h++){var z=y[h];"paths"!==z&&"arguments"!==z&&"caller"!==z&&(f[z]=u[z])}f.paths=e.paths=t._nodeModulePaths(process.cwd());f.resolve=function(a){return t._resolveFilename(a,e)}}}h={};for(k in c)x.call(c,k)&&(f=c[k],h[k]=f);h.bare=!0;a=ra(a,
|
||||
h);return r===global?b.runInThisContext(a):b.runInContext(a,r)}};e.register=function(){return u("./register")};if(u.extensions){var N=this.FILE_EXTENSIONS;var y=function(a){var b;return null!=(b=u.extensions)[a]?b[a]:b[a]=function(){throw Error("Use CoffeeScript.register() or require the coffee-script/register module to require "+a+" files.");}};var G=0;for(r=N.length;G<r;G++)z=N[G],y(z)}e._compileFile=function(b,c,e){null==c&&(c=!1);null==e&&(e=!1);var f=a.readFileSync(b,"utf8");f=65279===f.charCodeAt(0)?
|
||||
f.substring(1):f;try{var h=ra(f,{filename:b,sourceMap:c,inlineMap:e,sourceFiles:[b],literate:t.isLiterate(b)})}catch(K){throw c=K,t.updateSyntaxError(c,f,b);}return h};var O=new f;k.lexer={lex:function(){var a;if(a=k.tokens[this.pos++]){var b=a[0];this.yytext=a[1];this.yylloc=a[2];k.errorToken=a.origin||a;this.yylineno=this.yylloc.first_line}else b="";return b},setInput:function(a){k.tokens=a;return this.pos=0},upcomingInput:function(){return""}};k.yy=u("./nodes");k.yy.parseError=function(a,b){var c=
|
||||
k.errorToken;var e=k.tokens;var f=c[0];var n=c[1];a=c[2];n=function(){switch(!1){case c!==e[e.length-1]:return"end of input";case "INDENT"!==f&&"OUTDENT"!==f:return"indentation";case "IDENTIFIER"!==f&&"NUMBER"!==f&&"INFINITY"!==f&&"STRING"!==f&&"STRING_START"!==f&&"REGEX"!==f&&"REGEX_START"!==f:return f.replace(/_START$/,"").toLowerCase();default:return t.nameWhitespaceCharacter(n)}}();return t.throwSyntaxError("unexpected "+n,a)};var Q=function(a,b){var c;if(a.isNative())var e="native";else{a.isEval()?
|
||||
(c=a.getScriptNameOrSourceURL())||a.getEvalOrigin():c=a.getFileName();c||(c="\x3canonymous\x3e");var f=a.getLineNumber();e=a.getColumnNumber();e=(b=b(c,f,e))?c+":"+b[0]+":"+b[1]:c+":"+f+":"+e}c=a.getFunctionName();f=a.isConstructor();if(a.isToplevel()||f)return f?"new "+(c||"\x3canonymous\x3e")+" ("+e+")":c?c+" ("+e+")":e;f=a.getMethodName();var k=a.getTypeName();return c?(b=a="",k&&c.indexOf(k)&&(b=k+"."),f&&c.indexOf("."+f)!==c.length-f.length-1&&(a=" [as "+f+"]"),""+b+c+a+" ("+e+")"):k+"."+(f||
|
||||
"\x3canonymous\x3e")+" ("+e+")"};var B=function(a){return null!=F[a]?F[a]:null!=F["\x3canonymous\x3e"]?F["\x3canonymous\x3e"]:null!=J[a]?(a=ra(J[a],{filename:a,sourceMap:!0,literate:t.isLiterate(a)}),a.sourceMap):null};Error.prepareStackTrace=function(a,b){var c;var f=function(a,b,c){var e;a=B(a);null!=a&&(e=a.sourceLocation([b-1,c-1]));return null!=e?[e[0]+1,e[1]+1]:null};var h=function(){var a;var h=[];var k=0;for(a=b.length;k<a;k++){c=b[k];if(c.getFunction()===e.run)break;h.push(" at "+Q(c,
|
||||
f))}return h}();return a.toString()+"\n"+h.join("\n")+"\n"}}).call(this);return e}();u["./browser"]=function(){(function(){var e=[].indexOf||function(a){for(var b=0,e=this.length;b<e;b++)if(b in this&&this[b]===a)return b;return-1};var ra=u("./coffee-script");ra.require=u;var r=ra.compile;ra.eval=function(a,b){null==b&&(b={});null==b.bare&&(b.bare=!0);return eval(r(a,b))};ra.run=function(a,b){null==b&&(b={});b.bare=!0;b.shiftLine=!0;return Function(r(a,b))()};if("undefined"!==typeof window&&null!==
|
||||
window){"undefined"!==typeof btoa&&null!==btoa&&"undefined"!==typeof JSON&&null!==JSON&&(r=function(a,b){null==b&&(b={});b.inlineMap=!0;return ra.compile(a,b)});ra.load=function(a,b,e,f){null==e&&(e={});null==f&&(f=!1);e.sourceFiles=[a];var k=window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLHTTP"):new window.XMLHttpRequest;k.open("GET",a,!0);"overrideMimeType"in k&&k.overrideMimeType("text/plain");k.onreadystatechange=function(){var r;if(4===k.readyState){if(0===(r=k.status)||200===r)r=
|
||||
[k.responseText,e],f||ra.run.apply(ra,r);else throw Error("Could not load "+a);if(b)return b(r)}};return k.send(null)};var x=function(){var a,b,r;var f=window.document.getElementsByTagName("script");var k=["text/coffeescript","text/literate-coffeescript"];var t=function(){var a,b;var p=[];var t=0;for(a=f.length;t<a;t++)r=f[t],(b=r.type,0<=e.call(k,b))&&p.push(r);return p}();var p=0;var u=function(){var a=t[p];if(a instanceof Array)return ra.run.apply(ra,a),p++,u()};var x=function(a,b){var e;var f=
|
||||
{literate:a.type===k[1]};if(e=a.src||a.getAttribute("data-src"))return ra.load(e,function(a){t[b]=a;return u()},f,!0);f.sourceFiles=["embedded"];return t[b]=[a.innerHTML,f]};var J=a=0;for(b=t.length;a<b;J=++a){var F=t[J];x(F,J)}return u()};window.addEventListener?window.addEventListener("DOMContentLoaded",x,!1):window.attachEvent("onload",x)}}).call(this);return{}}();return u["./coffee-script"]}();"function"===typeof define&&define.amd?define(function(){return xa}):u.CoffeeScript=xa})(this);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -90,6 +90,10 @@ arrayEgal = (a, b) ->
|
||||
@eq = (a, b, msg) -> ok egal(a, b), msg or "Expected #{a} to equal #{b}"
|
||||
@arrayEq = (a, b, msg) -> ok arrayEgal(a,b), msg or "Expected #{a} to deep equal #{b}"
|
||||
|
||||
@toJS = (str) ->
|
||||
CoffeeScript.compile str, bare: yes
|
||||
.replace /^\s+|\s+$/g, '' # Trim leading/trailing whitespace
|
||||
|
||||
|
||||
@doesNotThrow = (fn) ->
|
||||
fn()
|
||||
@@ -3146,6 +3150,17 @@ test "#748: trailing reserved identifiers", ->
|
||||
nonce
|
||||
eq nonce, result
|
||||
|
||||
test 'if-else within an assignment, condition parenthesized', ->
|
||||
result = if (1 is 1) then 'correct'
|
||||
eq result, 'correct'
|
||||
|
||||
result = if ('whatever' ? no) then 'correct'
|
||||
eq result, 'correct'
|
||||
|
||||
f = -> 'wrong'
|
||||
result = if (f?()) then 'correct' else 'wrong'
|
||||
eq result, 'correct'
|
||||
|
||||
# Postfix
|
||||
|
||||
test "#3056: multiple postfix conditionals", ->
|
||||
@@ -3882,6 +3897,13 @@ test "octal escapes", ->
|
||||
/a\\0\\tb\\\\\\07c/
|
||||
\ \ \ \ ^\^^
|
||||
'''
|
||||
assertErrorFormat '''
|
||||
/a\\1\\tb\\\\\\07c/
|
||||
''', '''
|
||||
[stdin]:1:10: error: octal escape sequences are not allowed \\07
|
||||
/a\\1\\tb\\\\\\07c/
|
||||
\ \ \ \ ^\^^
|
||||
'''
|
||||
assertErrorFormat '''
|
||||
///a
|
||||
#{b} \\01///
|
||||
@@ -4677,6 +4699,119 @@ test "can't use pattern matches for loop indices", ->
|
||||
^^^
|
||||
'''
|
||||
|
||||
test "#4248: Unicode code point escapes", ->
|
||||
assertErrorFormat '''
|
||||
"a
|
||||
#{b} \\u{G02}
|
||||
c"
|
||||
''', '''
|
||||
[stdin]:2:8: error: invalid escape sequence \\u{G02}
|
||||
#{b} \\u{G02}
|
||||
^\^^^^^^
|
||||
'''
|
||||
assertErrorFormat '''
|
||||
/a\\u{}b/
|
||||
''', '''
|
||||
[stdin]:1:3: error: invalid escape sequence \\u{}
|
||||
/a\\u{}b/
|
||||
^\^^^
|
||||
'''
|
||||
assertErrorFormat '''
|
||||
///a \\u{01abc///
|
||||
''', '''
|
||||
[stdin]:1:6: error: invalid escape sequence \\u{01abc
|
||||
///a \\u{01abc///
|
||||
^\^^^^^^^
|
||||
'''
|
||||
|
||||
assertErrorFormat '''
|
||||
/\\u{123} \\u{110000}/
|
||||
''', '''
|
||||
[stdin]:1:10: error: unicode code point escapes greater than \\u{10ffff} are not allowed
|
||||
/\\u{123} \\u{110000}/
|
||||
\ ^\^^^^^^^^^
|
||||
'''
|
||||
|
||||
assertErrorFormat '''
|
||||
///abc\\\\\\u{123456}///u
|
||||
''', '''
|
||||
[stdin]:1:9: error: unicode code point escapes greater than \\u{10ffff} are not allowed
|
||||
///abc\\\\\\u{123456}///u
|
||||
\ \^\^^^^^^^^^
|
||||
'''
|
||||
|
||||
assertErrorFormat '''
|
||||
"""
|
||||
\\u{123}
|
||||
a
|
||||
\\u{00110000}
|
||||
#{ 'b' }
|
||||
"""
|
||||
''', '''
|
||||
[stdin]:4:5: error: unicode code point escapes greater than \\u{10ffff} are not allowed
|
||||
\\u{00110000}
|
||||
^\^^^^^^^^^^^
|
||||
'''
|
||||
|
||||
assertErrorFormat '''
|
||||
'\\u{a}\\u{1111110000}'
|
||||
''', '''
|
||||
[stdin]:1:7: error: unicode code point escapes greater than \\u{10ffff} are not allowed
|
||||
'\\u{a}\\u{1111110000}'
|
||||
\ ^\^^^^^^^^^^^^^
|
||||
'''
|
||||
|
||||
test "#4283: error message for implicit call", ->
|
||||
assertErrorFormat '''
|
||||
console.log {search, users, contacts users_to_display}
|
||||
''', '''
|
||||
[stdin]:1:29: error: unexpected implicit function call
|
||||
console.log {search, users, contacts users_to_display}
|
||||
^^^^^^^^
|
||||
'''
|
||||
|
||||
test "#3199: error message for call indented non-object", ->
|
||||
assertErrorFormat '''
|
||||
fn = ->
|
||||
fn
|
||||
1
|
||||
''', '''
|
||||
[stdin]:3:1: error: unexpected indentation
|
||||
1
|
||||
^^
|
||||
'''
|
||||
|
||||
test "#3199: error message for call indented comprehension", ->
|
||||
assertErrorFormat '''
|
||||
fn = ->
|
||||
fn
|
||||
x for x in [1, 2, 3]
|
||||
''', '''
|
||||
[stdin]:3:1: error: unexpected indentation
|
||||
x for x in [1, 2, 3]
|
||||
^^
|
||||
'''
|
||||
|
||||
test "#3199: error message for return indented non-object", ->
|
||||
assertErrorFormat '''
|
||||
return
|
||||
1
|
||||
''', '''
|
||||
[stdin]:2:3: error: unexpected number
|
||||
1
|
||||
^
|
||||
'''
|
||||
|
||||
test "#3199: error message for return indented comprehension", ->
|
||||
assertErrorFormat '''
|
||||
return
|
||||
x for x in [1, 2, 3]
|
||||
''', '''
|
||||
[stdin]:2:3: error: unexpected identifier
|
||||
x for x in [1, 2, 3]
|
||||
^
|
||||
'''
|
||||
|
||||
</script>
|
||||
<script type="text/x-coffeescript" class="test" id="eval">
|
||||
if vm = require? 'vm'
|
||||
@@ -4987,6 +5122,9 @@ test "indented heredoc", ->
|
||||
# * single line arguments
|
||||
# * inline function literal
|
||||
# * inline object literal
|
||||
#
|
||||
# * chaining inside
|
||||
# * implicit object literal
|
||||
|
||||
test "chaining after outdent", ->
|
||||
id = (x) -> x
|
||||
@@ -5057,6 +5195,47 @@ test "#1495, method call chaining", ->
|
||||
).join ', '
|
||||
eq 'a, b, c', result
|
||||
|
||||
test "chaining should not wrap spilling ternary", ->
|
||||
throws -> CoffeeScript.compile """
|
||||
if 0 then 1 else g
|
||||
a: 42
|
||||
.h()
|
||||
"""
|
||||
|
||||
test "chaining should wrap calls containing spilling ternary", ->
|
||||
f = (x) -> h: x
|
||||
id = (x) -> x
|
||||
result = f if true then 42 else id
|
||||
a: 2
|
||||
.h
|
||||
eq 42, result
|
||||
|
||||
test "chaining should work within spilling ternary", ->
|
||||
f = (x) -> h: x
|
||||
id = (x) -> x
|
||||
result = f if false then 1 else id
|
||||
a: 3
|
||||
.a
|
||||
eq 3, result.h
|
||||
|
||||
test "method call chaining inside objects", ->
|
||||
f = (x) -> c: 42
|
||||
result =
|
||||
a: f 1
|
||||
b: f a: 1
|
||||
.c
|
||||
eq 42, result.b
|
||||
|
||||
test "#4568: refine sameLine implicit object tagging", ->
|
||||
condition = yes
|
||||
fn = -> yes
|
||||
|
||||
x =
|
||||
fn bar: {
|
||||
foo: 123
|
||||
} if not condition
|
||||
eq x, undefined
|
||||
|
||||
# Nested blocks caused by paren unwrapping
|
||||
test "#1492: Nested blocks don't cause double semicolons", ->
|
||||
js = CoffeeScript.compile '(0;0)'
|
||||
@@ -5114,6 +5293,13 @@ test "#1275: allow indentation before closing brackets", ->
|
||||
)
|
||||
eq 1, a
|
||||
|
||||
test "#3199: return multiline implicit object", ->
|
||||
y = do ->
|
||||
if no then return
|
||||
type: 'a'
|
||||
msg: 'b'
|
||||
eq undefined, y
|
||||
|
||||
</script>
|
||||
<script type="text/x-coffeescript" class="test" id="function_invocation">
|
||||
# Function Invocation
|
||||
@@ -7628,12 +7814,6 @@ test "Verify all tokens get a location", ->
|
||||
# CoffeeScript also supports optional commas within `{ … }`.
|
||||
|
||||
|
||||
# Helper function
|
||||
toJS = (str) ->
|
||||
CoffeeScript.compile str, bare: yes
|
||||
.replace /^\s+|\s+$/g, '' # Trim leading/trailing whitespace
|
||||
|
||||
|
||||
# Import statements
|
||||
|
||||
test "backticked import statement", ->
|
||||
@@ -7945,6 +8125,28 @@ test "export default object", ->
|
||||
};"""
|
||||
eq toJS(input), output
|
||||
|
||||
test "export default implicit object", ->
|
||||
input = "export default foo: 'bar', baz: 'qux'"
|
||||
output = """
|
||||
export default {
|
||||
foo: 'bar',
|
||||
baz: 'qux'
|
||||
};"""
|
||||
eq toJS(input), output
|
||||
|
||||
test "export default multiline implicit object", ->
|
||||
input = """
|
||||
export default
|
||||
foo: 'bar',
|
||||
baz: 'qux'
|
||||
"""
|
||||
output = """
|
||||
export default {
|
||||
foo: 'bar',
|
||||
baz: 'qux'
|
||||
};"""
|
||||
eq toJS(input), output
|
||||
|
||||
test "export default assignment expression", ->
|
||||
input = "export default foo = 'bar'"
|
||||
output = """
|
||||
@@ -8310,7 +8512,7 @@ test "export an aliased member named default", ->
|
||||
};"""
|
||||
eq toJS(input), output
|
||||
|
||||
test "export an imported member named default", ->
|
||||
test "import an imported member named default", ->
|
||||
input = "import { default } from 'lib'"
|
||||
output = """
|
||||
import {
|
||||
@@ -8318,7 +8520,7 @@ test "export an imported member named default", ->
|
||||
} from 'lib';"""
|
||||
eq toJS(input), output
|
||||
|
||||
test "export an imported aliased member named default", ->
|
||||
test "import an imported aliased member named default", ->
|
||||
input = "import { default as def } from 'lib'"
|
||||
output = """
|
||||
import {
|
||||
@@ -8326,6 +8528,22 @@ test "export an imported aliased member named default", ->
|
||||
} from 'lib';"""
|
||||
eq toJS(input), output
|
||||
|
||||
test "export an imported member named default", ->
|
||||
input = "export { default } from 'lib'"
|
||||
output = """
|
||||
export {
|
||||
default
|
||||
} from 'lib';"""
|
||||
eq toJS(input), output
|
||||
|
||||
test "export an imported aliased member named default", ->
|
||||
input = "export { default as def } from 'lib'"
|
||||
output = """
|
||||
export {
|
||||
default as def
|
||||
} from 'lib';"""
|
||||
eq toJS(input), output
|
||||
|
||||
test "#4394: export shouldn't prevent variable declarations", ->
|
||||
input = """
|
||||
x = 1
|
||||
@@ -8342,6 +8560,121 @@ test "#4394: export shouldn't prevent variable declarations", ->
|
||||
"""
|
||||
eq toJS(input), output
|
||||
|
||||
test "#4451: `default` in an export statement is only treated as a keyword when it follows `export` or `as`", ->
|
||||
input = "export default { default: 1 }"
|
||||
output = """
|
||||
export default {
|
||||
"default": 1
|
||||
};
|
||||
"""
|
||||
eq toJS(input), output
|
||||
|
||||
test "#4491: import- and export-specific lexing should stop after import/export statement", ->
|
||||
input = """
|
||||
import {
|
||||
foo,
|
||||
bar as baz
|
||||
} from 'lib'
|
||||
|
||||
foo as
|
||||
3 * as 4
|
||||
from 'foo'
|
||||
"""
|
||||
output = """
|
||||
import {
|
||||
foo,
|
||||
bar as baz
|
||||
} from 'lib';
|
||||
|
||||
foo(as);
|
||||
|
||||
3 * as(4);
|
||||
|
||||
from('foo');
|
||||
"""
|
||||
eq toJS(input), output
|
||||
|
||||
input = """
|
||||
import { foo, bar as baz } from 'lib'
|
||||
|
||||
foo as
|
||||
3 * as 4
|
||||
from 'foo'
|
||||
"""
|
||||
output = """
|
||||
import {
|
||||
foo,
|
||||
bar as baz
|
||||
} from 'lib';
|
||||
|
||||
foo(as);
|
||||
|
||||
3 * as(4);
|
||||
|
||||
from('foo');
|
||||
"""
|
||||
eq toJS(input), output
|
||||
|
||||
input = """
|
||||
import * as lib from 'lib'
|
||||
|
||||
foo as
|
||||
3 * as 4
|
||||
from 'foo'
|
||||
"""
|
||||
output = """
|
||||
import * as lib from 'lib';
|
||||
|
||||
foo(as);
|
||||
|
||||
3 * as(4);
|
||||
|
||||
from('foo');
|
||||
"""
|
||||
eq toJS(input), output
|
||||
|
||||
input = """
|
||||
export {
|
||||
foo,
|
||||
bar
|
||||
}
|
||||
|
||||
foo as
|
||||
3 * as 4
|
||||
from 'foo'
|
||||
"""
|
||||
output = """
|
||||
export {
|
||||
foo,
|
||||
bar
|
||||
};
|
||||
|
||||
foo(as);
|
||||
|
||||
3 * as(4);
|
||||
|
||||
from('foo');
|
||||
"""
|
||||
eq toJS(input), output
|
||||
|
||||
input = """
|
||||
export * from 'lib'
|
||||
|
||||
foo as
|
||||
3 * as 4
|
||||
from 'foo'
|
||||
"""
|
||||
output = """
|
||||
export * from 'lib';
|
||||
|
||||
foo(as);
|
||||
|
||||
3 * as(4);
|
||||
|
||||
from('foo');
|
||||
"""
|
||||
eq toJS(input), output
|
||||
|
||||
</script>
|
||||
<script type="text/x-coffeescript" class="test" id="numbers">
|
||||
# Number Literals
|
||||
@@ -9013,6 +9346,18 @@ test "#4324: Shorthand after interpolated key", ->
|
||||
eq 1, obj[1]
|
||||
eq 2, obj.a
|
||||
|
||||
test "#1263: Braceless object return", ->
|
||||
fn = ->
|
||||
return
|
||||
a: 1
|
||||
b: 2
|
||||
c: -> 3
|
||||
|
||||
obj = fn()
|
||||
eq 1, obj.a
|
||||
eq 2, obj.b
|
||||
eq 3, obj.c()
|
||||
|
||||
</script>
|
||||
<script type="text/x-coffeescript" class="test" id="operators">
|
||||
# Operators
|
||||
@@ -9979,6 +10324,37 @@ test "#3795: Escape otherwise invalid characters", ->
|
||||
ok ///#{a}\0
|
||||
1///.test 'a\x001'
|
||||
|
||||
test "#4248: Unicode code point escapes", ->
|
||||
# Support for the `u` flag in regexes was added in Node 6.
|
||||
return if new RegExp().unicode is undefined
|
||||
ok /a\u{1ab}c/u.test 'a\u01abc'
|
||||
ok ///#{ 'a' }\u{000001ab}c///u.test 'a\u{1ab}c'
|
||||
ok ///a\u{000001ab}c///u.test 'a\u{1ab}c'
|
||||
ok /a\u{12345}c/u.test 'a\ud808\udf45c'
|
||||
|
||||
# and now without u flag
|
||||
ok /a\u{1ab}c/.test 'a\u01abc'
|
||||
ok ///#{ 'a' }\u{000001ab}c///.test 'a\u{1ab}c'
|
||||
ok ///a\u{000001ab}c///.test 'a\u{1ab}c'
|
||||
ok /a\u{12345}c/.test 'a\ud808\udf45c'
|
||||
|
||||
# rewrite code point escapes
|
||||
input = """
|
||||
/\\u{bcdef}\\u{abc}/u
|
||||
"""
|
||||
output = """
|
||||
/\\udab3\\uddef\\u0abc/u;
|
||||
"""
|
||||
eq toJS(input), output
|
||||
|
||||
input = """
|
||||
///#{ 'a' }\\u{bcdef}///
|
||||
"""
|
||||
output = """
|
||||
/a\\udab3\\uddef/;
|
||||
"""
|
||||
eq toJS(input), output
|
||||
|
||||
</script>
|
||||
<script type="text/x-coffeescript" class="test" id="repl">
|
||||
return if global.testingBrowser
|
||||
@@ -10050,6 +10426,11 @@ testRepl "variables are saved", (input, output) ->
|
||||
eq "'foobar'", output.lastWrite()
|
||||
|
||||
testRepl "empty command evaluates to undefined", (input, output) ->
|
||||
# A regression fixed in Node 5.11.0 broke the handling of pressing enter in
|
||||
# the Node REPL; see https://github.com/nodejs/node/pull/6090 and
|
||||
# https://github.com/jashkenas/coffeescript/issues/4502.
|
||||
# Just skip this test for versions of Node < 6.
|
||||
return if parseInt(process.versions.node.split('.')[0], 10) < 6
|
||||
input.emitLine ''
|
||||
eq 'undefined', output.lastWrite()
|
||||
|
||||
@@ -10723,10 +11104,10 @@ test "`Future Reserved Word`s, `eval` and `arguments` restrictions", ->
|
||||
check "#{keyword} *= 1"
|
||||
check "#{keyword} /= 1"
|
||||
check "#{keyword} ?= 1"
|
||||
check "{keyword}++"
|
||||
check "++{keyword}"
|
||||
check "{keyword}--"
|
||||
check "--{keyword}"
|
||||
check "#{keyword}++"
|
||||
check "++#{keyword}"
|
||||
check "#{keyword}--"
|
||||
check "--#{keyword}"
|
||||
destruct = (keyword, check = strict) ->
|
||||
check "{#{keyword}}"
|
||||
check "o = {#{keyword}}"
|
||||
@@ -11169,6 +11550,36 @@ test "#4314: Whitespace less than or equal to stripped indentation", ->
|
||||
#{1} #{2} #{3} #{4} #{5} end
|
||||
a #{0} b"""
|
||||
|
||||
test "#4248: Unicode code point escapes", ->
|
||||
eq '\u01ab\u00cd', '\u{1ab}\u{cd}'
|
||||
eq '\u01ab', '\u{000001ab}'
|
||||
eq 'a\u01ab', "#{ 'a' }\u{1ab}"
|
||||
eq '\u01abc', '''\u{01ab}c'''
|
||||
eq '\u01abc', """\u{1ab}#{ 'c' }"""
|
||||
eq '\udab3\uddef', '\u{bcdef}'
|
||||
eq '\udab3\uddef', '\u{0000bcdef}'
|
||||
eq 'a\udab3\uddef', "#{ 'a' }\u{bcdef}"
|
||||
eq '\udab3\uddefc', '''\u{0bcdef}c'''
|
||||
eq '\udab3\uddefc', """\u{bcdef}#{ 'c' }"""
|
||||
eq '\\u{123456}', "#{'\\'}#{'u{123456}'}"
|
||||
|
||||
# rewrite code point escapes
|
||||
input = """
|
||||
'\\u{bcdef}\\u{abc}'
|
||||
"""
|
||||
output = """
|
||||
'\\udab3\\uddef\\u0abc';
|
||||
"""
|
||||
eq toJS(input), output
|
||||
|
||||
input = """
|
||||
"#{ 'a' }\\u{bcdef}"
|
||||
"""
|
||||
output = """
|
||||
"a\\udab3\\uddef";
|
||||
"""
|
||||
eq toJS(input), output
|
||||
|
||||
</script>
|
||||
<script type="text/x-coffeescript" class="test" id="tagged_template_literals">
|
||||
# Tagged template literals
|
||||
|
||||
343
docs/v2/annotated-source/browser.html
Normal file
343
docs/v2/annotated-source/browser.html
Normal file
@@ -0,0 +1,343 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>browser.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>browser.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-1">§</a>
|
||||
</div>
|
||||
<p>This <strong>Browser</strong> compatibility layer extends core CoffeeScript functions
|
||||
to make things work smoothly when compiling code directly in the browser.
|
||||
We add support for loading remote Coffee scripts via <strong>XHR</strong>, and
|
||||
<code>text/coffeescript</code> script tags, source maps via data-URLs, and so on.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>
|
||||
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span>
|
||||
{ compile } = CoffeeScript</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-2">§</a>
|
||||
</div>
|
||||
<p>Use <code>window.eval</code> to evaluate code, rather than just <code>eval</code>, to run the
|
||||
script in a clean global scope rather than inheriting the scope of the
|
||||
CoffeeScript compiler. (So that <code>cake test:browser</code> also works in Node,
|
||||
use either <code>window.eval</code> or <code>global.eval</code> as appropriate).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.<span class="hljs-built_in">eval</span> = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
|
||||
options.bare ?= <span class="hljs-literal">on</span>
|
||||
globalRoot = <span class="hljs-keyword">if</span> window? <span class="hljs-keyword">then</span> window <span class="hljs-keyword">else</span> global
|
||||
globalRoot[<span class="hljs-string">'eval'</span>] compile code, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-3">§</a>
|
||||
</div>
|
||||
<p>Running code does not provide access to this scope.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.run = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
|
||||
options.bare = <span class="hljs-literal">on</span>
|
||||
options.shiftLine = <span class="hljs-literal">on</span>
|
||||
<span class="hljs-built_in">Function</span>(compile code, options)()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-4">§</a>
|
||||
</div>
|
||||
<p>Export this more limited <code>CoffeeScript</code> than what is exported by
|
||||
<code>index.coffee</code>, which is intended for a Node environment.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>module.<span class="hljs-built_in">exports</span> = CoffeeScript</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-5">§</a>
|
||||
</div>
|
||||
<p>If we’re not in a browser environment, we’re finished with the public API.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> window?</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-6">§</a>
|
||||
</div>
|
||||
<p>Include source maps where possible. If we’ve got a base64 encoder, a
|
||||
JSON serializer, and tools for escaping unicode characters, we’re good to go.
|
||||
Ported from <a href="https://developer.mozilla.org/en-US/docs/DOM/window.btoa">https://developer.mozilla.org/en-US/docs/DOM/window.btoa</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> btoa? <span class="hljs-keyword">and</span> <span class="hljs-built_in">JSON</span>?
|
||||
<span class="hljs-function"> <span class="hljs-title">compile</span> = <span class="hljs-params">(code, options = {})</span> -></span>
|
||||
options.inlineMap = <span class="hljs-literal">true</span>
|
||||
CoffeeScript.compile code, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-7">§</a>
|
||||
</div>
|
||||
<p>Load a remote script from the current domain via XHR.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.load = <span class="hljs-function"><span class="hljs-params">(url, callback, options = {}, hold = <span class="hljs-literal">false</span>)</span> -></span>
|
||||
options.sourceFiles = [url]
|
||||
xhr = <span class="hljs-keyword">if</span> window.ActiveXObject
|
||||
<span class="hljs-keyword">new</span> window.ActiveXObject(<span class="hljs-string">'Microsoft.XMLHTTP'</span>)
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-keyword">new</span> window.XMLHttpRequest()
|
||||
xhr.open <span class="hljs-string">'GET'</span>, url, <span class="hljs-literal">true</span>
|
||||
xhr.overrideMimeType <span class="hljs-string">'text/plain'</span> <span class="hljs-keyword">if</span> <span class="hljs-string">'overrideMimeType'</span> <span class="hljs-keyword">of</span> xhr
|
||||
xhr.onreadystatechange = <span class="hljs-function">-></span>
|
||||
<span class="hljs-keyword">if</span> xhr.readyState <span class="hljs-keyword">is</span> <span class="hljs-number">4</span>
|
||||
<span class="hljs-keyword">if</span> xhr.status <span class="hljs-keyword">in</span> [<span class="hljs-number">0</span>, <span class="hljs-number">200</span>]
|
||||
param = [xhr.responseText, options]
|
||||
CoffeeScript.run param... <span class="hljs-keyword">unless</span> hold
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">"Could not load <span class="hljs-subst">#{url}</span>"</span>
|
||||
callback param <span class="hljs-keyword">if</span> callback
|
||||
xhr.send <span class="hljs-literal">null</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-8">§</a>
|
||||
</div>
|
||||
<p>Activate CoffeeScript in the browser by having it compile and evaluate
|
||||
all script tags with a content-type of <code>text/coffeescript</code>.
|
||||
This happens on page load.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.runScripts = <span class="hljs-function">-></span>
|
||||
scripts = window.document.getElementsByTagName <span class="hljs-string">'script'</span>
|
||||
coffeetypes = [<span class="hljs-string">'text/coffeescript'</span>, <span class="hljs-string">'text/literate-coffeescript'</span>]
|
||||
coffees = (s <span class="hljs-keyword">for</span> s <span class="hljs-keyword">in</span> scripts <span class="hljs-keyword">when</span> s.type <span class="hljs-keyword">in</span> coffeetypes)
|
||||
index = <span class="hljs-number">0</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">execute</span> = -></span>
|
||||
param = coffees[index]
|
||||
<span class="hljs-keyword">if</span> param <span class="hljs-keyword">instanceof</span> <span class="hljs-built_in">Array</span>
|
||||
CoffeeScript.run param...
|
||||
index++
|
||||
execute()
|
||||
|
||||
<span class="hljs-keyword">for</span> script, i <span class="hljs-keyword">in</span> coffees
|
||||
<span class="hljs-keyword">do</span> (script, i) ->
|
||||
options = literate: script.type <span class="hljs-keyword">is</span> coffeetypes[<span class="hljs-number">1</span>]
|
||||
source = script.src <span class="hljs-keyword">or</span> script.getAttribute(<span class="hljs-string">'data-src'</span>)
|
||||
<span class="hljs-keyword">if</span> source
|
||||
options.filename = source
|
||||
CoffeeScript.load source,
|
||||
<span class="hljs-function"><span class="hljs-params">(param)</span> -></span>
|
||||
coffees[i] = param
|
||||
execute()
|
||||
options
|
||||
<span class="hljs-literal">true</span>
|
||||
<span class="hljs-keyword">else</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-9">§</a>
|
||||
</div>
|
||||
<p><code>options.filename</code> defines the filename the source map appears as
|
||||
in Developer Tools. If a script tag has an <code>id</code>, use that as the
|
||||
filename; otherwise use <code>coffeescript</code>, or <code>coffeescript1</code> etc.,
|
||||
leaving the first one unnumbered for the common case that there’s
|
||||
only one CoffeeScript script block to parse.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> options.filename = <span class="hljs-keyword">if</span> script.id <span class="hljs-keyword">and</span> script.id <span class="hljs-keyword">isnt</span> <span class="hljs-string">''</span> <span class="hljs-keyword">then</span> script.id <span class="hljs-keyword">else</span> <span class="hljs-string">"coffeescript<span class="hljs-subst">#{<span class="hljs-keyword">if</span> i <span class="hljs-keyword">isnt</span> <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> i <span class="hljs-keyword">else</span> <span class="hljs-string">''</span>}</span>"</span>
|
||||
options.sourceFiles = [<span class="hljs-string">'embedded'</span>]
|
||||
coffees[i] = [script.innerHTML, options]
|
||||
|
||||
execute()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-10">§</a>
|
||||
</div>
|
||||
<p>Listen for window load, both in decent browsers and in IE.
|
||||
Only attach this event handler on startup for the
|
||||
non-ES module version of the browser compiler, to preserve
|
||||
backward compatibility while letting the ES module version
|
||||
be importable without side effects.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> this <span class="hljs-keyword">is</span> window
|
||||
<span class="hljs-keyword">if</span> window.addEventListener
|
||||
window.addEventListener <span class="hljs-string">'DOMContentLoaded'</span>, CoffeeScript.runScripts, <span class="hljs-literal">no</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
window.attachEvent <span class="hljs-string">'onload'</span>, CoffeeScript.runScripts</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
345
docs/v2/annotated-source/cake.html
Normal file
345
docs/v2/annotated-source/cake.html
Normal file
@@ -0,0 +1,345 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>cake.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>cake.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-1">§</a>
|
||||
</div>
|
||||
<p><code>cake</code> is a simplified version of <a href="http://www.gnu.org/software/make/">Make</a>
|
||||
(<a href="http://rake.rubyforge.org/">Rake</a>, <a href="https://github.com/280north/jake">Jake</a>)
|
||||
for CoffeeScript. You define tasks with names and descriptions in a Cakefile,
|
||||
and can call them from the command line, or invoke them from other tasks.</p>
|
||||
<p>Running <code>cake</code> with no arguments will print out a list of all the tasks in the
|
||||
current directory’s Cakefile.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-2">§</a>
|
||||
</div>
|
||||
<p>External dependencies.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>fs = <span class="hljs-built_in">require</span> <span class="hljs-string">'fs'</span>
|
||||
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
|
||||
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
|
||||
optparse = <span class="hljs-built_in">require</span> <span class="hljs-string">'./optparse'</span>
|
||||
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-3">§</a>
|
||||
</div>
|
||||
<p>Register .coffee extension</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.register()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-4">§</a>
|
||||
</div>
|
||||
<p>Keep track of the list of defined tasks, the accepted options, and so on.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>tasks = {}
|
||||
options = {}
|
||||
switches = []
|
||||
oparse = <span class="hljs-literal">null</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-5">§</a>
|
||||
</div>
|
||||
<p>Mixin the top-level Cake functions for Cakefiles to use directly.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>helpers.extend global,</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-6">§</a>
|
||||
</div>
|
||||
<p>Define a Cake task with a short name, an optional sentence description,
|
||||
and the function to run as the action itself.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> task: <span class="hljs-function"><span class="hljs-params">(name, description, action)</span> -></span>
|
||||
[action, description] = [description, action] <span class="hljs-keyword">unless</span> action
|
||||
tasks[name] = {name, description, action}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-7">§</a>
|
||||
</div>
|
||||
<p>Define an option that the Cakefile accepts. The parsed options hash,
|
||||
containing all of the command-line options passed, will be made available
|
||||
as the first argument to the action.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> option: <span class="hljs-function"><span class="hljs-params">(letter, flag, description)</span> -></span>
|
||||
switches.push [letter, flag, description]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-8">§</a>
|
||||
</div>
|
||||
<p>Invoke another task in the current Cakefile.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> invoke: <span class="hljs-function"><span class="hljs-params">(name)</span> -></span>
|
||||
missingTask name <span class="hljs-keyword">unless</span> tasks[name]
|
||||
tasks[name].action options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-9">§</a>
|
||||
</div>
|
||||
<p>Run <code>cake</code>. Executes all of the tasks you pass, in order. Note that Node’s
|
||||
asynchrony may cause tasks to execute in a different order than you’d expect.
|
||||
If no tasks are passed, print the help screen. Keep a reference to the
|
||||
original directory name, when running Cake tasks from subdirectories.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.run = <span class="hljs-function">-></span>
|
||||
global.__originalDirname = fs.realpathSync <span class="hljs-string">'.'</span>
|
||||
process.chdir cakefileDirectory __originalDirname
|
||||
args = process.argv[<span class="hljs-number">2.</span>.]
|
||||
CoffeeScript.run fs.readFileSync(<span class="hljs-string">'Cakefile'</span>).toString(), filename: <span class="hljs-string">'Cakefile'</span>
|
||||
oparse = <span class="hljs-keyword">new</span> optparse.OptionParser switches
|
||||
<span class="hljs-keyword">return</span> printTasks() <span class="hljs-keyword">unless</span> args.length
|
||||
<span class="hljs-keyword">try</span>
|
||||
options = oparse.parse(args)
|
||||
<span class="hljs-keyword">catch</span> e
|
||||
<span class="hljs-keyword">return</span> fatalError <span class="hljs-string">"<span class="hljs-subst">#{e}</span>"</span>
|
||||
invoke arg <span class="hljs-keyword">for</span> arg <span class="hljs-keyword">in</span> options.arguments</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-10">§</a>
|
||||
</div>
|
||||
<p>Display the list of Cake tasks in a format similar to <code>rake -T</code></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">printTasks</span> = -></span>
|
||||
relative = path.relative <span class="hljs-keyword">or</span> path.resolve
|
||||
cakefilePath = path.join relative(__originalDirname, process.cwd()), <span class="hljs-string">'Cakefile'</span>
|
||||
console.log <span class="hljs-string">"<span class="hljs-subst">#{cakefilePath}</span> defines the following tasks:\n"</span>
|
||||
<span class="hljs-keyword">for</span> name, task <span class="hljs-keyword">of</span> tasks
|
||||
spaces = <span class="hljs-number">20</span> - name.length
|
||||
spaces = <span class="hljs-keyword">if</span> spaces > <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> <span class="hljs-built_in">Array</span>(spaces + <span class="hljs-number">1</span>).join(<span class="hljs-string">' '</span>) <span class="hljs-keyword">else</span> <span class="hljs-string">''</span>
|
||||
desc = <span class="hljs-keyword">if</span> task.description <span class="hljs-keyword">then</span> <span class="hljs-string">"# <span class="hljs-subst">#{task.description}</span>"</span> <span class="hljs-keyword">else</span> <span class="hljs-string">''</span>
|
||||
console.log <span class="hljs-string">"cake <span class="hljs-subst">#{name}</span><span class="hljs-subst">#{spaces}</span> <span class="hljs-subst">#{desc}</span>"</span>
|
||||
console.log oparse.help() <span class="hljs-keyword">if</span> switches.length</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-11">§</a>
|
||||
</div>
|
||||
<p>Print an error and exit when attempting to use an invalid task/option.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">fatalError</span> = <span class="hljs-params">(message)</span> -></span>
|
||||
console.error message + <span class="hljs-string">'\n'</span>
|
||||
console.log <span class="hljs-string">'To see a list of all tasks/options, run "cake"'</span>
|
||||
process.exit <span class="hljs-number">1</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">missingTask</span> = <span class="hljs-params">(task)</span> -></span> fatalError <span class="hljs-string">"No such task: <span class="hljs-subst">#{task}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-12">§</a>
|
||||
</div>
|
||||
<p>When <code>cake</code> is invoked, search in the current and all parent directories
|
||||
to find the relevant Cakefile.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">cakefileDirectory</span> = <span class="hljs-params">(dir)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> dir <span class="hljs-keyword">if</span> fs.existsSync path.join dir, <span class="hljs-string">'Cakefile'</span>
|
||||
parent = path.normalize path.join dir, <span class="hljs-string">'..'</span>
|
||||
<span class="hljs-keyword">return</span> cakefileDirectory parent <span class="hljs-keyword">unless</span> parent <span class="hljs-keyword">is</span> dir
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">"Cakefile not found in <span class="hljs-subst">#{process.cwd()}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
973
docs/v2/annotated-source/coffeescript.html
Normal file
973
docs/v2/annotated-source/coffeescript.html
Normal file
@@ -0,0 +1,973 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>coffeescript.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>coffeescript.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-1">§</a>
|
||||
</div>
|
||||
<p>CoffeeScript can be used both on the server, as a command-line compiler based
|
||||
on Node.js/V8, or to run CoffeeScript directly in the browser. This module
|
||||
contains the main entry functions for tokenizing, parsing, and compiling
|
||||
source CoffeeScript into JavaScript.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>
|
||||
{Lexer} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./lexer'</span>
|
||||
{parser} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./parser'</span>
|
||||
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
|
||||
SourceMap = <span class="hljs-built_in">require</span> <span class="hljs-string">'./sourcemap'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-2">§</a>
|
||||
</div>
|
||||
<p>Require <code>package.json</code>, which is two levels above this file, as this file is
|
||||
evaluated from <code>lib/coffeescript</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>packageJson = <span class="hljs-built_in">require</span> <span class="hljs-string">'../../package.json'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-3">§</a>
|
||||
</div>
|
||||
<p>The current CoffeeScript version number.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.VERSION = packageJson.version
|
||||
|
||||
<span class="hljs-built_in">exports</span>.FILE_EXTENSIONS = FILE_EXTENSIONS = [<span class="hljs-string">'.coffee'</span>, <span class="hljs-string">'.litcoffee'</span>, <span class="hljs-string">'.coffee.md'</span>]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-4">§</a>
|
||||
</div>
|
||||
<p>Expose helpers for testing.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.helpers = helpers</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-5">§</a>
|
||||
</div>
|
||||
<p>Function that allows for btoa in both nodejs and the browser.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">base64encode</span> = <span class="hljs-params">(src)</span> -></span> <span class="hljs-keyword">switch</span>
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-keyword">typeof</span> Buffer <span class="hljs-keyword">is</span> <span class="hljs-string">'function'</span>
|
||||
Buffer.<span class="hljs-keyword">from</span>(src).toString(<span class="hljs-string">'base64'</span>)
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-keyword">typeof</span> btoa <span class="hljs-keyword">is</span> <span class="hljs-string">'function'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-6">§</a>
|
||||
</div>
|
||||
<p>The contents of a <code><script></code> block are encoded via UTF-16, so if any extended
|
||||
characters are used in the block, btoa will fail as it maxes out at UTF-8.
|
||||
See <a href="https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem">https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem</a>
|
||||
for the gory details, and for the solution implemented here.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> btoa <span class="hljs-built_in">encodeURIComponent</span>(src).replace <span class="hljs-regexp">/%([0-9A-F]{2})/g</span>, <span class="hljs-function"><span class="hljs-params">(match, p1)</span> -></span>
|
||||
<span class="hljs-built_in">String</span>.fromCharCode <span class="hljs-string">'0x'</span> + p1
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(<span class="hljs-string">'Unable to base64 encode inline sourcemap.'</span>)</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-7">§</a>
|
||||
</div>
|
||||
<p>Function wrapper to add source file information to SyntaxErrors thrown by the
|
||||
lexer/parser/compiler.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">withPrettyErrors</span> = <span class="hljs-params">(fn)</span> -></span>
|
||||
(code, options = {}) ->
|
||||
<span class="hljs-keyword">try</span>
|
||||
fn.call @, code, options
|
||||
<span class="hljs-keyword">catch</span> err
|
||||
<span class="hljs-keyword">throw</span> err <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> code <span class="hljs-keyword">isnt</span> <span class="hljs-string">'string'</span> <span class="hljs-comment"># Support `CoffeeScript.nodes(tokens)`.</span>
|
||||
<span class="hljs-keyword">throw</span> helpers.updateSyntaxError err, code, options.filename</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-8">§</a>
|
||||
</div>
|
||||
<p>For each compiled file, save its source in memory in case we need to
|
||||
recompile it later. We might need to recompile if the first compilation
|
||||
didn’t create a source map (faster) but something went wrong and we need
|
||||
a stack trace. Assuming that most of the time, code isn’t throwing
|
||||
exceptions, it’s probably more efficient to compile twice only when we
|
||||
need a stack trace, rather than always generating a source map even when
|
||||
it’s not likely to be used. Save in form of <code>filename</code>: [<code>(source)</code>]</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>sources = {}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-9">§</a>
|
||||
</div>
|
||||
<p>Also save source maps if generated, in form of <code>(source)</code>: [<code>(source map)</code>].</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>sourceMaps = {}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-10">§</a>
|
||||
</div>
|
||||
<p>This is exported to enable an external module to implement caching of
|
||||
compilation results. When the compiled js source is loaded from cache, the
|
||||
original coffee code should be added with this method in order to enable the
|
||||
Error.prepareStackTrace below to correctly adjust the stack trace for the
|
||||
corresponding file (the source map will be generated on demand).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.registerCompiled = registerCompiled = <span class="hljs-function"><span class="hljs-params">(filename, source, sourcemap)</span> -></span>
|
||||
|
||||
sources[filename] ?= []
|
||||
sources[filename].push source
|
||||
|
||||
<span class="hljs-keyword">if</span> sourcemap?
|
||||
sourceMaps[filename] ?= []
|
||||
sourceMaps[filename].push sourcemap</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-11">§</a>
|
||||
</div>
|
||||
<p>Compile CoffeeScript code to JavaScript, using the Coffee/Jison compiler.</p>
|
||||
<p>If <code>options.sourceMap</code> is specified, then <code>options.filename</code> must also be
|
||||
specified. All options that can be passed to <code>SourceMap#generate</code> may also
|
||||
be passed here.</p>
|
||||
<p>This returns a javascript string, unless <code>options.sourceMap</code> is passed,
|
||||
in which case this returns a <code>{js, v3SourceMap, sourceMap}</code>
|
||||
object, where sourceMap is a sourcemap.coffee#SourceMap object, handy for
|
||||
doing programmatic lookups.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.compile = compile = withPrettyErrors (code, options = {}) -></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-12">§</a>
|
||||
</div>
|
||||
<p>Clone <code>options</code>, to avoid mutating the <code>options</code> object passed in.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> options = <span class="hljs-built_in">Object</span>.assign {}, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-13">§</a>
|
||||
</div>
|
||||
<p>Always generate a source map if no filename is passed in, since without a
|
||||
a filename we have no way to retrieve this source later in the event that
|
||||
we need to recompile it to get a source map for <code>prepareStackTrace</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> generateSourceMap = options.sourceMap <span class="hljs-keyword">or</span> options.inlineMap <span class="hljs-keyword">or</span> <span class="hljs-keyword">not</span> options.filename?
|
||||
filename = options.filename <span class="hljs-keyword">or</span> <span class="hljs-string">'<anonymous>'</span>
|
||||
|
||||
checkShebangLine filename, code
|
||||
|
||||
map = <span class="hljs-keyword">new</span> SourceMap <span class="hljs-keyword">if</span> generateSourceMap
|
||||
|
||||
tokens = lexer.tokenize code, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-14">§</a>
|
||||
</div>
|
||||
<p>Pass a list of referenced variables, so that generated variables won’t get
|
||||
the same name.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> options.referencedVars = (
|
||||
token[<span class="hljs-number">1</span>] <span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens <span class="hljs-keyword">when</span> token[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'IDENTIFIER'</span>
|
||||
)</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-15">§</a>
|
||||
</div>
|
||||
<p>Check for import or export; if found, force bare mode.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">unless</span> options.bare? <span class="hljs-keyword">and</span> options.bare <span class="hljs-keyword">is</span> <span class="hljs-literal">yes</span>
|
||||
<span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens
|
||||
<span class="hljs-keyword">if</span> token[<span class="hljs-number">0</span>] <span class="hljs-keyword">in</span> [<span class="hljs-string">'IMPORT'</span>, <span class="hljs-string">'EXPORT'</span>]
|
||||
options.bare = <span class="hljs-literal">yes</span>
|
||||
<span class="hljs-keyword">break</span>
|
||||
|
||||
nodes = parser.parse tokens</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-16">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-16">§</a>
|
||||
</div>
|
||||
<p>If all that was requested was a POJO representation of the nodes, e.g.
|
||||
the abstract syntax tree (AST), we can stop now and just return that
|
||||
(after fixing the location data for the root/<code>File</code>»<code>Program</code> node,
|
||||
which might’ve gotten misaligned from the original source due to the
|
||||
<code>clean</code> function in the lexer).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> options.ast
|
||||
nodes.allCommentTokens = helpers.extractAllCommentTokens tokens
|
||||
sourceCodeNumberOfLines = (code.match(<span class="hljs-regexp">/\r?\n/g</span>) <span class="hljs-keyword">or</span> <span class="hljs-string">''</span>).length + <span class="hljs-number">1</span>
|
||||
sourceCodeLastLine = <span class="hljs-regexp">/.*$/</span>.exec(code)[<span class="hljs-number">0</span>] <span class="hljs-comment"># `.*` matches all but line break characters.</span>
|
||||
ast = nodes.ast options
|
||||
range = [<span class="hljs-number">0</span>, code.length]
|
||||
ast.start = ast.program.start = range[<span class="hljs-number">0</span>]
|
||||
ast.end = ast.program.end = range[<span class="hljs-number">1</span>]
|
||||
ast.range = ast.program.range = range
|
||||
ast.loc.start = ast.program.loc.start = {line: <span class="hljs-number">1</span>, column: <span class="hljs-number">0</span>}
|
||||
ast.loc.end.line = ast.program.loc.end.line = sourceCodeNumberOfLines
|
||||
ast.loc.end.column = ast.program.loc.end.column = sourceCodeLastLine.length
|
||||
ast.tokens = tokens
|
||||
<span class="hljs-keyword">return</span> ast
|
||||
|
||||
fragments = nodes.compileToFragments options
|
||||
|
||||
currentLine = <span class="hljs-number">0</span>
|
||||
currentLine += <span class="hljs-number">1</span> <span class="hljs-keyword">if</span> options.header
|
||||
currentLine += <span class="hljs-number">1</span> <span class="hljs-keyword">if</span> options.shiftLine
|
||||
currentColumn = <span class="hljs-number">0</span>
|
||||
js = <span class="hljs-string">""</span>
|
||||
<span class="hljs-keyword">for</span> fragment <span class="hljs-keyword">in</span> fragments</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-17">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-17">§</a>
|
||||
</div>
|
||||
<p>Update the sourcemap with data from each fragment.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> generateSourceMap</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-18">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-18">§</a>
|
||||
</div>
|
||||
<p>Do not include empty, whitespace, or semicolon-only fragments.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> fragment.locationData <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> <span class="hljs-regexp">/^[;\s]*$/</span>.test fragment.code
|
||||
map.add(
|
||||
[fragment.locationData.first_line, fragment.locationData.first_column]
|
||||
[currentLine, currentColumn]
|
||||
{noReplace: <span class="hljs-literal">true</span>})
|
||||
newLines = helpers.count fragment.code, <span class="hljs-string">"\n"</span>
|
||||
currentLine += newLines
|
||||
<span class="hljs-keyword">if</span> newLines
|
||||
currentColumn = fragment.code.length - (fragment.code.lastIndexOf(<span class="hljs-string">"\n"</span>) + <span class="hljs-number">1</span>)
|
||||
<span class="hljs-keyword">else</span>
|
||||
currentColumn += fragment.code.length</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-19">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-19">§</a>
|
||||
</div>
|
||||
<p>Copy the code from each fragment into the final JavaScript.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> js += fragment.code
|
||||
|
||||
<span class="hljs-keyword">if</span> options.header
|
||||
header = <span class="hljs-string">"Generated by CoffeeScript <span class="hljs-subst">#{@VERSION}</span>"</span>
|
||||
js = <span class="hljs-string">"// <span class="hljs-subst">#{header}</span>\n<span class="hljs-subst">#{js}</span>"</span>
|
||||
|
||||
<span class="hljs-keyword">if</span> generateSourceMap
|
||||
v3SourceMap = map.generate options, code
|
||||
|
||||
<span class="hljs-keyword">if</span> options.transpile
|
||||
<span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> options.transpile <span class="hljs-keyword">isnt</span> <span class="hljs-string">'object'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-20">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-20">§</a>
|
||||
</div>
|
||||
<p>This only happens if run via the Node API and <code>transpile</code> is set to
|
||||
something other than an object.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">'The transpile option must be given an object with options to pass to Babel'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-21">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-21">§</a>
|
||||
</div>
|
||||
<p>Get the reference to Babel that we have been passed if this compiler
|
||||
is run via the CLI or Node API.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> transpiler = options.transpile.transpile
|
||||
<span class="hljs-keyword">delete</span> options.transpile.transpile
|
||||
|
||||
transpilerOptions = <span class="hljs-built_in">Object</span>.assign {}, options.transpile</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-22">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-22">§</a>
|
||||
</div>
|
||||
<p>See <a href="https://github.com/babel/babel/issues/827#issuecomment-77573107">https://github.com/babel/babel/issues/827#issuecomment-77573107</a>:
|
||||
Babel can take a v3 source map object as input in <code>inputSourceMap</code>
|
||||
and it will return an <em>updated</em> v3 source map object in its output.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> v3SourceMap <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> transpilerOptions.inputSourceMap?
|
||||
transpilerOptions.inputSourceMap = v3SourceMap
|
||||
transpilerOutput = transpiler js, transpilerOptions
|
||||
js = transpilerOutput.code
|
||||
<span class="hljs-keyword">if</span> v3SourceMap <span class="hljs-keyword">and</span> transpilerOutput.map
|
||||
v3SourceMap = transpilerOutput.map
|
||||
|
||||
<span class="hljs-keyword">if</span> options.inlineMap
|
||||
encoded = base64encode <span class="hljs-built_in">JSON</span>.stringify v3SourceMap
|
||||
sourceMapDataURI = <span class="hljs-string">"//# sourceMappingURL=data:application/json;base64,<span class="hljs-subst">#{encoded}</span>"</span>
|
||||
sourceURL = <span class="hljs-string">"//# sourceURL=<span class="hljs-subst">#{options.filename ? <span class="hljs-string">'coffeescript'</span>}</span>"</span>
|
||||
js = <span class="hljs-string">"<span class="hljs-subst">#{js}</span>\n<span class="hljs-subst">#{sourceMapDataURI}</span>\n<span class="hljs-subst">#{sourceURL}</span>"</span>
|
||||
|
||||
registerCompiled filename, code, map
|
||||
|
||||
<span class="hljs-keyword">if</span> options.sourceMap
|
||||
{
|
||||
js
|
||||
sourceMap: map
|
||||
v3SourceMap: <span class="hljs-built_in">JSON</span>.stringify v3SourceMap, <span class="hljs-literal">null</span>, <span class="hljs-number">2</span>
|
||||
}
|
||||
<span class="hljs-keyword">else</span>
|
||||
js</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-23">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-23">§</a>
|
||||
</div>
|
||||
<p>Tokenize a string of CoffeeScript code, and return the array of tokens.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.tokens = withPrettyErrors (code, options) ->
|
||||
lexer.tokenize code, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-24">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-24">§</a>
|
||||
</div>
|
||||
<p>Parse a string of CoffeeScript code or an array of lexed tokens, and
|
||||
return the AST. You can then compile it by calling <code>.compile()</code> on the root,
|
||||
or traverse it by using <code>.traverseChildren()</code> with a callback.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.nodes = withPrettyErrors (source, options) ->
|
||||
source = lexer.tokenize source, options <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> source <span class="hljs-keyword">is</span> <span class="hljs-string">'string'</span>
|
||||
parser.parse source</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-25">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-25">§</a>
|
||||
</div>
|
||||
<p>This file used to export these methods; leave stubs that throw warnings
|
||||
instead. These methods have been moved into <code>index.coffee</code> to provide
|
||||
separate entrypoints for Node and non-Node environments, so that static
|
||||
analysis tools don’t choke on Node packages when compiling for a non-Node
|
||||
environment.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.run = <span class="hljs-built_in">exports</span>.<span class="hljs-built_in">eval</span> = <span class="hljs-built_in">exports</span>.register = <span class="hljs-function">-></span>
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">'require index.coffee, not this file'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-26">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-26">§</a>
|
||||
</div>
|
||||
<p>Instantiate a Lexer for our use here.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>lexer = <span class="hljs-keyword">new</span> Lexer</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-27">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-27">§</a>
|
||||
</div>
|
||||
<p>The real Lexer produces a generic stream of tokens. This object provides a
|
||||
thin wrapper around it, compatible with the Jison API. We can then pass it
|
||||
directly as a “Jison lexer.”</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>parser.lexer =
|
||||
yylloc:
|
||||
range: []
|
||||
options:
|
||||
ranges: <span class="hljs-literal">yes</span>
|
||||
lex: <span class="hljs-function">-></span>
|
||||
token = parser.tokens[@pos++]
|
||||
<span class="hljs-keyword">if</span> token
|
||||
[tag, @yytext, @yylloc] = token
|
||||
parser.errorToken = token.origin <span class="hljs-keyword">or</span> token
|
||||
@yylineno = @yylloc.first_line
|
||||
<span class="hljs-keyword">else</span>
|
||||
tag = <span class="hljs-string">''</span>
|
||||
tag
|
||||
setInput: <span class="hljs-function"><span class="hljs-params">(tokens)</span> -></span>
|
||||
parser.tokens = tokens
|
||||
@pos = <span class="hljs-number">0</span>
|
||||
upcomingInput: <span class="hljs-function">-></span> <span class="hljs-string">''</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-28">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-28">§</a>
|
||||
</div>
|
||||
<p>Make all the AST nodes visible to the parser.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>parser.yy = <span class="hljs-built_in">require</span> <span class="hljs-string">'./nodes'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-29">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-29">§</a>
|
||||
</div>
|
||||
<p>Override Jison’s default error handling function.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>parser.yy.parseError = <span class="hljs-function"><span class="hljs-params">(message, {token})</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-30">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-30">§</a>
|
||||
</div>
|
||||
<p>Disregard Jison’s message, it contains redundant line number information.
|
||||
Disregard the token, we take its value directly from the lexer in case
|
||||
the error is caused by a generated token which might refer to its origin.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> {errorToken, tokens} = parser
|
||||
[errorTag, errorText, errorLoc] = errorToken
|
||||
|
||||
errorText = <span class="hljs-keyword">switch</span>
|
||||
<span class="hljs-keyword">when</span> errorToken <span class="hljs-keyword">is</span> tokens[tokens.length - <span class="hljs-number">1</span>]
|
||||
<span class="hljs-string">'end of input'</span>
|
||||
<span class="hljs-keyword">when</span> errorTag <span class="hljs-keyword">in</span> [<span class="hljs-string">'INDENT'</span>, <span class="hljs-string">'OUTDENT'</span>]
|
||||
<span class="hljs-string">'indentation'</span>
|
||||
<span class="hljs-keyword">when</span> errorTag <span class="hljs-keyword">in</span> [<span class="hljs-string">'IDENTIFIER'</span>, <span class="hljs-string">'NUMBER'</span>, <span class="hljs-string">'INFINITY'</span>, <span class="hljs-string">'STRING'</span>, <span class="hljs-string">'STRING_START'</span>, <span class="hljs-string">'REGEX'</span>, <span class="hljs-string">'REGEX_START'</span>]
|
||||
errorTag.replace(<span class="hljs-regexp">/_START$/</span>, <span class="hljs-string">''</span>).toLowerCase()
|
||||
<span class="hljs-keyword">else</span>
|
||||
helpers.nameWhitespaceCharacter errorText</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-31">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-31">§</a>
|
||||
</div>
|
||||
<p>The second argument has a <code>loc</code> property, which should have the location
|
||||
data for this token. Unfortunately, Jison seems to send an outdated <code>loc</code>
|
||||
(from the previous token), so we take the location information directly
|
||||
from the lexer.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> helpers.throwSyntaxError <span class="hljs-string">"unexpected <span class="hljs-subst">#{errorText}</span>"</span>, errorLoc</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-32">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-32">§</a>
|
||||
</div>
|
||||
<p>Based on <a href="http://v8.googlecode.com/svn/branches/bleeding_edge/src/messages.js">http://v8.googlecode.com/svn/branches/bleeding_edge/src/messages.js</a>
|
||||
Modified to handle sourceMap</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">formatSourcePosition</span> = <span class="hljs-params">(frame, getSourceMapping)</span> -></span>
|
||||
filename = <span class="hljs-literal">undefined</span>
|
||||
fileLocation = <span class="hljs-string">''</span>
|
||||
|
||||
<span class="hljs-keyword">if</span> frame.isNative()
|
||||
fileLocation = <span class="hljs-string">"native"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-keyword">if</span> frame.isEval()
|
||||
filename = frame.getScriptNameOrSourceURL()
|
||||
fileLocation = <span class="hljs-string">"<span class="hljs-subst">#{frame.getEvalOrigin()}</span>, "</span> <span class="hljs-keyword">unless</span> filename
|
||||
<span class="hljs-keyword">else</span>
|
||||
filename = frame.getFileName()
|
||||
|
||||
filename <span class="hljs-keyword">or</span>= <span class="hljs-string">"<anonymous>"</span>
|
||||
|
||||
line = frame.getLineNumber()
|
||||
column = frame.getColumnNumber()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-33">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-33">§</a>
|
||||
</div>
|
||||
<p>Check for a sourceMap position</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> source = getSourceMapping filename, line, column
|
||||
fileLocation =
|
||||
<span class="hljs-keyword">if</span> source
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{filename}</span>:<span class="hljs-subst">#{source[<span class="hljs-number">0</span>]}</span>:<span class="hljs-subst">#{source[<span class="hljs-number">1</span>]}</span>"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{filename}</span>:<span class="hljs-subst">#{line}</span>:<span class="hljs-subst">#{column}</span>"</span>
|
||||
|
||||
functionName = frame.getFunctionName()
|
||||
isConstructor = frame.isConstructor()
|
||||
isMethodCall = <span class="hljs-keyword">not</span> (frame.isToplevel() <span class="hljs-keyword">or</span> isConstructor)
|
||||
|
||||
<span class="hljs-keyword">if</span> isMethodCall
|
||||
methodName = frame.getMethodName()
|
||||
typeName = frame.getTypeName()
|
||||
|
||||
<span class="hljs-keyword">if</span> functionName
|
||||
tp = <span class="hljs-keyword">as</span> = <span class="hljs-string">''</span>
|
||||
<span class="hljs-keyword">if</span> typeName <span class="hljs-keyword">and</span> functionName.indexOf typeName
|
||||
tp = <span class="hljs-string">"<span class="hljs-subst">#{typeName}</span>."</span>
|
||||
<span class="hljs-keyword">if</span> methodName <span class="hljs-keyword">and</span> functionName.indexOf(<span class="hljs-string">".<span class="hljs-subst">#{methodName}</span>"</span>) <span class="hljs-keyword">isnt</span> functionName.length - methodName.length - <span class="hljs-number">1</span>
|
||||
<span class="hljs-keyword">as</span> = <span class="hljs-string">" [as <span class="hljs-subst">#{methodName}</span>]"</span>
|
||||
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{tp}</span><span class="hljs-subst">#{functionName}</span><span class="hljs-subst">#{<span class="hljs-keyword">as</span>}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{typeName}</span>.<span class="hljs-subst">#{methodName <span class="hljs-keyword">or</span> <span class="hljs-string">'<anonymous>'</span>}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> isConstructor
|
||||
<span class="hljs-string">"new <span class="hljs-subst">#{functionName <span class="hljs-keyword">or</span> <span class="hljs-string">'<anonymous>'</span>}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> functionName
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{functionName}</span> (<span class="hljs-subst">#{fileLocation}</span>)"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
fileLocation
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">getSourceMap</span> = <span class="hljs-params">(filename, line, column)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-34">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-34">§</a>
|
||||
</div>
|
||||
<p>Skip files that we didn’t compile, like Node system files that appear in
|
||||
the stack trace, as they never have source maps.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span> <span class="hljs-keyword">unless</span> filename <span class="hljs-keyword">is</span> <span class="hljs-string">'<anonymous>'</span> <span class="hljs-keyword">or</span> filename.slice(filename.lastIndexOf(<span class="hljs-string">'.'</span>)) <span class="hljs-keyword">in</span> FILE_EXTENSIONS
|
||||
|
||||
<span class="hljs-keyword">if</span> filename <span class="hljs-keyword">isnt</span> <span class="hljs-string">'<anonymous>'</span> <span class="hljs-keyword">and</span> sourceMaps[filename]?
|
||||
<span class="hljs-keyword">return</span> sourceMaps[filename][sourceMaps[filename].length - <span class="hljs-number">1</span>]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-35">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-35">§</a>
|
||||
</div>
|
||||
<p>CoffeeScript compiled in a browser or via <code>CoffeeScript.compile</code> or <code>.run</code>
|
||||
may get compiled with <code>options.filename</code> that’s missing, which becomes
|
||||
<code><anonymous></code>; but the runtime might request the stack trace with the
|
||||
filename of the script file. See if we have a source map cached under
|
||||
<code><anonymous></code> that matches the error.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> sourceMaps[<span class="hljs-string">'<anonymous>'</span>]?</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-36">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-36">§</a>
|
||||
</div>
|
||||
<p>Work backwards from the most recent anonymous source maps, until we find
|
||||
one that works. This isn’t foolproof; there is a chance that multiple
|
||||
source maps will have line/column pairs that match. But we have no other
|
||||
way to match them. <code>frame.getFunction().toString()</code> doesn’t always work,
|
||||
and it’s not foolproof either.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">for</span> map <span class="hljs-keyword">in</span> sourceMaps[<span class="hljs-string">'<anonymous>'</span>] <span class="hljs-keyword">by</span> <span class="hljs-number">-1</span>
|
||||
sourceLocation = map.sourceLocation [line - <span class="hljs-number">1</span>, column - <span class="hljs-number">1</span>]
|
||||
<span class="hljs-keyword">return</span> map <span class="hljs-keyword">if</span> sourceLocation?[<span class="hljs-number">0</span>]? <span class="hljs-keyword">and</span> sourceLocation[<span class="hljs-number">1</span>]?</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-37">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-37">§</a>
|
||||
</div>
|
||||
<p>If all else fails, recompile this source to get a source map. We need the
|
||||
previous section (for <code><anonymous></code>) despite this option, because after it
|
||||
gets compiled we will still need to look it up from
|
||||
<code>sourceMaps['<anonymous>']</code> in order to find and return it. That’s why we
|
||||
start searching from the end in the previous block, because most of the
|
||||
time the source map we want is the last one.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> sources[filename]?
|
||||
answer = compile sources[filename][sources[filename].length - <span class="hljs-number">1</span>],
|
||||
filename: filename
|
||||
sourceMap: <span class="hljs-literal">yes</span>
|
||||
literate: helpers.isLiterate filename
|
||||
answer.sourceMap
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-literal">null</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-38">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-38">§</a>
|
||||
</div>
|
||||
<p>Based on <a href="http://goo.gl/ZTx1p">michaelficarra/CoffeeScriptRedux</a>
|
||||
NodeJS / V8 have no support for transforming positions in stack traces using
|
||||
sourceMap, so we must monkey-patch Error to display CoffeeScript source
|
||||
positions.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">Error</span>.prepareStackTrace = <span class="hljs-function"><span class="hljs-params">(err, stack)</span> -></span>
|
||||
<span class="hljs-function"> <span class="hljs-title">getSourceMapping</span> = <span class="hljs-params">(filename, line, column)</span> -></span>
|
||||
sourceMap = getSourceMap filename, line, column
|
||||
answer = sourceMap.sourceLocation [line - <span class="hljs-number">1</span>, column - <span class="hljs-number">1</span>] <span class="hljs-keyword">if</span> sourceMap?
|
||||
<span class="hljs-keyword">if</span> answer? <span class="hljs-keyword">then</span> [answer[<span class="hljs-number">0</span>] + <span class="hljs-number">1</span>, answer[<span class="hljs-number">1</span>] + <span class="hljs-number">1</span>] <span class="hljs-keyword">else</span> <span class="hljs-literal">null</span>
|
||||
|
||||
frames = <span class="hljs-keyword">for</span> frame <span class="hljs-keyword">in</span> stack
|
||||
<span class="hljs-keyword">break</span> <span class="hljs-keyword">if</span> frame.getFunction() <span class="hljs-keyword">is</span> <span class="hljs-built_in">exports</span>.run
|
||||
<span class="hljs-string">" at <span class="hljs-subst">#{formatSourcePosition frame, getSourceMapping}</span>"</span>
|
||||
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{err.toString()}</span>\n<span class="hljs-subst">#{frames.join <span class="hljs-string">'\n'</span>}</span>\n"</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">checkShebangLine</span> = <span class="hljs-params">(file, input)</span> -></span>
|
||||
firstLine = input.split(<span class="hljs-regexp">/$/m</span>)[<span class="hljs-number">0</span>]
|
||||
rest = firstLine?.match(<span class="hljs-regexp">/^#!\s*([^\s]+\s*)(.*)/</span>)
|
||||
args = rest?[<span class="hljs-number">2</span>]?.split(<span class="hljs-regexp">/\s/</span>).filter (s) -> s <span class="hljs-keyword">isnt</span> <span class="hljs-string">''</span>
|
||||
<span class="hljs-keyword">if</span> args?.length > <span class="hljs-number">1</span>
|
||||
console.error <span class="hljs-string">'''
|
||||
The script to be run begins with a shebang line with more than one
|
||||
argument. This script will fail on platforms such as Linux which only
|
||||
allow a single argument.
|
||||
'''</span>
|
||||
console.error <span class="hljs-string">"The shebang line was: '<span class="hljs-subst">#{firstLine}</span>' in file '<span class="hljs-subst">#{file}</span>'"</span>
|
||||
console.error <span class="hljs-string">"The arguments were: <span class="hljs-subst">#{<span class="hljs-built_in">JSON</span>.stringify args}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
1052
docs/v2/annotated-source/command.html
Normal file
1052
docs/v2/annotated-source/command.html
Normal file
File diff suppressed because it is too large
Load Diff
518
docs/v2/annotated-source/docco.css
Normal file
518
docs/v2/annotated-source/docco.css
Normal file
@@ -0,0 +1,518 @@
|
||||
/*--------------------- Typography ----------------------------*/
|
||||
|
||||
@font-face {
|
||||
font-family: 'aller-light';
|
||||
src: url('public/fonts/aller-light.eot');
|
||||
src: url('public/fonts/aller-light.eot?#iefix') format('embedded-opentype'),
|
||||
url('public/fonts/aller-light.woff') format('woff'),
|
||||
url('public/fonts/aller-light.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'aller-bold';
|
||||
src: url('public/fonts/aller-bold.eot');
|
||||
src: url('public/fonts/aller-bold.eot?#iefix') format('embedded-opentype'),
|
||||
url('public/fonts/aller-bold.woff') format('woff'),
|
||||
url('public/fonts/aller-bold.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'roboto-black';
|
||||
src: url('public/fonts/roboto-black.eot');
|
||||
src: url('public/fonts/roboto-black.eot?#iefix') format('embedded-opentype'),
|
||||
url('public/fonts/roboto-black.woff') format('woff'),
|
||||
url('public/fonts/roboto-black.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/*--------------------- Layout ----------------------------*/
|
||||
html { height: 100%; }
|
||||
body {
|
||||
font-family: "aller-light";
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
color: #30404f;
|
||||
margin: 0; padding: 0;
|
||||
height:100%;
|
||||
}
|
||||
#container { min-height: 100%; }
|
||||
|
||||
a {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
b, strong {
|
||||
font-weight: normal;
|
||||
font-family: "aller-bold";
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 15px 0 0px;
|
||||
}
|
||||
.annotation ul, .annotation ol {
|
||||
margin: 25px 0;
|
||||
}
|
||||
.annotation ul li, .annotation ol li {
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
color: #112233;
|
||||
line-height: 1em;
|
||||
font-weight: normal;
|
||||
font-family: "roboto-black";
|
||||
text-transform: uppercase;
|
||||
margin: 30px 0 15px 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-top: 40px;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.26em;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: 0;
|
||||
background: 1px #ddd;
|
||||
height: 1px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
pre, tt, code {
|
||||
font-size: 12px; line-height: 16px;
|
||||
font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
|
||||
margin: 0; padding: 0;
|
||||
}
|
||||
.annotation pre {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 7px 10px;
|
||||
background: #fcfcfc;
|
||||
-moz-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
|
||||
-webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
|
||||
box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
|
||||
overflow-x: auto;
|
||||
}
|
||||
.annotation pre code {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
|
||||
blockquote {
|
||||
border-left: 5px solid #ccc;
|
||||
margin: 0;
|
||||
padding: 1px 0 1px 1em;
|
||||
}
|
||||
.sections blockquote p {
|
||||
font-family: Menlo, Consolas, Monaco, monospace;
|
||||
font-size: 12px; line-height: 16px;
|
||||
color: #999;
|
||||
margin: 10px 0 0;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
ul.sections {
|
||||
list-style: none;
|
||||
padding:0 0 5px 0;;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
/*
|
||||
Force border-box so that % widths fit the parent
|
||||
container without overlap because of margin/padding.
|
||||
|
||||
More Info : http://www.quirksmode.org/css/box.html
|
||||
*/
|
||||
ul.sections > li > div {
|
||||
-moz-box-sizing: border-box; /* firefox */
|
||||
-ms-box-sizing: border-box; /* ie */
|
||||
-webkit-box-sizing: border-box; /* webkit */
|
||||
-khtml-box-sizing: border-box; /* konqueror */
|
||||
box-sizing: border-box; /* css3 */
|
||||
}
|
||||
|
||||
|
||||
/*---------------------- Jump Page -----------------------------*/
|
||||
#jump_to, #jump_page {
|
||||
margin: 0;
|
||||
background: white;
|
||||
-webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
|
||||
-webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
|
||||
font: 16px Arial;
|
||||
cursor: pointer;
|
||||
text-align: right;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#jump_to a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#jump_to a.large {
|
||||
display: none;
|
||||
}
|
||||
#jump_to a.small {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
color: #676767;
|
||||
}
|
||||
|
||||
#jump_to, #jump_wrapper {
|
||||
position: fixed;
|
||||
right: 0; top: 0;
|
||||
padding: 10px 15px;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
#jump_wrapper {
|
||||
display: none;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
#jump_to:hover #jump_wrapper {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#jump_page_wrapper{
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#jump_page {
|
||||
padding: 5px 0 3px;
|
||||
margin: 0 0 25px 25px;
|
||||
max-height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#jump_page .source {
|
||||
display: block;
|
||||
padding: 15px;
|
||||
text-decoration: none;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
#jump_page .source:hover {
|
||||
background: #f5f5ff;
|
||||
}
|
||||
|
||||
#jump_page .source:first-child {
|
||||
}
|
||||
|
||||
/*---------------------- Low resolutions (> 320px) ---------------------*/
|
||||
@media only screen and (min-width: 320px) {
|
||||
.sswrap { display: none; }
|
||||
|
||||
ul.sections > li > div {
|
||||
display: block;
|
||||
padding:5px 10px 0 10px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.content {
|
||||
overflow-x:auto;
|
||||
-webkit-box-shadow: inset 0 0 5px #e5e5ee;
|
||||
box-shadow: inset 0 0 5px #e5e5ee;
|
||||
border: 1px solid #dedede;
|
||||
margin:5px 10px 5px 10px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation pre {
|
||||
margin: 7px 0 7px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation p tt, .annotation code {
|
||||
background: #f8f8ff;
|
||||
border: 1px solid #dedede;
|
||||
font-size: 12px;
|
||||
padding: 0 0.2em;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------- (> 481px) ---------------------*/
|
||||
@media only screen and (min-width: 481px) {
|
||||
#container {
|
||||
position: relative;
|
||||
}
|
||||
body {
|
||||
background-color: #F5F5FF;
|
||||
font-size: 15px;
|
||||
line-height: 21px;
|
||||
}
|
||||
pre, tt, code {
|
||||
line-height: 18px;
|
||||
}
|
||||
p, ul, ol {
|
||||
margin: 0 0 15px;
|
||||
}
|
||||
|
||||
|
||||
#jump_to {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
#jump_wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
#jump_to, #jump_page {
|
||||
font: 10px Arial;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
#jump_page .source {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
#jump_to a.large {
|
||||
display: inline-block;
|
||||
}
|
||||
#jump_to a.small {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#background {
|
||||
position: absolute;
|
||||
top: 0; bottom: 0;
|
||||
width: 350px;
|
||||
background: #fff;
|
||||
border-right: 1px solid #e5e5ee;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
|
||||
padding-left: 40px;
|
||||
}
|
||||
|
||||
ul.sections > li {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
ul.sections > li > div {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation {
|
||||
max-width: 350px;
|
||||
min-width: 350px;
|
||||
min-height: 5px;
|
||||
padding: 13px;
|
||||
overflow-x: hidden;
|
||||
white-space: normal;
|
||||
vertical-align: top;
|
||||
text-align: left;
|
||||
}
|
||||
ul.sections > li > div.annotation pre {
|
||||
margin: 15px 0 15px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.content {
|
||||
padding: 13px;
|
||||
vertical-align: top;
|
||||
border: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.sswrap {
|
||||
position: relative;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.ss {
|
||||
font: 12px Arial;
|
||||
text-decoration: none;
|
||||
color: #454545;
|
||||
position: absolute;
|
||||
top: 3px; left: -20px;
|
||||
padding: 1px 2px;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.2s linear;
|
||||
}
|
||||
.for-h1 .ss {
|
||||
top: 47px;
|
||||
}
|
||||
.for-h2 .ss, .for-h3 .ss, .for-h4 .ss {
|
||||
top: 35px;
|
||||
}
|
||||
|
||||
ul.sections > li > div.annotation:hover .ss {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------- (> 1025px) ---------------------*/
|
||||
@media only screen and (min-width: 1025px) {
|
||||
|
||||
body {
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
#background {
|
||||
width: 525px;
|
||||
}
|
||||
ul.sections > li > div.annotation {
|
||||
max-width: 525px;
|
||||
min-width: 525px;
|
||||
padding: 10px 25px 1px 50px;
|
||||
}
|
||||
ul.sections > li > div.content {
|
||||
padding: 9px 15px 16px 25px;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------- Syntax Highlighting -----------------------------*/
|
||||
|
||||
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
|
||||
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
|
||||
/*
|
||||
|
||||
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||
|
||||
*/
|
||||
|
||||
pre code {
|
||||
display: block; padding: 0.5em;
|
||||
color: #000;
|
||||
background: #f8f8ff
|
||||
}
|
||||
|
||||
pre .hljs-comment,
|
||||
pre .hljs-template_comment,
|
||||
pre .hljs-diff .hljs-header,
|
||||
pre .hljs-javadoc {
|
||||
color: #408080;
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
pre .hljs-keyword,
|
||||
pre .hljs-assignment,
|
||||
pre .hljs-literal,
|
||||
pre .hljs-css .hljs-rule .hljs-keyword,
|
||||
pre .hljs-winutils,
|
||||
pre .hljs-javascript .hljs-title,
|
||||
pre .hljs-lisp .hljs-title,
|
||||
pre .hljs-subst {
|
||||
color: #954121;
|
||||
/*font-weight: bold*/
|
||||
}
|
||||
|
||||
pre .hljs-number,
|
||||
pre .hljs-hexcolor {
|
||||
color: #40a070
|
||||
}
|
||||
|
||||
pre .hljs-string,
|
||||
pre .hljs-tag .hljs-value,
|
||||
pre .hljs-phpdoc,
|
||||
pre .hljs-tex .hljs-formula {
|
||||
color: #219161;
|
||||
}
|
||||
|
||||
pre .hljs-title,
|
||||
pre .hljs-id {
|
||||
color: #19469D;
|
||||
}
|
||||
pre .hljs-params {
|
||||
color: #00F;
|
||||
}
|
||||
|
||||
pre .hljs-javascript .hljs-title,
|
||||
pre .hljs-lisp .hljs-title,
|
||||
pre .hljs-subst {
|
||||
font-weight: normal
|
||||
}
|
||||
|
||||
pre .hljs-class .hljs-title,
|
||||
pre .hljs-haskell .hljs-label,
|
||||
pre .hljs-tex .hljs-command {
|
||||
color: #458;
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
pre .hljs-tag,
|
||||
pre .hljs-tag .hljs-title,
|
||||
pre .hljs-rules .hljs-property,
|
||||
pre .hljs-django .hljs-tag .hljs-keyword {
|
||||
color: #000080;
|
||||
font-weight: normal
|
||||
}
|
||||
|
||||
pre .hljs-attribute,
|
||||
pre .hljs-variable,
|
||||
pre .hljs-instancevar,
|
||||
pre .hljs-lisp .hljs-body {
|
||||
color: #008080
|
||||
}
|
||||
|
||||
pre .hljs-regexp {
|
||||
color: #B68
|
||||
}
|
||||
|
||||
pre .hljs-class {
|
||||
color: #458;
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
pre .hljs-symbol,
|
||||
pre .hljs-ruby .hljs-symbol .hljs-string,
|
||||
pre .hljs-ruby .hljs-symbol .hljs-keyword,
|
||||
pre .hljs-ruby .hljs-symbol .hljs-keymethods,
|
||||
pre .hljs-lisp .hljs-keyword,
|
||||
pre .hljs-tex .hljs-special,
|
||||
pre .hljs-input_number {
|
||||
color: #990073
|
||||
}
|
||||
|
||||
pre .hljs-builtin,
|
||||
pre .hljs-constructor,
|
||||
pre .hljs-built_in,
|
||||
pre .hljs-lisp .hljs-title {
|
||||
color: #0086b3
|
||||
}
|
||||
|
||||
pre .hljs-preprocessor,
|
||||
pre .hljs-pi,
|
||||
pre .hljs-doctype,
|
||||
pre .hljs-shebang,
|
||||
pre .hljs-cdata {
|
||||
color: #999;
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
pre .hljs-deletion {
|
||||
background: #fdd
|
||||
}
|
||||
|
||||
pre .hljs-addition {
|
||||
background: #dfd
|
||||
}
|
||||
|
||||
pre .hljs-diff .hljs-change {
|
||||
background: #0086b3
|
||||
}
|
||||
|
||||
pre .hljs-chunk {
|
||||
color: #aaa
|
||||
}
|
||||
|
||||
pre .hljs-tex .hljs-formula {
|
||||
opacity: 0.5;
|
||||
}
|
||||
2078
docs/v2/annotated-source/grammar.html
Normal file
2078
docs/v2/annotated-source/grammar.html
Normal file
File diff suppressed because it is too large
Load Diff
849
docs/v2/annotated-source/helpers.html
Normal file
849
docs/v2/annotated-source/helpers.html
Normal file
@@ -0,0 +1,849 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>helpers.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>helpers.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-1">§</a>
|
||||
</div>
|
||||
<p>This file contains the common helper functions that we’d like to share among
|
||||
the <strong>Lexer</strong>, <strong>Rewriter</strong>, and the <strong>Nodes</strong>. Merge objects, flatten
|
||||
arrays, count characters, that sort of thing.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-2">§</a>
|
||||
</div>
|
||||
<p>Peek at the beginning of a given string to see if it matches a sequence.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.starts = <span class="hljs-function"><span class="hljs-params">(string, literal, start)</span> -></span>
|
||||
literal <span class="hljs-keyword">is</span> string.substr start, literal.length</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-3">§</a>
|
||||
</div>
|
||||
<p>Peek at the end of a given string to see if it matches a sequence.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.ends = <span class="hljs-function"><span class="hljs-params">(string, literal, back)</span> -></span>
|
||||
len = literal.length
|
||||
literal <span class="hljs-keyword">is</span> string.substr string.length - len - (back <span class="hljs-keyword">or</span> <span class="hljs-number">0</span>), len</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-4">§</a>
|
||||
</div>
|
||||
<p>Repeat a string <code>n</code> times.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.repeat = repeat = <span class="hljs-function"><span class="hljs-params">(str, n)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-5">§</a>
|
||||
</div>
|
||||
<p>Use clever algorithm to have O(log(n)) string concatenation operations.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> res = <span class="hljs-string">''</span>
|
||||
<span class="hljs-keyword">while</span> n > <span class="hljs-number">0</span>
|
||||
res += str <span class="hljs-keyword">if</span> n & <span class="hljs-number">1</span>
|
||||
n >>>= <span class="hljs-number">1</span>
|
||||
str += str
|
||||
res</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-6">§</a>
|
||||
</div>
|
||||
<p>Trim out all falsy values from an array.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.compact = <span class="hljs-function"><span class="hljs-params">(array)</span> -></span>
|
||||
item <span class="hljs-keyword">for</span> item <span class="hljs-keyword">in</span> array <span class="hljs-keyword">when</span> item</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-7">§</a>
|
||||
</div>
|
||||
<p>Count the number of occurrences of a string in a string.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.count = <span class="hljs-function"><span class="hljs-params">(string, substr)</span> -></span>
|
||||
num = pos = <span class="hljs-number">0</span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-number">1</span>/<span class="hljs-number">0</span> <span class="hljs-keyword">unless</span> substr.length
|
||||
num++ <span class="hljs-keyword">while</span> pos = <span class="hljs-number">1</span> + string.indexOf substr, pos
|
||||
num</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-8">§</a>
|
||||
</div>
|
||||
<p>Merge objects, returning a fresh copy with attributes from both sides.
|
||||
Used every time <code>Base#compile</code> is called, to allow properties in the
|
||||
options hash to propagate down the tree without polluting other branches.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.merge = <span class="hljs-function"><span class="hljs-params">(options, overrides)</span> -></span>
|
||||
extend (extend {}, options), overrides</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-9">§</a>
|
||||
</div>
|
||||
<p>Extend a source object with the properties of another object (shallow copy).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>extend = <span class="hljs-built_in">exports</span>.extend = <span class="hljs-function"><span class="hljs-params">(object, properties)</span> -></span>
|
||||
<span class="hljs-keyword">for</span> key, val <span class="hljs-keyword">of</span> properties
|
||||
object[key] = val
|
||||
object</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-10">§</a>
|
||||
</div>
|
||||
<p>Return a flattened version of an array.
|
||||
Handy for getting a list of <code>children</code> from the nodes.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.flatten = flatten = <span class="hljs-function"><span class="hljs-params">(array)</span> -></span>
|
||||
flattened = []
|
||||
<span class="hljs-keyword">for</span> element <span class="hljs-keyword">in</span> array
|
||||
<span class="hljs-keyword">if</span> <span class="hljs-string">'[object Array]'</span> <span class="hljs-keyword">is</span> Object::toString.call element
|
||||
flattened = flattened.concat flatten element
|
||||
<span class="hljs-keyword">else</span>
|
||||
flattened.push element
|
||||
flattened</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-11">§</a>
|
||||
</div>
|
||||
<p>Delete a key from an object, returning the value. Useful when a node is
|
||||
looking for a particular method in an options hash.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.del = <span class="hljs-function"><span class="hljs-params">(obj, key)</span> -></span>
|
||||
val = obj[key]
|
||||
<span class="hljs-keyword">delete</span> obj[key]
|
||||
val</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-12">§</a>
|
||||
</div>
|
||||
<p>Typical Array::some</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.some = Array::some ? (fn) ->
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-literal">true</span> <span class="hljs-keyword">for</span> e <span class="hljs-keyword">in</span> this <span class="hljs-keyword">when</span> fn e
|
||||
<span class="hljs-literal">false</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-13">§</a>
|
||||
</div>
|
||||
<p>Helper function for extracting code from Literate CoffeeScript by stripping
|
||||
out all non-code blocks, producing a string of CoffeeScript code that can
|
||||
be compiled “normally.”</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.invertLiterate = <span class="hljs-function"><span class="hljs-params">(code)</span> -></span>
|
||||
out = []
|
||||
blankLine = <span class="hljs-regexp">/^\s*$/</span>
|
||||
indented = <span class="hljs-regexp">/^[\t ]/</span>
|
||||
listItemStart = <span class="hljs-regexp">/// ^
|
||||
(?:\t?|\ {0,3}) <span class="hljs-comment"># Up to one tab, or up to three spaces, or neither;</span>
|
||||
(?:
|
||||
[\*\-\+] | <span class="hljs-comment"># followed by `*`, `-` or `+`;</span>
|
||||
[0-9]{1,9}\. <span class="hljs-comment"># or by an integer up to 9 digits long, followed by a period;</span>
|
||||
)
|
||||
[\ \t] <span class="hljs-comment"># followed by a space or a tab.</span>
|
||||
///</span>
|
||||
insideComment = <span class="hljs-literal">no</span>
|
||||
<span class="hljs-keyword">for</span> line <span class="hljs-keyword">in</span> code.split(<span class="hljs-string">'\n'</span>)
|
||||
<span class="hljs-keyword">if</span> blankLine.test(line)
|
||||
insideComment = <span class="hljs-literal">no</span>
|
||||
out.push line
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> insideComment <span class="hljs-keyword">or</span> listItemStart.test(line)
|
||||
insideComment = <span class="hljs-literal">yes</span>
|
||||
out.push <span class="hljs-string">"# <span class="hljs-subst">#{line}</span>"</span>
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> insideComment <span class="hljs-keyword">and</span> indented.test(line)
|
||||
out.push line
|
||||
<span class="hljs-keyword">else</span>
|
||||
insideComment = <span class="hljs-literal">yes</span>
|
||||
out.push <span class="hljs-string">"# <span class="hljs-subst">#{line}</span>"</span>
|
||||
out.join <span class="hljs-string">'\n'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-14">§</a>
|
||||
</div>
|
||||
<p>Merge two jison-style location data objects together.
|
||||
If <code>last</code> is not provided, this will simply return <code>first</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">buildLocationData</span> = <span class="hljs-params">(first, last)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> last
|
||||
first
|
||||
<span class="hljs-keyword">else</span>
|
||||
first_line: first.first_line
|
||||
first_column: first.first_column
|
||||
last_line: last.last_line
|
||||
last_column: last.last_column
|
||||
last_line_exclusive: last.last_line_exclusive
|
||||
last_column_exclusive: last.last_column_exclusive
|
||||
range: [
|
||||
first.range[<span class="hljs-number">0</span>]
|
||||
last.range[<span class="hljs-number">1</span>]
|
||||
]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-15">§</a>
|
||||
</div>
|
||||
<p>Build a list of all comments attached to tokens.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.extractAllCommentTokens = <span class="hljs-function"><span class="hljs-params">(tokens)</span> -></span>
|
||||
allCommentsObj = {}
|
||||
<span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens <span class="hljs-keyword">when</span> token.comments
|
||||
<span class="hljs-keyword">for</span> comment <span class="hljs-keyword">in</span> token.comments
|
||||
commentKey = comment.locationData.range[<span class="hljs-number">0</span>]
|
||||
allCommentsObj[commentKey] = comment
|
||||
sortedKeys = <span class="hljs-built_in">Object</span>.keys(allCommentsObj).sort (a, b) -> a - b
|
||||
<span class="hljs-keyword">for</span> key <span class="hljs-keyword">in</span> sortedKeys
|
||||
allCommentsObj[key]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-16">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-16">§</a>
|
||||
</div>
|
||||
<p>Get a lookup hash for a token based on its location data.
|
||||
Multiple tokens might have the same location hash, but using exclusive
|
||||
location data distinguishes e.g. zero-length generated tokens from
|
||||
actual source tokens.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">buildLocationHash</span> = <span class="hljs-params">(loc)</span> -></span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{loc.range[<span class="hljs-number">0</span>]}</span>-<span class="hljs-subst">#{loc.range[<span class="hljs-number">1</span>]}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-17">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-17">§</a>
|
||||
</div>
|
||||
<p>Build a dictionary of extra token properties organized by tokens’ locations
|
||||
used as lookup hashes.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.buildTokenDataDictionary = buildTokenDataDictionary = <span class="hljs-function"><span class="hljs-params">(tokens)</span> -></span>
|
||||
tokenData = {}
|
||||
<span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens <span class="hljs-keyword">when</span> token.comments
|
||||
tokenHash = buildLocationHash token[<span class="hljs-number">2</span>]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-18">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-18">§</a>
|
||||
</div>
|
||||
<p>Multiple tokens might have the same location hash, such as the generated
|
||||
<code>JS</code> tokens added at the start or end of the token stream to hold
|
||||
comments that start or end a file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> tokenData[tokenHash] ?= {}
|
||||
<span class="hljs-keyword">if</span> token.comments <span class="hljs-comment"># `comments` is always an array.</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-19">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-19">§</a>
|
||||
</div>
|
||||
<p>For “overlapping” tokens, that is tokens with the same location data
|
||||
and therefore matching <code>tokenHash</code>es, merge the comments from both/all
|
||||
tokens together into one array, even if there are duplicate comments;
|
||||
they will get sorted out later.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> (tokenData[tokenHash].comments ?= []).push token.comments...
|
||||
tokenData</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-20">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-20">§</a>
|
||||
</div>
|
||||
<p>This returns a function which takes an object as a parameter, and if that
|
||||
object is an AST node, updates that object’s locationData.
|
||||
The object is returned either way.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.addDataToNode = <span class="hljs-function"><span class="hljs-params">(parserState, firstLocationData, firstValue, lastLocationData, lastValue, forceUpdateLocation = <span class="hljs-literal">yes</span>)</span> -></span>
|
||||
(obj) -></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-21">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-21">§</a>
|
||||
</div>
|
||||
<p>Add location data.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> locationData = buildLocationData(firstValue?.locationData ? firstLocationData, lastValue?.locationData ? lastLocationData)
|
||||
<span class="hljs-keyword">if</span> obj?.updateLocationDataIfMissing? <span class="hljs-keyword">and</span> firstLocationData?
|
||||
obj.updateLocationDataIfMissing locationData, forceUpdateLocation
|
||||
<span class="hljs-keyword">else</span>
|
||||
obj.locationData = locationData</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-22">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-22">§</a>
|
||||
</div>
|
||||
<p>Add comments, building the dictionary of token data if it hasn’t been
|
||||
built yet.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> parserState.tokenData ?= buildTokenDataDictionary parserState.parser.tokens
|
||||
<span class="hljs-keyword">if</span> obj.locationData?
|
||||
objHash = buildLocationHash obj.locationData
|
||||
<span class="hljs-keyword">if</span> parserState.tokenData[objHash]?.comments?
|
||||
attachCommentsToNode parserState.tokenData[objHash].comments, obj
|
||||
obj
|
||||
|
||||
<span class="hljs-built_in">exports</span>.attachCommentsToNode = attachCommentsToNode = <span class="hljs-function"><span class="hljs-params">(comments, node)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> comments? <span class="hljs-keyword">or</span> comments.length <span class="hljs-keyword">is</span> <span class="hljs-number">0</span>
|
||||
node.comments ?= []
|
||||
node.comments.push comments...</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-23">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-23">§</a>
|
||||
</div>
|
||||
<p>Convert jison location data to a string.
|
||||
<code>obj</code> can be a token, or a locationData.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.locationDataToString = <span class="hljs-function"><span class="hljs-params">(obj)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> (<span class="hljs-string">"2"</span> <span class="hljs-keyword">of</span> obj) <span class="hljs-keyword">and</span> (<span class="hljs-string">"first_line"</span> <span class="hljs-keyword">of</span> obj[<span class="hljs-number">2</span>]) <span class="hljs-keyword">then</span> locationData = obj[<span class="hljs-number">2</span>]
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> <span class="hljs-string">"first_line"</span> <span class="hljs-keyword">of</span> obj <span class="hljs-keyword">then</span> locationData = obj
|
||||
|
||||
<span class="hljs-keyword">if</span> locationData
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{locationData.first_line + <span class="hljs-number">1</span>}</span>:<span class="hljs-subst">#{locationData.first_column + <span class="hljs-number">1</span>}</span>-"</span> +
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{locationData.last_line + <span class="hljs-number">1</span>}</span>:<span class="hljs-subst">#{locationData.last_column + <span class="hljs-number">1</span>}</span>"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-string">"No location data"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-24">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-24">§</a>
|
||||
</div>
|
||||
<p>A <code>.coffee.md</code> compatible version of <code>basename</code>, that returns the file sans-extension.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.baseFileName = <span class="hljs-function"><span class="hljs-params">(file, stripExt = <span class="hljs-literal">no</span>, useWinPathSep = <span class="hljs-literal">no</span>)</span> -></span>
|
||||
pathSep = <span class="hljs-keyword">if</span> useWinPathSep <span class="hljs-keyword">then</span> <span class="hljs-regexp">/\\|\//</span> <span class="hljs-keyword">else</span> <span class="hljs-regexp">/\//</span>
|
||||
parts = file.split(pathSep)
|
||||
file = parts[parts.length - <span class="hljs-number">1</span>]
|
||||
<span class="hljs-keyword">return</span> file <span class="hljs-keyword">unless</span> stripExt <span class="hljs-keyword">and</span> file.indexOf(<span class="hljs-string">'.'</span>) >= <span class="hljs-number">0</span>
|
||||
parts = file.split(<span class="hljs-string">'.'</span>)
|
||||
parts.pop()
|
||||
parts.pop() <span class="hljs-keyword">if</span> parts[parts.length - <span class="hljs-number">1</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'coffee'</span> <span class="hljs-keyword">and</span> parts.length > <span class="hljs-number">1</span>
|
||||
parts.join(<span class="hljs-string">'.'</span>)</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-25">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-25">§</a>
|
||||
</div>
|
||||
<p>Determine if a filename represents a CoffeeScript file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.isCoffee = <span class="hljs-function"><span class="hljs-params">(file)</span> -></span> <span class="hljs-regexp">/\.((lit)?coffee|coffee\.md)$/</span>.test file</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-26">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-26">§</a>
|
||||
</div>
|
||||
<p>Determine if a filename represents a Literate CoffeeScript file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.isLiterate = <span class="hljs-function"><span class="hljs-params">(file)</span> -></span> <span class="hljs-regexp">/\.(litcoffee|coffee\.md)$/</span>.test file</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-27">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-27">§</a>
|
||||
</div>
|
||||
<p>Throws a SyntaxError from a given location.
|
||||
The error’s <code>toString</code> will return an error message following the “standard”
|
||||
format <code><filename>:<line>:<col>: <message></code> plus the line with the error and a
|
||||
marker showing where the error is.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.throwSyntaxError = <span class="hljs-function"><span class="hljs-params">(message, location)</span> -></span>
|
||||
error = <span class="hljs-keyword">new</span> <span class="hljs-built_in">SyntaxError</span> message
|
||||
error.location = location
|
||||
error.toString = syntaxErrorToString</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-28">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-28">§</a>
|
||||
</div>
|
||||
<p>Instead of showing the compiler’s stacktrace, show our custom error message
|
||||
(this is useful when the error bubbles up in Node.js applications that
|
||||
compile CoffeeScript for example).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> error.stack = error.toString()
|
||||
|
||||
<span class="hljs-keyword">throw</span> error</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-29">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-29">§</a>
|
||||
</div>
|
||||
<p>Update a compiler SyntaxError with source code information if it didn’t have
|
||||
it already.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.updateSyntaxError = <span class="hljs-function"><span class="hljs-params">(error, code, filename)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-30">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-30">§</a>
|
||||
</div>
|
||||
<p>Avoid screwing up the <code>stack</code> property of other errors (i.e. possible bugs).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> error.toString <span class="hljs-keyword">is</span> syntaxErrorToString
|
||||
error.code <span class="hljs-keyword">or</span>= code
|
||||
error.filename <span class="hljs-keyword">or</span>= filename
|
||||
error.stack = error.toString()
|
||||
error
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">syntaxErrorToString</span> = -></span>
|
||||
<span class="hljs-keyword">return</span> Error::toString.call @ <span class="hljs-keyword">unless</span> @code <span class="hljs-keyword">and</span> @location
|
||||
|
||||
{first_line, first_column, last_line, last_column} = @location
|
||||
last_line ?= first_line
|
||||
last_column ?= first_column
|
||||
|
||||
filename = @filename <span class="hljs-keyword">or</span> <span class="hljs-string">'[stdin]'</span>
|
||||
codeLine = @code.split(<span class="hljs-string">'\n'</span>)[first_line]
|
||||
start = first_column</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-31">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-31">§</a>
|
||||
</div>
|
||||
<p>Show only the first line on multi-line errors.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> end = <span class="hljs-keyword">if</span> first_line <span class="hljs-keyword">is</span> last_line <span class="hljs-keyword">then</span> last_column + <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> codeLine.length
|
||||
marker = codeLine[...start].replace(<span class="hljs-regexp">/[^\s]/g</span>, <span class="hljs-string">' '</span>) + repeat(<span class="hljs-string">'^'</span>, end - start)</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-32">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-32">§</a>
|
||||
</div>
|
||||
<p>Check to see if we’re running on a color-enabled TTY.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> process?
|
||||
colorsEnabled = process.stdout?.isTTY <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> process.env?.NODE_DISABLE_COLORS
|
||||
|
||||
<span class="hljs-keyword">if</span> @colorful ? colorsEnabled
|
||||
<span class="hljs-function"> <span class="hljs-title">colorize</span> = <span class="hljs-params">(str)</span> -></span> <span class="hljs-string">"\x1B[1;31m<span class="hljs-subst">#{str}</span>\x1B[0m"</span>
|
||||
codeLine = codeLine[...start] + colorize(codeLine[start...end]) + codeLine[end..]
|
||||
marker = colorize marker
|
||||
|
||||
<span class="hljs-string">"""
|
||||
<span class="hljs-subst">#{filename}</span>:<span class="hljs-subst">#{first_line + <span class="hljs-number">1</span>}</span>:<span class="hljs-subst">#{first_column + <span class="hljs-number">1</span>}</span>: error: <span class="hljs-subst">#{@message}</span>
|
||||
<span class="hljs-subst">#{codeLine}</span>
|
||||
<span class="hljs-subst">#{marker}</span>
|
||||
"""</span>
|
||||
|
||||
<span class="hljs-built_in">exports</span>.nameWhitespaceCharacter = <span class="hljs-function"><span class="hljs-params">(string)</span> -></span>
|
||||
<span class="hljs-keyword">switch</span> string
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-string">' '</span> <span class="hljs-keyword">then</span> <span class="hljs-string">'space'</span>
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-string">'\n'</span> <span class="hljs-keyword">then</span> <span class="hljs-string">'newline'</span>
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-string">'\r'</span> <span class="hljs-keyword">then</span> <span class="hljs-string">'carriage return'</span>
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-string">'\t'</span> <span class="hljs-keyword">then</span> <span class="hljs-string">'tab'</span>
|
||||
<span class="hljs-keyword">else</span> string
|
||||
|
||||
<span class="hljs-built_in">exports</span>.parseNumber = <span class="hljs-function"><span class="hljs-params">(string)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-literal">NaN</span> <span class="hljs-keyword">unless</span> string?
|
||||
|
||||
base = <span class="hljs-keyword">switch</span> string.charAt <span class="hljs-number">1</span>
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-string">'b'</span> <span class="hljs-keyword">then</span> <span class="hljs-number">2</span>
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-string">'o'</span> <span class="hljs-keyword">then</span> <span class="hljs-number">8</span>
|
||||
<span class="hljs-keyword">when</span> <span class="hljs-string">'x'</span> <span class="hljs-keyword">then</span> <span class="hljs-number">16</span>
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-literal">null</span>
|
||||
|
||||
<span class="hljs-keyword">if</span> base?
|
||||
<span class="hljs-built_in">parseInt</span> string[<span class="hljs-number">2.</span>.].replace(<span class="hljs-regexp">/_/g</span>, <span class="hljs-string">''</span>), base
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-built_in">parseFloat</span> string.replace(<span class="hljs-regexp">/_/g</span>, <span class="hljs-string">''</span>)
|
||||
|
||||
<span class="hljs-built_in">exports</span>.isFunction = <span class="hljs-function"><span class="hljs-params">(obj)</span> -></span> Object::toString.call(obj) <span class="hljs-keyword">is</span> <span class="hljs-string">'[object Function]'</span>
|
||||
<span class="hljs-built_in">exports</span>.isNumber = isNumber = <span class="hljs-function"><span class="hljs-params">(obj)</span> -></span> Object::toString.call(obj) <span class="hljs-keyword">is</span> <span class="hljs-string">'[object Number]'</span>
|
||||
<span class="hljs-built_in">exports</span>.isString = isString = <span class="hljs-function"><span class="hljs-params">(obj)</span> -></span> Object::toString.call(obj) <span class="hljs-keyword">is</span> <span class="hljs-string">'[object String]'</span>
|
||||
<span class="hljs-built_in">exports</span>.isBoolean = isBoolean = <span class="hljs-function"><span class="hljs-params">(obj)</span> -></span> obj <span class="hljs-keyword">is</span> <span class="hljs-literal">yes</span> <span class="hljs-keyword">or</span> obj <span class="hljs-keyword">is</span> <span class="hljs-literal">no</span> <span class="hljs-keyword">or</span> Object::toString.call(obj) <span class="hljs-keyword">is</span> <span class="hljs-string">'[object Boolean]'</span>
|
||||
<span class="hljs-built_in">exports</span>.isPlainObject = <span class="hljs-function"><span class="hljs-params">(obj)</span> -></span> <span class="hljs-keyword">typeof</span> obj <span class="hljs-keyword">is</span> <span class="hljs-string">'object'</span> <span class="hljs-keyword">and</span> !!obj <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> <span class="hljs-built_in">Array</span>.isArray(obj) <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> isNumber(obj) <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> isString(obj) <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> isBoolean(obj)
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">unicodeCodePointToUnicodeEscapes</span> = <span class="hljs-params">(codePoint)</span> -></span>
|
||||
<span class="hljs-function"> <span class="hljs-title">toUnicodeEscape</span> = <span class="hljs-params">(val)</span> -></span>
|
||||
str = val.toString <span class="hljs-number">16</span>
|
||||
<span class="hljs-string">"\\u<span class="hljs-subst">#{repeat <span class="hljs-string">'0'</span>, <span class="hljs-number">4</span> - str.length}</span><span class="hljs-subst">#{str}</span>"</span>
|
||||
<span class="hljs-keyword">return</span> toUnicodeEscape(codePoint) <span class="hljs-keyword">if</span> codePoint < <span class="hljs-number">0x10000</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-33">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-33">§</a>
|
||||
</div>
|
||||
<p>surrogate pair</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> high = <span class="hljs-built_in">Math</span>.floor((codePoint - <span class="hljs-number">0x10000</span>) / <span class="hljs-number">0x400</span>) + <span class="hljs-number">0xD800</span>
|
||||
low = (codePoint - <span class="hljs-number">0x10000</span>) % <span class="hljs-number">0x400</span> + <span class="hljs-number">0xDC00</span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{toUnicodeEscape(high)}</span><span class="hljs-subst">#{toUnicodeEscape(low)}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-34">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-34">§</a>
|
||||
</div>
|
||||
<p>Replace <code>\u{...}</code> with <code>\uxxxx[\uxxxx]</code> in regexes without <code>u</code> flag</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.replaceUnicodeCodePointEscapes = <span class="hljs-function"><span class="hljs-params">(str, {flags, error, delimiter = <span class="hljs-string">''</span>} = {})</span> -></span>
|
||||
shouldReplace = flags? <span class="hljs-keyword">and</span> <span class="hljs-string">'u'</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> flags
|
||||
str.replace UNICODE_CODE_POINT_ESCAPE, <span class="hljs-function"><span class="hljs-params">(match, escapedBackslash, codePointHex, offset)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> escapedBackslash <span class="hljs-keyword">if</span> escapedBackslash
|
||||
|
||||
codePointDecimal = <span class="hljs-built_in">parseInt</span> codePointHex, <span class="hljs-number">16</span>
|
||||
<span class="hljs-keyword">if</span> codePointDecimal > <span class="hljs-number">0x10ffff</span>
|
||||
error <span class="hljs-string">"unicode code point escapes greater than \\u{10ffff} are not allowed"</span>,
|
||||
offset: offset + delimiter.length
|
||||
length: codePointHex.length + <span class="hljs-number">4</span>
|
||||
<span class="hljs-keyword">return</span> match <span class="hljs-keyword">unless</span> shouldReplace
|
||||
|
||||
unicodeCodePointToUnicodeEscapes codePointDecimal
|
||||
|
||||
UNICODE_CODE_POINT_ESCAPE = <span class="hljs-regexp">///
|
||||
( \\\\ ) <span class="hljs-comment"># Make sure the escape isn’t escaped.</span>
|
||||
|
|
||||
\\u\{ ( [\da-fA-F]+ ) \}
|
||||
///</span>g</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
495
docs/v2/annotated-source/index.html
Normal file
495
docs/v2/annotated-source/index.html
Normal file
@@ -0,0 +1,495 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>index.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>index.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-1">§</a>
|
||||
</div>
|
||||
<p>Node.js Implementation</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span>
|
||||
fs = <span class="hljs-built_in">require</span> <span class="hljs-string">'fs'</span>
|
||||
vm = <span class="hljs-built_in">require</span> <span class="hljs-string">'vm'</span>
|
||||
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
|
||||
|
||||
helpers = CoffeeScript.helpers
|
||||
|
||||
CoffeeScript.transpile = <span class="hljs-function"><span class="hljs-params">(js, options)</span> -></span>
|
||||
<span class="hljs-keyword">try</span>
|
||||
babel = <span class="hljs-built_in">require</span> <span class="hljs-string">'@babel/core'</span>
|
||||
<span class="hljs-keyword">catch</span>
|
||||
<span class="hljs-keyword">try</span>
|
||||
babel = <span class="hljs-built_in">require</span> <span class="hljs-string">'babel-core'</span>
|
||||
<span class="hljs-keyword">catch</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-2">§</a>
|
||||
</div>
|
||||
<p>This error is only for Node, as CLI users will see a different error
|
||||
earlier if they don’t have Babel installed.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">'To use the transpile option, you must have the \'@babel/core\' module installed'</span>
|
||||
babel.transform js, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-3">§</a>
|
||||
</div>
|
||||
<p>The <code>compile</code> method shared by the CLI, Node and browser APIs.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>universalCompile = CoffeeScript.compile</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-4">§</a>
|
||||
</div>
|
||||
<p>The <code>compile</code> method particular to the Node API.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.compile = <span class="hljs-function"><span class="hljs-params">(code, options)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-5">§</a>
|
||||
</div>
|
||||
<p>Pass a reference to Babel into the compiler, so that the transpile option
|
||||
is available in the Node API. We need to do this so that tools like Webpack
|
||||
can <code>require('coffeescript')</code> and build correctly, without trying to
|
||||
require Babel.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> options?.transpile
|
||||
options.transpile.transpile = CoffeeScript.transpile
|
||||
universalCompile.call CoffeeScript, code, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-6">§</a>
|
||||
</div>
|
||||
<p>Compile and execute a string of CoffeeScript (on the server), correctly
|
||||
setting <code>__filename</code>, <code>__dirname</code>, and relative <code>require()</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.run = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
|
||||
mainModule = <span class="hljs-built_in">require</span>.main</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-7">§</a>
|
||||
</div>
|
||||
<p>Set the filename.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> mainModule.filename = process.argv[<span class="hljs-number">1</span>] =
|
||||
<span class="hljs-keyword">if</span> options.filename <span class="hljs-keyword">then</span> fs.realpathSync(options.filename) <span class="hljs-keyword">else</span> <span class="hljs-string">'<anonymous>'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-8">§</a>
|
||||
</div>
|
||||
<p>Clear the module cache.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> mainModule.moduleCache <span class="hljs-keyword">and</span>= {}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-9">§</a>
|
||||
</div>
|
||||
<p>Assign paths for node_modules loading</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> dir = <span class="hljs-keyword">if</span> options.filename?
|
||||
path.dirname fs.realpathSync options.filename
|
||||
<span class="hljs-keyword">else</span>
|
||||
fs.realpathSync <span class="hljs-string">'.'</span>
|
||||
mainModule.paths = <span class="hljs-built_in">require</span>(<span class="hljs-string">'module'</span>)._nodeModulePaths dir</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-10">§</a>
|
||||
</div>
|
||||
<p>Save the options for compiling child imports.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> mainModule.options = options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-11">§</a>
|
||||
</div>
|
||||
<p>Compile.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> helpers.isCoffee(mainModule.filename) <span class="hljs-keyword">or</span> <span class="hljs-built_in">require</span>.extensions
|
||||
answer = CoffeeScript.compile code, options
|
||||
code = answer.js ? answer
|
||||
|
||||
mainModule._compile code, mainModule.filename</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-12">§</a>
|
||||
</div>
|
||||
<p>Compile and evaluate a string of CoffeeScript (in a Node.js-like environment).
|
||||
The CoffeeScript REPL uses this to run the input.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript.<span class="hljs-built_in">eval</span> = <span class="hljs-function"><span class="hljs-params">(code, options = {})</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> code = code.trim()
|
||||
createContext = vm.Script.createContext ? vm.createContext
|
||||
|
||||
isContext = vm.isContext ? (ctx) ->
|
||||
options.sandbox <span class="hljs-keyword">instanceof</span> createContext().constructor
|
||||
|
||||
<span class="hljs-keyword">if</span> createContext
|
||||
<span class="hljs-keyword">if</span> options.sandbox?
|
||||
<span class="hljs-keyword">if</span> isContext options.sandbox
|
||||
sandbox = options.sandbox
|
||||
<span class="hljs-keyword">else</span>
|
||||
sandbox = createContext()
|
||||
sandbox[k] = v <span class="hljs-keyword">for</span> own k, v <span class="hljs-keyword">of</span> options.sandbox
|
||||
sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox
|
||||
<span class="hljs-keyword">else</span>
|
||||
sandbox = global
|
||||
sandbox.__filename = options.filename || <span class="hljs-string">'eval'</span>
|
||||
sandbox.__dirname = path.dirname sandbox.__filename</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-13">§</a>
|
||||
</div>
|
||||
<p>define module/require only if they chose not to specify their own</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">unless</span> sandbox <span class="hljs-keyword">isnt</span> global <span class="hljs-keyword">or</span> sandbox.module <span class="hljs-keyword">or</span> sandbox.<span class="hljs-built_in">require</span>
|
||||
Module = <span class="hljs-built_in">require</span> <span class="hljs-string">'module'</span>
|
||||
sandbox.module = _module = <span class="hljs-keyword">new</span> Module(options.modulename || <span class="hljs-string">'eval'</span>)
|
||||
sandbox.<span class="hljs-built_in">require</span> = _require = <span class="hljs-function"><span class="hljs-params">(path)</span> -></span> Module._load path, _module, <span class="hljs-literal">true</span>
|
||||
_module.filename = sandbox.__filename
|
||||
<span class="hljs-keyword">for</span> r <span class="hljs-keyword">in</span> <span class="hljs-built_in">Object</span>.getOwnPropertyNames <span class="hljs-built_in">require</span> <span class="hljs-keyword">when</span> r <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> [<span class="hljs-string">'paths'</span>, <span class="hljs-string">'arguments'</span>, <span class="hljs-string">'caller'</span>]
|
||||
_require[r] = <span class="hljs-built_in">require</span>[r]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-14">§</a>
|
||||
</div>
|
||||
<p>use the same hack node currently uses for their own REPL</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> _require.paths = _module.paths = Module._nodeModulePaths process.cwd()
|
||||
_require.resolve = <span class="hljs-function"><span class="hljs-params">(request)</span> -></span> Module._resolveFilename request, _module
|
||||
o = {}
|
||||
o[k] = v <span class="hljs-keyword">for</span> own k, v <span class="hljs-keyword">of</span> options
|
||||
o.bare = <span class="hljs-literal">on</span> <span class="hljs-comment"># ensure return value</span>
|
||||
js = CoffeeScript.compile code, o
|
||||
<span class="hljs-keyword">if</span> sandbox <span class="hljs-keyword">is</span> global
|
||||
vm.runInThisContext js
|
||||
<span class="hljs-keyword">else</span>
|
||||
vm.runInContext js, sandbox
|
||||
|
||||
CoffeeScript.register = <span class="hljs-function">-></span> <span class="hljs-built_in">require</span> <span class="hljs-string">'./register'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-15">§</a>
|
||||
</div>
|
||||
<p>Throw error with deprecation warning when depending upon implicit <code>require.extensions</code> registration</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> <span class="hljs-built_in">require</span>.extensions
|
||||
<span class="hljs-keyword">for</span> ext <span class="hljs-keyword">in</span> CoffeeScript.FILE_EXTENSIONS <span class="hljs-keyword">then</span> <span class="hljs-keyword">do</span> (ext) ->
|
||||
<span class="hljs-built_in">require</span>.extensions[ext] ?= <span class="hljs-function">-></span>
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">"""
|
||||
Use CoffeeScript.register() or require the coffeescript/register module to require <span class="hljs-subst">#{ext}</span> files.
|
||||
"""</span>
|
||||
|
||||
CoffeeScript._compileRawFileContent = <span class="hljs-function"><span class="hljs-params">(raw, filename, options = {})</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-16">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-16">§</a>
|
||||
</div>
|
||||
<p>Strip the Unicode byte order mark, if this file begins with one.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> stripped = <span class="hljs-keyword">if</span> raw.charCodeAt(<span class="hljs-number">0</span>) <span class="hljs-keyword">is</span> <span class="hljs-number">0xFEFF</span> <span class="hljs-keyword">then</span> raw.substring <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> raw
|
||||
|
||||
options = <span class="hljs-built_in">Object</span>.assign {}, options,
|
||||
filename: filename
|
||||
literate: helpers.isLiterate filename
|
||||
sourceFiles: [filename]
|
||||
inlineMap: <span class="hljs-literal">yes</span> <span class="hljs-comment"># Always generate a source map, so that stack traces line up.</span>
|
||||
|
||||
<span class="hljs-keyword">try</span>
|
||||
answer = CoffeeScript.compile stripped, options
|
||||
<span class="hljs-keyword">catch</span> err</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-17">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-17">§</a>
|
||||
</div>
|
||||
<p>As the filename and code of a dynamically loaded file will be different
|
||||
from the original file compiled with CoffeeScript.run, add that
|
||||
information to error so it can be pretty-printed later.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">throw</span> helpers.updateSyntaxError err, stripped, filename
|
||||
|
||||
answer
|
||||
|
||||
CoffeeScript._compileFile = <span class="hljs-function"><span class="hljs-params">(filename, options = {})</span> -></span>
|
||||
raw = fs.readFileSync filename, <span class="hljs-string">'utf8'</span>
|
||||
|
||||
CoffeeScript._compileRawFileContent raw, filename, options
|
||||
|
||||
module.<span class="hljs-built_in">exports</span> = CoffeeScript</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-18">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-18">§</a>
|
||||
</div>
|
||||
<p>Explicitly define all named exports so that Node’s automatic detection of
|
||||
named exports from CommonJS packages finds all of them. This enables consuming
|
||||
packages to write code like <code>import { compile } from 'coffeescript'</code>.
|
||||
Don’t simplify this into a loop or similar; the <code>module.exports.name</code> part is
|
||||
essential for Node’s algorithm to successfully detect the name.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>module.<span class="hljs-built_in">exports</span>.VERSION = CoffeeScript.VERSION
|
||||
module.<span class="hljs-built_in">exports</span>.FILE_EXTENSIONS = CoffeeScript.FILE_EXTENSIONS
|
||||
module.<span class="hljs-built_in">exports</span>.helpers = CoffeeScript.helpers
|
||||
module.<span class="hljs-built_in">exports</span>.registerCompiled = CoffeeScript.registerCompiled
|
||||
module.<span class="hljs-built_in">exports</span>.compile = CoffeeScript.compile
|
||||
module.<span class="hljs-built_in">exports</span>.tokens = CoffeeScript.tokens
|
||||
module.<span class="hljs-built_in">exports</span>.nodes = CoffeeScript.nodes
|
||||
module.<span class="hljs-built_in">exports</span>.register = CoffeeScript.register
|
||||
module.<span class="hljs-built_in">exports</span>.<span class="hljs-built_in">eval</span> = CoffeeScript.<span class="hljs-built_in">eval</span>
|
||||
module.<span class="hljs-built_in">exports</span>.run = CoffeeScript.run
|
||||
module.<span class="hljs-built_in">exports</span>.transpile = CoffeeScript.transpile
|
||||
module.<span class="hljs-built_in">exports</span>._compileRawFileContent = CoffeeScript._compileRawFileContent
|
||||
module.<span class="hljs-built_in">exports</span>._compileFile = CoffeeScript._compileFile</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
3032
docs/v2/annotated-source/lexer.html
Normal file
3032
docs/v2/annotated-source/lexer.html
Normal file
File diff suppressed because it is too large
Load Diff
10762
docs/v2/annotated-source/nodes.html
Normal file
10762
docs/v2/annotated-source/nodes.html
Normal file
File diff suppressed because it is too large
Load Diff
483
docs/v2/annotated-source/optparse.html
Normal file
483
docs/v2/annotated-source/optparse.html
Normal file
@@ -0,0 +1,483 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>optparse.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>optparse.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-1">§</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>{repeat} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-2">§</a>
|
||||
</div>
|
||||
<p>A simple <strong>OptionParser</strong> class to parse option flags from the command-line.
|
||||
Use it like so:</p>
|
||||
<pre><code>parser = <span class="hljs-keyword">new</span> OptionParser switches, helpBanner
|
||||
options = parser.parse process.argv
|
||||
</code></pre><p>The first non-option is considered to be the start of the file (and file
|
||||
option) list, and all subsequent arguments are left unparsed.</p>
|
||||
<p>The <code>coffee</code> command uses an instance of <strong>OptionParser</strong> to parse its
|
||||
command-line arguments in <code>src/command.coffee</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.OptionParser = <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">OptionParser</span></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-3">§</a>
|
||||
</div>
|
||||
<p>Initialize with a list of valid options, in the form:</p>
|
||||
<pre><code>[short-flag, long-flag, description]
|
||||
</code></pre><p>Along with an optional banner for the usage help.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> constructor: <span class="hljs-function"><span class="hljs-params">(ruleDeclarations, @banner)</span> -></span>
|
||||
@rules = buildRules ruleDeclarations</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-4">§</a>
|
||||
</div>
|
||||
<p>Parse the list of arguments, populating an <code>options</code> object with all of the
|
||||
specified options, and return it. Options after the first non-option
|
||||
argument are treated as arguments. <code>options.arguments</code> will be an array
|
||||
containing the remaining arguments. This is a simpler API than many option
|
||||
parsers that allow you to attach callback actions for every flag. Instead,
|
||||
you’re responsible for interpreting the options object.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> parse: <span class="hljs-function"><span class="hljs-params">(args)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-5">§</a>
|
||||
</div>
|
||||
<p>The CoffeeScript option parser is a little odd; options after the first
|
||||
non-option argument are treated as non-option arguments themselves.
|
||||
Optional arguments are normalized by expanding merged flags into multiple
|
||||
flags. This allows you to have <code>-wl</code> be the same as <code>--watch --lint</code>.
|
||||
Note that executable scripts with a shebang (<code>#!</code>) line should use the
|
||||
line <code>#!/usr/bin/env coffee</code>, or <code>#!/absolute/path/to/coffee</code>, without a
|
||||
<code>--</code> argument after, because that will fail on Linux (see #3946).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> {rules, positional} = normalizeArguments args, @rules.flagDict
|
||||
options = {}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-6">§</a>
|
||||
</div>
|
||||
<p>The <code>argument</code> field is added to the rule instance non-destructively by
|
||||
<code>normalizeArguments</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">for</span> {hasArgument, argument, isList, name} <span class="hljs-keyword">in</span> rules
|
||||
<span class="hljs-keyword">if</span> hasArgument
|
||||
<span class="hljs-keyword">if</span> isList
|
||||
options[name] ?= []
|
||||
options[name].push argument
|
||||
<span class="hljs-keyword">else</span>
|
||||
options[name] = argument
|
||||
<span class="hljs-keyword">else</span>
|
||||
options[name] = <span class="hljs-literal">true</span>
|
||||
|
||||
<span class="hljs-keyword">if</span> positional[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'--'</span>
|
||||
options.doubleDashed = <span class="hljs-literal">yes</span>
|
||||
positional = positional[<span class="hljs-number">1.</span>.]
|
||||
|
||||
options.arguments = positional
|
||||
options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-7">§</a>
|
||||
</div>
|
||||
<p>Return the help text for this <strong>OptionParser</strong>, listing and describing all
|
||||
of the valid options, for <code>--help</code> and such.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> help: <span class="hljs-function">-></span>
|
||||
lines = []
|
||||
lines.unshift <span class="hljs-string">"<span class="hljs-subst">#{@banner}</span>\n"</span> <span class="hljs-keyword">if</span> @banner
|
||||
<span class="hljs-keyword">for</span> rule <span class="hljs-keyword">in</span> @rules.ruleList
|
||||
spaces = <span class="hljs-number">15</span> - rule.longFlag.length
|
||||
spaces = <span class="hljs-keyword">if</span> spaces > <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> repeat <span class="hljs-string">' '</span>, spaces <span class="hljs-keyword">else</span> <span class="hljs-string">''</span>
|
||||
letPart = <span class="hljs-keyword">if</span> rule.shortFlag <span class="hljs-keyword">then</span> rule.shortFlag + <span class="hljs-string">', '</span> <span class="hljs-keyword">else</span> <span class="hljs-string">' '</span>
|
||||
lines.push <span class="hljs-string">' '</span> + letPart + rule.longFlag + spaces + rule.description
|
||||
<span class="hljs-string">"\n<span class="hljs-subst">#{ lines.join(<span class="hljs-string">'\n'</span>) }</span>\n"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-8">§</a>
|
||||
</div>
|
||||
<h2 id="helpers">Helpers</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-9">§</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-10">§</a>
|
||||
</div>
|
||||
<p>Regex matchers for option flags on the command line and their rules.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>LONG_FLAG = <span class="hljs-regexp">/^(--\w[\w\-]*)/</span>
|
||||
SHORT_FLAG = <span class="hljs-regexp">/^(-\w)$/</span>
|
||||
MULTI_FLAG = <span class="hljs-regexp">/^-(\w{2,})/</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-11">§</a>
|
||||
</div>
|
||||
<p>Matches the long flag part of a rule for an option with an argument. Not
|
||||
applied to anything in process.argv.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>OPTIONAL = <span class="hljs-regexp">/\[(\w+(\*?))\]/</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-12">§</a>
|
||||
</div>
|
||||
<p>Build and return the list of option rules. If the optional <em>short-flag</em> is
|
||||
unspecified, leave it out by padding with <code>null</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">buildRules</span> = <span class="hljs-params">(ruleDeclarations)</span> -></span>
|
||||
ruleList = <span class="hljs-keyword">for</span> tuple <span class="hljs-keyword">in</span> ruleDeclarations
|
||||
tuple.unshift <span class="hljs-literal">null</span> <span class="hljs-keyword">if</span> tuple.length < <span class="hljs-number">3</span>
|
||||
buildRule tuple...
|
||||
flagDict = {}
|
||||
<span class="hljs-keyword">for</span> rule <span class="hljs-keyword">in</span> ruleList</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-13">§</a>
|
||||
</div>
|
||||
<p><code>shortFlag</code> is null if not provided in the rule.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">for</span> flag <span class="hljs-keyword">in</span> [rule.shortFlag, rule.longFlag] <span class="hljs-keyword">when</span> flag?
|
||||
<span class="hljs-keyword">if</span> flagDict[flag]?
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">"flag <span class="hljs-subst">#{flag}</span> for switch <span class="hljs-subst">#{rule.name}</span>
|
||||
was already declared for switch <span class="hljs-subst">#{flagDict[flag].name}</span>"</span>
|
||||
flagDict[flag] = rule
|
||||
|
||||
{ruleList, flagDict}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-14">§</a>
|
||||
</div>
|
||||
<p>Build a rule from a <code>-o</code> short flag, a <code>--output [DIR]</code> long flag, and the
|
||||
description of what the option does.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">buildRule</span> = <span class="hljs-params">(shortFlag, longFlag, description)</span> -></span>
|
||||
match = longFlag.match(OPTIONAL)
|
||||
shortFlag = shortFlag?.match(SHORT_FLAG)[<span class="hljs-number">1</span>]
|
||||
longFlag = longFlag.match(LONG_FLAG)[<span class="hljs-number">1</span>]
|
||||
{
|
||||
name: longFlag.replace <span class="hljs-regexp">/^--/</span>, <span class="hljs-string">''</span>
|
||||
shortFlag: shortFlag
|
||||
longFlag: longFlag
|
||||
description: description
|
||||
hasArgument: !!(match <span class="hljs-keyword">and</span> match[<span class="hljs-number">1</span>])
|
||||
isList: !!(match <span class="hljs-keyword">and</span> match[<span class="hljs-number">2</span>])
|
||||
}
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">normalizeArguments</span> = <span class="hljs-params">(args, flagDict)</span> -></span>
|
||||
rules = []
|
||||
positional = []
|
||||
needsArgOpt = <span class="hljs-literal">null</span>
|
||||
<span class="hljs-keyword">for</span> arg, argIndex <span class="hljs-keyword">in</span> args</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-15">§</a>
|
||||
</div>
|
||||
<p>If the previous argument given to the script was an option that uses the
|
||||
next command-line argument as its argument, create copy of the option’s
|
||||
rule with an <code>argument</code> field.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> needsArgOpt?
|
||||
withArg = <span class="hljs-built_in">Object</span>.assign {}, needsArgOpt.rule, {argument: arg}
|
||||
rules.push withArg
|
||||
needsArgOpt = <span class="hljs-literal">null</span>
|
||||
<span class="hljs-keyword">continue</span>
|
||||
|
||||
multiFlags = arg.match(MULTI_FLAG)?[<span class="hljs-number">1</span>]
|
||||
.split(<span class="hljs-string">''</span>)
|
||||
.map (flagName) -> <span class="hljs-string">"-<span class="hljs-subst">#{flagName}</span>"</span>
|
||||
<span class="hljs-keyword">if</span> multiFlags?
|
||||
multiOpts = multiFlags.map (flag) ->
|
||||
rule = flagDict[flag]
|
||||
<span class="hljs-keyword">unless</span> rule?
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">"unrecognized option <span class="hljs-subst">#{flag}</span> in multi-flag <span class="hljs-subst">#{arg}</span>"</span>
|
||||
{rule, flag}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-16">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-16">§</a>
|
||||
</div>
|
||||
<p>Only the last flag in a multi-flag may have an argument.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> [innerOpts..., lastOpt] = multiOpts
|
||||
<span class="hljs-keyword">for</span> {rule, flag} <span class="hljs-keyword">in</span> innerOpts
|
||||
<span class="hljs-keyword">if</span> rule.hasArgument
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">"cannot use option <span class="hljs-subst">#{flag}</span> in multi-flag <span class="hljs-subst">#{arg}</span> except
|
||||
as the last option, because it needs an argument"</span>
|
||||
rules.push rule
|
||||
<span class="hljs-keyword">if</span> lastOpt.rule.hasArgument
|
||||
needsArgOpt = lastOpt
|
||||
<span class="hljs-keyword">else</span>
|
||||
rules.push lastOpt.rule
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> ([LONG_FLAG, SHORT_FLAG].some (pat) -> arg.match(pat)?)
|
||||
singleRule = flagDict[arg]
|
||||
<span class="hljs-keyword">unless</span> singleRule?
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">"unrecognized option <span class="hljs-subst">#{arg}</span>"</span>
|
||||
<span class="hljs-keyword">if</span> singleRule.hasArgument
|
||||
needsArgOpt = {rule: singleRule, flag: arg}
|
||||
<span class="hljs-keyword">else</span>
|
||||
rules.push singleRule
|
||||
<span class="hljs-keyword">else</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-17">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-17">§</a>
|
||||
</div>
|
||||
<p>This is a positional argument.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> positional = args[argIndex..]
|
||||
<span class="hljs-keyword">break</span>
|
||||
|
||||
<span class="hljs-keyword">if</span> needsArgOpt?
|
||||
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">"value required for <span class="hljs-subst">#{needsArgOpt.flag}</span>, but it was the last
|
||||
argument provided"</span>
|
||||
{rules, positional}</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/v2/annotated-source/public/fonts/aller-bold.eot
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-bold.eot
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/aller-bold.ttf
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-bold.ttf
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/aller-bold.woff
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-bold.woff
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/aller-light.eot
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-light.eot
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/aller-light.ttf
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-light.ttf
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/aller-light.woff
Normal file
BIN
docs/v2/annotated-source/public/fonts/aller-light.woff
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/roboto-black.eot
Normal file
BIN
docs/v2/annotated-source/public/fonts/roboto-black.eot
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/roboto-black.ttf
Normal file
BIN
docs/v2/annotated-source/public/fonts/roboto-black.ttf
Normal file
Binary file not shown.
BIN
docs/v2/annotated-source/public/fonts/roboto-black.woff
Normal file
BIN
docs/v2/annotated-source/public/fonts/roboto-black.woff
Normal file
Binary file not shown.
375
docs/v2/annotated-source/public/stylesheets/normalize.css
vendored
Normal file
375
docs/v2/annotated-source/public/stylesheets/normalize.css
vendored
Normal file
@@ -0,0 +1,375 @@
|
||||
/*! normalize.css v2.0.1 | MIT License | git.io/normalize */
|
||||
|
||||
/* ==========================================================================
|
||||
HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Corrects `block` display not defined in IE 8/9.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Corrects `inline-block` display not defined in IE 8/9.
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
video {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevents modern browsers from displaying `audio` without controls.
|
||||
* Remove excess height in iOS 5 devices.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses styling for `hidden` attribute not present in IE 8/9.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Base
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* 1. Sets default font family to sans-serif.
|
||||
* 2. Prevents iOS text size adjust after orientation change, without disabling
|
||||
* user zoom.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes default margin.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Links
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Addresses `outline` inconsistency between Chrome and other browsers.
|
||||
*/
|
||||
|
||||
a:focus {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
/*
|
||||
* Improves readability when focused and also mouse hovered in all browsers.
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Typography
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Addresses `h1` font sizes within `section` and `article` in Firefox 4+,
|
||||
* Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses styling not present in IE 8/9, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses styling not present in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses styling not present in IE 8/9.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Corrects font family set oddly in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/*
|
||||
* Improves readability of pre-formatted text in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
white-space: pre;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets consistent quote types.
|
||||
*/
|
||||
|
||||
q {
|
||||
quotes: "\201C" "\201D" "\2018" "\2019";
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses inconsistent and variable font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevents `sub` and `sup` affecting `line-height` in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Removes border when inside `a` element in IE 8/9.
|
||||
*/
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Corrects overflow displayed oddly in IE 9.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Figures
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Addresses margin not present in IE 8/9 and Safari 5.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Forms
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Define consistent border, margin, and padding.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Corrects color not being inherited in IE 8/9.
|
||||
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Corrects font family not being inherited in all browsers.
|
||||
* 2. Corrects font size not being inherited in all browsers.
|
||||
* 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit; /* 1 */
|
||||
font-size: 100%; /* 2 */
|
||||
margin: 0; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||
* the UA stylesheet.
|
||||
*/
|
||||
|
||||
button,
|
||||
input {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||
* and `video` controls.
|
||||
* 2. Corrects inability to style clickable `input` types in iOS.
|
||||
* 3. Improves usability and consistency of cursor style between image-type
|
||||
* `input` and others.
|
||||
*/
|
||||
|
||||
button,
|
||||
html input[type="button"], /* 1 */
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
cursor: pointer; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Re-set default cursor for disabled elements.
|
||||
*/
|
||||
|
||||
button[disabled],
|
||||
input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Addresses box sizing set to `content-box` in IE 8/9.
|
||||
* 2. Removes excess padding in IE 8/9.
|
||||
*/
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
|
||||
* 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
|
||||
* (include `-moz` to future-proof).
|
||||
*/
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box; /* 2 */
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes inner padding and search cancel button in Safari 5 and Chrome
|
||||
* on OS X.
|
||||
*/
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes inner padding and border in Firefox 4+.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Removes default vertical scrollbar in IE 8/9.
|
||||
* 2. Improves readability and alignment in all browsers.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto; /* 1 */
|
||||
vertical-align: top; /* 2 */
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Tables
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Remove most spacing between table cells.
|
||||
*/
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
268
docs/v2/annotated-source/register.html
Normal file
268
docs/v2/annotated-source/register.html
Normal file
@@ -0,0 +1,268 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>register.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>register.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-1">§</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./'</span>
|
||||
child_process = <span class="hljs-built_in">require</span> <span class="hljs-string">'child_process'</span>
|
||||
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
|
||||
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-2">§</a>
|
||||
</div>
|
||||
<p>Load and run a CoffeeScript file for Node, stripping any <code>BOM</code>s.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">loadFile</span> = <span class="hljs-params">(module, filename)</span> -></span>
|
||||
options = module.options <span class="hljs-keyword">or</span> getRootModule(module).options
|
||||
answer = CoffeeScript._compileFile filename, options
|
||||
module._compile answer, filename</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-3">§</a>
|
||||
</div>
|
||||
<p>If the installed version of Node supports <code>require.extensions</code>, register
|
||||
CoffeeScript as an extension.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> <span class="hljs-built_in">require</span>.extensions
|
||||
<span class="hljs-keyword">for</span> ext <span class="hljs-keyword">in</span> CoffeeScript.FILE_EXTENSIONS
|
||||
<span class="hljs-built_in">require</span>.extensions[ext] = loadFile</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-4">§</a>
|
||||
</div>
|
||||
<p>Patch Node’s module loader to be able to handle multi-dot extensions.
|
||||
This is a horrible thing that should not be required.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> Module = <span class="hljs-built_in">require</span> <span class="hljs-string">'module'</span>
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">findExtension</span> = <span class="hljs-params">(filename)</span> -></span>
|
||||
extensions = path.basename(filename).split <span class="hljs-string">'.'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-5">§</a>
|
||||
</div>
|
||||
<p>Remove the initial dot from dotfiles.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> extensions.shift() <span class="hljs-keyword">if</span> extensions[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">''</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-6">§</a>
|
||||
</div>
|
||||
<p>Start with the longest possible extension and work our way shortwards.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">while</span> extensions.shift()
|
||||
curExtension = <span class="hljs-string">'.'</span> + extensions.join <span class="hljs-string">'.'</span>
|
||||
<span class="hljs-keyword">return</span> curExtension <span class="hljs-keyword">if</span> Module._extensions[curExtension]
|
||||
<span class="hljs-string">'.js'</span>
|
||||
|
||||
Module::load = <span class="hljs-function"><span class="hljs-params">(filename)</span> -></span>
|
||||
@filename = filename
|
||||
@paths = Module._nodeModulePaths path.dirname filename
|
||||
extension = findExtension filename
|
||||
Module._extensions[extension](this, filename)
|
||||
@loaded = <span class="hljs-literal">true</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-7">§</a>
|
||||
</div>
|
||||
<p>If we’re on Node, patch <code>child_process.fork</code> so that Coffee scripts are able
|
||||
to fork both CoffeeScript files, and JavaScript files, directly.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> child_process
|
||||
{fork} = child_process
|
||||
binary = <span class="hljs-built_in">require</span>.resolve <span class="hljs-string">'../../bin/coffee'</span>
|
||||
child_process.fork = <span class="hljs-function"><span class="hljs-params">(path, args, options)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> helpers.isCoffee path
|
||||
<span class="hljs-keyword">unless</span> <span class="hljs-built_in">Array</span>.isArray args
|
||||
options = args <span class="hljs-keyword">or</span> {}
|
||||
args = []
|
||||
args = [path].concat args
|
||||
path = binary
|
||||
fork path, args, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-8">§</a>
|
||||
</div>
|
||||
<p>Utility function to find the <code>options</code> object attached to the topmost module.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">getRootModule</span> = <span class="hljs-params">(module)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> module.parent <span class="hljs-keyword">then</span> getRootModule module.parent <span class="hljs-keyword">else</span> module</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
770
docs/v2/annotated-source/repl.html
Normal file
770
docs/v2/annotated-source/repl.html
Normal file
@@ -0,0 +1,770 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>repl.coffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>repl.coffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-1">§</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>fs = <span class="hljs-built_in">require</span> <span class="hljs-string">'fs'</span>
|
||||
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
|
||||
vm = <span class="hljs-built_in">require</span> <span class="hljs-string">'vm'</span>
|
||||
nodeREPL = <span class="hljs-built_in">require</span> <span class="hljs-string">'repl'</span>
|
||||
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./'</span>
|
||||
{merge, updateSyntaxError} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
|
||||
|
||||
sawSIGINT = <span class="hljs-literal">no</span>
|
||||
transpile = <span class="hljs-literal">no</span>
|
||||
|
||||
replDefaults =
|
||||
prompt: <span class="hljs-string">'coffee> '</span>,
|
||||
historyFile: <span class="hljs-keyword">do</span> ->
|
||||
historyPath = process.env.XDG_CACHE_HOME <span class="hljs-keyword">or</span> process.env.HOME
|
||||
path.join historyPath, <span class="hljs-string">'.coffee_history'</span> <span class="hljs-keyword">if</span> historyPath
|
||||
historyMaxInputSize: <span class="hljs-number">10240</span>
|
||||
eval: <span class="hljs-function"><span class="hljs-params">(input, context, filename, cb)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-2">§</a>
|
||||
</div>
|
||||
<p>XXX: multiline hack.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> input = input.replace <span class="hljs-regexp">/\uFF00/g</span>, <span class="hljs-string">'\n'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-3">§</a>
|
||||
</div>
|
||||
<p>Node’s REPL sends the input ending with a newline and then wrapped in
|
||||
parens. Unwrap all that.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> input = input.replace <span class="hljs-regexp">/^\(([\s\S]*)\n\)$/m</span>, <span class="hljs-string">'$1'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-4">§</a>
|
||||
</div>
|
||||
<p>Node’s REPL v6.9.1+ sends the input wrapped in a try/catch statement.
|
||||
Unwrap that too.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> input = input.replace <span class="hljs-regexp">/^\s*try\s*{([\s\S]*)}\s*catch.*$/m</span>, <span class="hljs-string">'$1'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-5">§</a>
|
||||
</div>
|
||||
<p>Require AST nodes to do some AST manipulation.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> {Block, Assign, Value, Literal, Call, Code, Root} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./nodes'</span>
|
||||
|
||||
<span class="hljs-keyword">try</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-6">§</a>
|
||||
</div>
|
||||
<p>Tokenize the clean input.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> tokens = CoffeeScript.tokens input</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-7">§</a>
|
||||
</div>
|
||||
<p>Filter out tokens generated just to hold comments.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> tokens.length >= <span class="hljs-number">2</span> <span class="hljs-keyword">and</span> tokens[<span class="hljs-number">0</span>].generated <span class="hljs-keyword">and</span>
|
||||
tokens[<span class="hljs-number">0</span>].comments?.length <span class="hljs-keyword">isnt</span> <span class="hljs-number">0</span> <span class="hljs-keyword">and</span> <span class="hljs-string">"<span class="hljs-subst">#{tokens[<span class="hljs-number">0</span>][<span class="hljs-number">1</span>]}</span>"</span> <span class="hljs-keyword">is</span> <span class="hljs-string">''</span> <span class="hljs-keyword">and</span>
|
||||
tokens[<span class="hljs-number">1</span>][<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'TERMINATOR'</span>
|
||||
tokens = tokens[<span class="hljs-number">2.</span>..]
|
||||
<span class="hljs-keyword">if</span> tokens.length >= <span class="hljs-number">1</span> <span class="hljs-keyword">and</span> tokens[tokens.length - <span class="hljs-number">1</span>].generated <span class="hljs-keyword">and</span>
|
||||
tokens[tokens.length - <span class="hljs-number">1</span>].comments?.length <span class="hljs-keyword">isnt</span> <span class="hljs-number">0</span> <span class="hljs-keyword">and</span> <span class="hljs-string">"<span class="hljs-subst">#{tokens[tokens.length - <span class="hljs-number">1</span>][<span class="hljs-number">1</span>]}</span>"</span> <span class="hljs-keyword">is</span> <span class="hljs-string">''</span>
|
||||
tokens.pop()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-8">§</a>
|
||||
</div>
|
||||
<p>Collect referenced variable names just like in <code>CoffeeScript.compile</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> referencedVars = (token[<span class="hljs-number">1</span>] <span class="hljs-keyword">for</span> token <span class="hljs-keyword">in</span> tokens <span class="hljs-keyword">when</span> token[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'IDENTIFIER'</span>)</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-9">§</a>
|
||||
</div>
|
||||
<p>Generate the AST of the tokens.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> ast = CoffeeScript.nodes(tokens).body</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-10">§</a>
|
||||
</div>
|
||||
<p>Add assignment to <code>__</code> variable to force the input to be an expression.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> ast = <span class="hljs-keyword">new</span> Block [<span class="hljs-keyword">new</span> Assign (<span class="hljs-keyword">new</span> Value <span class="hljs-keyword">new</span> Literal <span class="hljs-string">'__'</span>), ast, <span class="hljs-string">'='</span>]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-11">§</a>
|
||||
</div>
|
||||
<p>Wrap the expression in a closure to support top-level <code>await</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> ast = <span class="hljs-keyword">new</span> Code [], ast
|
||||
isAsync = ast.isAsync</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-12">§</a>
|
||||
</div>
|
||||
<p>Invoke the wrapping closure.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> ast = <span class="hljs-keyword">new</span> Root <span class="hljs-keyword">new</span> Block [<span class="hljs-keyword">new</span> Call ast]
|
||||
js = ast.compile {bare: <span class="hljs-literal">yes</span>, locals: <span class="hljs-built_in">Object</span>.keys(context), referencedVars, sharedScope: <span class="hljs-literal">yes</span>}
|
||||
<span class="hljs-keyword">if</span> transpile
|
||||
js = transpile.transpile(js, transpile.options).code</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-13">§</a>
|
||||
</div>
|
||||
<p>Strip <code>"use strict"</code>, to avoid an exception on assigning to
|
||||
undeclared variable <code>__</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> js = js.replace <span class="hljs-regexp">/^"use strict"|^'use strict'/</span>, <span class="hljs-string">''</span>
|
||||
result = runInContext js, context, filename</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-14">§</a>
|
||||
</div>
|
||||
<p>Await an async result, if necessary.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> isAsync
|
||||
result.<span class="hljs-keyword">then</span> (resolvedResult) ->
|
||||
cb <span class="hljs-literal">null</span>, resolvedResult <span class="hljs-keyword">unless</span> sawSIGINT
|
||||
sawSIGINT = <span class="hljs-literal">no</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
cb <span class="hljs-literal">null</span>, result
|
||||
<span class="hljs-keyword">catch</span> err</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-15">§</a>
|
||||
</div>
|
||||
<p>AST’s <code>compile</code> does not add source code information to syntax errors.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> updateSyntaxError err, input
|
||||
cb err
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">runInContext</span> = <span class="hljs-params">(js, context, filename)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> context <span class="hljs-keyword">is</span> global
|
||||
vm.runInThisContext js, filename
|
||||
<span class="hljs-keyword">else</span>
|
||||
vm.runInContext js, context, filename
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">addMultilineHandler</span> = <span class="hljs-params">(repl)</span> -></span>
|
||||
{inputStream, outputStream} = repl</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-16">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-16">§</a>
|
||||
</div>
|
||||
<p>Node 0.11.12 changed API, prompt is now _prompt.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> origPrompt = repl._prompt ? repl.prompt
|
||||
|
||||
multiline =
|
||||
enabled: <span class="hljs-literal">off</span>
|
||||
initialPrompt: origPrompt.replace <span class="hljs-regexp">/^[^> ]*/</span>, <span class="hljs-function"><span class="hljs-params">(x)</span> -></span> x.replace <span class="hljs-regexp">/./g</span>, <span class="hljs-string">'-'</span>
|
||||
prompt: origPrompt.replace <span class="hljs-regexp">/^[^> ]*>?/</span>, <span class="hljs-function"><span class="hljs-params">(x)</span> -></span> x.replace <span class="hljs-regexp">/./g</span>, <span class="hljs-string">'.'</span>
|
||||
buffer: <span class="hljs-string">''</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-17">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-17">§</a>
|
||||
</div>
|
||||
<p>Proxy node’s line listener</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> nodeLineListener = repl.listeners(<span class="hljs-string">'line'</span>)[<span class="hljs-number">0</span>]
|
||||
repl.removeListener <span class="hljs-string">'line'</span>, nodeLineListener
|
||||
repl.<span class="hljs-literal">on</span> <span class="hljs-string">'line'</span>, <span class="hljs-function"><span class="hljs-params">(cmd)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> multiline.enabled
|
||||
multiline.buffer += <span class="hljs-string">"<span class="hljs-subst">#{cmd}</span>\n"</span>
|
||||
repl.setPrompt multiline.prompt
|
||||
repl.prompt <span class="hljs-literal">true</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
repl.setPrompt origPrompt
|
||||
nodeLineListener cmd
|
||||
<span class="hljs-keyword">return</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-18">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-18">§</a>
|
||||
</div>
|
||||
<p>Handle Ctrl-v</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> inputStream.<span class="hljs-literal">on</span> <span class="hljs-string">'keypress'</span>, <span class="hljs-function"><span class="hljs-params">(char, key)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">unless</span> key <span class="hljs-keyword">and</span> key.ctrl <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> key.meta <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> key.shift <span class="hljs-keyword">and</span> key.name <span class="hljs-keyword">is</span> <span class="hljs-string">'v'</span>
|
||||
<span class="hljs-keyword">if</span> multiline.enabled</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-19">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-19">§</a>
|
||||
</div>
|
||||
<p>allow arbitrarily switching between modes any time before multiple lines are entered</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">unless</span> multiline.buffer.match <span class="hljs-regexp">/\n/</span>
|
||||
multiline.enabled = <span class="hljs-keyword">not</span> multiline.enabled
|
||||
repl.setPrompt origPrompt
|
||||
repl.prompt <span class="hljs-literal">true</span>
|
||||
<span class="hljs-keyword">return</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-20">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-20">§</a>
|
||||
</div>
|
||||
<p>no-op unless the current line is empty</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> repl.line? <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> repl.line.match <span class="hljs-regexp">/^\s*$/</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-21">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-21">§</a>
|
||||
</div>
|
||||
<p>eval, print, loop</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> multiline.enabled = <span class="hljs-keyword">not</span> multiline.enabled
|
||||
repl.line = <span class="hljs-string">''</span>
|
||||
repl.cursor = <span class="hljs-number">0</span>
|
||||
repl.output.cursorTo <span class="hljs-number">0</span>
|
||||
repl.output.clearLine <span class="hljs-number">1</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-22">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-22">§</a>
|
||||
</div>
|
||||
<p>XXX: multiline hack</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> multiline.buffer = multiline.buffer.replace <span class="hljs-regexp">/\n/g</span>, <span class="hljs-string">'\uFF00'</span>
|
||||
repl.emit <span class="hljs-string">'line'</span>, multiline.buffer
|
||||
multiline.buffer = <span class="hljs-string">''</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
multiline.enabled = <span class="hljs-keyword">not</span> multiline.enabled
|
||||
repl.setPrompt multiline.initialPrompt
|
||||
repl.prompt <span class="hljs-literal">true</span>
|
||||
<span class="hljs-keyword">return</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-23">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-23">§</a>
|
||||
</div>
|
||||
<p>Store and load command history from a file</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-title">addHistory</span> = <span class="hljs-params">(repl, filename, maxSize)</span> -></span>
|
||||
lastLine = <span class="hljs-literal">null</span>
|
||||
<span class="hljs-keyword">try</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-24">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-24">§</a>
|
||||
</div>
|
||||
<p>Get file info and at most maxSize of command history</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> stat = fs.statSync filename
|
||||
size = <span class="hljs-built_in">Math</span>.min maxSize, stat.size</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-25">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-25">§</a>
|
||||
</div>
|
||||
<p>Read last <code>size</code> bytes from the file</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> readFd = fs.openSync filename, <span class="hljs-string">'r'</span>
|
||||
buffer = Buffer.alloc size
|
||||
fs.readSync readFd, buffer, <span class="hljs-number">0</span>, size, stat.size - size
|
||||
fs.closeSync readFd</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-26">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-26">§</a>
|
||||
</div>
|
||||
<p>Set the history on the interpreter</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> repl.history = buffer.toString().split(<span class="hljs-string">'\n'</span>).reverse()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-27">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-27">§</a>
|
||||
</div>
|
||||
<p>If the history file was truncated we should pop off a potential partial line</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> repl.history.pop() <span class="hljs-keyword">if</span> stat.size > maxSize</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-28">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-28">§</a>
|
||||
</div>
|
||||
<p>Shift off the final blank newline</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> repl.history.shift() <span class="hljs-keyword">if</span> repl.history[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">''</span>
|
||||
repl.historyIndex = <span class="hljs-number">-1</span>
|
||||
lastLine = repl.history[<span class="hljs-number">0</span>]
|
||||
|
||||
fd = fs.openSync filename, <span class="hljs-string">'a'</span>
|
||||
|
||||
repl.addListener <span class="hljs-string">'line'</span>, <span class="hljs-function"><span class="hljs-params">(code)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> code <span class="hljs-keyword">and</span> code.length <span class="hljs-keyword">and</span> code <span class="hljs-keyword">isnt</span> <span class="hljs-string">'.history'</span> <span class="hljs-keyword">and</span> code <span class="hljs-keyword">isnt</span> <span class="hljs-string">'.exit'</span> <span class="hljs-keyword">and</span> lastLine <span class="hljs-keyword">isnt</span> code</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-29">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-29">§</a>
|
||||
</div>
|
||||
<p>Save the latest command in the file</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> fs.writeSync fd, <span class="hljs-string">"<span class="hljs-subst">#{code}</span>\n"</span>
|
||||
lastLine = code</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-30">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-30">§</a>
|
||||
</div>
|
||||
<p>XXX: The SIGINT event from REPLServer is undocumented, so this is a bit fragile</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> repl.<span class="hljs-literal">on</span> <span class="hljs-string">'SIGINT'</span>, <span class="hljs-function">-></span> sawSIGINT = <span class="hljs-literal">yes</span>
|
||||
repl.<span class="hljs-literal">on</span> <span class="hljs-string">'exit'</span>, <span class="hljs-function">-></span> fs.closeSync fd</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-31">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-31">§</a>
|
||||
</div>
|
||||
<p>Add a command to show the history stack</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> repl.commands[getCommandId(repl, <span class="hljs-string">'history'</span>)] =
|
||||
help: <span class="hljs-string">'Show command history'</span>
|
||||
action: <span class="hljs-function">-></span>
|
||||
repl.outputStream.write <span class="hljs-string">"<span class="hljs-subst">#{repl.history[..].reverse().join <span class="hljs-string">'\n'</span>}</span>\n"</span>
|
||||
repl.displayPrompt()
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">getCommandId</span> = <span class="hljs-params">(repl, commandName)</span> -></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-32">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-32">§</a>
|
||||
</div>
|
||||
<p>Node 0.11 changed API, a command such as ‘.help’ is now stored as ‘help’</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> commandsHaveLeadingDot = repl.commands[<span class="hljs-string">'.help'</span>]?
|
||||
<span class="hljs-keyword">if</span> commandsHaveLeadingDot <span class="hljs-keyword">then</span> <span class="hljs-string">".<span class="hljs-subst">#{commandName}</span>"</span> <span class="hljs-keyword">else</span> commandName
|
||||
|
||||
module.<span class="hljs-built_in">exports</span> =
|
||||
start: <span class="hljs-function"><span class="hljs-params">(opts = {})</span> -></span>
|
||||
[major, minor, build] = process.versions.node.split(<span class="hljs-string">'.'</span>).map (n) -> <span class="hljs-built_in">parseInt</span>(n, <span class="hljs-number">10</span>)
|
||||
|
||||
<span class="hljs-keyword">if</span> major < <span class="hljs-number">6</span>
|
||||
console.warn <span class="hljs-string">"Node 6+ required for CoffeeScript REPL"</span>
|
||||
process.exit <span class="hljs-number">1</span>
|
||||
|
||||
CoffeeScript.register()
|
||||
process.argv = [<span class="hljs-string">'coffee'</span>].concat process.argv[<span class="hljs-number">2.</span>.]
|
||||
<span class="hljs-keyword">if</span> opts.transpile
|
||||
transpile = {}
|
||||
<span class="hljs-keyword">try</span>
|
||||
transpile.transpile = <span class="hljs-built_in">require</span>(<span class="hljs-string">'@babel/core'</span>).transform
|
||||
<span class="hljs-keyword">catch</span>
|
||||
<span class="hljs-keyword">try</span>
|
||||
transpile.transpile = <span class="hljs-built_in">require</span>(<span class="hljs-string">'babel-core'</span>).transform
|
||||
<span class="hljs-keyword">catch</span>
|
||||
console.error <span class="hljs-string">'''
|
||||
To use --transpile with an interactive REPL, @babel/core must be installed either in the current folder or globally:
|
||||
npm install --save-dev @babel/core
|
||||
or
|
||||
npm install --global @babel/core
|
||||
And you must save options to configure Babel in one of the places it looks to find its options.
|
||||
See https://coffeescript.org/#transpilation
|
||||
'''</span>
|
||||
process.exit <span class="hljs-number">1</span>
|
||||
transpile.options =
|
||||
filename: path.resolve process.cwd(), <span class="hljs-string">'<repl>'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-33">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-33">§</a>
|
||||
</div>
|
||||
<p>Since the REPL compilation path is unique (in <code>eval</code> above), we need
|
||||
another way to get the <code>options</code> object attached to a module so that
|
||||
it knows later on whether it needs to be transpiled. In the case of
|
||||
the REPL, the only applicable option is <code>transpile</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> Module = <span class="hljs-built_in">require</span> <span class="hljs-string">'module'</span>
|
||||
originalModuleLoad = Module::load
|
||||
Module::load = <span class="hljs-function"><span class="hljs-params">(filename)</span> -></span>
|
||||
@options = transpile: transpile.options
|
||||
originalModuleLoad.call @, filename
|
||||
opts = merge replDefaults, opts
|
||||
repl = nodeREPL.start opts
|
||||
runInContext opts.prelude, repl.context, <span class="hljs-string">'prelude'</span> <span class="hljs-keyword">if</span> opts.prelude
|
||||
repl.<span class="hljs-literal">on</span> <span class="hljs-string">'exit'</span>, <span class="hljs-function">-></span> repl.outputStream.write <span class="hljs-string">'\n'</span> <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> repl.closed
|
||||
addMultilineHandler repl
|
||||
addHistory repl, opts.historyFile, opts.historyMaxInputSize <span class="hljs-keyword">if</span> opts.historyFile</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-34">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-34">§</a>
|
||||
</div>
|
||||
<p>Adapt help inherited from the node REPL</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> repl.commands[getCommandId(repl, <span class="hljs-string">'load'</span>)].help = <span class="hljs-string">'Load code from a file into this REPL session'</span>
|
||||
repl</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
1884
docs/v2/annotated-source/rewriter.html
Normal file
1884
docs/v2/annotated-source/rewriter.html
Normal file
File diff suppressed because it is too large
Load Diff
400
docs/v2/annotated-source/scope.html
Normal file
400
docs/v2/annotated-source/scope.html
Normal file
@@ -0,0 +1,400 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>scope.litcoffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>scope.litcoffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-1">§</a>
|
||||
</div>
|
||||
<p>The <strong>Scope</strong> class regulates lexical scoping within CoffeeScript. As you
|
||||
generate code, you create a tree of scopes in the same shape as the nested
|
||||
function bodies. Each scope knows about the variables declared within it,
|
||||
and has a reference to its parent enclosing scope. In this way, we know which
|
||||
variables are new and need to be declared with <code>var</code>, and which are shared
|
||||
with external scopes.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.Scope = <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Scope</span></span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-2">§</a>
|
||||
</div>
|
||||
<p>Initialize a scope with its parent, for lookups up the chain,
|
||||
as well as a reference to the <strong>Block</strong> node it belongs to, which is
|
||||
where it should declare its variables, a reference to the function that
|
||||
it belongs to, and a list of variables referenced in the source code
|
||||
and therefore should be avoided when generating variables. Also track comments
|
||||
that should be output as part of variable declarations.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> constructor: <span class="hljs-function"><span class="hljs-params">(@parent, @expressions, @method, @referencedVars)</span> -></span>
|
||||
@variables = [{name: <span class="hljs-string">'arguments'</span>, type: <span class="hljs-string">'arguments'</span>}]
|
||||
@comments = {}
|
||||
@positions = {}
|
||||
@utilities = {} <span class="hljs-keyword">unless</span> @parent</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-3">§</a>
|
||||
</div>
|
||||
<p>The <code>@root</code> is the top-level <strong>Scope</strong> object for a given file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> @root = @parent?.root ? this</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-4">§</a>
|
||||
</div>
|
||||
<p>Adds a new variable or overrides an existing one.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> add: <span class="hljs-function"><span class="hljs-params">(name, type, immediate)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> @parent.add name, type, immediate <span class="hljs-keyword">if</span> @shared <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> immediate
|
||||
<span class="hljs-keyword">if</span> Object::hasOwnProperty.call @positions, name
|
||||
@variables[@positions[name]].type = type
|
||||
<span class="hljs-keyword">else</span>
|
||||
@positions[name] = @variables.push({name, type}) - <span class="hljs-number">1</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-5">§</a>
|
||||
</div>
|
||||
<p>When <code>super</code> is called, we need to find the name of the current method we’re
|
||||
in, so that we know how to invoke the same method of the parent class. This
|
||||
can get complicated if super is being called from an inner function.
|
||||
<code>namedMethod</code> will walk up the scope tree until it either finds the first
|
||||
function object that has a name filled in, or bottoms out.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> namedMethod: <span class="hljs-function">-></span>
|
||||
<span class="hljs-keyword">return</span> @method <span class="hljs-keyword">if</span> @method?.name <span class="hljs-keyword">or</span> !@parent
|
||||
@parent.namedMethod()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-6">§</a>
|
||||
</div>
|
||||
<p>Look up a variable name in lexical scope, and declare it if it does not
|
||||
already exist.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> find: <span class="hljs-function"><span class="hljs-params">(name, type = <span class="hljs-string">'var'</span>)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-literal">yes</span> <span class="hljs-keyword">if</span> @check name
|
||||
@add name, type
|
||||
<span class="hljs-literal">no</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-7">§</a>
|
||||
</div>
|
||||
<p>Reserve a variable name as originating from a function parameter for this
|
||||
scope. No <code>var</code> required for internal references.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> parameter: <span class="hljs-function"><span class="hljs-params">(name)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> @shared <span class="hljs-keyword">and</span> @parent.check name, <span class="hljs-literal">yes</span>
|
||||
@add name, <span class="hljs-string">'param'</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-8">§</a>
|
||||
</div>
|
||||
<p>Just check to see if a variable has already been declared, without reserving,
|
||||
walks up to the root scope.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> check: <span class="hljs-function"><span class="hljs-params">(name)</span> -></span>
|
||||
!!(@type(name) <span class="hljs-keyword">or</span> @parent?.check(name))</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-9">§</a>
|
||||
</div>
|
||||
<p>Generate a temporary variable name at the given index.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> temporary: <span class="hljs-function"><span class="hljs-params">(name, index, single=<span class="hljs-literal">false</span>)</span> -></span>
|
||||
<span class="hljs-keyword">if</span> single
|
||||
startCode = name.charCodeAt(<span class="hljs-number">0</span>)
|
||||
endCode = <span class="hljs-string">'z'</span>.charCodeAt(<span class="hljs-number">0</span>)
|
||||
diff = endCode - startCode
|
||||
newCode = startCode + index % (diff + <span class="hljs-number">1</span>)
|
||||
letter = <span class="hljs-built_in">String</span>.fromCharCode(newCode)
|
||||
num = index <span class="hljs-regexp">//</span> (diff + <span class="hljs-number">1</span>)
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{letter}</span><span class="hljs-subst">#{num <span class="hljs-keyword">or</span> <span class="hljs-string">''</span>}</span>"</span>
|
||||
<span class="hljs-keyword">else</span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{name}</span><span class="hljs-subst">#{index <span class="hljs-keyword">or</span> <span class="hljs-string">''</span>}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-10">§</a>
|
||||
</div>
|
||||
<p>Gets the type of a variable.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> type: <span class="hljs-function"><span class="hljs-params">(name)</span> -></span>
|
||||
<span class="hljs-keyword">return</span> v.type <span class="hljs-keyword">for</span> v <span class="hljs-keyword">in</span> @variables <span class="hljs-keyword">when</span> v.name <span class="hljs-keyword">is</span> name
|
||||
<span class="hljs-literal">null</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-11">§</a>
|
||||
</div>
|
||||
<p>If we need to store an intermediate result, find an available name for a
|
||||
compiler-generated variable. <code>_var</code>, <code>_var2</code>, and so on…</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> freeVariable: <span class="hljs-function"><span class="hljs-params">(name, options={})</span> -></span>
|
||||
index = <span class="hljs-number">0</span>
|
||||
<span class="hljs-keyword">loop</span>
|
||||
temp = @temporary name, index, options.single
|
||||
<span class="hljs-keyword">break</span> <span class="hljs-keyword">unless</span> @check(temp) <span class="hljs-keyword">or</span> temp <span class="hljs-keyword">in</span> @root.referencedVars
|
||||
index++
|
||||
@add temp, <span class="hljs-string">'var'</span>, <span class="hljs-literal">yes</span> <span class="hljs-keyword">if</span> options.reserve ? <span class="hljs-literal">true</span>
|
||||
temp</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-12">§</a>
|
||||
</div>
|
||||
<p>Ensure that an assignment is made at the top of this scope
|
||||
(or at the top-level scope, if requested).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> assign: <span class="hljs-function"><span class="hljs-params">(name, value)</span> -></span>
|
||||
@add name, {value, assigned: <span class="hljs-literal">yes</span>}, <span class="hljs-literal">yes</span>
|
||||
@hasAssignments = <span class="hljs-literal">yes</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-13">§</a>
|
||||
</div>
|
||||
<p>Does this scope have any declared variables?</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> hasDeclarations: <span class="hljs-function">-></span>
|
||||
!!@declaredVariables().length</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-14">§</a>
|
||||
</div>
|
||||
<p>Return the list of variables first declared in this scope.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> declaredVariables: <span class="hljs-function">-></span>
|
||||
(v.name <span class="hljs-keyword">for</span> v <span class="hljs-keyword">in</span> @variables <span class="hljs-keyword">when</span> v.type <span class="hljs-keyword">is</span> <span class="hljs-string">'var'</span>).sort()</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-15">§</a>
|
||||
</div>
|
||||
<p>Return the list of assignments that are supposed to be made at the top
|
||||
of this scope.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> assignedVariables: <span class="hljs-function">-></span>
|
||||
<span class="hljs-string">"<span class="hljs-subst">#{v.name}</span> = <span class="hljs-subst">#{v.type.value}</span>"</span> <span class="hljs-keyword">for</span> v <span class="hljs-keyword">in</span> @variables <span class="hljs-keyword">when</span> v.type.assigned</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
530
docs/v2/annotated-source/sourcemap.html
Normal file
530
docs/v2/annotated-source/sourcemap.html
Normal file
@@ -0,0 +1,530 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>sourcemap.litcoffee</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
||||
<link rel="stylesheet" media="all" href="docco.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
<ul id="jump_to">
|
||||
<li>
|
||||
<a class="large" href="javascript:void(0);">Jump To …</a>
|
||||
<a class="small" href="javascript:void(0);">+</a>
|
||||
<div id="jump_wrapper">
|
||||
<div id="jump_page_wrapper">
|
||||
<div id="jump_page">
|
||||
|
||||
|
||||
<a class="source" href="browser.html">
|
||||
browser.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="cake.html">
|
||||
cake.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="coffeescript.html">
|
||||
coffeescript.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="command.html">
|
||||
command.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="grammar.html">
|
||||
grammar.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="helpers.html">
|
||||
helpers.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="index.html">
|
||||
index.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="lexer.html">
|
||||
lexer.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="nodes.html">
|
||||
nodes.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="optparse.html">
|
||||
optparse.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="register.html">
|
||||
register.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="repl.html">
|
||||
repl.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="rewriter.html">
|
||||
rewriter.coffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="scope.html">
|
||||
scope.litcoffee
|
||||
</a>
|
||||
|
||||
|
||||
<a class="source" href="sourcemap.html">
|
||||
sourcemap.litcoffee
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
<li id="title">
|
||||
<div class="annotation">
|
||||
<h1>sourcemap.litcoffee</h1>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-1">§</a>
|
||||
</div>
|
||||
<p>Source maps allow JavaScript runtimes to match running JavaScript back to
|
||||
the original source code that corresponds to it. This can be minified
|
||||
JavaScript, but in our case, we’re concerned with mapping pretty-printed
|
||||
JavaScript back to CoffeeScript.</p>
|
||||
<p>In order to produce maps, we must keep track of positions (line number, column number)
|
||||
that originated every node in the syntax tree, and be able to generate a
|
||||
<a href="https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit">map file</a>
|
||||
— which is a compact, VLQ-encoded representation of the JSON serialization
|
||||
of this information — to write out alongside the generated JavaScript.</p>
|
||||
<h2 id="linemap">LineMap</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-2">§</a>
|
||||
</div>
|
||||
<p>A <strong>LineMap</strong> object keeps track of information about original line and column
|
||||
positions for a single line of output JavaScript code.
|
||||
<strong>SourceMaps</strong> are implemented in terms of <strong>LineMaps</strong>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">LineMap</span></span>
|
||||
constructor: <span class="hljs-function"><span class="hljs-params">(@line)</span> -></span>
|
||||
@columns = []
|
||||
|
||||
add: <span class="hljs-function"><span class="hljs-params">(column, [sourceLine, sourceColumn], options={})</span> -></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> @columns[column] <span class="hljs-keyword">and</span> options.noReplace
|
||||
@columns[column] = {line: @line, column, sourceLine, sourceColumn}
|
||||
|
||||
sourceLocation: <span class="hljs-function"><span class="hljs-params">(column)</span> -></span>
|
||||
column-- <span class="hljs-keyword">until</span> (mapping = @columns[column]) <span class="hljs-keyword">or</span> (column <= <span class="hljs-number">0</span>)
|
||||
mapping <span class="hljs-keyword">and</span> [mapping.sourceLine, mapping.sourceColumn]</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-3">§</a>
|
||||
</div>
|
||||
<h2 id="sourcemap">SourceMap</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-4">§</a>
|
||||
</div>
|
||||
<p>Maps locations in a single generated JavaScript file back to locations in
|
||||
the original CoffeeScript source file.</p>
|
||||
<p>This is intentionally agnostic towards how a source map might be represented on
|
||||
disk. Once the compiler is ready to produce a “v3”-style source map, we can walk
|
||||
through the arrays of line and column buffer to produce it.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SourceMap</span></span>
|
||||
constructor: <span class="hljs-function">-></span>
|
||||
@lines = []</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-5">§</a>
|
||||
</div>
|
||||
<p>Adds a mapping to this SourceMap. <code>sourceLocation</code> and <code>generatedLocation</code>
|
||||
are both <code>[line, column]</code> arrays. If <code>options.noReplace</code> is true, then if there
|
||||
is already a mapping for the specified <code>line</code> and <code>column</code>, this will have no
|
||||
effect.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> add: <span class="hljs-function"><span class="hljs-params">(sourceLocation, generatedLocation, options = {})</span> -></span>
|
||||
[line, column] = generatedLocation
|
||||
lineMap = (@lines[line] <span class="hljs-keyword">or</span>= <span class="hljs-keyword">new</span> LineMap(line))
|
||||
lineMap.add column, sourceLocation, options</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-6">§</a>
|
||||
</div>
|
||||
<p>Look up the original position of a given <code>line</code> and <code>column</code> in the generated
|
||||
code.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> sourceLocation: <span class="hljs-function"><span class="hljs-params">([line, column])</span> -></span>
|
||||
line-- <span class="hljs-keyword">until</span> (lineMap = @lines[line]) <span class="hljs-keyword">or</span> (line <= <span class="hljs-number">0</span>)
|
||||
lineMap <span class="hljs-keyword">and</span> lineMap.sourceLocation column</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-7">§</a>
|
||||
</div>
|
||||
<h2 id="v3-sourcemap-generation">V3 SourceMap Generation</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-8">§</a>
|
||||
</div>
|
||||
<p>Builds up a V3 source map, returning the generated JSON as a string.
|
||||
<code>options.sourceRoot</code> may be used to specify the sourceRoot written to the source
|
||||
map. Also, <code>options.sourceFiles</code> and <code>options.generatedFile</code> may be passed to
|
||||
set “sources” and “file”, respectively.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> generate: <span class="hljs-function"><span class="hljs-params">(options = {}, code = <span class="hljs-literal">null</span>)</span> -></span>
|
||||
writingline = <span class="hljs-number">0</span>
|
||||
lastColumn = <span class="hljs-number">0</span>
|
||||
lastSourceLine = <span class="hljs-number">0</span>
|
||||
lastSourceColumn = <span class="hljs-number">0</span>
|
||||
needComma = <span class="hljs-literal">no</span>
|
||||
buffer = <span class="hljs-string">""</span>
|
||||
|
||||
<span class="hljs-keyword">for</span> lineMap, lineNumber <span class="hljs-keyword">in</span> @lines <span class="hljs-keyword">when</span> lineMap
|
||||
<span class="hljs-keyword">for</span> mapping <span class="hljs-keyword">in</span> lineMap.columns <span class="hljs-keyword">when</span> mapping
|
||||
<span class="hljs-keyword">while</span> writingline < mapping.line
|
||||
lastColumn = <span class="hljs-number">0</span>
|
||||
needComma = <span class="hljs-literal">no</span>
|
||||
buffer += <span class="hljs-string">";"</span>
|
||||
writingline++</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-9">§</a>
|
||||
</div>
|
||||
<p>Write a comma if we’ve already written a segment on this line.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> needComma
|
||||
buffer += <span class="hljs-string">","</span>
|
||||
needComma = <span class="hljs-literal">no</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-10">§</a>
|
||||
</div>
|
||||
<p>Write the next segment. Segments can be 1, 4, or 5 values. If just one, then it
|
||||
is a generated column which doesn’t match anything in the source code.</p>
|
||||
<p>The starting column in the generated source, relative to any previous recorded
|
||||
column for the current line:</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> buffer += @encodeVlq mapping.column - lastColumn
|
||||
lastColumn = mapping.column</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-11">§</a>
|
||||
</div>
|
||||
<p>The index into the list of sources:</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> buffer += @encodeVlq <span class="hljs-number">0</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-12">§</a>
|
||||
</div>
|
||||
<p>The starting line in the original source, relative to the previous source line.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> buffer += @encodeVlq mapping.sourceLine - lastSourceLine
|
||||
lastSourceLine = mapping.sourceLine</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-13">§</a>
|
||||
</div>
|
||||
<p>The starting column in the original source, relative to the previous column.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> buffer += @encodeVlq mapping.sourceColumn - lastSourceColumn
|
||||
lastSourceColumn = mapping.sourceColumn
|
||||
needComma = <span class="hljs-literal">yes</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-14">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-14">§</a>
|
||||
</div>
|
||||
<p>Produce the canonical JSON object format for a “v3” source map.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> sources = <span class="hljs-keyword">if</span> options.sourceFiles
|
||||
options.sourceFiles
|
||||
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> options.filename
|
||||
[options.filename]
|
||||
<span class="hljs-keyword">else</span>
|
||||
[<span class="hljs-string">'<anonymous>'</span>]
|
||||
|
||||
v3 =
|
||||
version: <span class="hljs-number">3</span>
|
||||
file: options.generatedFile <span class="hljs-keyword">or</span> <span class="hljs-string">''</span>
|
||||
sourceRoot: options.sourceRoot <span class="hljs-keyword">or</span> <span class="hljs-string">''</span>
|
||||
sources: sources
|
||||
names: []
|
||||
mappings: buffer
|
||||
|
||||
v3.sourcesContent = [code] <span class="hljs-keyword">if</span> options.sourceMap <span class="hljs-keyword">or</span> options.inlineMap
|
||||
|
||||
v3</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-15">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-15">§</a>
|
||||
</div>
|
||||
<h2 id="base64-vlq-encoding">Base64 VLQ Encoding</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-16">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-16">§</a>
|
||||
</div>
|
||||
<p>Note that SourceMap VLQ encoding is “backwards”. MIDI-style VLQ encoding puts
|
||||
the most-significant-bit (MSB) from the original value into the MSB of the VLQ
|
||||
encoded value (see <a href="https://en.wikipedia.org/wiki/File:Uintvar_coding.svg">Wikipedia</a>).
|
||||
SourceMap VLQ does things the other way around, with the least significat four
|
||||
bits of the original value encoded into the first byte of the VLQ encoded value.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> VLQ_SHIFT = <span class="hljs-number">5</span>
|
||||
VLQ_CONTINUATION_BIT = <span class="hljs-number">1</span> << VLQ_SHIFT <span class="hljs-comment"># 0010 0000</span>
|
||||
VLQ_VALUE_MASK = VLQ_CONTINUATION_BIT - <span class="hljs-number">1</span> <span class="hljs-comment"># 0001 1111</span>
|
||||
|
||||
encodeVlq: <span class="hljs-function"><span class="hljs-params">(value)</span> -></span>
|
||||
answer = <span class="hljs-string">''</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-17">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-17">§</a>
|
||||
</div>
|
||||
<p>Least significant bit represents the sign.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> signBit = <span class="hljs-keyword">if</span> value < <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> <span class="hljs-number">1</span> <span class="hljs-keyword">else</span> <span class="hljs-number">0</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-18">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-18">§</a>
|
||||
</div>
|
||||
<p>The next bits are the actual value.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> valueToEncode = (<span class="hljs-built_in">Math</span>.abs(value) << <span class="hljs-number">1</span>) + signBit</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-19">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-19">§</a>
|
||||
</div>
|
||||
<p>Make sure we encode at least one character, even if valueToEncode is 0.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">while</span> valueToEncode <span class="hljs-keyword">or</span> <span class="hljs-keyword">not</span> answer
|
||||
nextChunk = valueToEncode & VLQ_VALUE_MASK
|
||||
valueToEncode = valueToEncode >> VLQ_SHIFT
|
||||
nextChunk |= VLQ_CONTINUATION_BIT <span class="hljs-keyword">if</span> valueToEncode
|
||||
answer += @encodeBase64 nextChunk
|
||||
|
||||
answer</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-20">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-20">§</a>
|
||||
</div>
|
||||
<h2 id="regular-base64-encoding">Regular Base64 Encoding</h2>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-21">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-21">§</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> BASE64_CHARS = <span class="hljs-string">'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'</span>
|
||||
|
||||
encodeBase64: <span class="hljs-function"><span class="hljs-params">(value)</span> -></span>
|
||||
BASE64_CHARS[value] <span class="hljs-keyword">or</span> <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span> <span class="hljs-string">"Cannot Base64 encode value: <span class="hljs-subst">#{value}</span>"</span></pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-22">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="sswrap ">
|
||||
<a class="ss" href="#section-22">§</a>
|
||||
</div>
|
||||
<p>Our API for source maps is just the <code>SourceMap</code> class.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre>module.<span class="hljs-built_in">exports</span> = SourceMap</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
351
docs/v2/announcing-coffeescript-2/index.html
Normal file
351
docs/v2/announcing-coffeescript-2/index.html
Normal file
@@ -0,0 +1,351 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
||||
<title>Announcing CoffeeScript 2</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="canonical" href="http://coffeescript.org" />
|
||||
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
|
||||
<link href="https://fonts.googleapis.com/css?family=Alegreya+Sans:400,800|Galada:400|Lato:300,300i,400,700|Roboto+Mono:400,400i" rel="stylesheet" crossorigin="anonymous">
|
||||
<style>
|
||||
body {
|
||||
/* Push below header bar */
|
||||
margin-top: 3.5rem;
|
||||
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 3"><path opacity=".02" fill="#000" d="M0 0h1v1H0z"/><path opacity=".005" fill="#000" d="M0 1h1v2H0z"/></svg>');
|
||||
background-size: 1px 3px;
|
||||
}
|
||||
|
||||
svg {
|
||||
width: auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #1b5e20;
|
||||
transition: 0.1s ease-in-out;
|
||||
}
|
||||
a:focus, a:hover, a:active {
|
||||
color: #388e3c;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
button:focus, .navbar-dark .navbar-toggler:focus {
|
||||
outline: none;
|
||||
border: thin solid rgba(248, 243, 240, 0.3);
|
||||
}
|
||||
|
||||
.bg-dark {
|
||||
background-color: #3e2723 !important;
|
||||
}
|
||||
|
||||
.bg-ribbed-light {
|
||||
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 3"><path opacity=".03" fill="#000" d="M0 0h1v1H0z"/><path opacity=".005" fill="#000" d="M0 1h1v2H0z"/></svg>');
|
||||
background-size: 1px 3px;
|
||||
}
|
||||
.bg-ribbed-dark {
|
||||
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 3"><path opacity=".2" fill="#000" d="M0 0h1v1H0z"/><path opacity=".15" fill="#000" d="M0 1h1v2H0z"/></svg>');
|
||||
background-size: 1px 3px;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Header
|
||||
*/
|
||||
.site-navbar {
|
||||
height: 3.5rem;
|
||||
font-family: 'Lato';
|
||||
font-weight: 400;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
height: 2.2em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.navbar-dark path {
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.navbar-nav .nav-item {
|
||||
margin-left: 0.6em;
|
||||
margin-right: 0.6em;
|
||||
border-radius: 0.4em;
|
||||
}
|
||||
.navbar-nav .nav-item:hover,
|
||||
.navbar-nav .nav-item:active,
|
||||
.navbar-nav .nav-item.show {
|
||||
background-color: #4e342e;
|
||||
}
|
||||
|
||||
.navbar-toggler {
|
||||
transition: all 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Main content
|
||||
*/
|
||||
|
||||
.main {
|
||||
padding: 1.3em;
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
.main {
|
||||
padding-right: 2em;
|
||||
padding-left: 2em;
|
||||
}
|
||||
}
|
||||
|
||||
h1 {
|
||||
font: 2.5em Galada;
|
||||
color: #2f2625;
|
||||
text-align: center;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
h1 {
|
||||
font-size: 3em;
|
||||
}
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
h1 {
|
||||
font-size: 4em;
|
||||
}
|
||||
}
|
||||
|
||||
.title-logo {
|
||||
display: inline-block;
|
||||
height: 1em;
|
||||
transform: translateY(0.2em);
|
||||
margin-left: 0.3em;
|
||||
margin-right: 0.25em;
|
||||
fill: #2f2625;
|
||||
}
|
||||
|
||||
.main p, .main li {
|
||||
font-family: Lato;
|
||||
font-weight: 300;
|
||||
font-size: 1.1em;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.main blockquote {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.main p, .main li {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
.main blockquote {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
}
|
||||
.main strong {
|
||||
font-weight: 700;
|
||||
}
|
||||
.main a {
|
||||
border-bottom: 2px solid transparent;
|
||||
font-weight: 400;
|
||||
}
|
||||
.main a:focus, .main a:hover, .main a:active {
|
||||
border-bottom: 2px solid rgba(56, 142, 60, 0.2);
|
||||
}
|
||||
.main blockquote pre {
|
||||
background-color: #f8f3f0;
|
||||
color: #2f2625;
|
||||
border-radius: .3em;
|
||||
padding: 0.4em 0.6em;
|
||||
}
|
||||
|
||||
p, blockquote, li {
|
||||
margin-bottom: 1.3rem;
|
||||
}
|
||||
.credits li {
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
h2, h3, h4 {
|
||||
margin-top: 1.3em;
|
||||
margin-bottom: 0.6em;
|
||||
font-family: 'Alegreya Sans';
|
||||
}
|
||||
h2 {
|
||||
font-weight: 800;
|
||||
}
|
||||
h3, h4, h2 time {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.main h2 {
|
||||
padding-top: 4rem;
|
||||
margin-top: -4rem;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: 'Roboto Mono';
|
||||
font-weight: 400;
|
||||
}
|
||||
code, a > code {
|
||||
background-color: #f8f3f0;
|
||||
padding: 0.2rem 0.4rem;
|
||||
}
|
||||
code {
|
||||
color: #2f2625;
|
||||
}
|
||||
|
||||
|
||||
.uneditable-code-block .comment {
|
||||
font-style: italic;
|
||||
color: #837B85;
|
||||
}
|
||||
.uneditable-code-block .class,
|
||||
.uneditable-code-block .function,
|
||||
.uneditable-code-block .keyword,
|
||||
.uneditable-code-block .reserved,
|
||||
.uneditable-code-block .title {
|
||||
color: #534328;
|
||||
}
|
||||
.uneditable-code-block .string
|
||||
.uneditable-code-block .value
|
||||
.uneditable-code-block .inheritance
|
||||
.uneditable-code-block .header {
|
||||
color: #3A4029;
|
||||
}
|
||||
.uneditable-code-block .variable,
|
||||
.uneditable-code-block .literal,
|
||||
.uneditable-code-block .tag,
|
||||
.uneditable-code-block .regexp,
|
||||
.uneditable-code-block .subst,
|
||||
.uneditable-code-block .property {
|
||||
color: #474429;
|
||||
}
|
||||
.uneditable-code-block .number,
|
||||
.uneditable-code-block .preprocessor,
|
||||
.uneditable-code-block .built_in,
|
||||
.uneditable-code-block .params,
|
||||
.uneditable-code-block .constant {
|
||||
color: #474429;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-lg fixed-top navbar-dark bg-dark bg-ribbed-dark site-navbar">
|
||||
<a class="navbar-brand" href="/" data-close="try"><svg xmlns="http://www.w3.org/2000/svg" viewBox="-22 347 566 100">
|
||||
<title>
|
||||
CoffeeScript Logo
|
||||
</title>
|
||||
<path d="M21.7 351.1c.1.6-.2 1.1-1.2 1.6-1.3-.7-4.1-1.1-6.4-.9-2.5.2-4.6 1-4.3 2.7.4 1.7 2.8 2.7 7.1 2.3 10.5-.9 10.4-8 25.8-9.4 12-1.1 18.7 2.6 19.6 7.1.7 3.5-2.2 6.9-10.9 7.6-7.7.7-12.2-1.4-12.6-3.5-.2-1.1.4-2.7 4.1-3.1.4 1.7 2.5 3.5 7.5 3 3.6-.3 6.6-1.6 6.2-3.6-.4-2.1-4.2-3.3-10.2-2.8-12.2 1.1-15.2 7.8-25.6 8.7-7.4.7-13.4-2-14.2-6-.3-1.5-.3-5 7.5-5.7 4-.3 7.2.4 7.6 2zm-39 41.8c-3.4 4.3-4.9 9.3-4.6 14.2.3 4.9 2.7 8.9 6.5 12 4 3.1 8.3 4 13.2 3.1 1.9-.3 4-1.3 5.9-1.9-4 0-7.4-1.3-10.8-4-3.7-2.7-6.2-6.5-6.8-11.1-.9-4.3 0-8.3 2.4-11.8 2.7-3.4 6.2-5.3 10.8-5.9 4.6-.3 8.6.9 12.6 3.7-.9-1.3-2.2-2.2-3.4-3.4-4-2.7-8.3-4-13.6-2.7-4.8 1-8.8 3.5-12.2 7.8zm53.6-23.1c-12.9 0-24.4-1.3-32.7-3.1-8.9-2.2-13.6-4.6-13.6-7.7 0-1.3.6-2.4 2.4-3.7-5.6 2.2-8.6 4-8.6 6.8.3 3.1 5.3 6.2 15.5 8.6 9.6 2.4 21.9 3.7 36.7 3.7 15.1 0 27.1-1.3 36.7-3.7 10.2-2.4 15.1-5.6 15.1-8.6 0-2.2-2.2-4.3-6.2-5.9.9.6 1.6 1.6 1.6 2.7 0 3.1-4.6 5.6-13.9 7.7-8.6 1.9-19.6 3.2-33 3.2zm36.8 8.6c-9.6 2.2-21.9 3.7-36.7 3.7-15.1 0-27.4-1.6-37-3.7-8.6-2.2-13.2-4.6-14.8-7.1 1.6 10.8 5.3 21 10.2 30 3.7 5.6 7.4 10.5 11.1 15.8 1.6 3.1 2.7 6.2 3.4 9.3 2.4 3.4 5.9 5.6 10.2 6.8 5.3 1.9 10.8 2.7 16.4 2.4h.6c5.6.3 11.5-.6 16.9-2.4 4-1.3 7.4-3.4 9.9-6.8h.3c.6-3.1 1.6-6.2 3.1-9.3 3.7-5.3 7.4-10.2 11.1-15.8 4.9-8.9 8.3-19.1 10.2-30-2 2.8-6.6 5.2-14.9 7.1zm106.2 30.1c-4.8 12.1-17.6 16.9-25.9 16.9-13.4 0-19.9-6-19.9-22.3 0-16.5 7.9-47.3 31.7-47.3 8.5 0 15.2 3.3 15.2 12.1 0 4.8-1.8 8.3-6.4 8.3-1.5 0-3.4-.4-5.2-2.4 2.2-1.1 4.2-4.9 4.2-8.3 0-2.9-1.5-5.6-5.6-5.6-10 0-18.9 23.9-18.9 42.4 0 8.3 2.2 14.2 10.9 14.2 7.1 0 13.5-3.4 17.7-9.1l2.2 1.1zm32.9-16.3c.4.2.7.2 1 .2 4.2 0 10.1-2.7 14-5.5l.8 2.4c-3.4 3.7-9.5 6.5-16.1 7.5-1.5 16.8-10.6 27.3-21.7 27.3-8.4 0-14.5-4-14.5-14.4 0-10.5 6.2-32.2 24.9-32.2 7.8.3 11.6 5.3 11.6 14.7zm-7.7 5c-1.9-.5-2.4-2-2.4-3.8 0-2.5 1.2-4.2 2.8-4.9-.2-3.8-1.1-5.3-3.4-5.3-6.5 0-12 16.6-12 25.6 0 6 1.2 7.3 4.6 7.3 4.2.1 8.9-8 10.4-18.9zm-6.6 39.7c0-8.3 7.1-11 15.8-13.6l10.9-51.9c2.7-13 10.6-15.5 16.5-15.5 4.1 0 8 2.2 9.7 5.7 3.6-4.6 8.4-5.7 12.4-5.7 5.6 0 10.8 3.9 10.8 9.8 0 1.5-.1 2.6-.3 3.7h-4.3c.1-.9.2-1.7.2-2.4 0-2.1-1.7-3.1-3.4-3.1-2 0-4.8 1.1-6.2 7.1l-1.7 7.4h9.1l-.8 3.6h-9l-10.3 49.1c-2.7 13-10.6 15.5-16.5 15.5-5.2 0-8.3-2.3-9.8-5.7-3.5 4.6-8.3 5.7-12.3 5.7-5.6.1-10.8-3.8-10.8-9.7zm9.1 1.8c1.9 0 4.2-1.8 5.4-7.1l1.1-5.3c-5.7 2-10.1 4.4-10.1 9.4 0 1.2 1.7 3 3.6 3zm21.7 0c1.9 0 4.2-1.8 5.4-7.1l2.2-10.4-9.4 1.8-1.8 8.3c-.5 2.1-1.1 4-1.8 5.6.9 1.3 3 1.8 5.4 1.8zm-1.4-18l9.4-1.7 7.7-36.8h-9l-8.1 38.5zm16.6-56.7c-2 0-4.8 1.1-6.2 7.1l-1.7 7.4h9l2.1-9.5c.2-.7.2-1.3.2-2 .1-2-1.5-3-3.4-3zm37.9 53c7.1 0 11.6-4 16.1-9.2h3.1c-5.2 8.3-12.9 16.8-25 16.8-8.5 0-14.2-4.2-14.2-14.5 0-10.5 5.9-32.3 24.6-32.3 8.1 0 10 4.2 10 8.7 0 10.5-10 18.5-20.9 19.2-.1 1.3-.2 2.5-.2 3.6 0 6.2 2.2 7.7 6.5 7.7zm5.3-34.4c-4.6 0-9.1 9.7-10.9 18.7 7-.5 13.2-7.4 13.2-15 0-2.2-.5-3.7-2.3-3.7zm28.6 33.4c3.4 0 7.8-2.3 10.8-4.8-2 10.4-8.4 13.4-15.8 13.4-8.4 0-14.1-4.2-14.1-14.5 0-10.5 5.9-32.3 24.6-32.3 8.1 0 10 4.2 10 8.7 0 10.6-10 18.5-20.9 19.2-.1.9-.2 2-.2 2.7 0 5.7 2.5 7.6 5.6 7.6zm6.2-33.4c-4.5 0-9.1 10.1-11 18.7 7.1-.4 13.3-7.3 13.3-15 0-2.2-.6-3.7-2.3-3.7zm51.3-6.7c-1.7 0-3-.6-4.2-1.9 2.4-1.5 4.1-4.8 4.1-7.8 0-3.1-1.8-6.1-6.8-6.1s-8.3 2.8-8.3 8.2c0 13.3 20.5 15.2 20.5 34.8 0 15.3-12.3 22.7-25.6 22.7-10.4 0-19.3-4.5-19.3-15.7 0-9.8 7-14.9 13.3-14.9 3.1 0 7.7 1.3 8 6-4.9 0-10.7 2.3-10.7 8.5 0 4.5 2.9 8.7 8.7 8.7 6.1 0 10.6-4.4 10.6-12 0-15.6-18.6-21.1-18.6-34.5 0-9.5 9.3-16.3 21-16.3 4.3 0 14.6.9 14.6 10.9.1 5.5-2.8 9.4-7.3 9.4zm36.2 10.3c0-2.3-.8-3.7-2.5-3.7-5.7 0-11.7 16.6-11.7 26.7 0 6.2 2.2 7.6 6.6 7.6 7.1 0 11.6-4 16.1-9.2h3.1c-5.2 8.3-12.9 16.8-25 16.8-8.5 0-14.2-4.2-14.2-14.5 0-10.6 6-32.3 24.5-32.3 8.1 0 10.1 4.2 10.1 8.3 0 4.4-2.2 6.7-4.8 6.7-1 0-2.1-.4-3.1-1.1.5-1.9.9-3.6.9-5.3zm27.7-7.6l-1.2 5.7c3.1-2.7 6.7-5.7 11-5.7 4.1 0 6.3 3.3 6.3 6.9 0 3.1-2.1 6.7-6.6 6.7-5.1 0-2.5-6-5.3-6-2.7 0-4.4 1.4-6.7 3.4l-7.2 34.6h-13.1l9.6-45.4 13.2-.2zm34.2 0l-6.6 30.9c-.3 1.2-.4 2.1-.4 2.9 0 2.5 1.2 3.3 3.7 3.3 3.5 0 6.9-3.4 8.1-8h3.8c-5.2 14.8-14.2 16.8-19.1 16.8-5.5 0-9.7-3.2-9.7-10.9 0-1.8.3-3.7.7-5.9l6.2-29.2 13.3.1zm-4.1-19.4c4 0 7.2 3.2 7.2 7.2s-3.2 7.1-7.2 7.1-7.1-3.1-7.1-7.1c-.1-4 3.2-7.2 7.1-7.2zm29.1 16l-1.5 6.9c2.6-2.3 6.1-3.9 10.7-3.9 6.2 0 11.1 3.5 11.1 14.4 0 12.2-4.7 32.1-22.3 32.1-4.5 0-6.8-1.6-7.7-3.2l-4.7 22.1-13.7 3.2 15.2-71.5 12.9-.1zm7.8 17c0-7-2.9-7.5-4.5-7.5-2 0-4.5 1.6-6.3 4.4l-5.4 25.5c.4 1 1.4 2.1 3.4 2.1 9.7 0 12.8-15.9 12.8-24.5zm27.8 17.3c-.3 1.1-.5 2.2-.5 3.1 0 1.9.7 3.2 3.1 3.2.7 0 1.7 0 2.4-.3-2.5 7.8-6.6 8.9-9.6 8.9-6.4 0-9.1-4.4-9.1-10.3 0-1.6.2-3.1.6-4.8l5.8-27.2h-3l.7-3.6h3L528 366l13.4-1.9s-1.4 6.2-3.1 14.4h5.5l-.7 3.6h-5.5l-5.7 27.4z"/>
|
||||
</svg>
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="offcanvas" data-close="try" aria-label="Toggle sidebar">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<nav class="collapse navbar-collapse">
|
||||
<div class="navbar-nav mr-auto d-none d-lg-flex">
|
||||
<a href="../#try" id="try-link" class="nav-item nav-link" data-toggle="try">Try CoffeeScript</a>
|
||||
<a href="../#language" class="nav-item nav-link" data-close="try">Language Reference</a>
|
||||
<a href="../#resources" class="nav-item nav-link" data-close="try">Resources</a>
|
||||
<a href="https://github.com/jashkenas/coffeescript" class="nav-item nav-link" data-close="try">GitHub
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="container" id="top">
|
||||
<div class="row">
|
||||
<main class="main">
|
||||
<header>
|
||||
<h1>Announcing <span class="text-nowrap"><svg class="title-logo" xmlns="http://www.w3.org/2000/svg" viewBox="-76 212 458 369">
|
||||
<title>
|
||||
CoffeeScript Icon
|
||||
</title>
|
||||
<path d="M106 228.6c.5 2.3-.9 4.4-5 6.5-5.5-3.1-16.9-4.4-26.7-3.5-10.4.9-19.4 4.2-17.9 11.3 1.5 7.1 11.7 11 29.5 9.5 43.6-3.8 43.4-33.3 107.4-39 49.8-4.4 77.8 11 81.8 29.7 3.1 14.7-9.1 28.6-45.2 31.8-32 2.8-50.7-5.6-52.6-14.6-1-4.5 1.8-11.3 17.2-13.1 1.5 7 10.6 14.4 31.1 12.6 14.8-1.3 27.6-6.6 25.9-14.9-1.8-8.6-17.7-13.7-42.6-11.5-50.7 4.5-63.2 32.5-106.8 36.3-30.8 2.7-55.9-8.5-59.4-25.1-1.3-6.1-1.4-21 31.2-23.9 17.1-1.5 30.7 1.5 32.1 7.9zM-56.4 402.5c-14.3 18-20.4 38.8-19.2 59.2 1.2 20.4 11.4 37.1 26.9 50.2C-32 525-14 528.6 6.4 525c7.8-1.2 16.7-5.3 24.5-7.8-16.7 0-31-5.3-44.9-16.7-15.5-11.4-25.7-26.9-28.2-46.1-3.7-18 0-34.7 10.2-49 11.4-14.3 25.7-22 44.9-24.5 19.2-1.2 35.9 3.7 52.6 15.5-3.7-5.3-9-9-14.3-14.3-16.7-11.4-34.7-16.7-56.7-11.4-19.9 3.6-36.7 13.8-50.9 31.8zm223.6-96.3c-53.9 0-101.6-5.3-136.3-13.1-37.1-9-56.7-19.2-56.7-32.2 0-5.3 2.4-10.2 10.2-15.5-23.3 9-35.9 16.7-35.9 28.2 1.2 13.1 22 25.7 64.5 35.9 40 10.2 91.4 15.5 153 15.5 62.8 0 113-5.3 153-15.5 42.4-10.2 62.8-23.3 62.8-35.9 0-9-9-18-25.7-24.5 3.7 2.4 6.5 6.5 6.5 11.4 0 13.1-19.2 23.3-57.9 32.2-36 8.2-82.1 13.5-137.5 13.5zm153 35.9c-40 9-91.4 15.5-153 15.5-62.8 0-114.2-6.5-154.2-15.5-35.9-9-55.1-19.2-61.6-29.4 6.5 44.9 22 87.3 42.4 124.8 15.5 23.3 31 43.7 46.1 65.7 6.5 13.1 11.4 25.7 14.3 38.8 10.2 14.3 24.5 23.3 42.4 28.2 22 7.8 44.9 11.4 68.1 10.2h2.4c23.3 1.2 47.7-2.4 70.6-10.2 16.7-5.3 31-14.3 41.2-28.2h1.2c2.4-13.1 6.5-25.7 13.1-38.8 15.5-22 31-42.4 46.1-65.7 20.4-37.1 34.7-79.6 42.4-124.8-7.7 11.4-26.9 21.6-61.5 29.4z"/>
|
||||
</svg> CoffeeScript 2</span></h1>
|
||||
</header>
|
||||
<section>
|
||||
<p>We are pleased to announce CoffeeScript 2! This new release of the CoffeeScript language and compiler aims to bring CoffeeScript into the modern JavaScript era, closing gaps in compatibility with JavaScript while preserving the clean syntax that is CoffeeScript’s hallmark. In a nutshell:</p>
|
||||
<ul>
|
||||
<li>The CoffeeScript 2 compiler now translates CoffeeScript code into modern JavaScript syntax. So a CoffeeScript <code>=></code> is now output as <code>=></code>, a CoffeeScript <code>class</code> is now output using the <code>class</code> keyword, and so on. This means you may need to <a href="../#transpilation">transpile the CoffeeScript compiler’s output</a>.</li>
|
||||
<li>CoffeeScript 2 adds support for <a href="../#async-functions">async functions</a> syntax, for the future <a href="../#destructuring">object destructuring</a> syntax, and for <a href="../#jsx">JSX</a>. Some features, such as <a href="../#modules">modules</a> (<code>import</code> and <code>export</code> statements), <a href="../#generator-iteration"><code>for…of</code></a>, and <a href="../#tagged-template-literals">tagged template literals</a> were backported into CoffeeScript versions 1.11 and 1.12.</li>
|
||||
<li>All of the above was achieved with very few <a href="../#breaking-changes">breaking changes from 1.x</a>. Most current CoffeeScript projects should be able to upgrade with little or no refactoring necessary.</li>
|
||||
</ul>
|
||||
<p>CoffeeScript 2 was developed with two primary goals: remove any incompatibilities with modern JavaScript that might prevent CoffeeScript from being used on a project; and preserve as much backward compatibility as possible. <a href="../#installation">Install now</a>: <code>npm install -g coffeescript@2</code></p>
|
||||
<h2 id="modern-javascript-output">Modern JavaScript Output</h2>
|
||||
<p>From the beginning, CoffeeScript has been described as being “just JavaScript.” And today, JavaScript is ES2015 (well, ES2017; also commonly known as ES6). CoffeeScript welcomes the changes in the JavaScript world and we’re happy to stop outputting circa-1999 syntax for modern features.</p>
|
||||
<p>Many new JavaScript features, such as <code>=></code>, were informed by CoffeeScript and are one-to-one compatible, or very nearly so. This has made outputting many of CoffeeScript’s innovations into new JS syntax straightforward: not only does <code>=></code> become <code>=></code>, but <code>{ a } = obj</code> becomes <code>{ a } = obj</code>, <code>"a#{b}c"</code> becomes <code>`a${b}c`</code> and so on.</p>
|
||||
<p>The following CoffeeScript features were updated in 2.0 to output using modern JavaScript syntax (or added in CoffeeScript 1.11 through 2.0, output using modern syntax):</p>
|
||||
<ul>
|
||||
<li>Modules: <code>import</code>/<code>export</code></li>
|
||||
<li>Classes: <code>class Animal</code></li>
|
||||
<li>Async functions: <code>await someFunction()</code></li>
|
||||
<li>Bound/arrow functions: <code>=></code></li>
|
||||
<li>Function default parameters: <code>(options = {}) -></code></li>
|
||||
<li>Function splat/rest parameters: <code>(items...) -></code></li>
|
||||
<li>Destructuring, for both arrays and objects: <code>[first, second] = items</code>, <code>{length} = items</code></li>
|
||||
<li>Object rest/spread properties: <code>{options..., force: yes}</code>, <code>{force, otherOptions...} = options</code></li>
|
||||
<li>Interpolated strings/template literals (JS backticked strings): <code>"Hello, #{user}!"</code></li>
|
||||
<li>Tagged template literals: <code>html"<strong>coffee</strong>"</code></li>
|
||||
<li>JavaScript’s <code>for…of</code> is now available as CoffeeScript’s <code>for…from</code> (we already had a <code>for…of</code>): <code>for n from generatorFunction()</code></li>
|
||||
</ul>
|
||||
<p>Not all CoffeeScript features were adopted into JavaScript in 100% the same way; most notably, <a href="../#breaking-changes-default-values">default values</a> in JavaScript (and also in CoffeeScript 2) are only applied when a variable is <code>undefined</code>, not <code>undefined</code> or <code>null</code> as in CoffeeScript 1; and <a href="../#breaking-changes-classes">classes</a> have their own differences. See the <a href="../#breaking-changes">breaking changes</a> for the fine details.</p>
|
||||
<p>In our experience, most breaking changes are edge cases that should affect very few people, like JavaScript’s <a href="../#breaking-change-fat-arrow">lack of an <code>arguments</code> object inside arrow functions</a>. There seem to be two breaking changes that affect a significant number of projects:</p>
|
||||
<ul>
|
||||
<li>In CoffeeScript 2, “bare” <code>super</code> (calling <code>super</code> without arguments) is now no longer allowed, and one must use <code>super()</code> or <code>super arguments...</code> instead.</li>
|
||||
<li>References to <code>this</code>/<code>@</code> cannot occur before a call to <code>super</code>, per the JS spec.</li>
|
||||
</ul>
|
||||
<p>See the <a href="../#breaking-changes-super-extends">full details</a>. Either the CoffeeScript compiler or your transpiler will throw errors for either of these cases, so updating your code is a matter of fixing each occurrence as the compiler errors on it, until your code compiles successfully.</p>
|
||||
<h2 id="other-features">Other Features</h2>
|
||||
<p>Besides supporting new JavaScript features and outputting older CoffeeScript features in modern JS syntax, CoffeeScript 2 has added support for the following:</p>
|
||||
<ul>
|
||||
<li><a href="../#jsx">JSX</a></li>
|
||||
<li><a href="../#comments">Line comments</a> are now output (in CoffeeScript 1 they were discarded)</li>
|
||||
<li>Block comments are now allowed anywhere, enabling <a href="../#type-annotations">static type annotations</a> using Flow’s comment-based syntax</li>
|
||||
</ul>
|
||||
<p>There are many smaller improvements as well, such as to the <code>coffee</code> command-line tool. You can read all the details in the <a href="../#changelog">changelog</a> for the 2.0.0 betas.</p>
|
||||
<h2 id="what-about-…">“What About …?”</h2>
|
||||
<p>A few JavaScript features have been intentionally omitted from CoffeeScript. These include <code>let</code> and <code>const</code> (and <code>var</code>), named functions and the <code>get</code> and <code>set</code> keywords. These get asked about so often that we added a section to the docs called <a href="../#unsupported">Unsupported ECMAScript Features</a>. CoffeeScript’s lack of equivalents for these features does not affect compatibility or interoperability with JavaScript modules or libraries.</p>
|
||||
<h2 id="future-compatibility">Future Compatibility</h2>
|
||||
<p>Back when CoffeeScript 1 was created, ES2015 JavaScript and transpilers like <a href="http://babeljs.io/">Babel</a>, <a href="https://buble.surge.sh/">Bublé</a> or <a href="https://github.com/google/traceur-compiler">Traceur Compiler</a> were several years away. The CoffeeScript compiler itself had to do what today’s transpilers do, converting modern features like destructuring and arrow functions into equivalent lowest-common-denominator JavaScript.</p>
|
||||
<p>But transpilers exist now, and they do their job well. With them around, there’s no need for the CoffeeScript compiler to duplicate this functionality. All the CoffeeScript compiler needs to worry about now is converting the CoffeeScript version of new syntax into the JS version of that syntax, e.g. <code>"Hello, #{name}!"</code> into <code>`Hello, ${name}!`</code>. This makes adding support for new JavaScript features much easier than before.</p>
|
||||
<p>Most features added by ECMA in recent years haven’t required any updates at all in CoffeeScript. New global objects, or new methods on global objects, don’t require any updates on CoffeeScript’s part to work. Some proposed future JS features <em>do</em> involve new syntax, like <a href="https://github.com/tc39/proposal-class-fields">class fields</a>. We have adopted a policy of supporting new syntax only when it reaches Stage 4 in ECMA’s process, which means that the syntax is final and will be in the next ES release. On occasion we might support a <em>feature</em> before it has reached Stage 4, but output it using equivalent non-experimental syntax instead of the newly-proposed syntax; that’s what’s happening in 2.0.0 for <a href="../#splats">object destructuring</a>, where our output uses the same polyfill that Babel uses. When the new syntax is finalized, we will update our output to use the final syntax.</p>
|
||||
<h2 id="credits">Credits</h2>
|
||||
<p>The major features of 2.0.0 would not have been possible without the following people:</p>
|
||||
<ul class="credits">
|
||||
<li><a href="https://github.com/GeoffreyBooth">@GeoffreyBooth</a>: Organizer of the CoffeeScript 2 effort, developer for modules; arrow functions, function default parameters and function rest parameters output using ES2015 syntax; line comments output and block comments output anywhere; block embedded JavaScript via triple backticks; improved parsing of Literate CoffeeScript; and the new docs website.</li>
|
||||
<li><a href="https://github.com/connec">@connec</a>: Classes; destructuring; splats/rest syntax in arrays and function calls; and computed properties all output using ES2015 syntax.</li>
|
||||
<li><a href="https://github.com/GabrielRatener">@GabrielRatener</a>: Async functions.</li>
|
||||
<li><a href="https://github.com/xixixao">@xixixao</a>: JSX.</li>
|
||||
<li><a href="https://github.com/zdenko">@zdenko</a>: Object rest/spread properties (object destructuring).</li>
|
||||
<li><a href="https://github.com/greghuc">@greghuc</a>: Tagged template literals, interpolated strings output in ES2015 syntax.</li>
|
||||
<li><a href="https://github.com/atg">@atg</a>: ES2015 <code>for…of</code>, supported as CoffeeScript’s <code>for…from</code>.</li>
|
||||
<li><a href="https://github.com/lydell">@lydell</a> and <a href="https://github.com/jashkenas">@jashkenas</a>: Guidance, code reviews and feedback.</li>
|
||||
</ul>
|
||||
<p>See the full <a href="https://github.com/jashkenas/coffeescript/wiki/CoffeeScript-2-Honor-Roll">honor roll</a>.</p>
|
||||
<p>Thanks and we hope you enjoy CoffeeScript 2!</p>
|
||||
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-106156830-1"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments)};
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'UA-106156830-1');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
8
docs/v2/browser-compiler-legacy/coffeescript.js
Normal file
8
docs/v2/browser-compiler-legacy/coffeescript.js
Normal file
File diff suppressed because one or more lines are too long
8
docs/v2/browser-compiler-modern/coffeescript.js
Normal file
8
docs/v2/browser-compiler-modern/coffeescript.js
Normal file
File diff suppressed because one or more lines are too long
6561
docs/v2/index.html
Normal file
6561
docs/v2/index.html
Normal file
File diff suppressed because one or more lines are too long
33391
docs/v2/test.html
Normal file
33391
docs/v2/test.html
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,10 @@
|
||||
# Eat lunch.
|
||||
eat = (food) -> "#{food} eaten."
|
||||
eat food for food in ['toast', 'cheese', 'wine']
|
||||
|
||||
# Fine five course dining.
|
||||
courses = ['greens', 'caviar', 'truffles', 'roast', 'cake']
|
||||
menu = (i, dish) -> "Menu Item #{i}: #{dish}"
|
||||
menu i + 1, dish for dish, i in courses
|
||||
|
||||
# Health conscious meal.
|
||||
|
||||
4
documentation/examples/array_spread.coffee
Normal file
4
documentation/examples/array_spread.coffee
Normal file
@@ -0,0 +1,4 @@
|
||||
popular = ['pepperoni', 'sausage', 'cheese']
|
||||
unwanted = ['anchovies', 'olives']
|
||||
|
||||
all = [popular..., unwanted..., 'mushrooms']
|
||||
18
documentation/examples/async.coffee
Normal file
18
documentation/examples/async.coffee
Normal file
@@ -0,0 +1,18 @@
|
||||
# Your browser must support async/await and speech synthesis
|
||||
# to run this example.
|
||||
|
||||
sleep = (ms) ->
|
||||
new Promise (resolve) ->
|
||||
window.setTimeout resolve, ms
|
||||
|
||||
say = (text) ->
|
||||
window.speechSynthesis.cancel()
|
||||
window.speechSynthesis.speak new SpeechSynthesisUtterance text
|
||||
|
||||
countdown = (seconds) ->
|
||||
for i in [seconds..1]
|
||||
say i
|
||||
await sleep 1000 # wait one second
|
||||
say "Blastoff!"
|
||||
|
||||
countdown 3
|
||||
@@ -1,4 +0,0 @@
|
||||
###
|
||||
SkinnyMochaHalfCaffScript Compiler v1.0
|
||||
Released under the MIT License
|
||||
###
|
||||
@@ -0,0 +1,2 @@
|
||||
self = this
|
||||
f = -> yield self
|
||||
@@ -0,0 +1,3 @@
|
||||
{a = 1} = {a: null}
|
||||
|
||||
a # Equals 1 in CoffeeScript 1.x, null in CoffeeScript 2
|
||||
5
documentation/examples/breaking_change_fat_arrow.coffee
Normal file
5
documentation/examples/breaking_change_fat_arrow.coffee
Normal file
@@ -0,0 +1,5 @@
|
||||
outer = ->
|
||||
inner = => Array.from arguments
|
||||
inner()
|
||||
|
||||
outer(1, 2) # Returns '' in CoffeeScript 1.x, '1, 2' in CoffeeScript 2
|
||||
@@ -0,0 +1,3 @@
|
||||
f = (a = 1) -> a
|
||||
|
||||
f(null) # Returns 1 in CoffeeScript 1.x, null in CoffeeScript 2
|
||||
@@ -0,0 +1,18 @@
|
||||
# Helper functions
|
||||
hasProp = {}.hasOwnProperty
|
||||
extend = (child, parent) ->
|
||||
ctor = ->
|
||||
@constructor = child
|
||||
return
|
||||
for key of parent
|
||||
if hasProp.call(parent, key)
|
||||
child[key] = parent[key]
|
||||
ctor.prototype = parent.prototype
|
||||
child.prototype = new ctor
|
||||
child
|
||||
|
||||
|
||||
A = ->
|
||||
B = ->
|
||||
extend B, A
|
||||
B.prototype.foo = -> A::foo.apply this, arguments
|
||||
@@ -0,0 +1,3 @@
|
||||
class A
|
||||
class B extends A
|
||||
foo: -> super arguments...
|
||||
4
documentation/examples/breaking_change_super_this.coffee
Normal file
4
documentation/examples/breaking_change_super_this.coffee
Normal file
@@ -0,0 +1,4 @@
|
||||
class B extends A
|
||||
constructor: (arg) ->
|
||||
super arg
|
||||
@arg = arg
|
||||
@@ -0,0 +1,2 @@
|
||||
class B extends A
|
||||
foo: -> super arguments...
|
||||
@@ -0,0 +1,2 @@
|
||||
class B extends A
|
||||
foo: -> super()
|
||||
@@ -2,5 +2,5 @@ $ 'body'
|
||||
.click (e) ->
|
||||
$ '.box'
|
||||
.fadeIn 'fast'
|
||||
.addClass '.active'
|
||||
.addClass 'show'
|
||||
.css 'background', 'white'
|
||||
|
||||
7
documentation/examples/comment.coffee
Normal file
7
documentation/examples/comment.coffee
Normal file
@@ -0,0 +1,7 @@
|
||||
###
|
||||
Fortune Cookie Reader v1.0
|
||||
Released under the MIT License
|
||||
###
|
||||
|
||||
sayFortune = (fortune) ->
|
||||
console.log fortune # in bed!
|
||||
@@ -1,4 +1,5 @@
|
||||
for filename in list
|
||||
do (filename) ->
|
||||
fs.readFile filename, (err, contents) ->
|
||||
compile filename, contents.toString()
|
||||
if filename not in ['.DS_Store', 'Thumbs.db', 'ehthumbs.db']
|
||||
fs.readFile filename, (err, contents) ->
|
||||
compile filename, contents.toString()
|
||||
|
||||
10
documentation/examples/dynamic_import.coffee
Normal file
10
documentation/examples/dynamic_import.coffee
Normal file
@@ -0,0 +1,10 @@
|
||||
# Your browser must support dynamic import to run this example.
|
||||
|
||||
do ->
|
||||
{ run } = await import('./browser-compiler-modern/coffeescript.js')
|
||||
run '''
|
||||
if 5 < new Date().getHours() < 9
|
||||
alert 'Time to make the coffee!'
|
||||
else
|
||||
alert 'Time to get some work done.'
|
||||
'''
|
||||
4
documentation/examples/existence_declared.coffee
Normal file
4
documentation/examples/existence_declared.coffee
Normal file
@@ -0,0 +1,4 @@
|
||||
major = 'Computer Science'
|
||||
|
||||
unless major?
|
||||
signUpForClass 'Introduction to Wines'
|
||||
2
documentation/examples/existence_undeclared.coffee
Normal file
2
documentation/examples/existence_undeclared.coffee
Normal file
@@ -0,0 +1,2 @@
|
||||
if window?
|
||||
environment = 'browser (probably)'
|
||||
9
documentation/examples/get_set.coffee
Normal file
9
documentation/examples/get_set.coffee
Normal file
@@ -0,0 +1,9 @@
|
||||
screen =
|
||||
width: 1200
|
||||
ratio: 16/9
|
||||
|
||||
Object.defineProperty screen, 'height',
|
||||
get: ->
|
||||
this.width / this.ratio
|
||||
set: (val) ->
|
||||
this.width = val * this.ratio
|
||||
@@ -1,9 +1,6 @@
|
||||
OPERATOR = /// ^ (
|
||||
?: [-=]> # function
|
||||
| [-+*/%<>&|^!?=]= # compound assign / compare
|
||||
| >>>=? # zero-fill right shift
|
||||
| ([-+:])\1 # doubles
|
||||
| ([&|<>])\2=? # logic / shift
|
||||
| \?\. # soak access
|
||||
| \.{2,3} # range or splat
|
||||
) ///
|
||||
NUMBER = ///
|
||||
^ 0b[01]+ | # binary
|
||||
^ 0o[0-7]+ | # octal
|
||||
^ 0x[\da-f]+ | # hex
|
||||
^ \d*\.?\d+ (?:e[+-]?\d+)? # decimal
|
||||
///i
|
||||
|
||||
9
documentation/examples/jsx.coffee
Normal file
9
documentation/examples/jsx.coffee
Normal file
@@ -0,0 +1,9 @@
|
||||
renderStarRating = ({ rating, maxStars }) ->
|
||||
<aside title={"Rating: #{rating} of #{maxStars} stars"}>
|
||||
{for wholeStar in [0...Math.floor(rating)]
|
||||
<Star className="wholeStar" key={wholeStar} />}
|
||||
{if rating % 1 isnt 0
|
||||
<Star className="halfStar" />}
|
||||
{for emptyStar in [Math.ceil(rating)...maxStars]
|
||||
<Star className="emptyStar" key={emptyStar} />}
|
||||
</aside>
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'local-file.coffee'
|
||||
import 'coffee-script'
|
||||
import './local-file.js' # Must be the filename of the generated file
|
||||
import 'package'
|
||||
|
||||
import _ from 'underscore'
|
||||
import * as underscore from 'underscore'
|
||||
|
||||
5
documentation/examples/object_spread.coffee
Normal file
5
documentation/examples/object_spread.coffee
Normal file
@@ -0,0 +1,5 @@
|
||||
user =
|
||||
name: 'Werner Heisenberg'
|
||||
occupation: 'theoretical physicist'
|
||||
|
||||
currentUser = { user..., status: 'Uncertain' }
|
||||
@@ -1,3 +1,3 @@
|
||||
$('.account').attr class: 'active'
|
||||
$('.account').prop class: 'active'
|
||||
|
||||
log object.class
|
||||
|
||||
@@ -20,6 +20,8 @@ contenders = [
|
||||
|
||||
awardMedals contenders...
|
||||
|
||||
alert "Gold: " + gold
|
||||
alert "Silver: " + silver
|
||||
alert "The Field: " + rest
|
||||
alert """
|
||||
Gold: #{gold}
|
||||
Silver: #{silver}
|
||||
The Field: #{rest.join ', '}
|
||||
"""
|
||||
|
||||
9
documentation/examples/static.coffee
Normal file
9
documentation/examples/static.coffee
Normal file
@@ -0,0 +1,9 @@
|
||||
class Teenager
|
||||
@say: (speech) ->
|
||||
words = speech.split ' '
|
||||
fillers = ['uh', 'um', 'like', 'actually', 'so', 'maybe']
|
||||
output = []
|
||||
for word, index in words
|
||||
output.push word
|
||||
output.push fillers[Math.floor(Math.random() * fillers.length)] unless index is words.length - 1
|
||||
output.join ', '
|
||||
10
documentation/examples/type_annotations.coffee
Normal file
10
documentation/examples/type_annotations.coffee
Normal file
@@ -0,0 +1,10 @@
|
||||
# @flow
|
||||
|
||||
###::
|
||||
type Obj = {
|
||||
num: number,
|
||||
};
|
||||
###
|
||||
|
||||
fn = (str ###: string ###, obj ###: Obj ###) ###: string ### ->
|
||||
str + obj.num
|
||||
@@ -1,6 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-22 347 566 100">
|
||||
<title>
|
||||
CoffeeScript Logo
|
||||
</title>
|
||||
<path d="M21.7 351.1c.1.6-.2 1.1-1.2 1.6-1.3-.7-4.1-1.1-6.4-.9-2.5.2-4.6 1-4.3 2.7.4 1.7 2.8 2.7 7.1 2.3 10.5-.9 10.4-8 25.8-9.4 12-1.1 18.7 2.6 19.6 7.1.7 3.5-2.2 6.9-10.9 7.6-7.7.7-12.2-1.4-12.6-3.5-.2-1.1.4-2.7 4.1-3.1.4 1.7 2.5 3.5 7.5 3 3.6-.3 6.6-1.6 6.2-3.6-.4-2.1-4.2-3.3-10.2-2.8-12.2 1.1-15.2 7.8-25.6 8.7-7.4.7-13.4-2-14.2-6-.3-1.5-.3-5 7.5-5.7 4-.3 7.2.4 7.6 2zm-39 41.8c-3.4 4.3-4.9 9.3-4.6 14.2.3 4.9 2.7 8.9 6.5 12 4 3.1 8.3 4 13.2 3.1 1.9-.3 4-1.3 5.9-1.9-4 0-7.4-1.3-10.8-4-3.7-2.7-6.2-6.5-6.8-11.1-.9-4.3 0-8.3 2.4-11.8 2.7-3.4 6.2-5.3 10.8-5.9 4.6-.3 8.6.9 12.6 3.7-.9-1.3-2.2-2.2-3.4-3.4-4-2.7-8.3-4-13.6-2.7-4.8 1-8.8 3.5-12.2 7.8zm53.6-23.1c-12.9 0-24.4-1.3-32.7-3.1-8.9-2.2-13.6-4.6-13.6-7.7 0-1.3.6-2.4 2.4-3.7-5.6 2.2-8.6 4-8.6 6.8.3 3.1 5.3 6.2 15.5 8.6 9.6 2.4 21.9 3.7 36.7 3.7 15.1 0 27.1-1.3 36.7-3.7 10.2-2.4 15.1-5.6 15.1-8.6 0-2.2-2.2-4.3-6.2-5.9.9.6 1.6 1.6 1.6 2.7 0 3.1-4.6 5.6-13.9 7.7-8.6 1.9-19.6 3.2-33 3.2zm36.8 8.6c-9.6 2.2-21.9 3.7-36.7 3.7-15.1 0-27.4-1.6-37-3.7-8.6-2.2-13.2-4.6-14.8-7.1 1.6 10.8 5.3 21 10.2 30 3.7 5.6 7.4 10.5 11.1 15.8 1.6 3.1 2.7 6.2 3.4 9.3 2.4 3.4 5.9 5.6 10.2 6.8 5.3 1.9 10.8 2.7 16.4 2.4h.6c5.6.3 11.5-.6 16.9-2.4 4-1.3 7.4-3.4 9.9-6.8h.3c.6-3.1 1.6-6.2 3.1-9.3 3.7-5.3 7.4-10.2 11.1-15.8 4.9-8.9 8.3-19.1 10.2-30-2 2.8-6.6 5.2-14.9 7.1zm106.2 30.1c-4.8 12.1-17.6 16.9-25.9 16.9-13.4 0-19.9-6-19.9-22.3 0-16.5 7.9-47.3 31.7-47.3 8.5 0 15.2 3.3 15.2 12.1 0 4.8-1.8 8.3-6.4 8.3-1.5 0-3.4-.4-5.2-2.4 2.2-1.1 4.2-4.9 4.2-8.3 0-2.9-1.5-5.6-5.6-5.6-10 0-18.9 23.9-18.9 42.4 0 8.3 2.2 14.2 10.9 14.2 7.1 0 13.5-3.4 17.7-9.1l2.2 1.1zm32.9-16.3c.4.2.7.2 1 .2 4.2 0 10.1-2.7 14-5.5l.8 2.4c-3.4 3.7-9.5 6.5-16.1 7.5-1.5 16.8-10.6 27.3-21.7 27.3-8.4 0-14.5-4-14.5-14.4 0-10.5 6.2-32.2 24.9-32.2 7.8.3 11.6 5.3 11.6 14.7zm-7.7 5c-1.9-.5-2.4-2-2.4-3.8 0-2.5 1.2-4.2 2.8-4.9-.2-3.8-1.1-5.3-3.4-5.3-6.5 0-12 16.6-12 25.6 0 6 1.2 7.3 4.6 7.3 4.2.1 8.9-8 10.4-18.9zm-6.6 39.7c0-8.3 7.1-11 15.8-13.6l10.9-51.9c2.7-13 10.6-15.5 16.5-15.5 4.1 0 8 2.2 9.7 5.7 3.6-4.6 8.4-5.7 12.4-5.7 5.6 0 10.8 3.9 10.8 9.8 0 1.5-.1 2.6-.3 3.7h-4.3c.1-.9.2-1.7.2-2.4 0-2.1-1.7-3.1-3.4-3.1-2 0-4.8 1.1-6.2 7.1l-1.7 7.4h9.1l-.8 3.6h-9l-10.3 49.1c-2.7 13-10.6 15.5-16.5 15.5-5.2 0-8.3-2.3-9.8-5.7-3.5 4.6-8.3 5.7-12.3 5.7-5.6.1-10.8-3.8-10.8-9.7zm9.1 1.8c1.9 0 4.2-1.8 5.4-7.1l1.1-5.3c-5.7 2-10.1 4.4-10.1 9.4 0 1.2 1.7 3 3.6 3zm21.7 0c1.9 0 4.2-1.8 5.4-7.1l2.2-10.4-9.4 1.8-1.8 8.3c-.5 2.1-1.1 4-1.8 5.6.9 1.3 3 1.8 5.4 1.8zm-1.4-18l9.4-1.7 7.7-36.8h-9l-8.1 38.5zm16.6-56.7c-2 0-4.8 1.1-6.2 7.1l-1.7 7.4h9l2.1-9.5c.2-.7.2-1.3.2-2 .1-2-1.5-3-3.4-3zm37.9 53c7.1 0 11.6-4 16.1-9.2h3.1c-5.2 8.3-12.9 16.8-25 16.8-8.5 0-14.2-4.2-14.2-14.5 0-10.5 5.9-32.3 24.6-32.3 8.1 0 10 4.2 10 8.7 0 10.5-10 18.5-20.9 19.2-.1 1.3-.2 2.5-.2 3.6 0 6.2 2.2 7.7 6.5 7.7zm5.3-34.4c-4.6 0-9.1 9.7-10.9 18.7 7-.5 13.2-7.4 13.2-15 0-2.2-.5-3.7-2.3-3.7zm28.6 33.4c3.4 0 7.8-2.3 10.8-4.8-2 10.4-8.4 13.4-15.8 13.4-8.4 0-14.1-4.2-14.1-14.5 0-10.5 5.9-32.3 24.6-32.3 8.1 0 10 4.2 10 8.7 0 10.6-10 18.5-20.9 19.2-.1.9-.2 2-.2 2.7 0 5.7 2.5 7.6 5.6 7.6zm6.2-33.4c-4.5 0-9.1 10.1-11 18.7 7.1-.4 13.3-7.3 13.3-15 0-2.2-.6-3.7-2.3-3.7zm51.3-6.7c-1.7 0-3-.6-4.2-1.9 2.4-1.5 4.1-4.8 4.1-7.8 0-3.1-1.8-6.1-6.8-6.1s-8.3 2.8-8.3 8.2c0 13.3 20.5 15.2 20.5 34.8 0 15.3-12.3 22.7-25.6 22.7-10.4 0-19.3-4.5-19.3-15.7 0-9.8 7-14.9 13.3-14.9 3.1 0 7.7 1.3 8 6-4.9 0-10.7 2.3-10.7 8.5 0 4.5 2.9 8.7 8.7 8.7 6.1 0 10.6-4.4 10.6-12 0-15.6-18.6-21.1-18.6-34.5 0-9.5 9.3-16.3 21-16.3 4.3 0 14.6.9 14.6 10.9.1 5.5-2.8 9.4-7.3 9.4zm36.2 10.3c0-2.3-.8-3.7-2.5-3.7-5.7 0-11.7 16.6-11.7 26.7 0 6.2 2.2 7.6 6.6 7.6 7.1 0 11.6-4 16.1-9.2h3.1c-5.2 8.3-12.9 16.8-25 16.8-8.5 0-14.2-4.2-14.2-14.5 0-10.6 6-32.3 24.5-32.3 8.1 0 10.1 4.2 10.1 8.3 0 4.4-2.2 6.7-4.8 6.7-1 0-2.1-.4-3.1-1.1.5-1.9.9-3.6.9-5.3zm27.7-7.6l-1.2 5.7c3.1-2.7 6.7-5.7 11-5.7 4.1 0 6.3 3.3 6.3 6.9 0 3.1-2.1 6.7-6.6 6.7-5.1 0-2.5-6-5.3-6-2.7 0-4.4 1.4-6.7 3.4l-7.2 34.6h-13.1l9.6-45.4 13.2-.2zm34.2 0l-6.6 30.9c-.3 1.2-.4 2.1-.4 2.9 0 2.5 1.2 3.3 3.7 3.3 3.5 0 6.9-3.4 8.1-8h3.8c-5.2 14.8-14.2 16.8-19.1 16.8-5.5 0-9.7-3.2-9.7-10.9 0-1.8.3-3.7.7-5.9l6.2-29.2 13.3.1zm-4.1-19.4c4 0 7.2 3.2 7.2 7.2s-3.2 7.1-7.2 7.1-7.1-3.1-7.1-7.1c-.1-4 3.2-7.2 7.1-7.2zm29.1 16l-1.5 6.9c2.6-2.3 6.1-3.9 10.7-3.9 6.2 0 11.1 3.5 11.1 14.4 0 12.2-4.7 32.1-22.3 32.1-4.5 0-6.8-1.6-7.7-3.2l-4.7 22.1-13.7 3.2 15.2-71.5 12.9-.1zm7.8 17c0-7-2.9-7.5-4.5-7.5-2 0-4.5 1.6-6.3 4.4l-5.4 25.5c.4 1 1.4 2.1 3.4 2.1 9.7 0 12.8-15.9 12.8-24.5zm27.8 17.3c-.3 1.1-.5 2.2-.5 3.1 0 1.9.7 3.2 3.1 3.2.7 0 1.7 0 2.4-.3-2.5 7.8-6.6 8.9-9.6 8.9-6.4 0-9.1-4.4-9.1-10.3 0-1.6.2-3.1.6-4.8l5.8-27.2h-3l.7-3.6h3L528 366l13.4-1.9s-1.4 6.2-3.1 14.4h5.5l-.7 3.6h-5.5l-5.7 27.4z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.7 KiB |
16
documentation/sections/annotated_source.md
Normal file
16
documentation/sections/annotated_source.md
Normal file
@@ -0,0 +1,16 @@
|
||||
## Annotated Source
|
||||
|
||||
You can browse the CoffeeScript <%= fullVersion %> source in readable, annotated form [here](annotated-source/). You can also jump directly to a particular source file:
|
||||
|
||||
- [Grammar Rules — src/grammar](annotated-source/grammar.html)
|
||||
- [Lexing Tokens — src/lexer](annotated-source/lexer.html)
|
||||
- [The Rewriter — src/rewriter](annotated-source/rewriter.html)
|
||||
- [The Syntax Tree — src/nodes](annotated-source/nodes.html)
|
||||
- [Lexical Scope — src/scope](annotated-source/scope.html)
|
||||
- [Helpers & Utility Functions — src/helpers](annotated-source/helpers.html)
|
||||
- [The CoffeeScript Module — src/coffeescript](annotated-source/coffeescript.html)
|
||||
- [Cake & Cakefiles — src/cake](annotated-source/cake.html)
|
||||
- [“coffee” Command-Line Utility — src/command](annotated-source/command.html)
|
||||
- [Option Parsing — src/optparse](annotated-source/optparse.html)
|
||||
- [Interactive REPL — src/repl](annotated-source/repl.html)
|
||||
- [Source Maps — src/sourcemap](annotated-source/sourcemap.html)
|
||||
78
documentation/sections/announcing_coffeescript_2.md
Normal file
78
documentation/sections/announcing_coffeescript_2.md
Normal file
@@ -0,0 +1,78 @@
|
||||
# Announcing CoffeeScript 2
|
||||
|
||||
We are pleased to announce CoffeeScript 2! This new release of the CoffeeScript language and compiler aims to bring CoffeeScript into the modern JavaScript era, closing gaps in compatibility with JavaScript while preserving the clean syntax that is CoffeeScript’s hallmark. In a nutshell:
|
||||
|
||||
- The CoffeeScript 2 compiler now translates CoffeeScript code into modern JavaScript syntax. So a CoffeeScript `=>` is now output as `=>`, a CoffeeScript `class` is now output using the `class` keyword, and so on. This means you may need to [transpile the CoffeeScript compiler’s output](../#es2015plus-output).
|
||||
- CoffeeScript 2 adds support for [async functions](../#async-functions) syntax, for the future [object destructuring](../#destructuring) syntax, and for [JSX](../#jsx). Some features, such as [modules](../#modules) (`import` and `export` statements), [`for…of`](../#generator-iteration), and [tagged template literals](../#tagged-template-literals) were backported into CoffeeScript versions 1.11 and 1.12.
|
||||
- All of the above was achieved with very few [breaking changes from 1.x](../#breaking-changes). Most current CoffeeScript projects should be able to upgrade with little or no refactoring necessary.
|
||||
|
||||
CoffeeScript 2 was developed with two primary goals: remove any incompatibilities with modern JavaScript that might prevent CoffeeScript from being used on a project; and preserve as much backward compatibility as possible. [Install now](../#installation): `npm install -g coffeescript@2`
|
||||
|
||||
## Modern JavaScript Output
|
||||
|
||||
From the beginning, CoffeeScript has been described as being “just JavaScript.” And today, JavaScript is ES2015 (well, ES2017; also commonly known as ES6). CoffeeScript welcomes the changes in the JavaScript world and we’re happy to stop outputting circa-1999 syntax for modern features.
|
||||
|
||||
Many new JavaScript features, such as `=>`, were informed by CoffeeScript and are one-to-one compatible, or very nearly so. This has made outputting many of CoffeeScript’s innovations into new JS syntax straightforward: not only does `=>` become `=>`, but `{ a } = obj` becomes `{ a } = obj`, `"a#{b}c"` becomes `` `a${b}c` `` and so on.
|
||||
|
||||
The following CoffeeScript features were updated in 2.0 to output using modern JavaScript syntax (or added in CoffeeScript 1.11 through 2.0, output using modern syntax):
|
||||
|
||||
- Modules: `import`/`export`
|
||||
- Classes: `class Animal`
|
||||
- Async functions: `await someFunction()`
|
||||
- Bound/arrow functions: `=>`
|
||||
- Function default parameters: `(options = {}) ->`
|
||||
- Function splat/rest parameters: `(items...) ->`
|
||||
- Destructuring, for both arrays and objects: `[first, second] = items`, `{length} = items`
|
||||
- Object rest/spread properties: `{options..., force: yes}`, `{force, otherOptions...} = options`
|
||||
- Interpolated strings/template literals (JS backticked strings): `"Hello, #{user}!"`
|
||||
- Tagged template literals: `html"<strong>coffee</strong>"`
|
||||
- JavaScript’s `for…of` is now available as CoffeeScript’s `for…from` (we already had a `for…of`): `for n from generatorFunction()`
|
||||
|
||||
Not all CoffeeScript features were adopted into JavaScript in 100% the same way; most notably, [default values](../#breaking-changes-default-values) in JavaScript (and also in CoffeeScript 2) are only applied when a variable is `undefined`, not `undefined` or `null` as in CoffeeScript 1; and [classes](../#breaking-changes-classes) have their own differences. See the [breaking changes](../#breaking-changes) for the fine details.
|
||||
|
||||
In our experience, most breaking changes are edge cases that should affect very few people, like JavaScript’s [lack of an `arguments` object inside arrow functions](../#breaking-change-fat-arrow). There seem to be two breaking changes that affect a significant number of projects:
|
||||
|
||||
- In CoffeeScript 2, “bare” `super` (calling `super` without arguments) is now no longer allowed, and one must use `super()` or `super arguments...` instead.
|
||||
- References to `this`/`@` cannot occur before a call to `super`, per the JS spec.
|
||||
|
||||
See the [full details](../#breaking-changes-super-extends). Either the CoffeeScript compiler or your transpiler will throw errors for either of these cases, so updating your code is a matter of fixing each occurrence as the compiler errors on it, until your code compiles successfully.
|
||||
|
||||
## Other Features
|
||||
|
||||
Besides supporting new JavaScript features and outputting older CoffeeScript features in modern JS syntax, CoffeeScript 2 has added support for the following:
|
||||
|
||||
- [JSX](../#jsx)
|
||||
- [Line comments](../#comments) are now output (in CoffeeScript 1 they were discarded)
|
||||
- Block comments are now allowed anywhere, enabling [static type annotations](../#type-annotations) using Flow’s comment-based syntax
|
||||
|
||||
There are many smaller improvements as well, such as to the `coffee` command-line tool. You can read all the details in the [changelog](../#changelog) for the 2.0.0 betas.
|
||||
|
||||
## “What About …?”
|
||||
|
||||
A few JavaScript features have been intentionally omitted from CoffeeScript. These include `let` and `const` (and `var`), named functions and the `get` and `set` keywords. These get asked about so often that we added a section to the docs called [Unsupported ECMAScript Features](../#unsupported). CoffeeScript’s lack of equivalents for these features does not affect compatibility or interoperability with JavaScript modules or libraries.
|
||||
|
||||
## Future Compatibility
|
||||
|
||||
Back when CoffeeScript 1 was created, ES2015 JavaScript and transpilers like [Babel](http://babeljs.io/), [Bublé](https://buble.surge.sh/) or [Traceur Compiler](https://github.com/google/traceur-compiler) were several years away. The CoffeeScript compiler itself had to do what today’s transpilers do, converting modern features like destructuring and arrow functions into equivalent lowest-common-denominator JavaScript.
|
||||
|
||||
But transpilers exist now, and they do their job well. With them around, there’s no need for the CoffeeScript compiler to duplicate this functionality. All the CoffeeScript compiler needs to worry about now is converting the CoffeeScript version of new syntax into the JS version of that syntax, e.g. `"Hello, #{name}!"` into `` `Hello, ${name}!` ``. This makes adding support for new JavaScript features much easier than before.
|
||||
|
||||
Most features added by ECMA in recent years haven’t required any updates at all in CoffeeScript. New global objects, or new methods on global objects, don’t require any updates on CoffeeScript’s part to work. Some proposed future JS features _do_ involve new syntax, like [class fields](https://github.com/tc39/proposal-class-fields). We have adopted a policy of supporting new syntax only when it reaches Stage 4 in ECMA’s process, which means that the syntax is final and will be in the next ES release. On occasion we might support a _feature_ before it has reached Stage 4, but output it using equivalent non-experimental syntax instead of the newly-proposed syntax; that’s what’s happening in 2.0.0 for [object destructuring](../#splats), where our output uses the same polyfill that Babel uses. When the new syntax is finalized, we will update our output to use the final syntax.
|
||||
|
||||
## Credits
|
||||
|
||||
The major features of 2.0.0 would not have been possible without the following people:
|
||||
|
||||
- [@GeoffreyBooth](https://github.com/GeoffreyBooth): Organizer of the CoffeeScript 2 effort, developer for modules; arrow functions, function default parameters and function rest parameters output using ES2015 syntax; line comments output and block comments output anywhere; block embedded JavaScript via triple backticks; improved parsing of Literate CoffeeScript; and the new docs website.
|
||||
- [@connec](https://github.com/connec): Classes; destructuring; splats/rest syntax in arrays and function calls; and computed properties all output using ES2015 syntax.
|
||||
- [@GabrielRatener](https://github.com/GabrielRatener): Async functions.
|
||||
- [@xixixao](https://github.com/xixixao): JSX.
|
||||
- [@zdenko](https://github.com/zdenko): Object rest/spread properties (object destructuring).
|
||||
- [@greghuc](https://github.com/greghuc): Tagged template literals, interpolated strings output in ES2015 syntax.
|
||||
- [@atg](https://github.com/atg): ES2015 `for…of`, supported as CoffeeScript’s `for…from`.
|
||||
- [@lydell](https://github.com/lydell) and [@jashkenas](https://github.com/jashkenas): Guidance, code reviews and feedback.
|
||||
|
||||
|
||||
See the full [honor roll](https://github.com/jashkenas/coffeescript/wiki/CoffeeScript-2-Honor-Roll).
|
||||
|
||||
Thanks and we hope you enjoy CoffeeScript 2!
|
||||
9
documentation/sections/async_functions.md
Normal file
9
documentation/sections/async_functions.md
Normal file
@@ -0,0 +1,9 @@
|
||||
## Async Functions
|
||||
|
||||
ES2017’s [async functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) are supported through the `await` keyword. Like with generators, there's no need for an `async` keyword; an async function in CoffeeScript is simply a function that awaits.
|
||||
|
||||
Similar to how `yield return` forces a generator, `await return` may be used to force a function to be async.
|
||||
|
||||
```
|
||||
codeFor('async', true)
|
||||
```
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
There are a number of excellent resources to help you get started with CoffeeScript, some of which are freely available online.
|
||||
|
||||
* [The Little Book on CoffeeScript](http://arcturo.github.com/library/coffeescript/) is a brief 5-chapter introduction to CoffeeScript, written with great clarity and precision by [Alex MacCaw](http://alexmaccaw.co.uk/).
|
||||
* [Smooth CoffeeScript](http://autotelicum.github.com/Smooth-CoffeeScript/) is a reimagination of the excellent book [Eloquent JavaScript](http://eloquentjavascript.net/), as if it had been written in CoffeeScript instead. Covers language features as well as the functional and object oriented programming styles. By [E. Hoigaard](https://github.com/autotelicum).
|
||||
* [The Little Book on CoffeeScript](http://arcturo.github.io/library/coffeescript/) is a brief 5-chapter introduction to CoffeeScript, written with great clarity and precision by [Alex MacCaw](http://alexmaccaw.co.uk/).
|
||||
* [Smooth CoffeeScript](http://autotelicum.github.io/Smooth-CoffeeScript/) is a reimagination of the excellent book [Eloquent JavaScript](http://eloquentjavascript.net/), as if it had been written in CoffeeScript instead. Covers language features as well as the functional and object oriented programming styles. By [E. Hoigaard](https://github.com/autotelicum).
|
||||
* [CoffeeScript: Accelerated JavaScript Development](http://pragprog.com/book/tbcoffee/coffeescript) is [Trevor Burnham](http://trevorburnham.com/)’s thorough introduction to the language. By the end of the book, you’ll have built a fast-paced multiplayer word game, writing both the client-side and Node.js portions in CoffeeScript.
|
||||
* [CoffeeScript Programming with jQuery, Rails, and Node.js](http://www.packtpub.com/coffeescript-programming-with-jquery-rails-nodejs/book) is a new book by Michael Erasmus that covers CoffeeScript with an eye towards real-world usage both in the browser (jQuery) and on the server-side (Rails, Node).
|
||||
* [CoffeeScript Programming with jQuery, Rails, and Node.js](https://www.packtpub.com/web-development/coffeescript-programming-jquery-rails-and-nodejs) is a new book by Michael Erasmus that covers CoffeeScript with an eye towards real-world usage both in the browser (jQuery) and on the server-side (Rails, Node).
|
||||
* [CoffeeScript Ristretto](https://leanpub.com/coffeescript-ristretto/read) is a deep dive into CoffeeScript’s semantics from simple functions up through closures, higher-order functions, objects, classes, combinators, and decorators. By [Reg Braithwaite](http://braythwayt.com/).
|
||||
* [Testing with CoffeeScript](https://efendibooks.com/minibooks/testing-with-coffeescript) is a succinct and freely downloadable guide to building testable applications with CoffeeScript and Jasmine.
|
||||
* [CoffeeScript Application Development](http://www.packtpub.com/coffeescript-application-development/book) from Packt, introduces CoffeeScript while walking through the process of building a demonstration web application. A [CoffeeScript Application Development Coookbook](https://www.packtpub.com/web-development/coffeescript-application-development-cookbook) with over 90 “recipes” is also available.
|
||||
* [CoffeeScript in Action](http://www.manning.com/lee/) from Manning Publications, covers CoffeeScript syntax, composition techniques and application development.
|
||||
* [CoffeeScript: Die Alternative zu JavaScript](http://www.dpunkt.de/buecher/4021/coffeescript.html) from dpunkt.verlag, is the first CoffeeScript book in Deutsch.
|
||||
* [CoffeeScript Application Development](https://www.packtpub.com/web-development/coffeescript-application-development) from Packt, introduces CoffeeScript while walking through the process of building a demonstration web application. A [CoffeeScript Application Development Coookbook](https://www.packtpub.com/web-development/coffeescript-application-development-cookbook) with over 90 “recipes” is also available.
|
||||
* [CoffeeScript in Action](https://www.manning.com/books/coffeescript-in-action) from Manning Publications, covers CoffeeScript syntax, composition techniques and application development.
|
||||
* [CoffeeScript: Die Alternative zu JavaScript](https://www.dpunkt.de/buecher/4021/coffeescript.html) from dpunkt.verlag, is the first CoffeeScript book in Deutsch.
|
||||
|
||||
3
documentation/sections/breaking_changes.md
Normal file
3
documentation/sections/breaking_changes.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## Breaking Changes From CoffeeScript 1.x to 2
|
||||
|
||||
CoffeeScript 2 aims to output as much idiomatic ES2015+ syntax as possible with as few breaking changes from CoffeeScript 1.x as possible. Some breaking changes, unfortunately, were unavoidable.
|
||||
@@ -0,0 +1,34 @@
|
||||
### Argument parsing and shebang (`#!`) lines
|
||||
|
||||
In CoffeeScript 1.x, `--` was required after the path and filename of the script to be run, but before any arguments passed to that script. This convention is now deprecated. So instead of:
|
||||
|
||||
```bash
|
||||
coffee [options] path/to/script.coffee -- [args]
|
||||
```
|
||||
|
||||
Now you would just type:
|
||||
|
||||
```bash
|
||||
coffee [options] path/to/script.coffee [args]
|
||||
```
|
||||
|
||||
The deprecated version will still work, but it will print a warning before running the script.
|
||||
|
||||
On non-Windows platforms, a `.coffee` file can be made executable by adding a shebang (`#!`) line at the top of the file and marking the file as executable. For example:
|
||||
|
||||
```coffee
|
||||
#!/usr/bin/env coffee
|
||||
|
||||
x = 2 + 2
|
||||
console.log x
|
||||
```
|
||||
|
||||
If this were saved as `executable.coffee`, it could be made executable and run:
|
||||
|
||||
```bash
|
||||
▶ chmod +x ./executable.coffee
|
||||
▶ ./executable.coffee
|
||||
4
|
||||
```
|
||||
|
||||
In CoffeeScript 1.x, this used to fail when trying to pass arguments to the script. Some users on OS X worked around the problem by using `#!/usr/bin/env coffee --` as the first line of the file. That didn’t work on Linux, however, which cannot parse shebang lines with more than a single argument. While such scripts will still run on OS X, CoffeeScript will now display a warning before compiling or evaluating files that begin with a too-long shebang line. Now that CoffeeScript 2 supports passing arguments without needing `--`, we recommend simply changing the shebang lines in such scripts to just `#!/usr/bin/env coffee`.
|
||||
@@ -0,0 +1,14 @@
|
||||
### Bound generator functions
|
||||
|
||||
Bound generator functions, a.k.a. generator arrow functions, [aren’t allowed in ECMAScript](http://stackoverflow.com/questions/27661306/can-i-use-es6s-arrow-function-syntax-with-generators-arrow-notation). You can write `function*` or `=>`, but not both. Therefore, CoffeeScript code like this:
|
||||
|
||||
```coffee
|
||||
f = => yield this
|
||||
# Throws a compiler error
|
||||
```
|
||||
|
||||
Needs to be rewritten the old-fashioned way:
|
||||
|
||||
```
|
||||
codeFor('breaking_change_bound_generator_function')
|
||||
```
|
||||
41
documentation/sections/breaking_changes_classes.md
Normal file
41
documentation/sections/breaking_changes_classes.md
Normal file
@@ -0,0 +1,41 @@
|
||||
### Classes are compiled to ES2015 classes
|
||||
|
||||
ES2015 classes and their methods have some restrictions beyond those on regular functions.
|
||||
|
||||
Class constructors can’t be invoked without `new`:
|
||||
|
||||
```coffee
|
||||
(class)()
|
||||
# Throws a TypeError at runtime
|
||||
```
|
||||
|
||||
ES2015 classes don’t allow bound (fat arrow) methods. The CoffeeScript compiler goes through some contortions to preserve support for them, but one thing that can’t be accommodated is calling a bound method before it is bound:
|
||||
|
||||
```coffee
|
||||
class Base
|
||||
constructor: ->
|
||||
@onClick() # This works
|
||||
clickHandler = @onClick
|
||||
clickHandler() # This throws a runtime error
|
||||
|
||||
class Component extends Base
|
||||
onClick: =>
|
||||
console.log 'Clicked!', @
|
||||
```
|
||||
|
||||
Class methods can’t be used with `new` (uncommon):
|
||||
|
||||
```coffee
|
||||
class Namespace
|
||||
@Klass = ->
|
||||
new Namespace.Klass # Throws a TypeError at runtime
|
||||
```
|
||||
|
||||
Due to the hoisting required to compile to ES2015 classes, dynamic keys in class methods can’t use values from the executable class body unless the methods are assigned in prototype style.
|
||||
|
||||
```coffee
|
||||
class A
|
||||
name = 'method'
|
||||
"#{name}": -> # This method will be named 'undefined'
|
||||
@::[name] = -> # This will work; assigns to `A.prototype.method`
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user