1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | "use strict";
|
18 |
|
19 | exports.isStrictModeReservedWord = isStrictModeReservedWord;
|
20 | exports.getHexValue = getHexValue;
|
21 |
|
22 | var _esutils = require("esutils");
|
23 |
|
24 | var isReservedWordES6 = _esutils.keyword.isReservedWordES6;
|
25 | var isRestrictedWord = _esutils.keyword.isRestrictedWord;
|
26 | var isIdentifierStartES6 = _esutils.code.isIdentifierStartES6;
|
27 | var isIdentifierPartES6 = _esutils.code.isIdentifierPartES6;
|
28 | var isWhiteSpace = _esutils.code.isWhiteSpace;
|
29 | var isLineTerminator = _esutils.code.isLineTerminator;
|
30 | var isDecimalDigit = _esutils.code.isDecimalDigit;
|
31 | exports.isRestrictedWord = isRestrictedWord;
|
32 | exports.isIdentifierStart = isIdentifierStartES6;
|
33 | exports.isIdentifierPart = isIdentifierPartES6;
|
34 | exports.isWhiteSpace = isWhiteSpace;
|
35 | exports.isLineTerminator = isLineTerminator;
|
36 | exports.isDecimalDigit = isDecimalDigit;
|
37 |
|
38 | function isStrictModeReservedWord(id) {
|
39 | return isReservedWordES6(id, true);
|
40 | }
|
41 |
|
42 | function getHexValue(rune) {
|
43 | if ("0" <= rune && rune <= "9") {
|
44 | return rune.charCodeAt(0) - 48;
|
45 | }
|
46 | if ("a" <= rune && rune <= "f") {
|
47 | return rune.charCodeAt(0) - 87;
|
48 | }
|
49 | if ("A" <= rune && rune <= "F") {
|
50 | return rune.charCodeAt(0) - 55;
|
51 | }
|
52 | return -1;
|
53 | } |
\ | No newline at end of file |