@mirascript/constants 0.1.61 → 0.1.62-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/package.json +3 -8
- package/dist/constants.g.d.ts +0 -754
- package/dist/constants.g.d.ts.map +0 -1
- package/dist/constants.g.js +0 -841
- package/dist/constants.g.js.map +0 -1
- package/dist/index.d.ts +0 -17
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -10
- package/dist/index.js.map +0 -1
- package/src/constants.g.ts +0 -851
package/dist/constants.g.js
DELETED
|
@@ -1,841 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Diagnostic codes for MiraScript compiler and tools.
|
|
3
|
-
*/
|
|
4
|
-
export var DiagnosticCode;
|
|
5
|
-
(function (DiagnosticCode) {
|
|
6
|
-
DiagnosticCode[DiagnosticCode["ErrorStart"] = 1000] = "ErrorStart";
|
|
7
|
-
DiagnosticCode[DiagnosticCode["InternalError"] = 1001] = "InternalError";
|
|
8
|
-
DiagnosticCode[DiagnosticCode["LexerError"] = 1002] = "LexerError";
|
|
9
|
-
DiagnosticCode[DiagnosticCode["ParserError"] = 1003] = "ParserError";
|
|
10
|
-
DiagnosticCode[DiagnosticCode["EmitterError"] = 1004] = "EmitterError";
|
|
11
|
-
DiagnosticCode[DiagnosticCode["OptimizerError"] = 1005] = "OptimizerError";
|
|
12
|
-
DiagnosticCode[DiagnosticCode["Unimplemented"] = 1006] = "Unimplemented";
|
|
13
|
-
DiagnosticCode[DiagnosticCode["UnknownToken"] = 1007] = "UnknownToken";
|
|
14
|
-
DiagnosticCode[DiagnosticCode["UnexpectedToken"] = 1008] = "UnexpectedToken";
|
|
15
|
-
DiagnosticCode[DiagnosticCode["InvalidReservedKeyword"] = 1009] = "InvalidReservedKeyword";
|
|
16
|
-
DiagnosticCode[DiagnosticCode["InvalidKeyword"] = 1010] = "InvalidKeyword";
|
|
17
|
-
DiagnosticCode[DiagnosticCode["InvalidNumberLiteralUnderscore"] = 1011] = "InvalidNumberLiteralUnderscore";
|
|
18
|
-
DiagnosticCode[DiagnosticCode["InvalidNumberLiteral"] = 1012] = "InvalidNumberLiteral";
|
|
19
|
-
DiagnosticCode[DiagnosticCode["OverflowNumberLiteral"] = 1013] = "OverflowNumberLiteral";
|
|
20
|
-
DiagnosticCode[DiagnosticCode["OverflowIntegerLiteral"] = 1014] = "OverflowIntegerLiteral";
|
|
21
|
-
DiagnosticCode[DiagnosticCode["InvalidOrdinalLiteral"] = 1015] = "InvalidOrdinalLiteral";
|
|
22
|
-
DiagnosticCode[DiagnosticCode["UnterminatedString"] = 1016] = "UnterminatedString";
|
|
23
|
-
DiagnosticCode[DiagnosticCode["InvalidEscapeSequence"] = 1017] = "InvalidEscapeSequence";
|
|
24
|
-
DiagnosticCode[DiagnosticCode["InvalidHexEscapeSequence"] = 1018] = "InvalidHexEscapeSequence";
|
|
25
|
-
DiagnosticCode[DiagnosticCode["InvalidUnicodeEscapeSequence"] = 1019] = "InvalidUnicodeEscapeSequence";
|
|
26
|
-
DiagnosticCode[DiagnosticCode["BadArraySpread"] = 1020] = "BadArraySpread";
|
|
27
|
-
DiagnosticCode[DiagnosticCode["UnterminatedInterpolation"] = 1021] = "UnterminatedInterpolation";
|
|
28
|
-
DiagnosticCode[DiagnosticCode["BadInterpolation"] = 1022] = "BadInterpolation";
|
|
29
|
-
DiagnosticCode[DiagnosticCode["EmptyInterpolation"] = 1023] = "EmptyInterpolation";
|
|
30
|
-
DiagnosticCode[DiagnosticCode["UnexpectedUnderscore"] = 1024] = "UnexpectedUnderscore";
|
|
31
|
-
DiagnosticCode[DiagnosticCode["UnexpectedGlobal"] = 1025] = "UnexpectedGlobal";
|
|
32
|
-
DiagnosticCode[DiagnosticCode["MissingComma"] = 1026] = "MissingComma";
|
|
33
|
-
DiagnosticCode[DiagnosticCode["MissingCloseBracket"] = 1027] = "MissingCloseBracket";
|
|
34
|
-
DiagnosticCode[DiagnosticCode["MissingOpenBrace"] = 1028] = "MissingOpenBrace";
|
|
35
|
-
DiagnosticCode[DiagnosticCode["MissingCloseBrace"] = 1029] = "MissingCloseBrace";
|
|
36
|
-
DiagnosticCode[DiagnosticCode["MissingCloseParen"] = 1030] = "MissingCloseParen";
|
|
37
|
-
DiagnosticCode[DiagnosticCode["MissingSemicolon"] = 1031] = "MissingSemicolon";
|
|
38
|
-
DiagnosticCode[DiagnosticCode["MissingColon"] = 1032] = "MissingColon";
|
|
39
|
-
DiagnosticCode[DiagnosticCode["MissingBindOperator"] = 1033] = "MissingBindOperator";
|
|
40
|
-
DiagnosticCode[DiagnosticCode["InvalidConstantName"] = 1034] = "InvalidConstantName";
|
|
41
|
-
DiagnosticCode[DiagnosticCode["MissingFunctionName"] = 1035] = "MissingFunctionName";
|
|
42
|
-
DiagnosticCode[DiagnosticCode["MissingModuleName"] = 1036] = "MissingModuleName";
|
|
43
|
-
DiagnosticCode[DiagnosticCode["MissingOpenParenAfterExtension"] = 1037] = "MissingOpenParenAfterExtension";
|
|
44
|
-
DiagnosticCode[DiagnosticCode["MissingOpenParenAfterType"] = 1038] = "MissingOpenParenAfterType";
|
|
45
|
-
DiagnosticCode[DiagnosticCode["InvalidTypeCall"] = 1039] = "InvalidTypeCall";
|
|
46
|
-
DiagnosticCode[DiagnosticCode["RecordLiteralInExtensionCaller"] = 1040] = "RecordLiteralInExtensionCaller";
|
|
47
|
-
DiagnosticCode[DiagnosticCode["MissingCase"] = 1041] = "MissingCase";
|
|
48
|
-
DiagnosticCode[DiagnosticCode["UnknownExpression"] = 1042] = "UnknownExpression";
|
|
49
|
-
DiagnosticCode[DiagnosticCode["UnmatchedCloseBrace"] = 1043] = "UnmatchedCloseBrace";
|
|
50
|
-
DiagnosticCode[DiagnosticCode["UnmatchedCloseBracket"] = 1044] = "UnmatchedCloseBracket";
|
|
51
|
-
DiagnosticCode[DiagnosticCode["UnmatchedCloseParen"] = 1045] = "UnmatchedCloseParen";
|
|
52
|
-
DiagnosticCode[DiagnosticCode["UnknownPattern"] = 1046] = "UnknownPattern";
|
|
53
|
-
DiagnosticCode[DiagnosticCode["InvalidConstantLiteral"] = 1047] = "InvalidConstantLiteral";
|
|
54
|
-
DiagnosticCode[DiagnosticCode["UnknownStatement"] = 1048] = "UnknownStatement";
|
|
55
|
-
DiagnosticCode[DiagnosticCode["ExpressionExpected"] = 1049] = "ExpressionExpected";
|
|
56
|
-
DiagnosticCode[DiagnosticCode["PatternExpected"] = 1050] = "PatternExpected";
|
|
57
|
-
DiagnosticCode[DiagnosticCode["ExclamationInLiteralPattern"] = 1051] = "ExclamationInLiteralPattern";
|
|
58
|
-
DiagnosticCode[DiagnosticCode["MutInRebindPattern"] = 1052] = "MutInRebindPattern";
|
|
59
|
-
DiagnosticCode[DiagnosticCode["ConstantInBindPattern"] = 1053] = "ConstantInBindPattern";
|
|
60
|
-
DiagnosticCode[DiagnosticCode["MutInDiscardPattern"] = 1054] = "MutInDiscardPattern";
|
|
61
|
-
DiagnosticCode[DiagnosticCode["DiscardInSpreadPattern"] = 1055] = "DiscardInSpreadPattern";
|
|
62
|
-
DiagnosticCode[DiagnosticCode["SpreadDiscardInRecordPattern"] = 1056] = "SpreadDiscardInRecordPattern";
|
|
63
|
-
DiagnosticCode[DiagnosticCode["MispositionedSpreadInRecordPattern"] = 1057] = "MispositionedSpreadInRecordPattern";
|
|
64
|
-
DiagnosticCode[DiagnosticCode["InterpolatedNameRecordPattern"] = 1058] = "InterpolatedNameRecordPattern";
|
|
65
|
-
DiagnosticCode[DiagnosticCode["BadOmitKeyRecordPattern"] = 1059] = "BadOmitKeyRecordPattern";
|
|
66
|
-
DiagnosticCode[DiagnosticCode["AmbiguousRangePattern"] = 1060] = "AmbiguousRangePattern";
|
|
67
|
-
DiagnosticCode[DiagnosticCode["DuplicateSpreadPattern"] = 1061] = "DuplicateSpreadPattern";
|
|
68
|
-
DiagnosticCode[DiagnosticCode["MispositionedRestParameter"] = 1062] = "MispositionedRestParameter";
|
|
69
|
-
DiagnosticCode[DiagnosticCode["UndefinedVariableAssignment"] = 1063] = "UndefinedVariableAssignment";
|
|
70
|
-
DiagnosticCode[DiagnosticCode["ImmutableVariableAssignment"] = 1064] = "ImmutableVariableAssignment";
|
|
71
|
-
DiagnosticCode[DiagnosticCode["UninitializedVariable"] = 1065] = "UninitializedVariable";
|
|
72
|
-
DiagnosticCode[DiagnosticCode["DuplicateVariableDeclaration"] = 1066] = "DuplicateVariableDeclaration";
|
|
73
|
-
DiagnosticCode[DiagnosticCode["UnexpectedBreak"] = 1067] = "UnexpectedBreak";
|
|
74
|
-
DiagnosticCode[DiagnosticCode["UnexpectedContinue"] = 1068] = "UnexpectedContinue";
|
|
75
|
-
DiagnosticCode[DiagnosticCode["MisuseOfGlobalKeyword"] = 1069] = "MisuseOfGlobalKeyword";
|
|
76
|
-
DiagnosticCode[DiagnosticCode["BadOmitKeyRecordExpression"] = 1070] = "BadOmitKeyRecordExpression";
|
|
77
|
-
DiagnosticCode[DiagnosticCode["UnassignableExpression"] = 1071] = "UnassignableExpression";
|
|
78
|
-
DiagnosticCode[DiagnosticCode["UnexpectedPub"] = 1072] = "UnexpectedPub";
|
|
79
|
-
DiagnosticCode[DiagnosticCode["ErrorEnd"] = 1999] = "ErrorEnd";
|
|
80
|
-
DiagnosticCode[DiagnosticCode["WarningStart"] = 2000] = "WarningStart";
|
|
81
|
-
DiagnosticCode[DiagnosticCode["MisleadingNilVariable"] = 2001] = "MisleadingNilVariable";
|
|
82
|
-
DiagnosticCode[DiagnosticCode["UnnecessaryIrrefutablePattern"] = 2002] = "UnnecessaryIrrefutablePattern";
|
|
83
|
-
DiagnosticCode[DiagnosticCode["MatchExpressionHasNoCases"] = 2003] = "MatchExpressionHasNoCases";
|
|
84
|
-
DiagnosticCode[DiagnosticCode["NonNumberInRange"] = 2004] = "NonNumberInRange";
|
|
85
|
-
DiagnosticCode[DiagnosticCode["NonNumberOrStringInComparison"] = 2005] = "NonNumberOrStringInComparison";
|
|
86
|
-
DiagnosticCode[DiagnosticCode["NonNumberInArithmetic"] = 2006] = "NonNumberInArithmetic";
|
|
87
|
-
DiagnosticCode[DiagnosticCode["NonBooleanInLogical"] = 2007] = "NonBooleanInLogical";
|
|
88
|
-
DiagnosticCode[DiagnosticCode["LiteralNotCallable"] = 2008] = "LiteralNotCallable";
|
|
89
|
-
DiagnosticCode[DiagnosticCode["LiteralNotIndexable"] = 2009] = "LiteralNotIndexable";
|
|
90
|
-
DiagnosticCode[DiagnosticCode["GlobalVariableNotDeclared"] = 2010] = "GlobalVariableNotDeclared";
|
|
91
|
-
DiagnosticCode[DiagnosticCode["WarningEnd"] = 2999] = "WarningEnd";
|
|
92
|
-
DiagnosticCode[DiagnosticCode["InfoStart"] = 3000] = "InfoStart";
|
|
93
|
-
DiagnosticCode[DiagnosticCode["InfoEnd"] = 3999] = "InfoEnd";
|
|
94
|
-
DiagnosticCode[DiagnosticCode["HintStart"] = 4000] = "HintStart";
|
|
95
|
-
DiagnosticCode[DiagnosticCode["UnusedLocalVariable"] = 4001] = "UnusedLocalVariable";
|
|
96
|
-
DiagnosticCode[DiagnosticCode["UnusedLocalFunction"] = 4002] = "UnusedLocalFunction";
|
|
97
|
-
DiagnosticCode[DiagnosticCode["PreferLogicalOperatorAnd"] = 4003] = "PreferLogicalOperatorAnd";
|
|
98
|
-
DiagnosticCode[DiagnosticCode["PreferLogicalOperatorOr"] = 4004] = "PreferLogicalOperatorOr";
|
|
99
|
-
DiagnosticCode[DiagnosticCode["PreferLogicalOperatorNot"] = 4005] = "PreferLogicalOperatorNot";
|
|
100
|
-
DiagnosticCode[DiagnosticCode["PreferParenthesesForRecordLiteral"] = 4006] = "PreferParenthesesForRecordLiteral";
|
|
101
|
-
DiagnosticCode[DiagnosticCode["PreferIfExpression"] = 4007] = "PreferIfExpression";
|
|
102
|
-
DiagnosticCode[DiagnosticCode["UnnecessaryParentheses"] = 4008] = "UnnecessaryParentheses";
|
|
103
|
-
DiagnosticCode[DiagnosticCode["PreferUppercaseConstant"] = 4009] = "PreferUppercaseConstant";
|
|
104
|
-
DiagnosticCode[DiagnosticCode["HintEnd"] = 4999] = "HintEnd";
|
|
105
|
-
DiagnosticCode[DiagnosticCode["ReferenceStart"] = 5000] = "ReferenceStart";
|
|
106
|
-
DiagnosticCode[DiagnosticCode["VariableDeclaredHere"] = 5001] = "VariableDeclaredHere";
|
|
107
|
-
DiagnosticCode[DiagnosticCode["FunctionDeclaredHere"] = 5002] = "FunctionDeclaredHere";
|
|
108
|
-
DiagnosticCode[DiagnosticCode["ParameterDeclaredHere"] = 5003] = "ParameterDeclaredHere";
|
|
109
|
-
DiagnosticCode[DiagnosticCode["ParameterItDeclaredHere"] = 5004] = "ParameterItDeclaredHere";
|
|
110
|
-
DiagnosticCode[DiagnosticCode["ParameterRestDeclaredHere"] = 5005] = "ParameterRestDeclaredHere";
|
|
111
|
-
DiagnosticCode[DiagnosticCode["ParameterSubPatternDeclaredHere"] = 5006] = "ParameterSubPatternDeclaredHere";
|
|
112
|
-
DiagnosticCode[DiagnosticCode["ReferenceEnd"] = 5999] = "ReferenceEnd";
|
|
113
|
-
DiagnosticCode[DiagnosticCode["TagStart"] = 10000] = "TagStart";
|
|
114
|
-
DiagnosticCode[DiagnosticCode["LocalConst"] = 10001] = "LocalConst";
|
|
115
|
-
DiagnosticCode[DiagnosticCode["LocalImmutable"] = 10002] = "LocalImmutable";
|
|
116
|
-
DiagnosticCode[DiagnosticCode["LocalMutable"] = 10003] = "LocalMutable";
|
|
117
|
-
DiagnosticCode[DiagnosticCode["LocalFunction"] = 10004] = "LocalFunction";
|
|
118
|
-
DiagnosticCode[DiagnosticCode["LocalModule"] = 10005] = "LocalModule";
|
|
119
|
-
DiagnosticCode[DiagnosticCode["ParameterIt"] = 10006] = "ParameterIt";
|
|
120
|
-
DiagnosticCode[DiagnosticCode["ParameterImmutable"] = 10007] = "ParameterImmutable";
|
|
121
|
-
DiagnosticCode[DiagnosticCode["ParameterMutable"] = 10008] = "ParameterMutable";
|
|
122
|
-
DiagnosticCode[DiagnosticCode["ParameterImmutableRest"] = 10009] = "ParameterImmutableRest";
|
|
123
|
-
DiagnosticCode[DiagnosticCode["ParameterMutableRest"] = 10010] = "ParameterMutableRest";
|
|
124
|
-
DiagnosticCode[DiagnosticCode["ParameterPattern"] = 10011] = "ParameterPattern";
|
|
125
|
-
DiagnosticCode[DiagnosticCode["ParameterRestPattern"] = 10012] = "ParameterRestPattern";
|
|
126
|
-
DiagnosticCode[DiagnosticCode["ParameterSubPatternImmutable"] = 10013] = "ParameterSubPatternImmutable";
|
|
127
|
-
DiagnosticCode[DiagnosticCode["ParameterSubPatternMutable"] = 10014] = "ParameterSubPatternMutable";
|
|
128
|
-
DiagnosticCode[DiagnosticCode["GlobalVariable"] = 10015] = "GlobalVariable";
|
|
129
|
-
DiagnosticCode[DiagnosticCode["GlobalDynamicAccess"] = 10016] = "GlobalDynamicAccess";
|
|
130
|
-
DiagnosticCode[DiagnosticCode["RecordFieldIdName"] = 10017] = "RecordFieldIdName";
|
|
131
|
-
DiagnosticCode[DiagnosticCode["RecordFieldOrdinalName"] = 10018] = "RecordFieldOrdinalName";
|
|
132
|
-
DiagnosticCode[DiagnosticCode["RecordFieldStringName"] = 10019] = "RecordFieldStringName";
|
|
133
|
-
DiagnosticCode[DiagnosticCode["UnnamedRecordField0"] = 10020] = "UnnamedRecordField0";
|
|
134
|
-
DiagnosticCode[DiagnosticCode["UnnamedRecordField1"] = 10021] = "UnnamedRecordField1";
|
|
135
|
-
DiagnosticCode[DiagnosticCode["UnnamedRecordField2"] = 10022] = "UnnamedRecordField2";
|
|
136
|
-
DiagnosticCode[DiagnosticCode["UnnamedRecordField3"] = 10023] = "UnnamedRecordField3";
|
|
137
|
-
DiagnosticCode[DiagnosticCode["UnnamedRecordField4"] = 10024] = "UnnamedRecordField4";
|
|
138
|
-
DiagnosticCode[DiagnosticCode["UnnamedRecordField5"] = 10025] = "UnnamedRecordField5";
|
|
139
|
-
DiagnosticCode[DiagnosticCode["UnnamedRecordField6"] = 10026] = "UnnamedRecordField6";
|
|
140
|
-
DiagnosticCode[DiagnosticCode["UnnamedRecordField7"] = 10027] = "UnnamedRecordField7";
|
|
141
|
-
DiagnosticCode[DiagnosticCode["UnnamedRecordField8"] = 10028] = "UnnamedRecordField8";
|
|
142
|
-
DiagnosticCode[DiagnosticCode["UnnamedRecordField9"] = 10029] = "UnnamedRecordField9";
|
|
143
|
-
DiagnosticCode[DiagnosticCode["UnnamedRecordFieldN"] = 10030] = "UnnamedRecordFieldN";
|
|
144
|
-
DiagnosticCode[DiagnosticCode["OmitNamedRecordField"] = 10031] = "OmitNamedRecordField";
|
|
145
|
-
DiagnosticCode[DiagnosticCode["FunctionCall"] = 10032] = "FunctionCall";
|
|
146
|
-
DiagnosticCode[DiagnosticCode["ExtensionCall"] = 10033] = "ExtensionCall";
|
|
147
|
-
DiagnosticCode[DiagnosticCode["Scope"] = 10034] = "Scope";
|
|
148
|
-
DiagnosticCode[DiagnosticCode["String"] = 10035] = "String";
|
|
149
|
-
DiagnosticCode[DiagnosticCode["Interpolation"] = 10036] = "Interpolation";
|
|
150
|
-
DiagnosticCode[DiagnosticCode["ForExpression"] = 10037] = "ForExpression";
|
|
151
|
-
DiagnosticCode[DiagnosticCode["WhileExpression"] = 10038] = "WhileExpression";
|
|
152
|
-
DiagnosticCode[DiagnosticCode["LoopExpression"] = 10039] = "LoopExpression";
|
|
153
|
-
DiagnosticCode[DiagnosticCode["FnDeclaration"] = 10040] = "FnDeclaration";
|
|
154
|
-
DiagnosticCode[DiagnosticCode["FnExpression"] = 10041] = "FnExpression";
|
|
155
|
-
DiagnosticCode[DiagnosticCode["IfExpression"] = 10042] = "IfExpression";
|
|
156
|
-
DiagnosticCode[DiagnosticCode["MatchExpression"] = 10043] = "MatchExpression";
|
|
157
|
-
DiagnosticCode[DiagnosticCode["TagEnd"] = 10999] = "TagEnd";
|
|
158
|
-
DiagnosticCode[DiagnosticCode["TagRefStart"] = 11000] = "TagRefStart";
|
|
159
|
-
DiagnosticCode[DiagnosticCode["ReadLocal"] = 11001] = "ReadLocal";
|
|
160
|
-
DiagnosticCode[DiagnosticCode["ReadWriteLocal"] = 11002] = "ReadWriteLocal";
|
|
161
|
-
DiagnosticCode[DiagnosticCode["WriteLocal"] = 11003] = "WriteLocal";
|
|
162
|
-
DiagnosticCode[DiagnosticCode["RedeclareLocal"] = 11004] = "RedeclareLocal";
|
|
163
|
-
DiagnosticCode[DiagnosticCode["ExportedLocal"] = 11005] = "ExportedLocal";
|
|
164
|
-
DiagnosticCode[DiagnosticCode["Callable"] = 11006] = "Callable";
|
|
165
|
-
DiagnosticCode[DiagnosticCode["ArgumentExtension"] = 11007] = "ArgumentExtension";
|
|
166
|
-
DiagnosticCode[DiagnosticCode["ArgumentStart"] = 11008] = "ArgumentStart";
|
|
167
|
-
DiagnosticCode[DiagnosticCode["ArgumentEnd"] = 11009] = "ArgumentEnd";
|
|
168
|
-
DiagnosticCode[DiagnosticCode["ArgumentComma"] = 11010] = "ArgumentComma";
|
|
169
|
-
DiagnosticCode[DiagnosticCode["ArgumentSpread"] = 11011] = "ArgumentSpread";
|
|
170
|
-
DiagnosticCode[DiagnosticCode["KeywordFor"] = 11012] = "KeywordFor";
|
|
171
|
-
DiagnosticCode[DiagnosticCode["KeywordIn"] = 11013] = "KeywordIn";
|
|
172
|
-
DiagnosticCode[DiagnosticCode["KeywordWhile"] = 11014] = "KeywordWhile";
|
|
173
|
-
DiagnosticCode[DiagnosticCode["KeywordLoop"] = 11015] = "KeywordLoop";
|
|
174
|
-
DiagnosticCode[DiagnosticCode["KeywordBreak"] = 11016] = "KeywordBreak";
|
|
175
|
-
DiagnosticCode[DiagnosticCode["KeywordContinue"] = 11017] = "KeywordContinue";
|
|
176
|
-
DiagnosticCode[DiagnosticCode["KeywordIf"] = 11018] = "KeywordIf";
|
|
177
|
-
DiagnosticCode[DiagnosticCode["KeywordElse"] = 11019] = "KeywordElse";
|
|
178
|
-
DiagnosticCode[DiagnosticCode["KeywordMatch"] = 11020] = "KeywordMatch";
|
|
179
|
-
DiagnosticCode[DiagnosticCode["KeywordCase"] = 11021] = "KeywordCase";
|
|
180
|
-
DiagnosticCode[DiagnosticCode["KeywordFn"] = 11022] = "KeywordFn";
|
|
181
|
-
DiagnosticCode[DiagnosticCode["KeywordReturn"] = 11023] = "KeywordReturn";
|
|
182
|
-
/**
|
|
183
|
-
* Work with [DiagnosticCode::OmitNamedRecordField]
|
|
184
|
-
*/
|
|
185
|
-
DiagnosticCode[DiagnosticCode["OmitNamedRecordFieldName"] = 11024] = "OmitNamedRecordFieldName";
|
|
186
|
-
DiagnosticCode[DiagnosticCode["TagRefEnd"] = 11999] = "TagRefEnd";
|
|
187
|
-
DiagnosticCode[DiagnosticCode["SourceMap"] = 12000] = "SourceMap";
|
|
188
|
-
})(DiagnosticCode || (DiagnosticCode = {}));
|
|
189
|
-
/**
|
|
190
|
-
* Encoding for counting positions in diagnostics.
|
|
191
|
-
*/
|
|
192
|
-
export var DiagnosticPositionEncoding;
|
|
193
|
-
(function (DiagnosticPositionEncoding) {
|
|
194
|
-
/**
|
|
195
|
-
* Use the default encoding (UTF-8) and
|
|
196
|
-
* 0-based indexing from the start of the file.
|
|
197
|
-
* Do not convert positions to line-column format.
|
|
198
|
-
*/
|
|
199
|
-
DiagnosticPositionEncoding[DiagnosticPositionEncoding["None"] = 0] = "None";
|
|
200
|
-
/**
|
|
201
|
-
* Convert positions to 1-based UTF-8 line-column format.
|
|
202
|
-
*/
|
|
203
|
-
DiagnosticPositionEncoding[DiagnosticPositionEncoding["Utf8"] = 1] = "Utf8";
|
|
204
|
-
/**
|
|
205
|
-
* Convert positions to 1-based UTF-16 line-column format.
|
|
206
|
-
*/
|
|
207
|
-
DiagnosticPositionEncoding[DiagnosticPositionEncoding["Utf16"] = 2] = "Utf16";
|
|
208
|
-
/**
|
|
209
|
-
* Convert positions to 1-based UTF-32 line-column format.
|
|
210
|
-
*/
|
|
211
|
-
DiagnosticPositionEncoding[DiagnosticPositionEncoding["Utf32"] = 3] = "Utf32";
|
|
212
|
-
})(DiagnosticPositionEncoding || (DiagnosticPositionEncoding = {}));
|
|
213
|
-
/**
|
|
214
|
-
* Mode for reading input.
|
|
215
|
-
*/
|
|
216
|
-
export var InputMode;
|
|
217
|
-
(function (InputMode) {
|
|
218
|
-
InputMode[InputMode["Script"] = 0] = "Script";
|
|
219
|
-
InputMode[InputMode["Template"] = 1] = "Template";
|
|
220
|
-
})(InputMode || (InputMode = {}));
|
|
221
|
-
/**
|
|
222
|
-
* MiraScript OpCodes
|
|
223
|
-
*/
|
|
224
|
-
export var OpCode;
|
|
225
|
-
(function (OpCode) {
|
|
226
|
-
/**
|
|
227
|
-
* No operation
|
|
228
|
-
*/
|
|
229
|
-
OpCode[OpCode["Noop"] = 0] = "Noop";
|
|
230
|
-
/**
|
|
231
|
-
* ADD %ret %1 %2\
|
|
232
|
-
* %ret = %1 + %2
|
|
233
|
-
*/
|
|
234
|
-
OpCode[OpCode["Add"] = 1] = "Add";
|
|
235
|
-
/**
|
|
236
|
-
* SUB %ret %1 %2\
|
|
237
|
-
* %ret = %1 - %2
|
|
238
|
-
*/
|
|
239
|
-
OpCode[OpCode["Sub"] = 2] = "Sub";
|
|
240
|
-
/**
|
|
241
|
-
* MUL %ret %1 %2\
|
|
242
|
-
* %ret = %1 * %2
|
|
243
|
-
*/
|
|
244
|
-
OpCode[OpCode["Mul"] = 3] = "Mul";
|
|
245
|
-
/**
|
|
246
|
-
* DIV %ret %1 %2\
|
|
247
|
-
* %ret = %1 / %2
|
|
248
|
-
*/
|
|
249
|
-
OpCode[OpCode["Div"] = 4] = "Div";
|
|
250
|
-
/**
|
|
251
|
-
* MOD %ret %1 %2\
|
|
252
|
-
* %ret = %1 % %2
|
|
253
|
-
*/
|
|
254
|
-
OpCode[OpCode["Mod"] = 5] = "Mod";
|
|
255
|
-
/**
|
|
256
|
-
* EXP %ret %1 %2\
|
|
257
|
-
* %ret = %1 ^ %2
|
|
258
|
-
*/
|
|
259
|
-
OpCode[OpCode["Pow"] = 6] = "Pow";
|
|
260
|
-
/**
|
|
261
|
-
* POS %ret %1\
|
|
262
|
-
* %ret = +%1
|
|
263
|
-
*/
|
|
264
|
-
OpCode[OpCode["Pos"] = 7] = "Pos";
|
|
265
|
-
/**
|
|
266
|
-
* NEG %ret %1\
|
|
267
|
-
* %ret = -%1
|
|
268
|
-
*/
|
|
269
|
-
OpCode[OpCode["Neg"] = 8] = "Neg";
|
|
270
|
-
/**
|
|
271
|
-
* NOT %ret %1\
|
|
272
|
-
* %ret = !%1
|
|
273
|
-
*/
|
|
274
|
-
OpCode[OpCode["Not"] = 9] = "Not";
|
|
275
|
-
/**
|
|
276
|
-
* PLUS %ret %1\
|
|
277
|
-
* %ret = +%1
|
|
278
|
-
*/
|
|
279
|
-
OpCode[OpCode["Plus"] = 10] = "Plus";
|
|
280
|
-
/**
|
|
281
|
-
* EQ %ret %1 %2\
|
|
282
|
-
* %ret = %1 == %2
|
|
283
|
-
*/
|
|
284
|
-
OpCode[OpCode["Eq"] = 11] = "Eq";
|
|
285
|
-
/**
|
|
286
|
-
* NEQ %ret %1 %2\
|
|
287
|
-
* %ret = %1 != %2
|
|
288
|
-
*/
|
|
289
|
-
OpCode[OpCode["Neq"] = 12] = "Neq";
|
|
290
|
-
/**
|
|
291
|
-
* LT %ret %1 %2\
|
|
292
|
-
* %ret = %1 < %2
|
|
293
|
-
*/
|
|
294
|
-
OpCode[OpCode["Lt"] = 13] = "Lt";
|
|
295
|
-
/**
|
|
296
|
-
* LTE %ret %1 %2\
|
|
297
|
-
* %ret = %1 <= %2
|
|
298
|
-
*/
|
|
299
|
-
OpCode[OpCode["Lte"] = 14] = "Lte";
|
|
300
|
-
/**
|
|
301
|
-
* GT %ret %1 %2\
|
|
302
|
-
* %ret = %1 > %2
|
|
303
|
-
*/
|
|
304
|
-
OpCode[OpCode["Gt"] = 15] = "Gt";
|
|
305
|
-
/**
|
|
306
|
-
* GTE %ret %1 %2\
|
|
307
|
-
* %ret = %1 >= %2
|
|
308
|
-
*/
|
|
309
|
-
OpCode[OpCode["Gte"] = 16] = "Gte";
|
|
310
|
-
/**
|
|
311
|
-
* AEQ %ret %1 %2\
|
|
312
|
-
* %ret = %1 =~ %2
|
|
313
|
-
*/
|
|
314
|
-
OpCode[OpCode["Aeq"] = 17] = "Aeq";
|
|
315
|
-
/**
|
|
316
|
-
* NAEQ %ret %1 %2\
|
|
317
|
-
* %ret = %1 !~ %2
|
|
318
|
-
*/
|
|
319
|
-
OpCode[OpCode["Naeq"] = 18] = "Naeq";
|
|
320
|
-
/**
|
|
321
|
-
* SAME %ret %1 %2\
|
|
322
|
-
* %ret = %1 === %2 // Same value zero
|
|
323
|
-
*/
|
|
324
|
-
OpCode[OpCode["Same"] = 19] = "Same";
|
|
325
|
-
/**
|
|
326
|
-
* Nsame %ret %1 %2\
|
|
327
|
-
* %ret = %1 !== %2
|
|
328
|
-
*/
|
|
329
|
-
OpCode[OpCode["Nsame"] = 20] = "Nsame";
|
|
330
|
-
/**
|
|
331
|
-
* IN %ret %1 %2\
|
|
332
|
-
* %ret = %1 in %2
|
|
333
|
-
*/
|
|
334
|
-
OpCode[OpCode["In"] = 21] = "In";
|
|
335
|
-
/**
|
|
336
|
-
* IN_GLOBAL %ret %1 %2\
|
|
337
|
-
* %ret = %1 in global
|
|
338
|
-
*/
|
|
339
|
-
OpCode[OpCode["InGlobal"] = 22] = "InGlobal";
|
|
340
|
-
/**
|
|
341
|
-
* CONCAT %ret `n` %1 %2 ... %n\
|
|
342
|
-
* %ret = %1 .. %2 .. ... .. %n
|
|
343
|
-
*/
|
|
344
|
-
OpCode[OpCode["Concat"] = 23] = "Concat";
|
|
345
|
-
/**
|
|
346
|
-
* FORMAT %ret %1 `index`\
|
|
347
|
-
* %ret = format(%1, CONSTANTS\[index])
|
|
348
|
-
*/
|
|
349
|
-
OpCode[OpCode["Format"] = 24] = "Format";
|
|
350
|
-
/**
|
|
351
|
-
* AND %ret %1 %2\
|
|
352
|
-
* %ret = %1 && %2
|
|
353
|
-
*/
|
|
354
|
-
OpCode[OpCode["And"] = 25] = "And";
|
|
355
|
-
/**
|
|
356
|
-
* OR %ret %1 %2\
|
|
357
|
-
* %ret = %1 || %2
|
|
358
|
-
*/
|
|
359
|
-
OpCode[OpCode["Or"] = 26] = "Or";
|
|
360
|
-
/**
|
|
361
|
-
* ASSERT_INIT %v\
|
|
362
|
-
* assert(%v != uninitialized)
|
|
363
|
-
*/
|
|
364
|
-
OpCode[OpCode["AssertInit"] = 27] = "AssertInit";
|
|
365
|
-
/**
|
|
366
|
-
* ASSERT_NON_NIL %v\
|
|
367
|
-
* assert(%v != nil)
|
|
368
|
-
*/
|
|
369
|
-
OpCode[OpCode["AssertNonNil"] = 28] = "AssertNonNil";
|
|
370
|
-
/**
|
|
371
|
-
* TYPE %ret %1\
|
|
372
|
-
* %ret = type(%1)
|
|
373
|
-
*/
|
|
374
|
-
OpCode[OpCode["Type"] = 29] = "Type";
|
|
375
|
-
/**
|
|
376
|
-
* TO_BOOLEAN %ret %1\
|
|
377
|
-
* %ret = boolean(%1)
|
|
378
|
-
*/
|
|
379
|
-
OpCode[OpCode["ToBoolean"] = 30] = "ToBoolean";
|
|
380
|
-
/**
|
|
381
|
-
* TO_NUMBER %ret %1\
|
|
382
|
-
* %ret = number(%1)
|
|
383
|
-
*/
|
|
384
|
-
OpCode[OpCode["ToNumber"] = 31] = "ToNumber";
|
|
385
|
-
/**
|
|
386
|
-
* TO_STRING %ret %1\
|
|
387
|
-
* %ret = string(%1)
|
|
388
|
-
*/
|
|
389
|
-
OpCode[OpCode["ToString"] = 32] = "ToString";
|
|
390
|
-
/**
|
|
391
|
-
* IS_BOOLEAN %ret %1\
|
|
392
|
-
* %ret = type(%1) == "boolean"
|
|
393
|
-
*/
|
|
394
|
-
OpCode[OpCode["IsBoolean"] = 33] = "IsBoolean";
|
|
395
|
-
/**
|
|
396
|
-
* IS_NUMBER %ret %1\
|
|
397
|
-
* %ret = type(%1) == "number"
|
|
398
|
-
*/
|
|
399
|
-
OpCode[OpCode["IsNumber"] = 34] = "IsNumber";
|
|
400
|
-
/**
|
|
401
|
-
* IS_STRING %ret %1\
|
|
402
|
-
* %ret = type(%1) == "string"
|
|
403
|
-
*/
|
|
404
|
-
OpCode[OpCode["IsString"] = 35] = "IsString";
|
|
405
|
-
/**
|
|
406
|
-
* IS_RECORD %ret %1\
|
|
407
|
-
* %ret = type(%1) == "record"
|
|
408
|
-
*/
|
|
409
|
-
OpCode[OpCode["IsRecord"] = 36] = "IsRecord";
|
|
410
|
-
/**
|
|
411
|
-
* IS_ARRAY %ret %1\
|
|
412
|
-
* %ret = type(%1) == "array"
|
|
413
|
-
*/
|
|
414
|
-
OpCode[OpCode["IsArray"] = 37] = "IsArray";
|
|
415
|
-
/**
|
|
416
|
-
* CONSTANT %reg `index`\
|
|
417
|
-
* %reg = CONSTANTS\[index]
|
|
418
|
-
*/
|
|
419
|
-
OpCode[OpCode["Constant"] = 38] = "Constant";
|
|
420
|
-
/**
|
|
421
|
-
* UNINIT %reg
|
|
422
|
-
* %reg = uninitialized
|
|
423
|
-
*/
|
|
424
|
-
OpCode[OpCode["Uninit"] = 39] = "Uninit";
|
|
425
|
-
/**
|
|
426
|
-
* ASSIGN %ret %1\
|
|
427
|
-
* %ret = %1
|
|
428
|
-
*/
|
|
429
|
-
OpCode[OpCode["Assign"] = 40] = "Assign";
|
|
430
|
-
/**
|
|
431
|
-
* SWAP %1 %2\
|
|
432
|
-
* (%1, %2) = (%2, %1)
|
|
433
|
-
*/
|
|
434
|
-
OpCode[OpCode["Swap"] = 41] = "Swap";
|
|
435
|
-
/**
|
|
436
|
-
* GET_UPVALUE %ret `level` %%up\
|
|
437
|
-
* %ret = UPVALUES\[level]\[%%up]
|
|
438
|
-
*/
|
|
439
|
-
OpCode[OpCode["GetUpvalue"] = 42] = "GetUpvalue";
|
|
440
|
-
/**
|
|
441
|
-
* SET_UPVALUE %value `level` %%up \
|
|
442
|
-
* UPVALUES\[level]\[%%up] = %value
|
|
443
|
-
*/
|
|
444
|
-
OpCode[OpCode["SetUpvalue"] = 43] = "SetUpvalue";
|
|
445
|
-
/**
|
|
446
|
-
* GET_GLOBAL %ret `name` \
|
|
447
|
-
* %ret = GLOBALS\[CONSTANTS\[name]]
|
|
448
|
-
*/
|
|
449
|
-
OpCode[OpCode["GetGlobal"] = 44] = "GetGlobal";
|
|
450
|
-
/**
|
|
451
|
-
* GET_GLOBAL_DYN %ret %name \
|
|
452
|
-
* %ret = GLOBALS\[%name]
|
|
453
|
-
*/
|
|
454
|
-
OpCode[OpCode["GetGlobalDyn"] = 45] = "GetGlobalDyn";
|
|
455
|
-
/**
|
|
456
|
-
* RECORD %ret\
|
|
457
|
-
* %ret = (
|
|
458
|
-
*/
|
|
459
|
-
OpCode[OpCode["Record"] = 46] = "Record";
|
|
460
|
-
/**
|
|
461
|
-
* MODULE %ret `name`\
|
|
462
|
-
* %ret = mod CONSTANTS\[name] {
|
|
463
|
-
*/
|
|
464
|
-
OpCode[OpCode["Module"] = 47] = "Module";
|
|
465
|
-
/**
|
|
466
|
-
* FIELD `name` %field\
|
|
467
|
-
* \[CONSTANTS\[name]]: %field,
|
|
468
|
-
*/
|
|
469
|
-
OpCode[OpCode["Field"] = 48] = "Field";
|
|
470
|
-
/**
|
|
471
|
-
* FIELD_DYN %name %field\
|
|
472
|
-
* \[%name]: %field,
|
|
473
|
-
*/
|
|
474
|
-
OpCode[OpCode["FieldDyn"] = 49] = "FieldDyn";
|
|
475
|
-
/**
|
|
476
|
-
* FIELD_INDEX `index` %field\
|
|
477
|
-
* \[index]: %field,
|
|
478
|
-
*/
|
|
479
|
-
OpCode[OpCode["FieldIndex"] = 50] = "FieldIndex";
|
|
480
|
-
/**
|
|
481
|
-
* FIELD_OPT `name` %field\
|
|
482
|
-
* \[CONSTANTS\[name]]?: %field,
|
|
483
|
-
*/
|
|
484
|
-
OpCode[OpCode["FieldOpt"] = 51] = "FieldOpt";
|
|
485
|
-
/**
|
|
486
|
-
* FIELD_OPT_DYN %name %field\
|
|
487
|
-
* \[%name]?: %field,
|
|
488
|
-
*/
|
|
489
|
-
OpCode[OpCode["FieldOptDyn"] = 52] = "FieldOptDyn";
|
|
490
|
-
/**
|
|
491
|
-
* FIELD_OPT_INDEX `index` %field\
|
|
492
|
-
* \[index]?: %field,
|
|
493
|
-
*/
|
|
494
|
-
OpCode[OpCode["FieldOptIndex"] = 53] = "FieldOptIndex";
|
|
495
|
-
/**
|
|
496
|
-
* PICK %ret %var `n` `key_1` `key_2` ... `key_n`\
|
|
497
|
-
* %ret = %var pick keys CONSTANTS\[key_1], CONSTANTS\[key_2], ..., CONSTANTS\[key_n]
|
|
498
|
-
*/
|
|
499
|
-
OpCode[OpCode["Pick"] = 54] = "Pick";
|
|
500
|
-
/**
|
|
501
|
-
* OMIT %ret %var `n` `key_1` `key_2` ... `key_n`\
|
|
502
|
-
* %ret = %var omit keys CONSTANTS\[key_1], CONSTANTS\[key_2], ..., CONSTANTS\[key_n]
|
|
503
|
-
*/
|
|
504
|
-
OpCode[OpCode["Omit"] = 55] = "Omit";
|
|
505
|
-
/**
|
|
506
|
-
* ARRAY %ret\
|
|
507
|
-
* %ret = \[
|
|
508
|
-
*/
|
|
509
|
-
OpCode[OpCode["Array"] = 56] = "Array";
|
|
510
|
-
/**
|
|
511
|
-
* ITEM %item\
|
|
512
|
-
* %item,
|
|
513
|
-
*/
|
|
514
|
-
OpCode[OpCode["Item"] = 57] = "Item";
|
|
515
|
-
/**
|
|
516
|
-
* ITEM_RANGE `start` `end`\
|
|
517
|
-
* `start`..`end`,
|
|
518
|
-
*/
|
|
519
|
-
OpCode[OpCode["ItemRange"] = 58] = "ItemRange";
|
|
520
|
-
/**
|
|
521
|
-
* ITEM_RANGE_DYN %start %end\
|
|
522
|
-
* %start..%end,
|
|
523
|
-
*/
|
|
524
|
-
OpCode[OpCode["ItemRangeDyn"] = 59] = "ItemRangeDyn";
|
|
525
|
-
/**
|
|
526
|
-
* ITEM_RANGE_EXCLUSIVE_DYN %start %end\
|
|
527
|
-
* %start..<%end,
|
|
528
|
-
*/
|
|
529
|
-
OpCode[OpCode["ItemRangeExclusiveDyn"] = 60] = "ItemRangeExclusiveDyn";
|
|
530
|
-
/**
|
|
531
|
-
* SPREAD %var\
|
|
532
|
-
* ..%var,
|
|
533
|
-
*/
|
|
534
|
-
OpCode[OpCode["Spread"] = 61] = "Spread";
|
|
535
|
-
/**
|
|
536
|
-
* FREEZE\
|
|
537
|
-
* ) for record or ] for array
|
|
538
|
-
*/
|
|
539
|
-
OpCode[OpCode["Freeze"] = 62] = "Freeze";
|
|
540
|
-
/**
|
|
541
|
-
* HAS %ret %var `key`\
|
|
542
|
-
* %ret = initialized(%var\[CONSTANTS\[key]])
|
|
543
|
-
*/
|
|
544
|
-
OpCode[OpCode["Has"] = 63] = "Has";
|
|
545
|
-
/**
|
|
546
|
-
* HAS_DYN %ret %var %key\
|
|
547
|
-
* %ret = initialized(%var\[%key])
|
|
548
|
-
*/
|
|
549
|
-
OpCode[OpCode["HasDyn"] = 64] = "HasDyn";
|
|
550
|
-
/**
|
|
551
|
-
* HAS_INDEX %ret %var `index`\
|
|
552
|
-
* %ret = initialized(%var\[index])
|
|
553
|
-
*/
|
|
554
|
-
OpCode[OpCode["HasIndex"] = 65] = "HasIndex";
|
|
555
|
-
/**
|
|
556
|
-
* GET %ret %var `key`\
|
|
557
|
-
* %ret = %var\[CONSTANTS\[key]] ?? nil
|
|
558
|
-
*/
|
|
559
|
-
OpCode[OpCode["Get"] = 66] = "Get";
|
|
560
|
-
/**
|
|
561
|
-
* GET_DYN %ret %var %key\
|
|
562
|
-
* %ret = %var\[%key] ?? nil
|
|
563
|
-
*/
|
|
564
|
-
OpCode[OpCode["GetDyn"] = 67] = "GetDyn";
|
|
565
|
-
/**
|
|
566
|
-
* GET_INDEX %ret %var `index`\
|
|
567
|
-
* %ret = %var\[index] ?? nil
|
|
568
|
-
*/
|
|
569
|
-
OpCode[OpCode["GetIndex"] = 68] = "GetIndex";
|
|
570
|
-
/**
|
|
571
|
-
* SET %value %var `key`\
|
|
572
|
-
* %var\[CONSTANTS\[key]] = %value
|
|
573
|
-
*/
|
|
574
|
-
OpCode[OpCode["Set"] = 69] = "Set";
|
|
575
|
-
/**
|
|
576
|
-
* SET_DYN %value %var %key\
|
|
577
|
-
* %var\[%key] = %value
|
|
578
|
-
*/
|
|
579
|
-
OpCode[OpCode["SetDyn"] = 70] = "SetDyn";
|
|
580
|
-
/**
|
|
581
|
-
* SET_INDEX %value %var `index`\
|
|
582
|
-
* %var\[index] = %value
|
|
583
|
-
*/
|
|
584
|
-
OpCode[OpCode["SetIndex"] = 71] = "SetIndex";
|
|
585
|
-
/**
|
|
586
|
-
* SLICE %ret %var `start` `end`\
|
|
587
|
-
* %ret = %var\[start..end]
|
|
588
|
-
*/
|
|
589
|
-
OpCode[OpCode["Slice"] = 72] = "Slice";
|
|
590
|
-
/**
|
|
591
|
-
* SLICE_START %ret %var `end`\
|
|
592
|
-
* %ret = %var\[..end]
|
|
593
|
-
*/
|
|
594
|
-
OpCode[OpCode["SliceStart"] = 73] = "SliceStart";
|
|
595
|
-
/**
|
|
596
|
-
* SLICE_END %ret %var `start`\
|
|
597
|
-
* %ret = %var\[start..]
|
|
598
|
-
*/
|
|
599
|
-
OpCode[OpCode["SliceEnd"] = 74] = "SliceEnd";
|
|
600
|
-
/**
|
|
601
|
-
* SLICE_DYN %ret %var %start %end\
|
|
602
|
-
* %ret = %var\[%start..%end]
|
|
603
|
-
*/
|
|
604
|
-
OpCode[OpCode["SliceDyn"] = 75] = "SliceDyn";
|
|
605
|
-
/**
|
|
606
|
-
* SLICE_EXCLUSIVE_DYN %ret %var %start %end\
|
|
607
|
-
* %ret = %var\[%start..<%end]
|
|
608
|
-
*/
|
|
609
|
-
OpCode[OpCode["SliceExclusiveDyn"] = 76] = "SliceExclusiveDyn";
|
|
610
|
-
/**
|
|
611
|
-
* LENGTH %ret %var\
|
|
612
|
-
* %ret = $Length(%var)
|
|
613
|
-
*/
|
|
614
|
-
OpCode[OpCode["Length"] = 77] = "Length";
|
|
615
|
-
/**
|
|
616
|
-
* LOOP `regn`\
|
|
617
|
-
* loop { let %1, .. ,%regn;
|
|
618
|
-
*/
|
|
619
|
-
OpCode[OpCode["Loop"] = 78] = "Loop";
|
|
620
|
-
/**
|
|
621
|
-
* LOOP_FOR `regn` %iterable\
|
|
622
|
-
* for %1 in %iterable { let %2, .. ,%regn;
|
|
623
|
-
*/
|
|
624
|
-
OpCode[OpCode["LoopFor"] = 79] = "LoopFor";
|
|
625
|
-
/**
|
|
626
|
-
* LOOP_RANGE `regn` %start %end\
|
|
627
|
-
* for %1 in %start..%end { let %2, .. ,%regn;
|
|
628
|
-
*/
|
|
629
|
-
OpCode[OpCode["LoopRange"] = 80] = "LoopRange";
|
|
630
|
-
/**
|
|
631
|
-
* LOOP_RANGE_EXCLUSIVE `regn` %start %end\
|
|
632
|
-
* for %1 in %start..<%end { let %2, .. ,%regn;
|
|
633
|
-
*/
|
|
634
|
-
OpCode[OpCode["LoopRangeExclusive"] = 81] = "LoopRangeExclusive";
|
|
635
|
-
/**
|
|
636
|
-
* LOOP_END\
|
|
637
|
-
* }
|
|
638
|
-
*/
|
|
639
|
-
OpCode[OpCode["LoopEnd"] = 82] = "LoopEnd";
|
|
640
|
-
/**
|
|
641
|
-
* BREAK\
|
|
642
|
-
* break;
|
|
643
|
-
*/
|
|
644
|
-
OpCode[OpCode["Break"] = 83] = "Break";
|
|
645
|
-
/**
|
|
646
|
-
* CONTINUE\
|
|
647
|
-
* continue;
|
|
648
|
-
*/
|
|
649
|
-
OpCode[OpCode["Continue"] = 84] = "Continue";
|
|
650
|
-
/**
|
|
651
|
-
* IF %cond\
|
|
652
|
-
* if (%cond) {
|
|
653
|
-
*/
|
|
654
|
-
OpCode[OpCode["If"] = 85] = "If";
|
|
655
|
-
/**
|
|
656
|
-
* IF_NOT %cond\
|
|
657
|
-
* if (!%cond) {
|
|
658
|
-
*/
|
|
659
|
-
OpCode[OpCode["IfNot"] = 86] = "IfNot";
|
|
660
|
-
/**
|
|
661
|
-
* IF_INIT %var\
|
|
662
|
-
* if (initialized(%var)) {
|
|
663
|
-
*/
|
|
664
|
-
OpCode[OpCode["IfInit"] = 87] = "IfInit";
|
|
665
|
-
/**
|
|
666
|
-
* IF_NOT_INIT %var\
|
|
667
|
-
* if (!initialized(%var)) {
|
|
668
|
-
*/
|
|
669
|
-
OpCode[OpCode["IfNotInit"] = 88] = "IfNotInit";
|
|
670
|
-
/**
|
|
671
|
-
* IF_NIL %var\
|
|
672
|
-
* if (%var == nil) {
|
|
673
|
-
*/
|
|
674
|
-
OpCode[OpCode["IfNil"] = 89] = "IfNil";
|
|
675
|
-
/**
|
|
676
|
-
* IF_NOT_NIL %var\
|
|
677
|
-
* if (%var != nil) {
|
|
678
|
-
*/
|
|
679
|
-
OpCode[OpCode["IfNotNil"] = 90] = "IfNotNil";
|
|
680
|
-
/**
|
|
681
|
-
* ELSE\
|
|
682
|
-
* } else {
|
|
683
|
-
*/
|
|
684
|
-
OpCode[OpCode["Else"] = 91] = "Else";
|
|
685
|
-
/**
|
|
686
|
-
* EL_IF IF*\
|
|
687
|
-
* } else if *** {\
|
|
688
|
-
* This instruction must be followed by an `IF*` instruction\
|
|
689
|
-
*/
|
|
690
|
-
OpCode[OpCode["ElIf"] = 92] = "ElIf";
|
|
691
|
-
/**
|
|
692
|
-
* IF_END\
|
|
693
|
-
* }
|
|
694
|
-
*/
|
|
695
|
-
OpCode[OpCode["IfEnd"] = 93] = "IfEnd";
|
|
696
|
-
/**
|
|
697
|
-
* FUNC %f `argn` `regn`\
|
|
698
|
-
* %f = (%1, %2, ... , %argn) => { let %argn+1, ... , %regn;
|
|
699
|
-
*/
|
|
700
|
-
OpCode[OpCode["Func"] = 94] = "Func";
|
|
701
|
-
/**
|
|
702
|
-
* FUNC_VARG %f `argn` `regn`\
|
|
703
|
-
* %f = (%1, %2, ... , %argn-1, ...%argn) => { let %argn+1, ... , %regn;
|
|
704
|
-
*/
|
|
705
|
-
OpCode[OpCode["FuncVarg"] = 95] = "FuncVarg";
|
|
706
|
-
/**
|
|
707
|
-
* FUNC_END\
|
|
708
|
-
* }
|
|
709
|
-
*/
|
|
710
|
-
OpCode[OpCode["FuncEnd"] = 96] = "FuncEnd";
|
|
711
|
-
/**
|
|
712
|
-
* RETURN %value\
|
|
713
|
-
* return %value;
|
|
714
|
-
*/
|
|
715
|
-
OpCode[OpCode["Return"] = 97] = "Return";
|
|
716
|
-
/**
|
|
717
|
-
* CALL %ret `f` `argn` %1 %2 ... %argn `spread_n` `spread_arg_a` ...\
|
|
718
|
-
* %ret = GLOBAL[CONSTANTS[f]](%1, %2, ... , %argn);
|
|
719
|
-
*
|
|
720
|
-
* If spread_arg_a is present, arg at that index will be spread
|
|
721
|
-
*/
|
|
722
|
-
OpCode[OpCode["Call"] = 98] = "Call";
|
|
723
|
-
/**
|
|
724
|
-
* CALL_DYN %ret %f `argn` %1 %2 ... %argn `spread_n` `spread_arg_a` ...\
|
|
725
|
-
* %ret = %f(%1, %2, ... , %argn);
|
|
726
|
-
*
|
|
727
|
-
* If spread_arg_a is present, arg at that index will be spread
|
|
728
|
-
*/
|
|
729
|
-
OpCode[OpCode["CallDyn"] = 99] = "CallDyn";
|
|
730
|
-
})(OpCode || (OpCode = {}));
|
|
731
|
-
/** Diagnostic messages for MiraScript compiler and tools. */
|
|
732
|
-
export const DIAGNOSTIC_MESSAGES = Object.freeze({
|
|
733
|
-
"1001": "发生未知内部错误",
|
|
734
|
-
"1002": "发生未知词法错误",
|
|
735
|
-
"1003": "发生未知解析错误",
|
|
736
|
-
"1004": "发生未知生成错误",
|
|
737
|
-
"1005": "发生未知优化错误",
|
|
738
|
-
"1006": "该功能尚未实现",
|
|
739
|
-
"1007": "遇到未知的记号",
|
|
740
|
-
"1008": "发现意外的记号",
|
|
741
|
-
"1009": "`$0` 是保留关键字,不能用作标识符",
|
|
742
|
-
"1010": "`$0` 是关键字,不能用作标识符",
|
|
743
|
-
"1011": "数字字面量不能以下划线开头或结尾",
|
|
744
|
-
"1012": "无效的数字字面量",
|
|
745
|
-
"1013": "数字字面量过大",
|
|
746
|
-
"1014": "整数字面量过大",
|
|
747
|
-
"1015": "无效的序数字面量;请移除前导零和下划线,或改用 `[$0]`",
|
|
748
|
-
"1016": "字符串字面量未终止",
|
|
749
|
-
"1017": "字符串中的转义序列无效",
|
|
750
|
-
"1018": "十六进制转义序列的值不是有效的 ASCII 字符",
|
|
751
|
-
"1019": "Unicode 转义序列的值不是有效的 Unicode 码点",
|
|
752
|
-
"1020": "在 `..` 之后需要表达式",
|
|
753
|
-
"1021": "插值表达式未终止",
|
|
754
|
-
"1022": "无效的插值表达式",
|
|
755
|
-
"1023": "插值表达式为空",
|
|
756
|
-
"1024": "意外的 `_`;它是用于丢弃值的保留关键字",
|
|
757
|
-
"1025": "意外的 `global`;它是用于全局变量的保留关键字",
|
|
758
|
-
"1026": "列表中缺少 `,`",
|
|
759
|
-
"1027": "缺少 `]` 以关闭中括号",
|
|
760
|
-
"1028": "缺少 `{` 以打开花括号",
|
|
761
|
-
"1029": "缺少 `}` 以关闭花括号",
|
|
762
|
-
"1030": "缺少 `)` 以关闭括号",
|
|
763
|
-
"1031": "语句末尾缺少 `;`",
|
|
764
|
-
"1032": "条件表达式中缺少 `:`",
|
|
765
|
-
"1033": "在 bind 或 const 语句中需要 `=` 运算符",
|
|
766
|
-
"1034": "常量名必须以 `@` 开头",
|
|
767
|
-
"1035": "声明中缺少函数名",
|
|
768
|
-
"1036": "声明中缺少模块名",
|
|
769
|
-
"1037": "扩展调用必须以参数列表结尾;请在此处添加 `(`",
|
|
770
|
-
"1038": "`type` 是类函数关键字;请在此处添加 `(`",
|
|
771
|
-
"1039": "`type` 调用必须恰好有一个参数",
|
|
772
|
-
"1040": "意外的记录字面量;此处需要分组表达式",
|
|
773
|
-
"1041": "语句中缺少 `case`",
|
|
774
|
-
"1042": "遇到未知的表达式",
|
|
775
|
-
"1043": "发现未匹配的 `}`",
|
|
776
|
-
"1044": "发现未匹配的 `]`",
|
|
777
|
-
"1045": "发现未匹配的 `)`",
|
|
778
|
-
"1046": "遇到未知的模式",
|
|
779
|
-
"1047": "此处只允许常量或字面量",
|
|
780
|
-
"1048": "遇到未知的语句",
|
|
781
|
-
"1049": "此处需要表达式",
|
|
782
|
-
"1050": "此处需要模式",
|
|
783
|
-
"1051": "字面量模式中不允许 `!` 运算符",
|
|
784
|
-
"1052": "重绑定时不允许使用 `mut`",
|
|
785
|
-
"1053": "名称以 `@` 开头的变量不允许被重绑定",
|
|
786
|
-
"1054": "弃元模式中不能使用 `mut`",
|
|
787
|
-
"1055": "展开模式中应省略丢弃弃元",
|
|
788
|
-
"1056": "记录模式中不允许展开弃元",
|
|
789
|
-
"1057": "记录模式中的展开模式应为最后一个字段",
|
|
790
|
-
"1058": "记录模式中不允许插值名称",
|
|
791
|
-
"1059": "省略记录字段名时需要绑定模式",
|
|
792
|
-
"1060": "数组模式中的范围模式应加括号",
|
|
793
|
-
"1061": "数组模式中展开模式只能使用一次",
|
|
794
|
-
"1062": "函数声明中剩余参数应为最后一个参数",
|
|
795
|
-
"1063": "不能对未声明的变量赋值",
|
|
796
|
-
"1064": "不能对不可变变量赋值...",
|
|
797
|
-
"1065": "变量无法在此之前访问...",
|
|
798
|
-
"1066": "该变量已...",
|
|
799
|
-
"1067": "在循环之外出现意外的 `break`",
|
|
800
|
-
"1068": "在循环之外出现意外的 `continue`",
|
|
801
|
-
"1069": "`global` 关键字只能用作 `global.<name>`、`global[<name>]` 或 `in` 运算符右侧",
|
|
802
|
-
"1070": "无法从表达式推断键名",
|
|
803
|
-
"1071": "只能对变量或字段访问赋值",
|
|
804
|
-
"1072": "在模块声明之外出现意外的 `pub`",
|
|
805
|
-
"2001": "`$0` 不是空值;显式使用全局变量 `global.$0` 或空值 `nil`",
|
|
806
|
-
"2002": "不可失败匹配中的该模式是多余的;请考虑移除它或改为在 `is` 表达式中使用",
|
|
807
|
-
"2003": "该 `match` 表达式没有分支;它永远不会匹配任何值",
|
|
808
|
-
"2004": "范围中不能使用非数字字面量",
|
|
809
|
-
"2005": "比较表达式中不能使用非数字或字符串字面量",
|
|
810
|
-
"2006": "算术表达式中不能使用非数字字面量",
|
|
811
|
-
"2007": "逻辑表达式中不能使用非布尔字面量",
|
|
812
|
-
"2008": "字面量不能作为函数调用",
|
|
813
|
-
"2009": "字面量不能作为记录或数组访问",
|
|
814
|
-
"2010": "全局变量 `$0` 未声明",
|
|
815
|
-
"4001": "局部变量未使用;请考虑删除它或使用 `_` 忽略",
|
|
816
|
-
"4002": "局部函数未使用;请考虑删除它",
|
|
817
|
-
"4003": "逻辑运算中更推荐使用 `&&` 而非 `and`",
|
|
818
|
-
"4004": "逻辑运算中更推荐使用 `||` 而非 `or`",
|
|
819
|
-
"4005": "逻辑运算中更推荐使用 `!` 而非 `not`",
|
|
820
|
-
"4006": "记录字面量声明中更推荐使用 `()` 而非 `{}`",
|
|
821
|
-
"4007": "更推荐使用 if 表达式而非条件表达式",
|
|
822
|
-
"4008": "考虑移除多余的括号",
|
|
823
|
-
"4009": "常量 $0 建议使用大写",
|
|
824
|
-
"5001": "...在此处声明",
|
|
825
|
-
"5002": "...在此处声明",
|
|
826
|
-
"5003": "...在此处作为参数声明",
|
|
827
|
-
"5004": "...在此处被该函数声明为自动参数 `it`",
|
|
828
|
-
"5005": "...在此处作为剩余参数声明",
|
|
829
|
-
"5006": "...在此处作为参数模式的子模式声明"
|
|
830
|
-
});
|
|
831
|
-
/** MiraScript keywords */
|
|
832
|
-
export const KEYWORDS = Object.freeze(["true", "false", "nil", "nan", "inf", "_", "global", "in", "is", "and", "or", "not", "type", "if", "else", "match", "case", "for", "while", "loop", "break", "continue", "return", "fn", "op", "let", "const", "mut", "where", "mod", "pub", "use", "effect", "try", "handle", "finally", "perform", "resume"]);
|
|
833
|
-
/** MiraScript constant keywords */
|
|
834
|
-
export const CONSTANT_KEYWORDS = Object.freeze(["true", "false", "nil", "nan", "inf"]);
|
|
835
|
-
/** MiraScript control flow keywords */
|
|
836
|
-
export const CONTROL_KEYWORDS = Object.freeze(["if", "else", "match", "case", "for", "while", "loop", "break", "continue", "return"]);
|
|
837
|
-
/** MiraScript numeric keywords */
|
|
838
|
-
export const NUMERIC_KEYWORDS = Object.freeze(["nan", "inf"]);
|
|
839
|
-
/** MiraScript reserved keywords */
|
|
840
|
-
export const RESERVED_KEYWORDS = Object.freeze(["op", "where", "use", "effect", "try", "handle", "finally", "perform", "resume"]);
|
|
841
|
-
//# sourceMappingURL=constants.g.js.map
|