@forthic/interp 0.4.0 → 0.6.0
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/dist/cjs/forthic/errors.d.ts +17 -14
- package/dist/cjs/forthic/errors.js +71 -29
- package/dist/cjs/forthic/errors.js.map +1 -1
- package/dist/cjs/forthic/global_module/map_word.js +14 -0
- package/dist/cjs/forthic/global_module/map_word.js.map +1 -1
- package/dist/cjs/forthic/global_module.d.ts +3 -1
- package/dist/cjs/forthic/global_module.js +15 -1
- package/dist/cjs/forthic/global_module.js.map +1 -1
- package/dist/cjs/forthic/interpreter.d.ts +18 -0
- package/dist/cjs/forthic/interpreter.js +126 -12
- package/dist/cjs/forthic/interpreter.js.map +1 -1
- package/dist/cjs/forthic/module.js +38 -2
- package/dist/cjs/forthic/module.js.map +1 -1
- package/dist/cjs/forthic/tokenizer.d.ts +9 -1
- package/dist/cjs/forthic/tokenizer.js +64 -5
- package/dist/cjs/forthic/tokenizer.js.map +1 -1
- package/dist/esm/forthic/errors.d.ts +17 -14
- package/dist/esm/forthic/errors.js +71 -29
- package/dist/esm/forthic/errors.js.map +1 -1
- package/dist/esm/forthic/global_module/map_word.js +14 -0
- package/dist/esm/forthic/global_module/map_word.js.map +1 -1
- package/dist/esm/forthic/global_module.d.ts +3 -1
- package/dist/esm/forthic/global_module.js +15 -1
- package/dist/esm/forthic/global_module.js.map +1 -1
- package/dist/esm/forthic/interpreter.d.ts +18 -0
- package/dist/esm/forthic/interpreter.js +126 -12
- package/dist/esm/forthic/interpreter.js.map +1 -1
- package/dist/esm/forthic/module.js +38 -2
- package/dist/esm/forthic/module.js.map +1 -1
- package/dist/esm/forthic/tokenizer.d.ts +9 -1
- package/dist/esm/forthic/tokenizer.js +64 -5
- package/dist/esm/forthic/tokenizer.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,70 +1,73 @@
|
|
|
1
1
|
import { CodeLocation } from "./tokenizer";
|
|
2
|
-
declare class ForthicError extends Error {
|
|
2
|
+
export declare class ForthicError extends Error {
|
|
3
|
+
private forthic;
|
|
3
4
|
private note;
|
|
4
5
|
private location?;
|
|
5
|
-
constructor(note: string, location?: CodeLocation);
|
|
6
|
+
constructor(forthic: string, note: string, location?: CodeLocation);
|
|
7
|
+
getDescription(): string;
|
|
6
8
|
getLocation(): CodeLocation;
|
|
9
|
+
getForthic(): string;
|
|
7
10
|
getNote(): string;
|
|
8
11
|
getMessage(): string;
|
|
9
12
|
}
|
|
10
13
|
export declare class UnknownWordError extends ForthicError {
|
|
11
14
|
private word;
|
|
12
|
-
constructor(word: string, location?: CodeLocation);
|
|
15
|
+
constructor(forthic: string, word: string, location?: CodeLocation);
|
|
13
16
|
getWord(): string;
|
|
14
17
|
}
|
|
15
18
|
export declare class InvalidVariableNameError extends ForthicError {
|
|
16
19
|
private var_name;
|
|
17
20
|
private addl_note;
|
|
18
|
-
constructor(var_name: string, addl_note: string, location?: CodeLocation);
|
|
21
|
+
constructor(forthic: string, var_name: string, addl_note: string, location?: CodeLocation);
|
|
19
22
|
getVarName(): string;
|
|
20
23
|
getAddlNote(): string;
|
|
21
24
|
}
|
|
22
25
|
export declare class UnknownScreenError extends ForthicError {
|
|
23
26
|
private screen_name;
|
|
24
|
-
constructor(screen_name: string, location?: CodeLocation);
|
|
27
|
+
constructor(forthic: string, screen_name: string, location?: CodeLocation);
|
|
25
28
|
getScreenName(): string;
|
|
26
29
|
}
|
|
27
30
|
export declare class UnknownModuleError extends ForthicError {
|
|
28
31
|
private module_name;
|
|
29
|
-
constructor(module_name: string, location?: CodeLocation);
|
|
32
|
+
constructor(forthic: string, module_name: string, location?: CodeLocation);
|
|
30
33
|
getModuleName(): string;
|
|
31
34
|
}
|
|
32
35
|
export declare class TooManyAttemptsError extends ForthicError {
|
|
33
36
|
private num_attempts;
|
|
34
37
|
private max_attempts;
|
|
35
|
-
constructor(num_attempts: number, max_attempts: number, location?: CodeLocation);
|
|
38
|
+
constructor(forthic: string, num_attempts: number, max_attempts: number, location?: CodeLocation);
|
|
36
39
|
getNumAttempts(): number;
|
|
37
40
|
getMaxAttempts(): number;
|
|
38
41
|
}
|
|
39
42
|
export declare class WordExecutionError extends ForthicError {
|
|
40
43
|
private word_name;
|
|
41
44
|
private error;
|
|
42
|
-
constructor(word_name: string, error: Error, location?: CodeLocation);
|
|
45
|
+
constructor(forthic: string, word_name: string, error: Error, location?: CodeLocation);
|
|
43
46
|
getWordName(): string;
|
|
44
47
|
getError(): Error;
|
|
45
48
|
}
|
|
46
49
|
export declare class ModuleError extends ForthicError {
|
|
47
50
|
private module_name;
|
|
48
51
|
private error;
|
|
49
|
-
constructor(module_name: string, error: Error, location?: CodeLocation);
|
|
52
|
+
constructor(forthic: string, module_name: string, error: Error, location?: CodeLocation);
|
|
50
53
|
getModuleName(): string;
|
|
51
54
|
getError(): Error;
|
|
52
55
|
}
|
|
53
56
|
export declare class StackUnderflowError extends ForthicError {
|
|
54
|
-
constructor(location?: CodeLocation);
|
|
57
|
+
constructor(forthic: string, location?: CodeLocation);
|
|
55
58
|
}
|
|
56
59
|
export declare class UnknownTokenError extends ForthicError {
|
|
57
60
|
private token;
|
|
58
|
-
constructor(token: string, location?: CodeLocation);
|
|
61
|
+
constructor(forthic: string, token: string, location?: CodeLocation);
|
|
59
62
|
getToken(): string;
|
|
60
63
|
}
|
|
61
64
|
export declare class MissingSemicolonError extends ForthicError {
|
|
62
|
-
constructor(location?: CodeLocation);
|
|
65
|
+
constructor(forthic: string, location?: CodeLocation);
|
|
63
66
|
}
|
|
64
67
|
export declare class ExtraSemicolonError extends ForthicError {
|
|
65
|
-
constructor(location?: CodeLocation);
|
|
68
|
+
constructor(forthic: string, location?: CodeLocation);
|
|
66
69
|
}
|
|
67
70
|
export declare class IntentionalStopError extends Error {
|
|
68
71
|
constructor(message: string);
|
|
69
72
|
}
|
|
70
|
-
export
|
|
73
|
+
export declare function get_error_description(forthic: string, forthicError: ForthicError): string;
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IntentionalStopError = exports.ExtraSemicolonError = exports.MissingSemicolonError = exports.UnknownTokenError = exports.StackUnderflowError = exports.ModuleError = exports.WordExecutionError = exports.TooManyAttemptsError = exports.UnknownModuleError = exports.UnknownScreenError = exports.InvalidVariableNameError = exports.UnknownWordError = void 0;
|
|
3
|
+
exports.IntentionalStopError = exports.ExtraSemicolonError = exports.MissingSemicolonError = exports.UnknownTokenError = exports.StackUnderflowError = exports.ModuleError = exports.WordExecutionError = exports.TooManyAttemptsError = exports.UnknownModuleError = exports.UnknownScreenError = exports.InvalidVariableNameError = exports.UnknownWordError = exports.ForthicError = void 0;
|
|
4
|
+
exports.get_error_description = get_error_description;
|
|
4
5
|
class ForthicError extends Error {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
forthic;
|
|
7
|
+
note;
|
|
8
|
+
location;
|
|
9
|
+
constructor(forthic, note, location) {
|
|
10
|
+
const message = `${note}`;
|
|
8
11
|
super(message);
|
|
12
|
+
this.forthic = forthic;
|
|
9
13
|
this.note = note;
|
|
10
14
|
this.location = location;
|
|
11
15
|
}
|
|
16
|
+
getDescription() {
|
|
17
|
+
return get_error_description(this.forthic, this);
|
|
18
|
+
}
|
|
12
19
|
getLocation() {
|
|
13
20
|
return this.location;
|
|
14
21
|
}
|
|
22
|
+
getForthic() {
|
|
23
|
+
return this.forthic;
|
|
24
|
+
}
|
|
15
25
|
getNote() {
|
|
16
26
|
return this.note;
|
|
17
27
|
}
|
|
@@ -19,13 +29,15 @@ class ForthicError extends Error {
|
|
|
19
29
|
return this.message;
|
|
20
30
|
}
|
|
21
31
|
}
|
|
32
|
+
exports.ForthicError = ForthicError;
|
|
22
33
|
// ============================================================
|
|
23
34
|
// Interpreter errors
|
|
24
35
|
// Interpreter couldn't find word in dictionaries
|
|
25
36
|
class UnknownWordError extends ForthicError {
|
|
26
|
-
|
|
37
|
+
word;
|
|
38
|
+
constructor(forthic, word, location) {
|
|
27
39
|
const note = `Unknown word: ${word}`;
|
|
28
|
-
super(note, location);
|
|
40
|
+
super(forthic, note, location);
|
|
29
41
|
this.word = word;
|
|
30
42
|
this.name = "UnknownWordError";
|
|
31
43
|
}
|
|
@@ -36,9 +48,11 @@ class UnknownWordError extends ForthicError {
|
|
|
36
48
|
exports.UnknownWordError = UnknownWordError;
|
|
37
49
|
// Variable name is not allowed
|
|
38
50
|
class InvalidVariableNameError extends ForthicError {
|
|
39
|
-
|
|
51
|
+
var_name;
|
|
52
|
+
addl_note;
|
|
53
|
+
constructor(forthic, var_name, addl_note, location) {
|
|
40
54
|
const note = `Invalid variable name: ${var_name}(${addl_note})`;
|
|
41
|
-
super(note, location);
|
|
55
|
+
super(forthic, note, location);
|
|
42
56
|
this.var_name = var_name;
|
|
43
57
|
this.addl_note = addl_note;
|
|
44
58
|
this.name = "InvalidVariableNameError";
|
|
@@ -53,9 +67,10 @@ class InvalidVariableNameError extends ForthicError {
|
|
|
53
67
|
exports.InvalidVariableNameError = InvalidVariableNameError;
|
|
54
68
|
// Interpreter couldn't find screen
|
|
55
69
|
class UnknownScreenError extends ForthicError {
|
|
56
|
-
|
|
70
|
+
screen_name;
|
|
71
|
+
constructor(forthic, screen_name, location) {
|
|
57
72
|
const note = `Unknown screen: ${screen_name}`;
|
|
58
|
-
super(note, location);
|
|
73
|
+
super(forthic, note, location);
|
|
59
74
|
this.screen_name = screen_name;
|
|
60
75
|
this.name = "UnknownScreenError";
|
|
61
76
|
}
|
|
@@ -66,9 +81,10 @@ class UnknownScreenError extends ForthicError {
|
|
|
66
81
|
exports.UnknownScreenError = UnknownScreenError;
|
|
67
82
|
// Interpreter couldn't find module
|
|
68
83
|
class UnknownModuleError extends ForthicError {
|
|
69
|
-
|
|
84
|
+
module_name;
|
|
85
|
+
constructor(forthic, module_name, location) {
|
|
70
86
|
const note = `Unknown module: ${module_name}`;
|
|
71
|
-
super(note, location);
|
|
87
|
+
super(forthic, note, location);
|
|
72
88
|
this.module_name = module_name;
|
|
73
89
|
this.name = "UnknownModuleError";
|
|
74
90
|
}
|
|
@@ -78,9 +94,11 @@ class UnknownModuleError extends ForthicError {
|
|
|
78
94
|
}
|
|
79
95
|
exports.UnknownModuleError = UnknownModuleError;
|
|
80
96
|
class TooManyAttemptsError extends ForthicError {
|
|
81
|
-
|
|
97
|
+
num_attempts;
|
|
98
|
+
max_attempts;
|
|
99
|
+
constructor(forthic, num_attempts, max_attempts, location) {
|
|
82
100
|
const note = `Too many recovery attempts: ${num_attempts} of ${max_attempts}`;
|
|
83
|
-
super(note, location);
|
|
101
|
+
super(forthic, note, location);
|
|
84
102
|
this.num_attempts = num_attempts;
|
|
85
103
|
this.max_attempts = max_attempts;
|
|
86
104
|
this.name = "TooManyAttemptsError";
|
|
@@ -94,9 +112,11 @@ class TooManyAttemptsError extends ForthicError {
|
|
|
94
112
|
}
|
|
95
113
|
exports.TooManyAttemptsError = TooManyAttemptsError;
|
|
96
114
|
class WordExecutionError extends ForthicError {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
115
|
+
word_name;
|
|
116
|
+
error;
|
|
117
|
+
constructor(forthic, word_name, error, location) {
|
|
118
|
+
const note = `(${error.message}) when executing word ${word_name}`;
|
|
119
|
+
super(forthic, note, location);
|
|
100
120
|
this.word_name = word_name;
|
|
101
121
|
this.error = error;
|
|
102
122
|
this.name = "WordExecutionError";
|
|
@@ -110,9 +130,11 @@ class WordExecutionError extends ForthicError {
|
|
|
110
130
|
}
|
|
111
131
|
exports.WordExecutionError = WordExecutionError;
|
|
112
132
|
class ModuleError extends ForthicError {
|
|
113
|
-
|
|
133
|
+
module_name;
|
|
134
|
+
error;
|
|
135
|
+
constructor(forthic, module_name, error, location) {
|
|
114
136
|
const note = `Error in module ${module_name}`;
|
|
115
|
-
super(note, location);
|
|
137
|
+
super(forthic, note, location);
|
|
116
138
|
this.module_name = module_name;
|
|
117
139
|
this.error = error;
|
|
118
140
|
this.name = "ModuleError";
|
|
@@ -126,17 +148,18 @@ class ModuleError extends ForthicError {
|
|
|
126
148
|
}
|
|
127
149
|
exports.ModuleError = ModuleError;
|
|
128
150
|
class StackUnderflowError extends ForthicError {
|
|
129
|
-
constructor(location) {
|
|
151
|
+
constructor(forthic, location) {
|
|
130
152
|
const note = `Stack underflow`;
|
|
131
|
-
super(note, location);
|
|
153
|
+
super(forthic, note, location);
|
|
132
154
|
this.name = "StackUnderflowError";
|
|
133
155
|
}
|
|
134
156
|
}
|
|
135
157
|
exports.StackUnderflowError = StackUnderflowError;
|
|
136
158
|
class UnknownTokenError extends ForthicError {
|
|
137
|
-
|
|
159
|
+
token;
|
|
160
|
+
constructor(forthic, token, location) {
|
|
138
161
|
const note = `(Should never happen) Unknown type of token: ${token}`;
|
|
139
|
-
super(note, location);
|
|
162
|
+
super(forthic, note, location);
|
|
140
163
|
this.token = token;
|
|
141
164
|
this.name = "UnknownTokenError";
|
|
142
165
|
}
|
|
@@ -146,17 +169,17 @@ class UnknownTokenError extends ForthicError {
|
|
|
146
169
|
}
|
|
147
170
|
exports.UnknownTokenError = UnknownTokenError;
|
|
148
171
|
class MissingSemicolonError extends ForthicError {
|
|
149
|
-
constructor(location) {
|
|
150
|
-
const note = `
|
|
151
|
-
super(note, location);
|
|
172
|
+
constructor(forthic, location) {
|
|
173
|
+
const note = `Definition was missing its semicolon`;
|
|
174
|
+
super(forthic, note, location);
|
|
152
175
|
this.name = "MissingSemicolonError";
|
|
153
176
|
}
|
|
154
177
|
}
|
|
155
178
|
exports.MissingSemicolonError = MissingSemicolonError;
|
|
156
179
|
class ExtraSemicolonError extends ForthicError {
|
|
157
|
-
constructor(location) {
|
|
158
|
-
const note = `
|
|
159
|
-
super(note, location);
|
|
180
|
+
constructor(forthic, location) {
|
|
181
|
+
const note = `Unexpected semicolon -- no definition in progress`;
|
|
182
|
+
super(forthic, note, location);
|
|
160
183
|
this.name = "ExtraSemicolonError";
|
|
161
184
|
}
|
|
162
185
|
}
|
|
@@ -171,4 +194,23 @@ class IntentionalStopError extends Error {
|
|
|
171
194
|
}
|
|
172
195
|
}
|
|
173
196
|
exports.IntentionalStopError = IntentionalStopError;
|
|
197
|
+
// ============================================================
|
|
198
|
+
// Utility functions
|
|
199
|
+
function get_error_description(forthic, forthicError) {
|
|
200
|
+
// If don't have any extra info, just return the note
|
|
201
|
+
if (!forthic || forthic === "" || forthicError.getLocation() === undefined) {
|
|
202
|
+
return forthicError.getNote();
|
|
203
|
+
}
|
|
204
|
+
// Otherwise, return the note and indicate where the error occurred
|
|
205
|
+
const location = forthicError.getLocation();
|
|
206
|
+
// Extract line where error occurred and highlight the error
|
|
207
|
+
const line_num = location.line;
|
|
208
|
+
// Get lines up to line_num
|
|
209
|
+
const lines = forthic.split("\n").slice(0, line_num);
|
|
210
|
+
// Error line is the line with the error, but with the error location highlighted and everything else a space
|
|
211
|
+
const error_line = " ".repeat(location.column - 1) + "^".repeat(location.end_pos - location.start_pos);
|
|
212
|
+
// Print all forthic lines with numbers adding the error line
|
|
213
|
+
const error_message = `${forthicError.getNote()} at line ${line_num}:\n\`\`\`\n${lines.map((line) => `${line}`).join("\n")}\n${error_line}\n\`\`\``;
|
|
214
|
+
return error_message;
|
|
215
|
+
}
|
|
174
216
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/forthic/errors.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/forthic/errors.ts"],"names":[],"mappings":";;;AA8LA,sDAqBC;AAjND,MAAa,YAAa,SAAQ,KAAK;IACf;IAAyB;IAAsB;IAAnE,YAAoB,OAAe,EAAU,IAAY,EAAU,QAAuB;QACtF,MAAM,OAAO,GAAG,GAAG,IAAI,EAAE,CAAC;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,YAAO,GAAP,OAAO,CAAQ;QAAU,SAA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AI,CAAC,OAAO,IAAI,OAAO,KAAK,EAAE,IAAI,YAAY,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE,CAAC;QACzE,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC;IAED,mEAAmE;IACnE,MAAM,QAAQ,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;IAE5C,4DAA4D;IAC5D,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC;IAE/B,2BAA2B;IAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAErD,6GAA6G;IAC7G,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAC,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAErG,6DAA6D;IAC7D,MAAM,aAAa,GAAG,GAAG,YAAY,CAAC,OAAO,EAAE,YAAY,QAAQ,cAAc,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,UAAU,UAAU,CAAC;IACpJ,OAAO,aAAa,CAAC;AACzB,CAAC"}
|
|
@@ -4,6 +4,20 @@ exports.MapWord = void 0;
|
|
|
4
4
|
const interpreter_1 = require("../interpreter");
|
|
5
5
|
// ( items forthic -- [ ? ] )
|
|
6
6
|
class MapWord {
|
|
7
|
+
forthic;
|
|
8
|
+
forthic_location;
|
|
9
|
+
items;
|
|
10
|
+
flags;
|
|
11
|
+
depth;
|
|
12
|
+
num_interps;
|
|
13
|
+
push_error;
|
|
14
|
+
with_key;
|
|
15
|
+
cur_index;
|
|
16
|
+
result;
|
|
17
|
+
errors;
|
|
18
|
+
is_debugging;
|
|
19
|
+
processing_item;
|
|
20
|
+
is_done;
|
|
7
21
|
constructor(items, forthic, forthic_location, flags) {
|
|
8
22
|
this.forthic = forthic;
|
|
9
23
|
this.forthic_location = forthic_location;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map_word.js","sourceRoot":"","sources":["../../../../src/forthic/global_module/map_word.ts"],"names":[],"mappings":";;;AAAA,gDAAiD;AAUjD,6BAA6B;AAC7B,MAAa,OAAO;
|
|
1
|
+
{"version":3,"file":"map_word.js","sourceRoot":"","sources":["../../../../src/forthic/global_module/map_word.ts"],"names":[],"mappings":";;;AAAA,gDAAiD;AAUjD,6BAA6B;AAC7B,MAAa,OAAO;IAClB,OAAO,CAAM;IACb,gBAAgB,CAAM;IACtB,KAAK,CAAQ;IACb,KAAK,CAAe;IACpB,KAAK,CAAS;IACd,WAAW,CAAS;IACpB,UAAU,CAAW;IACrB,QAAQ,CAAW;IACnB,SAAS,CAAS;IAClB,MAAM,CAAiC;IACvC,MAAM,CAAQ;IACd,YAAY,CAAU;IACtB,eAAe,CAAU;IACzB,OAAO,CAAU;IAEjB,YACE,KAAY,EACZ,OAAY,EACZ,gBAAqB,EACrB,KAAmB;QAEnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,YAAY;QACZ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAE/B,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;Q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type Interpreter } from "./interpreter";
|
|
3
3
|
export declare class GlobalModule extends Module {
|
|
4
|
-
module_id: string;
|
|
5
4
|
literal_handlers: Array<(value: any) => any>;
|
|
6
5
|
constructor(interp: Interpreter);
|
|
7
6
|
find_word(name: string): Word | null;
|
|
@@ -152,6 +151,9 @@ export declare class GlobalModule extends Module {
|
|
|
152
151
|
word_PROFILE_TIMESTAMP(interp: Interpreter): void;
|
|
153
152
|
word_PROFILE_DATA(interp: Interpreter): void;
|
|
154
153
|
word_NULL(interp: Interpreter): void;
|
|
154
|
+
word_NOP(_interp: Interpreter): void;
|
|
155
|
+
word_START_LOG(interp: Interpreter): void;
|
|
156
|
+
word_END_LOG(interp: Interpreter): void;
|
|
155
157
|
word_DEFAULT(interp: Interpreter): void;
|
|
156
158
|
word_star_DEFAULT(interp: Interpreter): Promise<void>;
|
|
157
159
|
word_REC_DEFAULTS(interp: Interpreter): void;
|
|
@@ -8,6 +8,7 @@ const tokenizer_1 = require("./tokenizer");
|
|
|
8
8
|
const errors_1 = require("./errors");
|
|
9
9
|
const DLE = String.fromCharCode(16); // ASCII char for "Data Link Escape" used as an untypeable quote
|
|
10
10
|
class GlobalModule extends module_1.Module {
|
|
11
|
+
literal_handlers;
|
|
11
12
|
constructor(interp) {
|
|
12
13
|
super("<GLOBAL>", interp);
|
|
13
14
|
this.module_id = `<GLOBAL>-${Math.floor(Math.random() * 1000000)}`;
|
|
@@ -120,6 +121,9 @@ class GlobalModule extends module_1.Module {
|
|
|
120
121
|
this.add_module_word("LOAD-SCREEN", this.word_LOAD_SCREEN);
|
|
121
122
|
this.add_module_word(".s", this.word_dot_s);
|
|
122
123
|
this.add_module_word(".S", this.word_dot_S);
|
|
124
|
+
this.add_module_word("START_LOG", this.word_START_LOG);
|
|
125
|
+
this.add_module_word("END_LOG", this.word_END_LOG);
|
|
126
|
+
this.add_module_word("NOP", this.word_NOP);
|
|
123
127
|
// --------------------
|
|
124
128
|
// Date/time words
|
|
125
129
|
this.add_module_word("AM", this.word_AM);
|
|
@@ -292,7 +296,7 @@ class GlobalModule extends module_1.Module {
|
|
|
292
296
|
const module = interp.cur_module();
|
|
293
297
|
varnames.forEach((v) => {
|
|
294
298
|
if (v.match(/__.*/)) {
|
|
295
|
-
throw new errors_1.InvalidVariableNameError(v, "Variable names cannot begin with '__'", interp.get_string_location());
|
|
299
|
+
throw new errors_1.InvalidVariableNameError(interp.get_top_input_string(), v, "Variable names cannot begin with '__'", interp.get_string_location());
|
|
296
300
|
}
|
|
297
301
|
module.add_variable(v);
|
|
298
302
|
});
|
|
@@ -2285,6 +2289,16 @@ class GlobalModule extends module_1.Module {
|
|
|
2285
2289
|
word_NULL(interp) {
|
|
2286
2290
|
interp.stack_push(null);
|
|
2287
2291
|
}
|
|
2292
|
+
// ( -- )
|
|
2293
|
+
word_NOP(_interp) { }
|
|
2294
|
+
// ( -- )
|
|
2295
|
+
word_START_LOG(interp) {
|
|
2296
|
+
interp.startStream();
|
|
2297
|
+
}
|
|
2298
|
+
// ( -- )
|
|
2299
|
+
word_END_LOG(interp) {
|
|
2300
|
+
interp.endStream();
|
|
2301
|
+
}
|
|
2288
2302
|
// ( value default_value -- value )
|
|
2289
2303
|
word_DEFAULT(interp) {
|
|
2290
2304
|
const default_value = interp.stack_pop();
|