-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstants.js
117 lines (110 loc) · 2.77 KB
/
Constants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
'use strict';
/**
* KLF Require Core
* Written by Kristian Oye
* Date: August 13, 2024
*
* Contains enumerated types used throughout this library.
*
* @version 1.0.0
*/
const EnumUtil = require('./util/EnumUtil');
const DetailLevelString = ['', ' NONE', ' ERROR', 'WARNING', ' DEBUG', 'VERBOSE'];
const LogDetailLevel = EnumUtil.createEnum('LogDetailLevel', {
/** Inane detail */
Verbose: 5,
/** Information helpful to configuring the importer */
Debug: 4,
/** Some expected behavior did not execute as expected */
Warning: 3,
/** An error occurred and the current module could not be handled */
Error: 2,
/** No Detail provided */
None: 1
});
const ReservedWord = EnumUtil.createEnum('ReservedWord', {
Await: 'await',
Break: 'break',
Case: 'case',
Catch: 'catch',
Class: 'class',
Const: 'const',
Continue: 'continue',
Debugger: 'debugger',
Default: 'default',
Delete: 'delete',
Do: 'do',
Else: 'else',
Export: 'export',
Extends: 'extends',
Finally: 'finally',
For: 'for',
Function: 'function',
If: 'if',
Implements: 'implements',
In: 'in',
Interface: 'interface',
InstanceOf: 'instanceof',
Let: 'let',
New: 'new',
Package: 'package',
Private: 'private',
Protected: 'protected',
Public: 'public',
Return: 'return',
Static: 'static',
Super: 'super',
Switch: 'switch',
This: 'this',
Throw: 'throw',
Try: 'try',
TypeOf: 'typeof',
Var: 'var',
Void: 'void',
While: 'while',
With: 'with',
Yield: 'yield'
}, 'string');
const TokenizerScope = EnumUtil.createEnum('TokenizerScope', {
ArrowFunction: 'ArrowFunction',
Class: 'Class',
Function: 'Function',
Global: 'Global',
Member: 'Member'
});
const TokenType = EnumUtil.createEnum('TokenType', {
Unknown: 'Unknown',
ArrowFunction: 'ArrowFunction',
Assignment: 'Assignment',
BlockStatement: 'BlockStatement',
BlockStatementEnd: 'BlockStatementEnd',
BlockStatementStart: 'BlockStatementStart',
CurlyBrace: 'CurlyBrace',
Class: 'Class',
ClassBody: 'ClassBody',
CommentBlock: 'CommentBlock',
CommentInline: 'CommentInline',
Equality: 'Equality',
Function: 'Function',
/** The global namespace */
Global: 'Global',
Identifier: 'Identifier',
Member: 'Member',
/** A numeric literal */
Number: 'Number',
Parameter: 'Parameter',
ParameterList: 'ParameterList',
ParameterListEnd: 'ParameterListEnd',
Paranthesis: 'Paranthesis',
RawText: 'RawText',
ReservedWord: 'ReservedWord',
Semicolon: 'Semicolon',
Whitespace: 'Whitespace'
});
module.exports = {
DetailLevelString,
LogDetailLevel,
ReservedWord,
TokenizerScope,
TokenType
};