{"version":3,"file":"howdy-D0n-Pei6.js","sources":["../../../node_modules/@forthic/interp/dist/esm/forthic/tokenizer.js","../../../node_modules/@forthic/interp/dist/esm/forthic/errors.js","../../../node_modules/@forthic/interp/dist/esm/forthic/module.js","../../../node_modules/@forthic/interp/dist/esm/forthic/utils.js","../../../node_modules/@forthic/interp/dist/esm/forthic/global_module/map_word.js","../../../node_modules/@forthic/interp/dist/esm/forthic/global_module.js","../../../node_modules/@forthic/interp/dist/esm/forthic/interpreter.js","../../../node_modules/@forthic/interp/dist/esm/index.js","../../../app/javascript/components/howdy.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UnterminatedStringError = exports.InvalidWordNameError = exports.InvalidInputPositionError = exports.PositionedString = exports.CodeLocation = exports.Tokenizer = exports.DLE = exports.Token = exports.TokenType = void 0;\n// -------------------------------------\n// Tokenizer\nvar TokenType;\n(function (TokenType) {\n TokenType[TokenType[\"STRING\"] = 1] = \"STRING\";\n TokenType[TokenType[\"COMMENT\"] = 2] = \"COMMENT\";\n TokenType[TokenType[\"START_ARRAY\"] = 3] = \"START_ARRAY\";\n TokenType[TokenType[\"END_ARRAY\"] = 4] = \"END_ARRAY\";\n TokenType[TokenType[\"START_MODULE\"] = 5] = \"START_MODULE\";\n TokenType[TokenType[\"END_MODULE\"] = 6] = \"END_MODULE\";\n TokenType[TokenType[\"START_DEF\"] = 7] = \"START_DEF\";\n TokenType[TokenType[\"END_DEF\"] = 8] = \"END_DEF\";\n TokenType[TokenType[\"START_MEMO\"] = 9] = \"START_MEMO\";\n TokenType[TokenType[\"WORD\"] = 10] = \"WORD\";\n TokenType[TokenType[\"EOS\"] = 11] = \"EOS\";\n})(TokenType || (exports.TokenType = TokenType = {}));\nclass Token {\n type;\n string;\n location;\n constructor(type, string, location) {\n this.type = type;\n this.string = string;\n this.location = location;\n }\n}\nexports.Token = Token;\n// 'Data Link Escape'\nexports.DLE = String.fromCharCode(16);\nclass Tokenizer {\n reference_location;\n line;\n column;\n input_string;\n input_pos;\n whitespace;\n quote_chars;\n token_start_pos;\n token_end_pos;\n token_line;\n token_column;\n token_string;\n string_delta;\n streaming;\n constructor(string, reference_location = null, streaming = false) {\n if (!reference_location) {\n reference_location = new CodeLocation({ screen_name: \"\" });\n }\n this.reference_location = reference_location;\n this.line = reference_location.line;\n this.column = reference_location.column;\n this.input_string = this.unescape_string(string);\n this.input_pos = 0; // This is the index into the input_string\n this.whitespace = [\" \", \"\\t\", \"\\n\", \"\\r\", \"(\", \")\", \",\"];\n this.quote_chars = ['\"', \"'\", \"^\", \"\\u0010\"]; // DLE (Data Link Escape) character\n // Token info\n this.token_start_pos = 0;\n this.token_end_pos = 0;\n this.token_line = 0;\n this.token_column = 0;\n this.token_string = \"\";\n this.string_delta = undefined;\n this.streaming = streaming;\n }\n next_token() {\n this.clear_token_string();\n return this.transition_from_START();\n }\n // ===================\n // Helper functions\n unescape_string(string) {\n let result = string.replace(/</g, \"<\");\n result = result.replace(/>/g, \">\");\n return result;\n }\n clear_token_string() {\n this.token_string = \"\";\n }\n note_start_token() {\n this.token_start_pos = this.input_pos + this.reference_location.start_pos;\n this.token_line = this.line;\n this.token_column = this.column;\n }\n is_whitespace(char) {\n return this.whitespace.indexOf(char) >= 0;\n }\n is_quote(char) {\n return this.quote_chars.indexOf(char) >= 0;\n }\n is_triple_quote(index, char) {\n if (!this.is_quote(char))\n return false;\n if (index + 2 >= this.input_string.length)\n return false;\n return (this.input_string[index + 1] === char &&\n this.input_string[index + 2] === char);\n }\n is_start_memo(index) {\n if (index + 1 >= this.input_string.length)\n return false;\n return (this.input_string[index] === \"@\" && this.input_string[index + 1] === \":\");\n }\n advance_position(num_chars) {\n let i;\n if (num_chars >= 0) {\n for (i = 0; i < num_chars; i++) {\n if (this.input_string[this.input_pos] === \"\\n\") {\n this.line += 1;\n this.column = 1;\n }\n else {\n this.column += 1;\n }\n this.input_pos += 1;\n }\n }\n else {\n for (i = 0; i < -num_chars; i++) {\n this.input_pos -= 1;\n if (this.input_pos < 0 || this.column < 0) {\n throw new InvalidInputPositionError(this.input_string, this.get_token_location());\n }\n if (this.input_string[this.input_pos] === \"\\n\") {\n this.line -= 1;\n this.column = 1;\n }\n else {\n this.column -= 1;\n }\n }\n i = -i;\n }\n return i;\n }\n get_token_location() {\n return new CodeLocation({\n screen_name: this.reference_location.screen_name,\n line: this.token_line,\n column: this.token_column,\n start_pos: this.token_start_pos,\n end_pos: this.token_start_pos + this.token_string.length,\n });\n }\n get_input_string() {\n return this.input_string;\n }\n get_string_delta() {\n if (!this.string_delta)\n return \"\";\n return this.input_string.slice(this.string_delta.start, this.string_delta.end);\n }\n transition_from_START() {\n while (this.input_pos < this.input_string.length) {\n const char = this.input_string[this.input_pos];\n this.note_start_token();\n this.advance_position(1);\n if (this.is_whitespace(char))\n continue;\n else if (char === \"#\")\n return this.transition_from_COMMENT();\n else if (char === \":\")\n return this.transition_from_START_DEFINITION();\n else if (this.is_start_memo(this.input_pos - 1)) {\n this.advance_position(1); // Skip over \":\" in \"@:\"\n return this.transition_from_START_MEMO();\n }\n else if (char === \";\") {\n this.token_string = char;\n return new Token(TokenType.END_DEF, char, this.get_token_location());\n }\n else if (char === \"[\") {\n this.token_string = char;\n return new Token(TokenType.START_ARRAY, char, this.get_token_location());\n }\n else if (char === \"]\") {\n this.token_string = char;\n return new Token(TokenType.END_ARRAY, char, this.get_token_location());\n }\n else if (char === \"{\")\n return this.transition_from_GATHER_MODULE();\n else if (char === \"}\") {\n this.token_string = char;\n return new Token(TokenType.END_MODULE, char, this.get_token_location());\n }\n else if (this.is_triple_quote(this.input_pos - 1, char)) {\n this.advance_position(2); // Skip over 2nd and 3rd quote chars\n return this.transition_from_GATHER_TRIPLE_QUOTE_STRING(char);\n }\n else if (this.is_quote(char))\n return this.transition_from_GATHER_STRING(char);\n else {\n this.advance_position(-1); // Back up to beginning of word\n return this.transition_from_GATHER_WORD();\n }\n }\n return new Token(TokenType.EOS, \"\", this.get_token_location());\n }\n transition_from_COMMENT() {\n this.note_start_token();\n while (this.input_pos < this.input_string.length) {\n const char = this.input_string[this.input_pos];\n this.token_string += char;\n this.advance_position(1);\n if (char === \"\\n\") {\n this.advance_position(-1);\n break;\n }\n }\n return new Token(TokenType.COMMENT, this.token_string, this.get_token_location());\n }\n transition_from_START_DEFINITION() {\n while (this.input_pos < this.input_string.length) {\n const char = this.input_string[this.input_pos];\n this.advance_position(1);\n if (this.is_whitespace(char))\n continue;\n else if (this.is_quote(char)) {\n throw new InvalidWordNameError(this.input_string, this.get_token_location(), \"Definition names can't have quotes in them\");\n }\n else {\n this.advance_position(-1);\n return this.transition_from_GATHER_DEFINITION_NAME();\n }\n }\n throw new InvalidWordNameError(this.input_string, this.get_token_location(), \"Got EOS in START_DEFINITION\");\n }\n transition_from_START_MEMO() {\n while (this.input_pos < this.input_string.length) {\n const char = this.input_string[this.input_pos];\n this.advance_position(1);\n if (this.is_whitespace(char))\n continue;\n else if (this.is_quote(char))\n throw new InvalidWordNameError(this.input_string, this.get_token_location(), \"Memo names can't have quotes in them\");\n else {\n this.advance_position(-1);\n return this.transition_from_GATHER_MEMO_NAME();\n }\n }\n throw new InvalidWordNameError(this.input_string, this.get_token_location(), \"Got EOS in START_MEMO\");\n }\n gather_definition_name() {\n while (this.input_pos < this.input_string.length) {\n const char = this.input_string[this.input_pos];\n this.advance_position(1);\n if (this.is_whitespace(char))\n break;\n if (this.is_quote(char)) {\n throw new InvalidWordNameError(this.input_string, this.get_token_location(), \"Definition names can't have quotes in them\");\n }\n if ([\"[\", \"]\", \"{\", \"}\"].indexOf(char) >= 0) {\n throw new InvalidWordNameError(this.input_string, this.get_token_location(), `Definition names can't have '${char}' in them`);\n }\n this.token_string += char;\n }\n }\n transition_from_GATHER_DEFINITION_NAME() {\n this.note_start_token();\n this.gather_definition_name();\n return new Token(TokenType.START_DEF, this.token_string, this.get_token_location());\n }\n transition_from_GATHER_MEMO_NAME() {\n this.note_start_token();\n this.gather_definition_name();\n return new Token(TokenType.START_MEMO, this.token_string, this.get_token_location());\n }\n transition_from_GATHER_MODULE() {\n this.note_start_token();\n while (this.input_pos < this.input_string.length) {\n const char = this.input_string[this.input_pos];\n this.advance_position(1);\n if (this.is_whitespace(char))\n break;\n else if (char === \"}\") {\n this.advance_position(-1);\n break;\n }\n else\n this.token_string += char;\n }\n return new Token(TokenType.START_MODULE, this.token_string, this.get_token_location());\n }\n transition_from_GATHER_TRIPLE_QUOTE_STRING(delim) {\n this.note_start_token();\n const string_delimiter = delim;\n this.string_delta = {\n start: this.input_pos,\n end: this.input_pos,\n };\n while (this.input_pos < this.input_string.length) {\n const char = this.input_string[this.input_pos];\n if (char === string_delimiter &&\n this.is_triple_quote(this.input_pos, char)) {\n this.advance_position(3);\n const token = new Token(TokenType.STRING, this.token_string, this.get_token_location());\n this.string_delta = undefined;\n return token;\n }\n else {\n this.advance_position(1);\n this.token_string += char;\n this.string_delta.end = this.input_pos;\n }\n }\n if (this.streaming) {\n return null;\n }\n throw new UnterminatedStringError(this.input_string, this.get_token_location());\n }\n transition_from_GATHER_STRING(delim) {\n this.note_start_token();\n const string_delimiter = delim;\n this.string_delta = {\n start: this.input_pos,\n end: this.input_pos,\n };\n while (this.input_pos < this.input_string.length) {\n const char = this.input_string[this.input_pos];\n this.advance_position(1);\n if (char === string_delimiter) {\n const token = new Token(TokenType.STRING, this.token_string, this.get_token_location());\n this.string_delta = undefined;\n return token;\n }\n else {\n this.token_string += char;\n this.string_delta.end = this.input_pos;\n }\n }\n if (this.streaming) {\n return null;\n }\n throw new UnterminatedStringError(this.input_string, this.get_token_location());\n }\n transition_from_GATHER_WORD() {\n this.note_start_token();\n while (this.input_pos < this.input_string.length) {\n const char = this.input_string[this.input_pos];\n this.advance_position(1);\n if (this.is_whitespace(char))\n break;\n if ([\";\", \"[\", \"]\", \"{\", \"}\", \"#\"].indexOf(char) >= 0) {\n this.advance_position(-1);\n break;\n }\n else\n this.token_string += char;\n }\n return new Token(TokenType.WORD, this.token_string, this.get_token_location());\n }\n}\nexports.Tokenizer = Tokenizer;\nclass CodeLocation {\n screen_name;\n line;\n column;\n start_pos;\n end_pos;\n constructor({ screen_name = \"\", line = 1, column = 1, start_pos = 0, end_pos = 0, }) {\n this.screen_name = screen_name;\n this.line = line;\n this.column = column;\n this.start_pos = start_pos;\n this.end_pos = end_pos;\n }\n}\nexports.CodeLocation = CodeLocation;\nclass PositionedString {\n string;\n location;\n constructor(string, location) {\n this.string = string;\n this.location = location;\n }\n valueOf() {\n return this.string;\n }\n}\nexports.PositionedString = PositionedString;\nclass TokenizerError extends Error {\n note;\n input;\n location;\n constructor(note, input, location) {\n const message = `${note} from ${location.start_pos} to ${location.end_pos} in '${input}'`;\n super(message);\n this.note = note;\n this.input = input;\n this.location = location;\n this.name = \"TokenizerError\";\n }\n getNote() {\n return this.note;\n }\n getInput() {\n return this.input;\n }\n getLocation() {\n return this.location;\n }\n getMessage() {\n return this.message;\n }\n}\nclass InvalidInputPositionError extends TokenizerError {\n constructor(input, location) {\n super(\"Invalid input position\", input, location);\n this.name = \"InvalidInputPositionError\";\n }\n}\nexports.InvalidInputPositionError = InvalidInputPositionError;\nclass InvalidWordNameError extends TokenizerError {\n constructor(input, location, note) {\n const message = `Invalid word name: ${note}`;\n super(message, input, location);\n this.name = \"InvalidWordNameError\";\n }\n}\nexports.InvalidWordNameError = InvalidWordNameError;\nclass UnterminatedStringError extends TokenizerError {\n constructor(input, location) {\n super(\"Unterminated string\", input, location);\n this.name = \"UnterminatedStringError\";\n }\n}\nexports.UnterminatedStringError = UnterminatedStringError;\n//# sourceMappingURL=tokenizer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.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;\nexports.get_error_description = get_error_description;\nclass ForthicError extends Error {\n forthic;\n note;\n location;\n constructor(forthic, note, location) {\n const message = `${note}`;\n super(message);\n this.forthic = forthic;\n this.note = note;\n this.location = location;\n }\n getDescription() {\n return get_error_description(this.forthic, this);\n }\n getLocation() {\n return this.location;\n }\n getForthic() {\n return this.forthic;\n }\n getNote() {\n return this.note;\n }\n getMessage() {\n return this.message;\n }\n}\nexports.ForthicError = ForthicError;\n// ============================================================\n// Interpreter errors\n// Interpreter couldn't find word in dictionaries\nclass UnknownWordError extends ForthicError {\n word;\n constructor(forthic, word, location) {\n const note = `Unknown word: ${word}`;\n super(forthic, note, location);\n this.word = word;\n this.name = \"UnknownWordError\";\n }\n getWord() {\n return this.word;\n }\n}\nexports.UnknownWordError = UnknownWordError;\n// Variable name is not allowed\nclass InvalidVariableNameError extends ForthicError {\n var_name;\n addl_note;\n constructor(forthic, var_name, addl_note, location) {\n const note = `Invalid variable name: ${var_name}(${addl_note})`;\n super(forthic, note, location);\n this.var_name = var_name;\n this.addl_note = addl_note;\n this.name = \"InvalidVariableNameError\";\n }\n getVarName() {\n return this.var_name;\n }\n getAddlNote() {\n return this.addl_note;\n }\n}\nexports.InvalidVariableNameError = InvalidVariableNameError;\n// Interpreter couldn't find screen\nclass UnknownScreenError extends ForthicError {\n screen_name;\n constructor(forthic, screen_name, location) {\n const note = `Unknown screen: ${screen_name}`;\n super(forthic, note, location);\n this.screen_name = screen_name;\n this.name = \"UnknownScreenError\";\n }\n getScreenName() {\n return this.screen_name;\n }\n}\nexports.UnknownScreenError = UnknownScreenError;\n// Interpreter couldn't find module\nclass UnknownModuleError extends ForthicError {\n module_name;\n constructor(forthic, module_name, location) {\n const note = `Unknown module: ${module_name}`;\n super(forthic, note, location);\n this.module_name = module_name;\n this.name = \"UnknownModuleError\";\n }\n getModuleName() {\n return this.module_name;\n }\n}\nexports.UnknownModuleError = UnknownModuleError;\nclass TooManyAttemptsError extends ForthicError {\n num_attempts;\n max_attempts;\n constructor(forthic, num_attempts, max_attempts, location) {\n const note = `Too many recovery attempts: ${num_attempts} of ${max_attempts}`;\n super(forthic, note, location);\n this.num_attempts = num_attempts;\n this.max_attempts = max_attempts;\n this.name = \"TooManyAttemptsError\";\n }\n getNumAttempts() {\n return this.num_attempts;\n }\n getMaxAttempts() {\n return this.max_attempts;\n }\n}\nexports.TooManyAttemptsError = TooManyAttemptsError;\nclass WordExecutionError extends ForthicError {\n word_name;\n error;\n constructor(forthic, word_name, error, location) {\n const note = `(${error.message}) when executing word ${word_name}`;\n super(forthic, note, location);\n this.word_name = word_name;\n this.error = error;\n this.name = \"WordExecutionError\";\n }\n getWordName() {\n return this.word_name;\n }\n getError() {\n return this.error;\n }\n}\nexports.WordExecutionError = WordExecutionError;\nclass ModuleError extends ForthicError {\n module_name;\n error;\n constructor(forthic, module_name, error, location) {\n const note = `Error in module ${module_name}`;\n super(forthic, note, location);\n this.module_name = module_name;\n this.error = error;\n this.name = \"ModuleError\";\n }\n getModuleName() {\n return this.module_name;\n }\n getError() {\n return this.error;\n }\n}\nexports.ModuleError = ModuleError;\nclass StackUnderflowError extends ForthicError {\n constructor(forthic, location) {\n const note = `Stack underflow`;\n super(forthic, note, location);\n this.name = \"StackUnderflowError\";\n }\n}\nexports.StackUnderflowError = StackUnderflowError;\nclass UnknownTokenError extends ForthicError {\n token;\n constructor(forthic, token, location) {\n const note = `(Should never happen) Unknown type of token: ${token}`;\n super(forthic, note, location);\n this.token = token;\n this.name = \"UnknownTokenError\";\n }\n getToken() {\n return this.token;\n }\n}\nexports.UnknownTokenError = UnknownTokenError;\nclass MissingSemicolonError extends ForthicError {\n constructor(forthic, location) {\n const note = `Definition was missing its semicolon`;\n super(forthic, note, location);\n this.name = \"MissingSemicolonError\";\n }\n}\nexports.MissingSemicolonError = MissingSemicolonError;\nclass ExtraSemicolonError extends ForthicError {\n constructor(forthic, location) {\n const note = `Unexpected semicolon -- no definition in progress`;\n super(forthic, note, location);\n this.name = \"ExtraSemicolonError\";\n }\n}\nexports.ExtraSemicolonError = ExtraSemicolonError;\n// ============================================================\n// Misc errors\n// Error indicating intentional stop\nclass IntentionalStopError extends Error {\n constructor(message) {\n super(message);\n this.name = \"IntentionalStopError\";\n }\n}\nexports.IntentionalStopError = IntentionalStopError;\n// ============================================================\n// Utility functions\nfunction get_error_description(forthic, forthicError) {\n // If don't have any extra info, just return the note\n if (!forthic || forthic === \"\" || forthicError.getLocation() === undefined) {\n return forthicError.getNote();\n }\n // Otherwise, return the note and indicate where the error occurred\n const location = forthicError.getLocation();\n // Extract line where error occurred and highlight the error\n const line_num = location.line;\n // Get lines up to line_num\n const lines = forthic.split(\"\\n\").slice(0, line_num);\n // Error line is the line with the error, but with the error location highlighted and everything else a space\n const error_line = \" \".repeat(location.column - 1) + \"^\".repeat(location.end_pos - location.start_pos);\n // Print all forthic lines with numbers adding the error line\n const error_message = `${forthicError.getNote()} at line ${line_num}:\\n\\`\\`\\`\\n${lines.map((line) => `${line}`).join(\"\\n\")}\\n${error_line}\\n\\`\\`\\``;\n return error_message;\n}\n//# sourceMappingURL=errors.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Module = exports.ModuleMemoBangAtWord = exports.ModuleMemoBangWord = exports.ModuleMemoWord = exports.ImportedWord = exports.ModuleWord = exports.DefinitionWord = exports.PushValueWord = exports.Word = exports.Variable = void 0;\nconst errors_1 = require(\"./errors\");\nconst errors_2 = require(\"./errors\");\n// -------------------------------------\n// Variable\nclass Variable {\n name;\n value;\n constructor(name, value = null) {\n this.name = name;\n this.value = value;\n }\n get_name() {\n return this.name;\n }\n set_value(val) {\n this.value = val;\n }\n get_value() {\n return this.value;\n }\n dup() {\n const result = new Variable(this.name, this.value);\n return result;\n }\n}\nexports.Variable = Variable;\n// -------------------------------------\n// Words\nclass Word {\n name;\n string;\n location;\n constructor(name) {\n this.name = name;\n this.string = name;\n this.location = null;\n }\n set_location(location) {\n this.location = location;\n }\n get_location() {\n return this.location;\n }\n async execute(_interp, _options) {\n throw \"Must override Word.execute\";\n }\n}\nexports.Word = Word;\nclass PushValueWord extends Word {\n value;\n constructor(name, value) {\n super(name);\n this.value = value;\n }\n async execute(interp) {\n interp.stack_push(this.value);\n }\n}\nexports.PushValueWord = PushValueWord;\nclass DefinitionWord extends Word {\n words;\n cur_index;\n constructor(name) {\n super(name);\n this.words = [];\n this.cur_index = 0;\n }\n add_word(word) {\n this.words.push(word);\n }\n async execute(interp) {\n for (let i = 0; i < this.words.length; i++) {\n const word = this.words[i];\n try {\n await word.execute(interp);\n }\n catch (e) {\n const tokenizer = interp.get_tokenizer();\n throw new errors_1.WordExecutionError(interp.get_top_input_string(), this.name, e, tokenizer.get_token_location());\n }\n }\n }\n}\nexports.DefinitionWord = DefinitionWord;\nclass ModuleWord extends Word {\n handler;\n constructor(name, handler) {\n super(name);\n this.handler = handler;\n }\n async execute(interp) {\n try {\n await this.handler(interp);\n }\n catch (e) {\n if (e instanceof errors_2.IntentionalStopError) {\n throw e;\n }\n const tokenizer = interp.get_tokenizer();\n throw new errors_1.WordExecutionError(interp.get_top_input_string(), this.name, e, tokenizer.get_token_location());\n }\n }\n}\nexports.ModuleWord = ModuleWord;\nclass ImportedWord extends Word {\n module_word;\n imported_module;\n constructor(module_word, prefix, module) {\n if (prefix != \"\")\n prefix = prefix + \".\";\n super(`${prefix}${module_word.name}`);\n this.module_word = module_word;\n this.imported_module = module;\n }\n async execute(interp) {\n interp.module_stack_push(this.imported_module);\n await this.module_word.execute(interp);\n interp.module_stack_pop();\n }\n}\nexports.ImportedWord = ImportedWord;\nclass ModuleMemoWord extends Word {\n word;\n has_value;\n value;\n constructor(word) {\n super(word.name);\n this.word = word;\n this.has_value = false;\n this.value = null;\n }\n async refresh(interp) {\n await this.word.execute(interp, { ignore_debug: true });\n this.value = interp.stack_pop();\n this.has_value = true;\n }\n async execute(interp) {\n if (!this.has_value)\n await this.refresh(interp);\n interp.stack_push(this.value);\n }\n reset() {\n this.has_value = false;\n this.value = null;\n }\n}\nexports.ModuleMemoWord = ModuleMemoWord;\nclass ModuleMemoBangWord extends Word {\n memo_word;\n constructor(memo_word) {\n super(`${memo_word.name}!`);\n this.memo_word = memo_word;\n }\n async execute(interp) {\n await this.memo_word.refresh(interp);\n }\n}\nexports.ModuleMemoBangWord = ModuleMemoBangWord;\nclass ModuleMemoBangAtWord extends Word {\n memo_word;\n constructor(memo_word) {\n super(`${memo_word.name}!@`);\n this.memo_word = memo_word;\n }\n async execute(interp) {\n await this.memo_word.refresh(interp);\n interp.stack_push(this.memo_word.value);\n }\n}\nexports.ModuleMemoBangAtWord = ModuleMemoBangAtWord;\n// -------------------------------------\n// Module\nclass Module {\n words;\n exportable;\n variables;\n modules;\n module_prefixes;\n required_modules;\n name;\n forthic_code;\n module_id;\n constructor(name, interp, forthic_code = \"\") {\n this.words = [];\n this.exportable = [];\n this.variables = {};\n this.modules = {};\n this.module_prefixes = {};\n this.required_modules = [];\n this.name = name;\n this.forthic_code = forthic_code;\n this.module_id = `${name}-${Math.floor(Math.random() * 1000000)}`;\n }\n dup() {\n const self = this;\n const result = new Module(self.name);\n result.words = self.words.slice();\n result.exportable = self.exportable.slice();\n Object.keys(self.variables).forEach((key) => (result.variables[key] = self.variables[key].dup()));\n Object.keys(self.modules).forEach((key) => (result.modules[key] = self.modules[key]));\n result.required_modules = self.required_modules.slice();\n result.forthic_code = self.forthic_code;\n return result;\n }\n copy(interp) {\n const self = this;\n const result = new Module(self.name);\n result.words = self.words.slice();\n result.exportable = self.exportable.slice();\n Object.keys(self.variables).forEach((key) => (result.variables[key] = self.variables[key].dup()));\n Object.keys(self.modules).forEach((key) => (result.modules[key] = self.modules[key]));\n Object.entries(self.module_prefixes).forEach(([module_name, prefixes]) => {\n prefixes.forEach((prefix) => {\n result.import_module(prefix, self.modules[module_name], interp);\n });\n });\n result.forthic_code = self.forthic_code;\n return result;\n }\n require_module(prefix, module) {\n this.required_modules.push({\n prefix: prefix,\n module: module,\n });\n }\n find_module(name) {\n return this.modules[name];\n }\n add_module_word(word_name, word_func) {\n this.add_exportable_word(new ModuleWord(word_name, word_func));\n }\n add_word(word) {\n this.words.push(word);\n }\n add_memo_words(word) {\n const memo_word = new ModuleMemoWord(word);\n this.words.push(memo_word);\n this.words.push(new ModuleMemoBangWord(memo_word));\n this.words.push(new ModuleMemoBangAtWord(memo_word));\n return memo_word;\n }\n add_exportable(names) {\n this.exportable = this.exportable.concat(names);\n }\n exportable_words() {\n const self = this;\n const result = [];\n self.words.forEach((word) => {\n if (self.exportable.indexOf(word.name) >= 0)\n result.push(word);\n });\n return result;\n }\n add_exportable_word(word) {\n this.words.push(word);\n this.exportable.push(word.name);\n }\n add_variable(name, value = null) {\n if (!this.variables[name])\n this.variables[name] = new Variable(name, value);\n }\n initialize(interp) {\n const self = this;\n self.required_modules.forEach((rec) => {\n self.import_module(rec.prefix, rec.module, interp);\n });\n }\n register_module(module_name, prefix, module) {\n this.modules[module_name] = module;\n if (!this.module_prefixes[module_name])\n this.module_prefixes[module_name] = new Set();\n this.module_prefixes[module_name].add(prefix);\n }\n import_module(prefix, module, interp) {\n const self = this;\n const new_module = module.dup();\n new_module.initialize(interp);\n const words = new_module.exportable_words();\n words.forEach((word) => {\n self.add_word(new ImportedWord(word, prefix, new_module));\n });\n self.register_module(module.name, prefix, new_module);\n }\n find_word(name) {\n let result = this.find_dictionary_word(name);\n if (!result)\n result = this.find_variable(name);\n return result;\n }\n find_dictionary_word(word_name) {\n for (let i = this.words.length - 1; i >= 0; i--) {\n const w = this.words[i];\n if (w.name == word_name)\n return w;\n }\n return null;\n }\n find_variable(varname) {\n const var_result = this.variables[varname];\n let result = null;\n if (var_result) {\n result = new PushValueWord(varname, var_result);\n }\n return result;\n }\n}\nexports.Module = Module;\n//# sourceMappingURL=module.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.is_string = is_string;\nexports.is_object = is_object;\nexports.is_record = is_record;\nexports.is_array = is_array;\nexports.is_empty_object = is_empty_object;\nexports.pretty_print = pretty_print;\nexports.to_string = to_string;\nexports.is_valid_date = is_valid_date;\nexports.to_date = to_date;\nexports.date_to_string = date_to_string;\nexports.date_to_int = date_to_int;\nfunction is_string(value) {\n return typeof value === \"string\" || value instanceof String;\n}\nfunction is_object(value) {\n if (value === null)\n return false;\n return typeof value === \"object\" && !Array.isArray(value);\n}\nfunction is_record(value) {\n return is_object(value);\n}\nfunction is_array(value) {\n return typeof value === \"object\" && Array.isArray(value);\n}\nfunction is_empty_object(value) {\n if (is_object(value)) {\n return Object.keys(value).length == 0;\n }\n return false;\n}\nfunction pretty_print(value) {\n return JSON.stringify(value, undefined, 4);\n}\nfunction to_string(obj) {\n return pretty_print(obj);\n}\nfunction is_valid_date(date) {\n if (date instanceof Date) {\n return !isNaN(date.getTime());\n }\n else if (typeof date === \"string\" || typeof date === \"number\") {\n const parsedDate = new Date(date);\n return !isNaN(parsedDate.getTime());\n }\n return false;\n}\nfunction to_date(obj) {\n let result;\n if (obj instanceof Date) {\n result = obj;\n }\n else if (is_valid_date(obj)) {\n result = new Date(obj);\n }\n else {\n return null;\n }\n result.setHours(0, 0, 0, 0);\n return result;\n}\nfunction date_to_string(date) {\n let result = \"\";\n if (date instanceof Date) {\n const m = date.getUTCMonth() + 1;\n const d = date.getUTCDate();\n const y = date.getUTCFullYear();\n let m_str = `${m}`;\n let d_str = `${d}`;\n if (m < 10)\n m_str = `0${m}`;\n if (d < 10)\n d_str = `0${d}`;\n result = `${y}-${m_str}-${d_str}`;\n }\n return result;\n}\nfunction date_to_int(date) {\n const str = date_to_string(date);\n const digits = str.replaceAll(\"-\", \"\");\n const result = parseInt(digits);\n return result;\n}\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MapWord = void 0;\nconst interpreter_1 = require(\"../interpreter\");\n// ( items forthic -- [ ? ] )\nclass MapWord {\n forthic;\n forthic_location;\n items;\n flags;\n depth;\n num_interps;\n push_error;\n with_key;\n cur_index;\n result;\n errors;\n is_debugging;\n processing_item;\n is_done;\n constructor(items, forthic, forthic_location, flags) {\n this.forthic = forthic;\n this.forthic_location = forthic_location;\n this.items = items;\n this.flags = flags;\n // MAP flags\n this.depth = flags.depth || 0;\n this.num_interps = flags.interps || 1;\n this.push_error = flags.push_error;\n this.with_key = flags.with_key;\n this.cur_index = 0;\n this.result = [];\n this.errors = [];\n this.is_debugging = false;\n this.processing_item = false;\n this.is_done = false;\n }\n async execute(interp) {\n await this.normal_execute(interp);\n }\n async normal_execute(interp) {\n this.is_debugging = false;\n const items = this.items;\n if (!items || items.length === 0) {\n interp.stack_push(items);\n return;\n }\n this.result = [];\n this.errors = [];\n if (this.num_interps > 1) {\n interp.stack_push(items);\n await interp.run(\"LENGTH\");\n const num_items = interp.stack_pop();\n const group_size = Math.ceil(num_items / this.num_interps);\n interp.stack_push(items);\n interp.stack_push(group_size);\n await interp.run(\"GROUPS-OF\");\n const groups = interp.stack_pop();\n // Clone and load up interpreters\n const interp_runs = [];\n for (let i = 0; i < groups.length; i++) {\n const group = groups[i];\n const new_interp = (0, interpreter_1.dup_interpreter)(interp);\n const interp_run = this.map(new_interp, group);\n interp_runs.push(interp_run);\n }\n const run_results = await Promise.all(interp_runs);\n // Gather results\n const is_array = items instanceof Array;\n let array_result = [];\n let object_result = {};\n let errors = [];\n for (const res of run_results) {\n if (is_array) {\n array_result = [...array_result, ...res[0]];\n }\n else {\n object_result = { ...object_result, ...res[0] };\n }\n errors = [...errors, ...res[1]];\n }\n this.result = is_array ? array_result : object_result;\n this.errors = errors;\n }\n else {\n await this.map(interp, items);\n }\n // Return results\n interp.stack_push(this.result);\n if (this.push_error)\n interp.stack_push(this.errors);\n }\n async map(interp, items) {\n const forthic = this.forthic;\n const forthic_location = this.forthic_location;\n const self = this;\n if (!items) {\n interp.stack_push(items);\n return;\n }\n // This maps the forthic over an item, storing errors if needed\n async function map_value(key, value, errors) {\n if (self.with_key)\n interp.stack_push(key);\n interp.stack_push(value);\n if (self.push_error) {\n let error = null;\n try {\n // If this runs successfully, it would have pushed the result onto the stack\n await interp.run(forthic, forthic_location);\n }\n catch (e) {\n // Since this didn't run successfully, push null onto the stack\n interp.stack_push(null);\n error = e;\n }\n errors.push(error);\n }\n else {\n await interp.run(forthic, forthic_location);\n }\n return interp.stack_pop();\n }\n // This recursively descends a record structure\n async function descend_record(record, depth, accum, errors) {\n const keys = Object.keys(record);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n const item = record[k];\n if (depth > 0) {\n if (item instanceof Array) {\n accum[k] = [];\n await descend_list(item, depth - 1, accum[k], errors);\n }\n else {\n accum[k] = {};\n await descend_record(item, depth - 1, accum[k], errors);\n }\n }\n else {\n accum[k] = await map_value(k, item, errors);\n }\n }\n return accum;\n }\n // This recursively descends a list\n async function descend_list(items, depth, accum, errors) {\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (depth > 0) {\n if (item instanceof Array) {\n accum.push([]);\n await descend_list(item, depth - 1, accum[accum.length - 1], errors);\n }\n else {\n accum.push({});\n await descend_record(item, depth - 1, accum[accum.length - 1], errors);\n }\n }\n else {\n accum.push(await map_value(i, item, errors));\n }\n }\n return accum;\n }\n const errors = [];\n let result;\n const depth = this.depth;\n if (items instanceof Array) {\n result = await descend_list(items, depth, [], errors);\n }\n else {\n result = await descend_record(items, depth, {}, errors);\n }\n this.result = result;\n this.errors = errors;\n return [result, errors];\n }\n}\nexports.MapWord = MapWord;\n//# sourceMappingURL=map_word.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GlobalModule = void 0;\nconst module_1 = require(\"./module\");\nconst utils_1 = require(\"./utils\");\nconst map_word_1 = require(\"./global_module/map_word\");\nconst tokenizer_1 = require(\"./tokenizer\");\nconst errors_1 = require(\"./errors\");\nconst DLE = String.fromCharCode(16); // ASCII char for \"Data Link Escape\" used as an untypeable quote\nclass GlobalModule extends module_1.Module {\n literal_handlers;\n constructor(interp) {\n super(\"\", interp);\n this.module_id = `-${Math.floor(Math.random() * 1000000)}`;\n // Set default flags\n interp.set_flags(this.module_id, {\n with_key: null,\n push_error: null,\n comparator: null,\n push_rest: null,\n depth: null,\n overwrite: null,\n delay: null,\n interps: 1,\n note_progress: null,\n });\n this.literal_handlers = [\n this.to_bool,\n this.to_float,\n this.to_literal_date,\n this.to_time,\n this.to_int,\n ];\n // --------------------\n // Base words\n this.add_module_word(\"VARIABLES\", this.word_VARIABLES);\n this.add_module_word(\"!\", this.word_bang);\n this.add_module_word(\"@\", this.word_at);\n this.add_module_word(\"!@\", this.word_bang_at);\n this.add_module_word(\"INTERPRET\", this.word_INTERPRET);\n this.add_module_word(\"EXPORT\", this.word_EXPORT);\n this.add_module_word(\"USE-MODULES\", this.word_USE_MODULES);\n this.add_module_word(\"REC\", this.word_REC);\n this.add_module_word(\"REC@\", this.word_REC_at);\n this.add_module_word(\"|REC@\", this.word_pipe_REC_at);\n this.add_module_word(\"STR\", this.word_to_STR);\n this.add_module_word(\"CONCAT\", this.word_CONCAT);\n this.add_module_word(\"SPLIT\", this.word_SPLIT);\n this.add_module_word(\"JOIN\", this.word_JOIN);\n this.add_module_word(\"/N\", this.word_slash_N);\n this.add_module_word(\"/R\", this.word_slash_R);\n this.add_module_word(\"/T\", this.word_slash_T);\n this.add_module_word(\"LOWERCASE\", this.word_LOWERCASE);\n this.add_module_word(\"UPPERCASE\", this.word_UPPERCASE);\n this.add_module_word(\"ASCII\", this.word_ASCII);\n this.add_module_word(\"STRIP\", this.word_STRIP);\n this.add_module_word(\"REPLACE\", this.word_REPLACE);\n this.add_module_word(\"RE-MATCH\", this.word_RE_MATCH);\n this.add_module_word(\"RE-MATCH-GROUP\", this.word_RE_MATCH_GROUP);\n this.add_module_word(\"RE-MATCH-ALL\", this.word_RE_MATCH_ALL);\n // --------------------\n // Misc words\n this.add_module_word(\"NULL\", this.word_NULL);\n this.add_module_word(\"DEFAULT\", this.word_DEFAULT);\n this.add_module_word(\"*DEFAULT\", this.word_star_DEFAULT);\n this.add_module_word(\"REC-DEFAULTS\", this.word_REC_DEFAULTS);\n this.add_module_word(\"FIXED\", this.word_to_FIXED);\n this.add_module_word(\">JSON\", this.word_to_JSON);\n this.add_module_word(\"PRETTIFY\", this.word_PRETTIFY);\n this.add_module_word(\"JSON>\", this.word_JSON_to);\n this.add_module_word(\"LOAD-SCREEN\", this.word_LOAD_SCREEN);\n this.add_module_word(\".s\", this.word_dot_s);\n this.add_module_word(\".S\", this.word_dot_S);\n this.add_module_word(\"START_LOG\", this.word_START_LOG);\n this.add_module_word(\"END_LOG\", this.word_END_LOG);\n this.add_module_word(\"NOP\", this.word_NOP);\n // --------------------\n // Date/time words\n this.add_module_word(\"AM\", this.word_AM);\n this.add_module_word(\"PM\", this.word_PM);\n this.add_module_word(\"NOW\", this.word_NOW);\n this.add_module_word(\">TIME\", this.word_to_TIME);\n this.add_module_word(\"TIME>STR\", this.word_TIME_to_STR);\n this.add_module_word(\">DATE\", this.word_to_DATE);\n this.add_module_word(\"TODAY\", this.word_TODAY);\n this.add_module_word(\"MONDAY\", this.word_MONDAY);\n this.add_module_word(\"TUESDAY\", this.word_TUESDAY);\n this.add_module_word(\"WEDNESDAY\", this.word_WEDNESDAY);\n this.add_module_word(\"THURSDAY\", this.word_THURSDAY);\n this.add_module_word(\"FRIDAY\", this.word_FRIDAY);\n this.add_module_word(\"SATURDAY\", this.word_SATURDAY);\n this.add_module_word(\"SUNDAY\", this.word_SUNDAY);\n this.add_module_word(\"ADD-DAYS\", this.word_ADD_DAYS);\n this.add_module_word(\"SUBTRACT-DATES\", this.word_SUBTRACT_DATES);\n this.add_module_word(\"DATE>STR\", this.word_DATE_to_STR);\n this.add_module_word(\"DATE>INT\", this.word_DATE_to_INT);\n this.add_module_word(\"DATE-TIME>DATETIME\", this.word_DATE_TIME_to_DATETIME);\n this.add_module_word(\"DATETIME>TIMESTAMP\", this.word_DATETIME_to_TIMESTAMP);\n this.add_module_word(\"TIMESTAMP>DATETIME\", this.word_TIMESTAMP_to_DATETIME);\n this.add_module_word(\"STR>DATETIME\", this.word_STR_to_DATETIME);\n this.add_module_word(\"STR>TIMESTAMP\", this.word_STR_to_TIMESTAMP);\n this.add_module_word(\"DAYS-AGO\", this.word_DAYS_AGO);\n // --------------------\n // Math words\n this.add_module_word(\"+\", this.word_plus);\n this.add_module_word(\"-\", this.word_minus);\n this.add_module_word(\"*\", this.word_times);\n this.add_module_word(\"/\", this.word_divide_by);\n this.add_module_word(\"ADD\", this.word_plus);\n this.add_module_word(\"SUBTRACT\", this.word_minus);\n this.add_module_word(\"MULTIPLY\", this.word_times);\n this.add_module_word(\"DIVIDE\", this.word_divide_by);\n this.add_module_word(\"MOD\", this.word_MOD);\n this.add_module_word(\"MEAN\", this.word_MEAN);\n this.add_module_word(\"MAX\", this.word_MAX);\n this.add_module_word(\"MIN\", this.word_MIN);\n this.add_module_word(\"ROUND\", this.word_ROUND);\n this.add_module_word(\"==\", this.word_equal_equal);\n this.add_module_word(\"!=\", this.word_not_equal);\n this.add_module_word(\">\", this.word_greater_than);\n this.add_module_word(\">=\", this.word_greater_than_or_equal);\n this.add_module_word(\"<\", this.word_less_than);\n this.add_module_word(\"<=\", this.word_less_than_or_equal);\n this.add_module_word(\"OR\", this.word_OR);\n this.add_module_word(\"AND\", this.word_AND);\n this.add_module_word(\"NOT\", this.word_NOT);\n this.add_module_word(\"IN\", this.word_IN);\n this.add_module_word(\"ANY\", this.word_ANY);\n this.add_module_word(\"ALL\", this.word_ALL);\n this.add_module_word(\">BOOL\", this.word_to_BOOL);\n this.add_module_word(\">INT\", this.word_to_INT);\n this.add_module_word(\">FLOAT\", this.word_to_FLOAT);\n this.add_module_word(\"BUCKET\", this.word_BUCKET);\n this.add_module_word(\"UNIFORM-RANDOM\", this.word_UNIFORM_RANDOM);\n this.add_module_word(\"RANGE-INDEX\", this.word_RANGE_INDEX);\n this.add_module_word(\"RANGE-BUCKETS\", this.word_RANGE_BUCKETS);\n this.add_module_word(\"INFINITY\", this.word_INFINITY);\n // ----------------\n // Flag words\n this.add_module_word(\"!PUSH-ERROR\", this.word_bang_PUSH_ERROR);\n this.add_module_word(\"!WITH-KEY\", this.word_bang_WITH_KEY);\n this.add_module_word(\"!COMPARATOR\", this.word_bang_COMPARATOR);\n this.add_module_word(\"!PUSH-REST\", this.word_bang_PUSH_REST);\n this.add_module_word(\"!DEPTH\", this.word_bang_DEPTH);\n this.add_module_word(\"!OVERWRITE\", this.word_bang_OVERWRITE);\n this.add_module_word(\"!DELAY\", this.word_bang_DELAY);\n this.add_module_word(\"!INTERPS\", this.word_bang_INTERPS);\n this.add_module_word(\"!NOTE-PROGRESS\", this.word_bang_NOTE_PROGRESS);\n // --------------------\n // Misc words (js-specific)\n this.add_module_word(\"URL-ENCODE\", this.word_URL_ENCODE);\n this.add_module_word(\"URL-DECODE\", this.word_URL_DECODE);\n this.add_module_word(\"QUOTE-CHAR\", this.word_QUOTE_CHAR);\n this.add_module_word(\"QUOTED\", this.word_QUOTED);\n this.add_module_word(\"CONSOLE.LOG\", this.word_CONSOLE_LOG);\n // --------------------\n // Profiling words\n this.add_module_word(\"PROFILE-START\", this.word_PROFILE_START);\n this.add_module_word(\"PROFILE-TIMESTAMP\", this.word_PROFILE_TIMESTAMP);\n this.add_module_word(\"PROFILE-END\", this.word_PROFILE_END);\n this.add_module_word(\"PROFILE-DATA\", this.word_PROFILE_DATA);\n }\n find_word(name) {\n let result = super.find_word(name);\n if (!result)\n result = this.find_literal_word(name);\n return result;\n }\n find_literal_word(string) {\n const self = this;\n let value = null;\n for (let i = 0; i < self.literal_handlers.length; i++) {\n value = self.literal_handlers[i](string);\n if (value !== null)\n return new module_1.PushValueWord(string, value);\n }\n return null;\n }\n // =======================\n // Literal handlers\n to_bool(str_val) {\n if (str_val == \"TRUE\")\n return true;\n else if (str_val == \"FALSE\")\n return false;\n else\n return null;\n }\n to_int(str_val) {\n const result = parseInt(str_val);\n if (isNaN(result))\n return null;\n return result;\n }\n to_float(str_val) {\n if (str_val.indexOf(\".\") == -1)\n return null;\n const result = parseFloat(str_val);\n if (isNaN(result))\n return null;\n else\n return result;\n }\n to_literal_date(str_val) {\n const match = str_val.match(/(\\d{4})-(\\d{2})-(\\d{2})/);\n if (!match)\n return null;\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n const result = new Date();\n result.setUTCFullYear(year, month - 1, day);\n result.setUTCHours(0, 0, 0, 0);\n return result;\n }\n to_time(str_val) {\n const match = str_val.match(/(\\d{1,2}):(\\d{2})/);\n if (!match)\n return null;\n const hours = Number(match[1]);\n const minutes = Number(match[2]);\n if (hours > 23)\n return null;\n if (minutes >= 60)\n return null;\n const result = new Date();\n result.setHours(hours, minutes, 0, 0);\n return result;\n }\n // Convenience function to create element word handlers\n make_element_word(element_name) {\n async function Result(interp) {\n interp.stack_push(`${element_name}`);\n await interp.run(\"Element\");\n }\n return Result;\n }\n add_element_word(element_name) {\n this.add_module_word(element_name, this.make_element_word(element_name));\n }\n // =======================\n // Words\n // ( varnames -- )\n word_VARIABLES(interp) {\n const varnames = interp.stack_pop();\n const module = interp.cur_module();\n varnames.forEach((v) => {\n if (v.match(/__.*/)) {\n throw new errors_1.InvalidVariableNameError(interp.get_top_input_string(), v, \"Variable names cannot begin with '__'\", interp.get_string_location());\n }\n module.add_variable(v);\n });\n }\n // ( value variable -- )\n word_bang(interp) {\n const variable = interp.stack_pop();\n const value = interp.stack_pop();\n variable.value = value;\n }\n // ( variable -- value )\n word_at(interp) {\n const variable = interp.stack_pop();\n interp.stack_push(variable.value);\n }\n // ( value variable -- value )\n word_bang_at(interp) {\n const variable = interp.stack_pop();\n const value = interp.stack_pop();\n variable.value = value;\n interp.stack_push(variable.value);\n }\n // ( string -- )\n async word_INTERPRET(interp) {\n const string = interp.stack_pop();\n const string_location = interp.get_string_location();\n if (string)\n await interp.run(string, string_location);\n }\n // ( names -- )\n word_EXPORT(interp) {\n const names = interp.stack_pop();\n interp.cur_module().add_exportable(names);\n }\n // ( names -- )\n async word_USE_MODULES(interp) {\n const names = interp.stack_pop();\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n let module_name = name;\n let prefix = name;\n if (name instanceof Array) {\n module_name = name[0];\n prefix = name[1];\n }\n const module = interp.find_module(module_name);\n interp.get_app_module().import_module(prefix, module, interp);\n }\n }\n // ( key_vals -- rec )\n word_REC(interp) {\n let key_vals = interp.stack_pop();\n if (!key_vals)\n key_vals = [];\n const result = {};\n key_vals.forEach((pair) => {\n let key = null;\n let val = null;\n if (pair) {\n if (pair.length >= 1)\n key = pair[0];\n if (pair.length >= 2)\n val = pair[1];\n }\n result[key] = val;\n });\n interp.stack_push(result);\n }\n // ( rec field -- value )\n // ( rec fields -- value )\n word_REC_at(interp) {\n const field = interp.stack_pop();\n const rec = interp.stack_pop();\n if (!rec) {\n interp.stack_push(null);\n return;\n }\n let fields = [field];\n if (field instanceof Array)\n fields = field;\n const result = drill_for_value(rec, fields);\n interp.stack_push(result);\n }\n // ( records field -- values )\n // ( records fields -- values )\n async word_pipe_REC_at(interp) {\n const fields = interp.stack_pop();\n await interp.run(`'${JSON.stringify(fields)} REC@' MAP`);\n }\n // ( rec value field -- rec )\n word_l_REC_bang(interp) {\n const field = interp.stack_pop();\n const value = interp.stack_pop();\n let rec = interp.stack_pop();\n if (!rec)\n rec = {};\n let fields = null;\n if (field instanceof Array)\n fields = field;\n else\n fields = [field];\n function ensure_field(rec, field) {\n let res = rec[field];\n if (res === undefined) {\n res = {};\n rec[field] = res;\n }\n return res;\n }\n let cur_rec = rec;\n // Drill down up until the last value\n for (let i = 0; i < fields.length - 1; i++) {\n cur_rec = ensure_field(cur_rec, fields[i]);\n }\n // Set the value at the right depth within rec\n cur_rec[fields[fields.length - 1]] = value;\n interp.stack_push(rec);\n }\n // ( array item -- array )\n // ( record key/val -- record )\n word_APPEND(interp) {\n const item = interp.stack_pop();\n let result = interp.stack_pop();\n if (!result)\n result = [];\n if (result instanceof Array)\n result.push(item);\n // If not a list, treat as record\n else\n result[item[0]] = item[1];\n interp.stack_push(result);\n }\n // ( array -- array )\n // ( record -- record )\n word_REVERSE(interp) {\n let result = interp.stack_pop();\n if (!result) {\n interp.stack_push(result);\n return;\n }\n if (result instanceof Array)\n result = result.reverse();\n interp.stack_push(result);\n }\n // ( array -- array )\n word_UNIQUE(interp) {\n const container = interp.stack_pop();\n if (!container) {\n interp.stack_push(container);\n return;\n }\n let result = container;\n if (container instanceof Array) {\n result = [...new Set(container)];\n }\n interp.stack_push(result);\n }\n // ( array index -- array )\n // ( record key -- record )\n word_L_DEL(interp) {\n const key = interp.stack_pop();\n const container = interp.stack_pop();\n if (!container) {\n interp.stack_push(container);\n return;\n }\n if (container instanceof Array)\n container.splice(key, 1);\n else\n delete container[key];\n interp.stack_push(container);\n }\n // ( array old_keys new_keys -- array )\n // ( record old_keys new_keys -- record )\n word_RELABEL(interp) {\n const new_keys = interp.stack_pop();\n const old_keys = interp.stack_pop();\n const container = interp.stack_pop();\n if (!container) {\n interp.stack_push(container);\n return;\n }\n if (old_keys.length != new_keys.length)\n throw \"RELABEL: old_keys and new_keys must be same length\";\n const new_to_old = {};\n for (let i = 0; i < old_keys.length; i++) {\n new_to_old[new_keys[i]] = old_keys[i];\n }\n let result = [];\n if (container instanceof Array) {\n Object.keys(new_to_old)\n .sort()\n .forEach((k) => result.push(container[new_to_old[k]]));\n }\n else {\n result = {};\n Object.keys(new_to_old).forEach((k) => (result[k] = container[new_to_old[k]]));\n }\n interp.stack_push(result);\n }\n // ( array field -- field_to_item )\n // ( record field -- field_to_item )\n word_BY_FIELD(interp) {\n const field = interp.stack_pop();\n let container = interp.stack_pop();\n if (!container)\n container = [];\n let values = null;\n if (container instanceof Array) {\n values = container;\n }\n else {\n values = [];\n Object.keys(container).forEach((k) => {\n values.push(container[k]);\n });\n }\n const result = {};\n values.forEach((v) => {\n if (v)\n result[v[field]] = v;\n });\n interp.stack_push(result);\n }\n // ( array field -- field_to_items )\n // ( record field -- field_to_items )\n word_GROUP_BY_FIELD(interp) {\n const field = interp.stack_pop();\n let container = interp.stack_pop();\n if (!container)\n container = [];\n let values = [];\n if (container instanceof Array)\n values = container;\n else\n values = Object.keys(container).map((k) => container[k]);\n const result = {};\n values.forEach((v) => {\n const field_val = v[field];\n if (field_val instanceof Array) {\n for (const fv of field_val) {\n if (!result[fv])\n result[fv] = [];\n result[fv].push(v);\n }\n }\n else {\n if (!result[field_val])\n result[field_val] = [];\n result[field_val].push(v);\n }\n });\n interp.stack_push(result);\n }\n // ( array forthic -- group_to_items )\n // ( record forthic -- group_to_items )\n async word_GROUP_BY(interp) {\n const forthic = interp.stack_pop();\n const string_location = interp.get_string_location();\n let container = interp.stack_pop();\n const flags = interp.get_flags(this.module_id);\n if (!container)\n container = [];\n let keys, values;\n if (container instanceof Array) {\n keys = [];\n for (let i = 0; i < container.length; i++)\n keys.push(i);\n values = container;\n }\n else {\n keys = Object.keys(container);\n values = keys.map((k) => container[k]);\n }\n const result = {};\n for (let i = 0; i < values.length; i++) {\n const key = keys[i];\n const value = values[i];\n if (flags.with_key)\n interp.stack_push(key);\n interp.stack_push(value);\n await interp.run(forthic, string_location);\n const group = interp.stack_pop();\n if (!result[group])\n result[group] = [];\n result[group].push(value);\n }\n interp.stack_push(result);\n }\n // ( array n -- arrays )\n // ( record n -- records )\n word_GROUPS_OF(interp) {\n const size = interp.stack_pop();\n let container = interp.stack_pop();\n if (size <= 0)\n throw \"GROUPS-OF requires group size > 0\";\n if (!container)\n container = [];\n function group_items(items, group_size) {\n const num_groups = Math.ceil(items.length / group_size);\n const res = [];\n let remaining = items.slice();\n for (let i = 0; i < num_groups; i++) {\n res.push(remaining.slice(0, group_size));\n remaining = remaining.slice(group_size);\n }\n return res;\n }\n function extract_rec(record, keys) {\n const res = {};\n keys.forEach((k) => (res[k] = record[k]));\n return res;\n }\n let result;\n if (container instanceof Array) {\n result = group_items(container, size);\n }\n else {\n const keys = Object.keys(container);\n const key_groups = group_items(keys, size);\n result = key_groups.map((ks) => extract_rec(container, ks));\n }\n interp.stack_push(result);\n return;\n }\n // ( array forthic -- record )\n async word_INDEX(interp) {\n const forthic = interp.stack_pop();\n const string_location = interp.get_string_location();\n const items = interp.stack_pop();\n if (!items) {\n interp.stack_push(items);\n return;\n }\n const result = {};\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n interp.stack_push(item);\n await interp.run(forthic, string_location);\n const keys = interp.stack_pop();\n keys.forEach((k) => {\n const lowercased_key = k.toLowerCase();\n if (result[lowercased_key])\n result[lowercased_key].push(item);\n else\n result[lowercased_key] = [item];\n });\n }\n interp.stack_push(result);\n }\n // ( items forthic -- [ ? ] )\n async word_MAP(interp) {\n const forthic = interp.stack_pop();\n const string_location = interp.get_string_location();\n const items = interp.stack_pop();\n const flags = interp.get_flags(this.module_id);\n const map_word = new map_word_1.MapWord(items, forthic, string_location, flags);\n await map_word.execute(interp);\n }\n // ( items word -- ? )\n async word_FOREACH(interp) {\n const forthic = interp.stack_pop();\n const string_location = interp.get_string_location();\n let items = interp.stack_pop();\n const flags = interp.get_flags(this.module_id);\n if (!items)\n items = [];\n const errors = [];\n if (items instanceof Array) {\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (flags.with_key)\n interp.stack_push(i);\n interp.stack_push(item);\n if (flags.push_error)\n errors.push(await execute_returning_error(interp, forthic, string_location));\n else\n await interp.run(forthic, string_location);\n }\n }\n else {\n const keys = Object.keys(items);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n const item = items[k];\n if (flags.with_key)\n interp.stack_push(k);\n interp.stack_push(item);\n if (flags.push_error)\n errors.push(await execute_returning_error(interp, forthic, string_location));\n else\n await interp.run(forthic, string_location);\n }\n }\n if (flags.push_error)\n interp.stack_push(errors);\n }\n // ( record -- record )\n word_INVERT_KEYS(interp) {\n const record = interp.stack_pop();\n const result = {};\n Object.keys(record).forEach((first_key) => {\n const sub_record = record[first_key];\n Object.keys(sub_record).forEach((second_key) => {\n const value = sub_record[second_key];\n if (!result[second_key])\n result[second_key] = {};\n result[second_key][first_key] = value;\n });\n });\n interp.stack_push(result);\n }\n // ( array1 array2 -- array )\n // ( record1 record2 -- record )\n word_ZIP(interp) {\n let container2 = interp.stack_pop();\n let container1 = interp.stack_pop();\n if (!container1)\n container1 = [];\n if (!container2)\n container2 = [];\n let result;\n if (container2 instanceof Array) {\n result = [];\n for (let i = 0; i < container1.length; i++) {\n let value2 = null;\n if (i < container2.length)\n value2 = container2[i];\n result.push([container1[i], value2]);\n }\n }\n else {\n result = {};\n Object.keys(container1).forEach((k) => {\n const v = container1[k];\n result[k] = [v, container2[k]];\n });\n }\n interp.stack_push(result);\n }\n // ( array1 array2 forthic -- array )\n // ( record1 record2 forthic -- record )\n async word_ZIP_WITH(interp) {\n const forthic = interp.stack_pop();\n const string_location = interp.get_string_location();\n let container2 = interp.stack_pop();\n let container1 = interp.stack_pop();\n if (!container1)\n container1 = [];\n if (!container2)\n container2 = [];\n let result;\n if (container2 instanceof Array) {\n result = [];\n for (let i = 0; i < container1.length; i++) {\n let value2 = null;\n if (i < container2.length)\n value2 = container2[i];\n interp.stack_push(container1[i]);\n interp.stack_push(value2);\n await interp.run(forthic, string_location);\n const res = interp.stack_pop();\n result.push(res);\n }\n }\n else {\n result = {};\n const keys = Object.keys(container1);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n interp.stack_push(container1[k]);\n interp.stack_push(container2[k]);\n await interp.run(forthic, string_location);\n const res = interp.stack_pop();\n result[k] = res;\n }\n }\n interp.stack_push(result);\n }\n // ( array -- array )\n // ( record -- array )\n word_KEYS(interp) {\n let container = interp.stack_pop();\n if (!container)\n container = [];\n let result;\n if (container instanceof Array) {\n result = [];\n for (let i = 0; i < container.length; i++)\n result.push(i);\n }\n else {\n result = Object.keys(container);\n }\n interp.stack_push(result);\n }\n // ( array -- array )\n // ( record -- array )\n word_VALUES(interp) {\n let container = interp.stack_pop();\n if (!container)\n container = [];\n let result;\n if (container instanceof Array) {\n result = container;\n }\n else {\n result = [];\n Object.keys(container).forEach((k) => result.push(container[k]));\n }\n interp.stack_push(result);\n }\n // ( array -- length )\n // ( record -- length )\n word_LENGTH(interp) {\n let container = interp.stack_pop();\n if (!container)\n container = [];\n let result;\n if (container instanceof Array || typeof container == \"string\") {\n result = container.length;\n }\n else {\n result = Object.keys(container).length;\n }\n interp.stack_push(result);\n }\n // ( array fstart fend -- indices )\n async word_RANGE(interp) {\n const fend = interp.stack_pop();\n const fend_string_location = interp.get_string_location();\n const fstart = interp.stack_pop();\n const fstart_string_location = interp.get_string_location();\n let array = interp.stack_pop();\n if (!array)\n array = [];\n let start_found = false;\n let end_found = false;\n let start_index = null;\n let end_index = null;\n for (let index = 0; index < array.length; index++) {\n const item = array[index];\n if (!start_found) {\n interp.stack_push(item);\n await interp.run(fstart, fstart_string_location);\n start_found = interp.stack_pop();\n if (start_found) {\n start_index = index;\n }\n }\n if (start_found && !end_found) {\n interp.stack_push(item);\n await interp.run(fend, fend_string_location);\n end_found = interp.stack_pop();\n if (end_found) {\n end_index = index;\n break;\n }\n }\n }\n interp.stack_push([start_index, end_index]);\n }\n // ( array start end -- array )\n // ( record start end -- record )\n word_SLICE(interp) {\n let end = Math.trunc(interp.stack_pop());\n let start = Math.trunc(interp.stack_pop());\n let container = interp.stack_pop();\n if (!container)\n container = [];\n let length;\n if (container instanceof Array) {\n length = container.length;\n }\n else {\n length = Object.keys(container).length;\n }\n function normalize_index(index) {\n let res = index;\n if (index < 0)\n res = index + length;\n return res;\n }\n start = normalize_index(start);\n end = normalize_index(end);\n let step = 1;\n if (start > end)\n step = -1;\n let indexes = [start];\n if (start < 0 || start >= length)\n indexes = [];\n while (start != end) {\n start = start + step;\n if (start < 0 || start >= length)\n indexes.push(null);\n else\n indexes.push(start);\n }\n let result;\n if (container instanceof Array) {\n result = [];\n indexes.forEach((i) => {\n if (i === null)\n result.push(null);\n else\n result.push(container[i]);\n });\n }\n else {\n const keys = Object.keys(container).sort();\n result = {};\n indexes.forEach((i) => {\n if (i !== null) {\n const k = keys[i];\n result[k] = container[k];\n }\n });\n }\n interp.stack_push(result);\n }\n // ( larray rarray -- array )\n // ( lrecord rrecord -- record )\n word_DIFFERENCE(interp) {\n let rcontainer = interp.stack_pop();\n let lcontainer = interp.stack_pop();\n if (!lcontainer)\n lcontainer = [];\n if (!rcontainer)\n rcontainer = [];\n function difference(l, r) {\n const res = [];\n l.forEach((item) => {\n if (r.indexOf(item) < 0)\n res.push(item);\n });\n return res;\n }\n let result;\n if (rcontainer instanceof Array) {\n result = difference(lcontainer, rcontainer);\n }\n else {\n const lkeys = Object.keys(lcontainer);\n const rkeys = Object.keys(rcontainer);\n const diff = difference(lkeys, rkeys);\n result = {};\n diff.forEach((k) => (result[k] = lcontainer[k]));\n }\n interp.stack_push(result);\n }\n // ( larray rarray -- array )\n // ( lrecord rrecord -- record )\n word_INTERSECTION(interp) {\n let rcontainer = interp.stack_pop();\n let lcontainer = interp.stack_pop();\n if (!lcontainer)\n lcontainer = [];\n if (!rcontainer)\n rcontainer = [];\n function intersection(l, r) {\n const res = [];\n l.forEach((item) => {\n if (r.indexOf(item) >= 0)\n res.push(item);\n });\n return res;\n }\n let result;\n if (rcontainer instanceof Array) {\n result = intersection(lcontainer, rcontainer);\n }\n else {\n const lkeys = Object.keys(lcontainer);\n const rkeys = Object.keys(rcontainer);\n const intersect = intersection(lkeys, rkeys);\n result = {};\n intersect.forEach((k) => (result[k] = lcontainer[k]));\n }\n interp.stack_push(result);\n }\n // ( larray rarray -- array )\n // ( lrecord rrecord -- record )\n word_UNION(interp) {\n let rcontainer = interp.stack_pop();\n let lcontainer = interp.stack_pop();\n if (!lcontainer)\n lcontainer = [];\n if (!rcontainer)\n rcontainer = [];\n function union(l, r) {\n const keyset = {};\n l.forEach((item) => {\n keyset[item] = true;\n });\n r.forEach((item) => {\n keyset[item] = true;\n });\n const res = Object.keys(keyset);\n return res;\n }\n let result;\n if (rcontainer instanceof Array) {\n result = union(lcontainer, rcontainer);\n }\n else {\n const lkeys = Object.keys(lcontainer);\n const rkeys = Object.keys(rcontainer);\n const keys = union(lkeys, rkeys);\n result = {};\n keys.forEach((k) => {\n let val = lcontainer[k];\n if (val === undefined)\n val = rcontainer[k];\n result[k] = val;\n });\n }\n interp.stack_push(result);\n }\n // ( larray forthic -- array )\n // ( lrecord forthic -- record )\n async word_SELECT(interp) {\n const forthic = interp.stack_pop();\n const string_location = interp.get_string_location();\n const container = interp.stack_pop();\n const flags = interp.get_flags(this.module_id);\n if (!container) {\n interp.stack_push(container);\n return;\n }\n let result;\n if (container instanceof Array) {\n result = [];\n for (let i = 0; i < container.length; i++) {\n const item = container[i];\n if (flags.with_key)\n interp.stack_push(i);\n interp.stack_push(item);\n await interp.run(forthic, string_location);\n const should_select = interp.stack_pop();\n if (should_select)\n result.push(item);\n }\n }\n else {\n result = {};\n const keys = Object.keys(container);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n const v = container[k];\n if (flags.with_key)\n interp.stack_push(k);\n interp.stack_push(v);\n await interp.run(forthic, string_location);\n const should_select = interp.stack_pop();\n if (should_select)\n result[k] = v;\n }\n }\n interp.stack_push(result);\n }\n // ( array n -- rest taken )\n // ( record n -- rest taken )\n word_TAKE(interp) {\n const n = interp.stack_pop();\n let container = interp.stack_pop();\n const flags = interp.get_flags(this.module_id);\n if (!container)\n container = [];\n let rest, taken;\n if (container instanceof Array) {\n taken = container.slice(0, n);\n rest = container.slice(n);\n }\n else {\n const keys = Object.keys(container).sort();\n const taken_keys = keys.slice(0, n);\n const rest_keys = keys.slice(n);\n taken = taken_keys.map((k) => container[k]);\n rest = rest_keys.map((k) => container[k]);\n }\n interp.stack_push(taken);\n if (flags.push_rest)\n interp.stack_push(rest);\n }\n // ( array n -- array )\n // ( record n -- record )\n word_DROP(interp) {\n const n = interp.stack_pop();\n let container = interp.stack_pop();\n if (!container)\n container = [];\n let result;\n if (container instanceof Array) {\n result = container.slice(n);\n }\n else {\n const keys = Object.keys(container).sort();\n const rest_keys = keys.slice(n);\n result = rest_keys.map((k) => container[k]);\n }\n interp.stack_push(result);\n }\n // ( array -- array )\n // ( record -- record )\n word_ROTATE(interp) {\n const container = interp.stack_pop();\n let result;\n if (!container) {\n result = container;\n }\n else if (container instanceof Array) {\n result = container;\n if (container.length > 0) {\n const val = result.pop();\n result.unshift(val);\n }\n }\n else {\n result = container;\n }\n interp.stack_push(result);\n }\n // ( array element -- array )\n // ( record element -- record )\n // Moves element to front of array\n word_ROTATE_ELEMENT(interp) {\n const element = interp.stack_pop();\n let container = interp.stack_pop();\n if (!container)\n container = [];\n let result;\n if (container instanceof Array) {\n const index = container.indexOf(element);\n result = container;\n if (index > 0) {\n result.splice(index, 1);\n result.unshift(element);\n }\n }\n else {\n result = container;\n }\n interp.stack_push(result);\n }\n // ( val -- bool )\n word_ARRAY_q(interp) {\n const val = interp.stack_pop();\n const result = val instanceof Array;\n interp.stack_push(result);\n }\n // ( array -- array )\n // ( record -- record )\n word_SHUFFLE(interp) {\n let container = interp.stack_pop();\n if (!container)\n container = [];\n let result;\n if (container instanceof Array) {\n // See: https://medium.com/@nitinpatel_20236/\n // how-to-shuffle-correctly-shuffle-an-array-in-javascript-15ea3f84bfb\n result = container;\n for (let i = result.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * i);\n const temp = result[i];\n result[i] = result[j];\n result[j] = temp;\n }\n }\n else {\n result = container;\n }\n interp.stack_push(result);\n }\n // ( field -- key_func )\n word_FIELD_KEY_FUNC(interp) {\n const field = interp.stack_pop();\n function result(record) {\n return record[field];\n }\n interp.stack_push(result);\n }\n // ( array -- array )\n // ( record -- record )\n async word_SORT(interp) {\n const flag_string_position = interp.get_string_location(); // NOTE: If the user specified a comparator flag, we want to get the string position of it\n let container = interp.stack_pop();\n const flags = interp.get_flags(this.module_id);\n const comparator = flags[\"comparator\"];\n if (!container)\n container = [];\n if (!(container instanceof Array)) {\n interp.stack_push(container);\n return;\n }\n // -----\n // Default sort\n function sort_without_comparator() {\n return container.sort();\n }\n // -----\n // Sort using a forthic string\n async function sort_with_forthic(forthic) {\n async function make_aug_array(vals) {\n const res = [];\n for (let i = 0; i < vals.length; i++) {\n const val = vals[i];\n interp.stack_push(val);\n await interp.run(forthic, flag_string_position);\n const aug_val = interp.stack_pop();\n res.push([val, aug_val]);\n }\n return res;\n }\n function cmp_items(l, r) {\n const l_val = l[1];\n const r_val = r[1];\n if (l_val < r_val)\n return -1;\n else if (l_val > r_val)\n return 1;\n else\n return 0;\n }\n function de_aug_array(aug_vals) {\n const res = aug_vals.map((aug_val) => aug_val[0]);\n return res;\n }\n // Create an augmented array, sort it and then return the underlying values\n // NOTE: We're doing it this way because sort is synchronous\n const aug_array = await make_aug_array(container);\n aug_array.sort(cmp_items);\n return de_aug_array(aug_array);\n }\n // -----\n // Sort with key func\n function sort_with_key_func(key_func) {\n function cmp_items(l, r) {\n const l_val = key_func(l);\n const r_val = key_func(r);\n if (l_val < r_val)\n return -1;\n else if (l_val > r_val)\n return 1;\n else\n return 0;\n }\n return container.sort(cmp_items);\n }\n // Figure out what to do\n let result;\n if (typeof comparator == \"string\") {\n result = await sort_with_forthic(comparator);\n }\n else if (comparator === undefined) {\n result = sort_without_comparator();\n }\n else {\n result = sort_with_key_func(comparator);\n }\n interp.stack_push(result);\n }\n // ( array n -- item )\n // ( record n -- value )\n word_NTH(interp) {\n const n = interp.stack_pop();\n const container = interp.stack_pop();\n if (n === null || !container) {\n interp.stack_push(null);\n return;\n }\n let result;\n if (container instanceof Array) {\n if (n < 0 || n >= container.length) {\n interp.stack_push(null);\n return;\n }\n result = container[n];\n }\n else {\n if (n < 0 || n >= Object.keys(container).length) {\n interp.stack_push(null);\n return;\n }\n const keys = Object.keys(container).sort();\n const key = keys[n];\n result = container[key];\n }\n interp.stack_push(result);\n }\n // ( array -- item )\n // ( record -- value )\n word_LAST(interp) {\n const container = interp.stack_pop();\n if (!container) {\n interp.stack_push(null);\n return;\n }\n let result;\n if (container instanceof Array) {\n if (container.length == 0)\n result = null;\n else\n result = container[container.length - 1];\n }\n else {\n const keys = Object.keys(container).sort();\n if (keys.length == 0)\n result = null;\n else\n result = container[keys[keys.length - 1]];\n }\n interp.stack_push(result);\n }\n // ( array -- a1 a2 .. an )\n // ( record -- v1 v2 .. vn )\n word_UNPACK(interp) {\n let container = interp.stack_pop();\n if (!container)\n container = [];\n if (container instanceof Array) {\n container.forEach((item) => {\n interp.stack_push(item);\n });\n }\n else {\n const keys = Object.keys(container).sort();\n keys.forEach((k) => {\n interp.stack_push(container[k]);\n });\n }\n }\n // ( array -- array )\n // ( record -- record )\n word_FLATTEN(interp) {\n let nested = interp.stack_pop();\n const flags = interp.get_flags(this.module_id);\n if (!nested)\n nested = [];\n const depth = flags.depth;\n function is_record(obj) {\n const keys = Object.keys(obj);\n return keys.length > 0;\n }\n function add_to_record_result(item, key, keys, result) {\n const new_key = keys.concat([key]).join(\"\\t\");\n result[new_key] = item;\n }\n function fully_flatten_record(record, res, keys) {\n const record_keys = Object.keys(record);\n for (const k of record_keys) {\n const item = record[k];\n if (is_record(item))\n fully_flatten_record(item, res, keys.concat([k]));\n else\n add_to_record_result(item, k, keys, res);\n }\n return res;\n }\n function flatten_record(record, depth, res, keys) {\n if (depth === undefined)\n return fully_flatten_record(record, res, keys);\n const record_keys = Object.keys(record);\n for (const k of record_keys) {\n const item = record[k];\n if (depth > 0 && is_record(item))\n flatten_record(item, depth - 1, res, keys.concat([k]));\n else\n add_to_record_result(item, k, keys, res);\n }\n return res;\n }\n let result;\n if (nested instanceof Array) {\n result = flatten_array(nested, depth);\n }\n else {\n result = flatten_record(nested, depth, {}, []);\n }\n interp.stack_push(result);\n return;\n }\n // ( array item -- index )\n // ( record item -- key )\n word_KEY_OF(interp) {\n const item = interp.stack_pop();\n let container = interp.stack_pop();\n if (!container)\n container = [];\n let result;\n if (container instanceof Array) {\n const index = container.indexOf(item);\n if (index < 0)\n result = null;\n else\n result = index;\n }\n else {\n result = null;\n const keys = Object.keys(container);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n const v = container[k];\n if (v == item) {\n result = k;\n break;\n }\n }\n }\n interp.stack_push(result);\n return;\n }\n // ( array init forthic -- value )\n // ( record init forthic -- value )\n async word_REDUCE(interp) {\n const forthic = interp.stack_pop();\n const string_location = interp.get_string_location();\n const initial = interp.stack_pop();\n let container = interp.stack_pop();\n if (!container)\n container = [];\n let result;\n if (container instanceof Array) {\n interp.stack_push(initial);\n container.forEach(async (item) => {\n interp.stack_push(item);\n await interp.run(forthic, string_location);\n });\n result = interp.stack_pop();\n }\n else {\n interp.stack_push(initial);\n Object.keys(container).forEach(async (k) => {\n const v = container[k];\n interp.stack_push(v);\n await interp.run(forthic, string_location);\n });\n result = interp.stack_pop();\n }\n interp.stack_push(result);\n }\n // ( a -- )\n word_POP(interp) {\n interp.stack_pop();\n }\n // ( a -- a a )\n word_DUP(interp) {\n const a = interp.stack_pop();\n interp.stack_push(a);\n interp.stack_push(a);\n }\n // ( a b -- b a )\n word_SWAP(interp) {\n const b = interp.stack_pop();\n const a = interp.stack_pop();\n interp.stack_push(b);\n interp.stack_push(a);\n }\n // ( item -- str )\n word_to_STR(interp) {\n const item = interp.stack_pop();\n interp.stack_push(item.toString());\n }\n // ( str1 str2 -- str )\n // ( array_of_str -- str )\n word_CONCAT(interp) {\n const str2 = interp.stack_pop();\n let array;\n if (str2 instanceof Array) {\n array = str2;\n }\n else {\n const str1 = interp.stack_pop();\n array = [str1, str2];\n }\n const result = array.join(\"\");\n interp.stack_push(result);\n }\n // ( string sep -- items )\n word_SPLIT(interp) {\n const sep = interp.stack_pop();\n let string = interp.stack_pop();\n if (!string)\n string = \"\";\n const result = string.split(sep);\n interp.stack_push(result);\n }\n // ( strings sep -- string )\n word_JOIN(interp) {\n const sep = interp.stack_pop();\n let strings = interp.stack_pop();\n if (!strings)\n strings = [];\n const result = strings.join(sep);\n interp.stack_push(result);\n }\n // ( -- char )\n word_slash_N(interp) {\n interp.stack_push(\"\\n\");\n }\n // ( -- char )\n word_slash_R(interp) {\n interp.stack_push(\"\\r\");\n }\n // ( -- char )\n word_slash_T(interp) {\n interp.stack_push(\"\\t\");\n }\n // ( A -- a )\n word_LOWERCASE(interp) {\n const string = interp.stack_pop();\n let result = \"\";\n if (string)\n result = string.toLowerCase();\n interp.stack_push(result);\n }\n // ( a -- A )\n word_UPPERCASE(interp) {\n const string = interp.stack_pop();\n let result = \"\";\n if (string)\n result = string.toUpperCase();\n interp.stack_push(result);\n }\n // ( string -- string )\n word_ASCII(interp) {\n let string = interp.stack_pop();\n if (!string)\n string = \"\";\n let result = \"\";\n for (let i = 0; i < string.length; i++) {\n const ch = string[i];\n if (ch.charCodeAt(0) < 256)\n result += ch;\n }\n interp.stack_push(result);\n }\n // ( str -- str )\n word_STRIP(interp) {\n const string = interp.stack_pop();\n let result = string;\n if (result)\n result = result.trim();\n interp.stack_push(result);\n }\n // ( string text replace -- string )\n word_REPLACE(interp) {\n const replace = interp.stack_pop();\n const text = interp.stack_pop();\n const string = interp.stack_pop();\n let result = string;\n if (string) {\n const pattern = new RegExp(text, \"g\");\n result = string.replace(pattern, replace);\n }\n interp.stack_push(result);\n }\n // ( string pattern -- match )\n word_RE_MATCH(interp) {\n const pattern = interp.stack_pop();\n const string = interp.stack_pop();\n const re_pattern = new RegExp(pattern);\n let result = false;\n if (string !== null)\n result = string.match(re_pattern);\n interp.stack_push(result);\n }\n // ( string pattern -- matches )\n word_RE_MATCH_ALL(interp) {\n const pattern = interp.stack_pop();\n const string = interp.stack_pop();\n const re_pattern = new RegExp(pattern, \"g\");\n let matches = [];\n if (string !== null)\n matches = string.matchAll(re_pattern);\n const result = Array.from(matches).map((v) => v[1]);\n interp.stack_push(result);\n }\n // ( match num -- string )\n word_RE_MATCH_GROUP(interp) {\n const num = interp.stack_pop();\n const match = interp.stack_pop();\n let result = null;\n if (match)\n result = match[num];\n interp.stack_push(result);\n }\n // ( time -- time )\n word_AM(interp) {\n const time = interp.stack_pop();\n if (!(time instanceof Date))\n throw \"AM expecting a time\";\n let result = time;\n if (time.getHours() >= 12) {\n result = new Date();\n result.setHours(time.getHours() - 12);\n result.setMinutes(time.getMinutes());\n }\n interp.stack_push(result);\n }\n // ( time -- time )\n word_PM(interp) {\n const time = interp.stack_pop();\n if (!(time instanceof Date))\n throw \"PM expecting a time\";\n let result = time;\n if (time.getHours() < 12) {\n result = new Date();\n result.setHours(time.getHours() + 12);\n result.setMinutes(time.getMinutes());\n }\n interp.stack_push(result);\n }\n // ( -- time )\n word_NOW(interp) {\n const result = new Date();\n interp.stack_push(result);\n }\n // ( item -- time )\n word_to_TIME(interp) {\n const item = interp.stack_pop();\n let result;\n if (item instanceof Date) {\n result = item;\n }\n else {\n // NB: We need a date in order for Date.parse to succeed. Also assuming str is a time\n const date_string = \"Jan 1, 2000 \" + item;\n result = new Date(Date.parse(date_string));\n }\n interp.stack_push(result);\n }\n // ( time -- str )\n word_TIME_to_STR(interp) {\n const time = interp.stack_pop();\n const result = time.getHours() + \":\" + time.getMinutes();\n interp.stack_push(result);\n }\n // ( str -- date )\n word_to_DATE(interp) {\n const s = interp.stack_pop();\n const result = (0, utils_1.to_date)(s);\n interp.stack_push(result);\n }\n // ( -- date )\n word_TODAY(interp) {\n const result = new Date();\n result.setHours(0, 0, 0, 0);\n interp.stack_push(result);\n }\n // ( -- date )\n word_MONDAY(interp) {\n interp.stack_push(GlobalModule.get_day_this_week(0));\n }\n // ( -- date )\n word_TUESDAY(interp) {\n interp.stack_push(GlobalModule.get_day_this_week(1));\n }\n // ( -- date )\n word_WEDNESDAY(interp) {\n interp.stack_push(GlobalModule.get_day_this_week(2));\n }\n // ( -- date )\n word_THURSDAY(interp) {\n interp.stack_push(GlobalModule.get_day_this_week(3));\n }\n // ( -- date )\n word_FRIDAY(interp) {\n interp.stack_push(GlobalModule.get_day_this_week(4));\n }\n // ( -- date )\n word_SATURDAY(interp) {\n interp.stack_push(GlobalModule.get_day_this_week(5));\n }\n // ( -- date )\n word_SUNDAY(interp) {\n interp.stack_push(GlobalModule.get_day_this_week(6));\n }\n static get_day_this_week(day_of_week) {\n // NOTE: Monday is start of week\n function normalize_day(day) {\n return day;\n }\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n const delta_days = (day_of_week - normalize_day(today.getDay())) % 7;\n const result = today;\n result.setDate(result.getDate() + delta_days + 1);\n return result;\n }\n // ( date num-days -- date )\n word_ADD_DAYS(interp) {\n const num_days = interp.stack_pop();\n const date = interp.stack_pop();\n const result = new Date(date);\n result.setDate(result.getDate() + num_days);\n interp.stack_push(result);\n }\n // ( l_date r_date -- num_days )\n word_SUBTRACT_DATES(interp) {\n const r_date = interp.stack_pop();\n const l_date = interp.stack_pop();\n const ms_per_day = 1000 * 60 * 60 * 24;\n const result = Math.round((l_date.getTime() - r_date.getTime()) / ms_per_day);\n interp.stack_push(result);\n }\n // ( date -- str )\n word_DATE_to_STR(interp) {\n const date = interp.stack_pop();\n const result = (0, utils_1.date_to_string)(date);\n interp.stack_push(result);\n }\n // ( date -- int )\n // Converts a date like 2023-11-12 to 20231112\n word_DATE_to_INT(interp) {\n const date = interp.stack_pop();\n const result = (0, utils_1.date_to_int)(date);\n interp.stack_push(result);\n }\n // ( date time -- datetime )\n word_DATE_TIME_to_DATETIME(interp) {\n const time = interp.stack_pop();\n const date = interp.stack_pop();\n const dt_string = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${time.getHours()}:${time.getMinutes()}`;\n const result = new Date(dt_string);\n interp.stack_push(result);\n }\n // ( datetime -- timestamp )\n word_DATETIME_to_TIMESTAMP(interp) {\n const datetime = interp.stack_pop();\n const result = Math.round(datetime.getTime() / 1000);\n interp.stack_push(result);\n }\n // ( timestamp -- datetime )\n word_TIMESTAMP_to_DATETIME(interp) {\n const timestamp = interp.stack_pop();\n const result = new Date(timestamp * 1000);\n interp.stack_push(result);\n }\n // ( str -- datetime )\n word_STR_to_DATETIME(interp) {\n const s = interp.stack_pop();\n const result = new Date(s);\n interp.stack_push(result);\n }\n // ( str -- timestamp )\n word_STR_to_TIMESTAMP(interp) {\n const s = interp.stack_pop();\n const datetime = new Date(s);\n const result = Math.round(datetime.getTime() / 1000);\n interp.stack_push(result);\n }\n // ( num_days -- days_ago-str )\n word_DAYS_AGO(interp) {\n const num_days = interp.stack_pop();\n let result;\n if (num_days == 0) {\n result = \"today\";\n }\n else if (num_days == 1) {\n result = \"yesterday\";\n }\n else if (num_days == -1) {\n result = \"tomorrow\";\n }\n else if (num_days > 0) {\n result = `${num_days} days ago`;\n }\n else {\n result = `${Math.abs(num_days)} days from now`;\n }\n interp.stack_push(result);\n }\n // ( a b -- a+b )\n // ( items -- sum )\n word_plus(interp) {\n const items = interp.stack_pop();\n if (items instanceof Array) {\n let sum = 0;\n items.forEach((item) => {\n sum += item;\n });\n interp.stack_push(sum);\n }\n else {\n const b = items;\n const a = interp.stack_pop();\n interp.stack_push(a + b);\n }\n }\n // ( a b -- a*b )\n word_times(interp) {\n const b = interp.stack_pop();\n let result = 1;\n let numbers = [];\n if (b instanceof Array) {\n numbers = b;\n }\n else {\n const a = interp.stack_pop();\n numbers = [a, b];\n }\n for (const num of numbers) {\n if (num === null || num === undefined) {\n interp.stack_push(null);\n return;\n }\n result = result * num;\n }\n interp.stack_push(result);\n }\n // ( a b -- a/b )\n word_divide_by(interp) {\n const b = interp.stack_pop();\n const a = interp.stack_pop();\n interp.stack_push(a / b);\n }\n // ( a b -- res )\n word_MOD(interp) {\n const b = interp.stack_pop();\n const a = interp.stack_pop();\n interp.stack_push(a % b);\n }\n // ( numbers -- mean )\n // ( records -- mean_record)\n word_MEAN(interp) {\n const values = interp.stack_pop();\n if (!values || values.length == 0) {\n interp.stack_push(0);\n return;\n }\n function compute_number_mean(numbers) {\n let sum = 0;\n for (const num of numbers) {\n sum += num;\n }\n const res = sum / numbers.length;\n return res;\n }\n function compute_non_number_mean(objects) {\n const non_null_objects = objects.filter((obj) => obj !== null || obj !== undefined);\n const res = {};\n non_null_objects.forEach((obj) => {\n const obj_str = (0, utils_1.is_string)(obj) ? obj : JSON.stringify(obj);\n if (res[obj_str])\n res[obj_str]++;\n else\n res[obj_str] = 1;\n });\n Object.entries(res).forEach(([key, value]) => {\n res[key] = value / non_null_objects.length;\n });\n return res;\n }\n function compute_object_mean(records) {\n const res = {};\n records.forEach((record) => {\n Object.entries(record).forEach(([key, value]) => {\n if (res[key])\n res[key].push(value);\n else\n res[key] = [value];\n });\n });\n Object.entries(res).forEach(([key, values]) => {\n res[key] = compute_mean(values);\n });\n return res;\n }\n function is_all_numbers(values) {\n return values.every((val) => typeof val == \"number\");\n }\n function is_all_records(values) {\n return values.every((val) => (0, utils_1.is_record)(val));\n }\n function select_non_null_values(values) {\n return values.filter((val) => val !== null && val !== undefined);\n }\n function compute_mean(values) {\n let result;\n if ((0, utils_1.is_array)(values)) {\n const non_null_values = select_non_null_values(values);\n if (is_all_numbers(non_null_values)) {\n result = compute_number_mean(non_null_values);\n }\n else if (is_all_records(non_null_values)) {\n result = compute_object_mean(non_null_values);\n }\n else {\n result = compute_non_number_mean(non_null_values);\n }\n }\n else {\n result = null;\n }\n return result;\n }\n const result = compute_mean(values);\n interp.stack_push(result);\n }\n // ( num1 num2 -- num )\n // ( numbers -- num )\n word_MAX(interp) {\n const num2 = interp.stack_pop();\n let numbers = [];\n if ((0, utils_1.is_array)(num2)) {\n numbers = num2;\n }\n else {\n const num1 = interp.stack_pop();\n numbers = [num1, num2];\n }\n interp.stack_push(Math.max(...numbers));\n }\n // ( num1 num2 -- num )\n // ( numbers -- num )\n word_MIN(interp) {\n const num2 = interp.stack_pop();\n let numbers = [];\n if ((0, utils_1.is_array)(num2)) {\n numbers = num2;\n }\n else {\n const num1 = interp.stack_pop();\n numbers = [num1, num2];\n }\n interp.stack_push(Math.min(...numbers));\n }\n // ( num -- int )\n word_ROUND(interp) {\n const num = interp.stack_pop();\n interp.stack_push(Math.round(num));\n }\n // ( l r -- bool )\n word_equal_equal(interp) {\n const r = interp.stack_pop();\n const l = interp.stack_pop();\n interp.stack_push(l == r);\n }\n // ( l r -- bool )\n word_not_equal(interp) {\n const r = interp.stack_pop();\n const l = interp.stack_pop();\n interp.stack_push(l != r);\n }\n // ( l r -- bool )\n word_greater_than(interp) {\n const r = interp.stack_pop();\n const l = interp.stack_pop();\n if (l === null || r === null) {\n interp.stack_push(null);\n return;\n }\n interp.stack_push(l > r);\n }\n // ( l r -- bool )\n word_greater_than_or_equal(interp) {\n const r = interp.stack_pop();\n const l = interp.stack_pop();\n if (l === null || r === null) {\n interp.stack_push(null);\n return;\n }\n interp.stack_push(l >= r);\n }\n // ( l r -- bool )\n word_less_than(interp) {\n const r = interp.stack_pop();\n const l = interp.stack_pop();\n if (l === null || r === null) {\n interp.stack_push(null);\n return;\n }\n interp.stack_push(l < r);\n }\n // ( l r -- bool )\n word_less_than_or_equal(interp) {\n const r = interp.stack_pop();\n const l = interp.stack_pop();\n if (l === null || r === null) {\n interp.stack_push(null);\n return;\n }\n interp.stack_push(l <= r);\n }\n // ( l r -- bool )\n // ( items -- bool )\n word_OR(interp) {\n const r = interp.stack_pop();\n let items;\n if (r instanceof Array) {\n items = r;\n }\n else {\n const l = interp.stack_pop();\n items = [l, r];\n }\n const result = items.some((item) => item);\n interp.stack_push(result);\n }\n // ( l r -- bool )\n // ( items -- bool )\n word_AND(interp) {\n const r = interp.stack_pop();\n let items;\n if (r instanceof Array) {\n items = r;\n }\n else {\n const l = interp.stack_pop();\n items = [l, r];\n }\n const result = items.every((item) => item);\n interp.stack_push(result);\n }\n // ( bool -- bool )\n word_NOT(interp) {\n const value = interp.stack_pop();\n interp.stack_push(!value);\n }\n // ( item items -- bool )\n word_IN(interp) {\n let items = interp.stack_pop();\n const item = interp.stack_pop();\n if (!items)\n items = [];\n const result = items.indexOf(item) >= 0;\n interp.stack_push(result);\n }\n // ( vals required_vals -- bool )\n word_ANY(interp) {\n const required_vals = interp.stack_pop();\n const vals = interp.stack_pop();\n let result = false;\n for (let i = 0; i < required_vals.length; i++) {\n const rv = required_vals[i];\n if (vals.indexOf(rv) >= 0) {\n result = true;\n break;\n }\n }\n // If nothing is required, then all values are true\n if (required_vals.length == 0)\n result = true;\n interp.stack_push(result);\n }\n // ( vals required_vals -- bool )\n word_ALL(interp) {\n let required_vals = interp.stack_pop();\n let vals = interp.stack_pop();\n if (!vals)\n vals = [];\n if (!required_vals)\n required_vals = [];\n const result = required_vals.every((val) => vals.indexOf(val) >= 0);\n interp.stack_push(result);\n }\n // ( item -- bool )\n word_to_BOOL(interp) {\n const item = interp.stack_pop();\n const result = !!item;\n interp.stack_push(result);\n }\n // ( item -- int )\n word_to_INT(interp) {\n const str = interp.stack_pop();\n const result = parseInt(str);\n interp.stack_push(result);\n }\n // ( item -- int )\n word_to_FLOAT(interp) {\n const str = interp.stack_pop();\n const result = parseFloat(str);\n interp.stack_push(result);\n }\n // ( num buckets -- bucket )\n // Each bucket has three elements: [low high value]. If num is >= low and < high, it's in the bucket\n // If a number isn't in any bucket, null is returned\n word_BUCKET(interp) {\n const buckets = interp.stack_pop();\n const num = interp.stack_pop();\n let result = null;\n for (let i = 0; i < buckets.length; i++) {\n const low = buckets[i][0];\n const high = buckets[i][1];\n const value = buckets[i][2];\n if (num >= low && num < high) {\n result = value;\n break;\n }\n }\n if (num == undefined)\n result = \"\";\n interp.stack_push(result);\n }\n // ( low high -- int )\n word_UNIFORM_RANDOM(interp) {\n const high = interp.stack_pop();\n const low = interp.stack_pop();\n // From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random\n function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1) + min); //The maximum is inclusive and the minimum is inclusive\n }\n const result = getRandomIntInclusive(low, high);\n interp.stack_push(result);\n }\n // ( val start_ranges -- index )\n word_RANGE_INDEX(interp) {\n const start_ranges = interp.stack_pop();\n const val = interp.stack_pop();\n // Cap off the value ranges with infinity\n start_ranges.push(Infinity);\n if (val === null || !start_ranges) {\n interp.stack_push(null);\n return;\n }\n if (val < start_ranges[0]) {\n interp.stack_push(null);\n return;\n }\n let result = null;\n for (let i = 0; i < start_ranges.length - 1; i++) {\n if (val >= start_ranges[i] && val < start_ranges[i + 1]) {\n result = i;\n break;\n }\n }\n interp.stack_push(result);\n }\n // ( items start_ranges fvalue -- value_by_bucket )\n async word_RANGE_BUCKETS(interp) {\n const fvalue = interp.stack_pop();\n const string_location = interp.get_string_location();\n const start_ranges = interp.stack_pop();\n const items = interp.stack_pop();\n if (!items || !start_ranges) {\n interp.stack_push({});\n return;\n }\n const result = { BEFORE: [] };\n for (const range_start of start_ranges) {\n result[range_start] = [];\n }\n for (const item of items) {\n interp.stack_push(item);\n await interp.run(fvalue, string_location);\n const value = interp.stack_pop();\n let bucket = \"BEFORE\";\n for (const range_start of start_ranges) {\n if (value < range_start) {\n break;\n }\n bucket = range_start;\n if (value === range_start) {\n break;\n }\n }\n result[bucket].push(item);\n }\n interp.stack_push(result);\n }\n // ( -- Infinity )\n async word_INFINITY(interp) {\n interp.stack_push(Infinity);\n }\n // ( -- )\n word_bang_PUSH_ERROR(interp) {\n interp.modify_flags(this.module_id, { push_error: true });\n }\n // ( -- )\n word_bang_WITH_KEY(interp) {\n interp.modify_flags(this.module_id, { with_key: true });\n }\n // (comparator -- )\n //\n // `comparator` may be a Forthic string or a Python key function\n word_bang_COMPARATOR(interp) {\n const comparator = interp.stack_pop();\n interp.modify_flags(this.module_id, { comparator });\n }\n // ( -- )\n word_bang_PUSH_REST(interp) {\n interp.modify_flags(this.module_id, { push_rest: true });\n }\n // (depth -- )\n //\n // NOTE: `depth` of 0 is the same not having set depth\n word_bang_DEPTH(interp) {\n const depth = interp.stack_pop();\n interp.modify_flags(this.module_id, { depth });\n }\n // ( bool -- )\n word_bang_OVERWRITE(interp) {\n const overwrite = interp.stack_pop();\n interp.modify_flags(this.module_id, { overwrite });\n }\n // ( delay_ms -- )\n word_bang_DELAY(interp) {\n const delay_ms = interp.stack_pop();\n interp.modify_flags(this.module_id, { delay: delay_ms });\n }\n // ( num_interps -- )\n word_bang_INTERPS(interp) {\n const num_interps = interp.stack_pop();\n interp.modify_flags(this.module_id, { interps: num_interps });\n }\n // ( label -- )\n word_bang_NOTE_PROGRESS(interp) {\n const label = interp.stack_pop();\n interp.modify_flags(this.module_id, { note_progress: label });\n }\n // (str -- encoded)\n word_URL_ENCODE(interp) {\n const str = interp.stack_pop();\n let result = \"\";\n if (str)\n result = encodeURIComponent(str);\n interp.stack_push(result);\n }\n // (urlencoded -- decoded)\n word_URL_DECODE(interp) {\n const urlencoded = interp.stack_pop();\n let result = \"\";\n if (urlencoded)\n result = decodeURIComponent(urlencoded);\n interp.stack_push(result);\n }\n // ( -- char)\n word_QUOTE_CHAR(interp) {\n interp.stack_push(DLE);\n }\n // ( string -- quoted_string)\n word_QUOTED(interp) {\n const string = interp.stack_pop();\n let clean_string = \"\";\n for (let i = 0; i < string.length; i++) {\n let c = string[i];\n if (c == DLE)\n c = \" \";\n clean_string += c;\n }\n const result = `${DLE}${clean_string}${DLE}`;\n interp.stack_push(result);\n }\n // ( object -- )\n word_CONSOLE_LOG(interp) {\n const object = interp.stack_pop();\n console.log(object);\n interp.stack_push(object);\n }\n // ( -- )\n word_PROFILE_START(interp) {\n interp.start_profiling();\n }\n // ( -- )\n word_PROFILE_END(interp) {\n interp.stop_profiling();\n }\n // ( label -- )\n word_PROFILE_TIMESTAMP(interp) {\n const label = interp.stack_pop();\n interp.add_timestamp(label);\n }\n // ( -- )\n word_PROFILE_DATA(interp) {\n const histogram = interp.word_histogram();\n const timestamps = interp.profile_timestamps();\n const result = {\n word_counts: [],\n timestamps: [],\n };\n histogram.forEach((val) => {\n const rec = { word: val[\"word\"], count: val[\"count\"] };\n result[\"word_counts\"].push(rec);\n });\n let prev_time = 0.0;\n timestamps.forEach((t) => {\n const rec = {\n label: t[\"label\"],\n time_ms: t[\"time_ms\"],\n delta: t[\"time_ms\"] - prev_time,\n };\n prev_time = t[\"time_ms\"];\n result[\"timestamps\"].push(rec);\n });\n interp.stack_push(result);\n }\n // ( -- null )\n word_NULL(interp) {\n interp.stack_push(null);\n }\n // ( -- )\n word_NOP(_interp) { }\n // ( -- )\n word_START_LOG(interp) {\n interp.startStream();\n }\n // ( -- )\n word_END_LOG(interp) {\n interp.endStream();\n }\n // ( value default_value -- value )\n word_DEFAULT(interp) {\n const default_value = interp.stack_pop();\n let value = interp.stack_pop();\n if (value === undefined || value === null || value === \"\")\n value = default_value;\n interp.stack_push(value);\n }\n // ( value default_forthic -- value )\n async word_star_DEFAULT(interp) {\n const default_forthic = interp.stack_pop();\n const string_location = interp.get_string_location();\n let value = interp.stack_pop();\n if (value === undefined || value === null || value === \"\") {\n await interp.run(default_forthic, string_location);\n value = interp.stack_pop();\n }\n interp.stack_push(value);\n }\n // ( Record default_key/vals -- Record )\n word_REC_DEFAULTS(interp) {\n const key_vals = interp.stack_pop();\n const record = interp.stack_pop();\n key_vals.forEach((key_val) => {\n const key = key_val[0];\n const value = record[key];\n if (value === undefined || value === null || value == \"\") {\n record[key] = key_val[1];\n }\n });\n interp.stack_push(record);\n }\n // ( item forthic num-times -- ? )\n async word_l_REPEAT(interp) {\n const num_times = interp.stack_pop();\n const forthic = interp.stack_pop();\n const string_location = interp.get_string_location();\n for (let i = 0; i < num_times; i++) {\n // Store item so we can push it back later\n const item = interp.stack_pop();\n interp.stack_push(item);\n await interp.run(forthic, string_location);\n const res = interp.stack_pop();\n // Push original item and result\n interp.stack_push(item);\n interp.stack_push(res);\n }\n }\n // ( a -- a )\n async word_IDENTITY(_interp) { }\n // ( value num_places -- str )\n word_to_FIXED(interp) {\n const num_places = interp.stack_pop();\n const value = interp.stack_pop();\n let result = value;\n if (value === undefined || value === null)\n result = \"\";\n else if (!isNaN(value))\n result = value.toFixed(num_places);\n interp.stack_push(result);\n }\n // ( object -- json )\n word_to_JSON(interp) {\n const object = interp.stack_pop();\n const result = JSON.stringify(object);\n interp.stack_push(result);\n }\n // ( json -- json )\n word_PRETTIFY(interp) {\n const json = interp.stack_pop();\n const result = (0, utils_1.pretty_print)(json);\n interp.stack_push(result);\n }\n // ( json -- object )\n word_JSON_to(interp) {\n const str = interp.stack_pop();\n let result = null;\n if (str)\n result = JSON.parse(str);\n interp.stack_push(result);\n }\n // ( name -- ? )\n async word_LOAD_SCREEN(interp) {\n const name = interp.stack_pop();\n const screen_forthic = interp.get_screen_forthic(name);\n const location = new tokenizer_1.CodeLocation({ screen_name: name });\n // await interp.run(screen_forthic, location);\n await interp.run(screen_forthic, location);\n }\n // ( -- )\n word_dot_s(interp) {\n const stack = interp.get_stack();\n if (stack.length > 0) {\n console.log(stack[stack.length - 1]);\n }\n else {\n console.log(\"\");\n }\n throw new errors_1.IntentionalStopError(\".s\");\n }\n // ( -- )\n word_dot_S(interp) {\n const stack = interp.get_stack().reverse();\n console.log(JSON.stringify(stack, null, 2));\n throw new errors_1.IntentionalStopError(\".S\");\n }\n // ( a b -- a - b )\n word_minus(interp) {\n const b = interp.stack_pop();\n const a = interp.stack_pop();\n interp.stack_push(a - b);\n }\n}\nexports.GlobalModule = GlobalModule;\n// Descends into record using an array of fields, returning final value or null\nfunction drill_for_value(record, fields) {\n let result = record;\n for (let i = 0; i < fields.length; i++) {\n const f = fields[i];\n if (result == null)\n return null;\n result = result[f];\n }\n if (result === undefined)\n result = null;\n return result;\n}\nasync function execute_returning_error(interp, forthic, string_location) {\n let result = null;\n try {\n await interp.run(forthic, string_location);\n }\n catch (e) {\n result = e;\n }\n return result;\n}\nfunction fully_flatten_array(items, accum) {\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (item instanceof Array)\n fully_flatten_array(item, accum);\n else\n accum.push(item);\n }\n return accum;\n}\nfunction flatten_array(items, depth, accum = []) {\n if (depth === undefined)\n return fully_flatten_array(items, accum);\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (depth > 0 && item instanceof Array)\n flatten_array(item, depth - 1, accum);\n else\n accum.push(item);\n }\n return accum;\n}\n//# sourceMappingURL=global_module.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Interpreter = void 0;\nexports.dup_interpreter = dup_interpreter;\nconst tokenizer_1 = require(\"./tokenizer\");\nconst module_1 = require(\"./module\");\nconst global_module_1 = require(\"./global_module\");\nconst tokenizer_2 = require(\"./tokenizer\");\nconst errors_1 = require(\"./errors\");\nclass StartModuleWord extends module_1.Word {\n async execute(interp) {\n const self = this;\n // The app module is the only module with a blank name\n if (self.name === \"\") {\n interp.module_stack_push(interp.get_app_module());\n return;\n }\n // If the module is used by the current module, push it onto the stack, otherwise\n // create a new module.\n let module = interp.cur_module().find_module(self.name);\n if (!module) {\n module = new module_1.Module(self.name);\n interp.cur_module().register_module(module.name, module.name, module);\n // If we're at the app module, also register with interpreter\n if (interp.cur_module().name === \"\") {\n interp.register_module(module);\n }\n }\n interp.module_stack_push(module);\n }\n}\nclass EndModuleWord extends module_1.Word {\n constructor() {\n super(\"}\");\n }\n async execute(interp) {\n interp.module_stack_pop();\n }\n}\nclass EndArrayWord extends module_1.Word {\n constructor() {\n super(\"]\");\n }\n async execute(interp) {\n const items = [];\n let item = interp.stack_pop();\n // NOTE: This won't infinite loop because interp.stack_pop() will eventually fail\n while (true) {\n if (item instanceof tokenizer_1.Token && item.type == tokenizer_1.TokenType.START_ARRAY)\n break;\n items.push(item);\n item = interp.stack_pop();\n }\n items.reverse();\n interp.stack_push(items);\n return;\n }\n}\nclass Interpreter {\n timestamp_id;\n stack;\n global_module;\n app_module;\n module_stack;\n registered_modules;\n tokenizer_stack;\n previous_token;\n handleError;\n maxAttempts;\n is_compiling;\n should_stop;\n is_memo_definition;\n cur_definition; // Assuming this can be of any type, update if you have a specific type\n screens; // Assuming screens can be of any type, update if you have a specific type\n default_module_flags; // Assuming flags can be of any type, update if you have a specific type\n module_flags; // Assuming flags can be of any type, update if you have a specific type\n string_location; // Assuming string_location can be of any type, update if you have a specific type\n word_counts;\n is_profiling;\n start_profile_time;\n timestamps;\n streaming_token_index = 0;\n stream = false;\n previous_delta_length = 0;\n constructor() {\n this.timestamp_id = Math.random();\n this.stack = [];\n this.tokenizer_stack = [];\n this.maxAttempts = 3;\n this.handleError = undefined;\n // We've split the global module functionality into a \"pure\" global module and a React global module\n this.global_module = new global_module_1.GlobalModule(this);\n this.app_module = new module_1.Module(\"\", this);\n this.module_stack = [this.app_module];\n this.registered_modules = {};\n this.is_compiling = false;\n this.should_stop = false;\n this.is_memo_definition = false;\n this.cur_definition = null;\n this.screens = {};\n // Module flags\n this.default_module_flags = {};\n this.module_flags = {};\n // Debug support\n this.string_location = null;\n // Profiling support\n this.word_counts = {};\n this.is_profiling = false;\n this.start_profile_time = null;\n this.timestamps = [];\n }\n get_stack() {\n return this.stack;\n }\n halt() {\n this.should_stop = true;\n }\n get_app_module() {\n return this.app_module;\n }\n get_top_input_string() {\n if (this.tokenizer_stack.length == 0)\n return \"\";\n return this.tokenizer_stack[0].get_input_string();\n }\n get_tokenizer() {\n return this.tokenizer_stack[this.tokenizer_stack.length - 1];\n }\n // Getter method for string_location\n get_string_location() {\n return this.string_location;\n }\n set_max_attempts(maxAttempts) {\n this.maxAttempts = maxAttempts;\n }\n set_error_handler(handleError) {\n this.handleError = handleError;\n }\n get_max_attempts() {\n return this.maxAttempts;\n }\n get_error_handler() {\n return this.handleError;\n }\n // Module flag support\n set_flags(module_id, flags) {\n if (!this.default_module_flags) {\n this.default_module_flags = {};\n }\n if (!this.module_flags) {\n this.module_flags = {};\n }\n this.default_module_flags[module_id] = flags;\n this.module_flags[module_id] = flags;\n }\n get_flags(module_id) {\n const module_flags = this.module_flags[module_id] || {};\n const result = {};\n Object.keys(module_flags).forEach((k) => {\n result[k] = module_flags[k];\n });\n this.module_flags[module_id] = { ...this.default_module_flags[module_id] };\n return result;\n }\n modify_flags(module_id, flags) {\n const module_flags = this.module_flags[module_id] || {};\n this.module_flags[module_id] = { ...module_flags, ...flags };\n }\n reset() {\n this.stack = [];\n this.app_module.variables = {};\n this.module_stack = [this.app_module];\n this.is_compiling = false;\n this.is_memo_definition = false;\n this.cur_definition = null;\n // Debug support\n this.string_location = null;\n }\n get_screen_forthic(screen_name) {\n const screen = this.screens[screen_name];\n if (!screen) {\n throw new errors_1.UnknownScreenError(this.get_top_input_string(), screen_name, this.string_location);\n }\n const result = screen;\n return result;\n }\n async run(string, reference_location = null) {\n this.tokenizer_stack.push(new tokenizer_1.Tokenizer(string, reference_location));\n if (this.handleError) {\n await this.execute_with_recovery();\n }\n else {\n await this.run_with_tokenizer(this.tokenizer_stack[this.tokenizer_stack.length - 1]);\n }\n this.tokenizer_stack.pop();\n return true;\n }\n async execute_with_recovery(numAttempts = 0) {\n try {\n numAttempts++;\n if (numAttempts > this.maxAttempts) {\n throw new errors_1.TooManyAttemptsError(this.get_top_input_string(), numAttempts, this.maxAttempts);\n }\n await this.continue();\n return numAttempts;\n }\n catch (e) {\n if (!this.handleError)\n throw e;\n await this.handleError(e);\n return await this.execute_with_recovery(numAttempts);\n }\n }\n async continue() {\n await this.run_with_tokenizer(this.tokenizer_stack[this.tokenizer_stack.length - 1]);\n return;\n }\n async run_with_tokenizer(tokenizer) {\n let token;\n do {\n this.previous_token = token;\n token = tokenizer.next_token();\n await this.handle_token(token);\n if (token.type === tokenizer_1.TokenType.EOS) {\n break;\n }\n if (this.should_stop) {\n this.should_stop = false;\n break;\n }\n // Regardless of debug mode, we don't want to stop when compiling definitions or going through comments\n if (token.type === tokenizer_1.TokenType.START_DEF ||\n token.type === tokenizer_1.TokenType.END_DEF ||\n token.type == tokenizer_1.TokenType.COMMENT ||\n this.is_compiling) {\n continue;\n }\n // eslint-disable-next-line no-constant-condition\n } while (true);\n return true; // Done executing\n }\n cur_module() {\n const result = this.module_stack[this.module_stack.length - 1];\n return result;\n }\n find_module(name) {\n const result = this.registered_modules[name];\n if (result === undefined) {\n throw new errors_1.UnknownModuleError(this.get_top_input_string(), name, this.string_location);\n }\n return result;\n }\n stack_push(val) {\n this.stack.push(val);\n }\n stack_pop() {\n if (this.stack.length == 0) {\n const tokenizer = this.get_tokenizer();\n throw new errors_1.StackUnderflowError(this.get_top_input_string(), tokenizer.get_token_location());\n }\n let result = this.stack.pop();\n // If we have a PositionedString, we need to record the location\n this.string_location = undefined;\n if (result instanceof tokenizer_2.PositionedString) {\n const positioned_string = result;\n result = positioned_string.valueOf();\n this.string_location = positioned_string.location;\n }\n return result;\n }\n module_stack_push(module) {\n this.module_stack.push(module);\n }\n module_stack_pop() {\n return this.module_stack.pop();\n }\n register_module(module) {\n this.registered_modules[module.name] = module;\n }\n async run_module_code(module) {\n this.module_stack_push(module);\n try {\n await this.run(module.forthic_code);\n }\n catch (e) {\n throw new errors_1.ModuleError(this.get_top_input_string(), module.name, e, this.string_location);\n }\n this.module_stack_pop();\n }\n find_word(name) {\n let result = null;\n for (let i = this.module_stack.length - 1; i >= 0; i--) {\n const m = this.module_stack[i];\n result = m.find_word(name);\n if (result)\n break;\n }\n if (!result) {\n result = this.global_module.find_word(name);\n }\n return result;\n }\n // ======================\n // Profiling\n start_profiling() {\n this.is_profiling = true;\n this.timestamps = [];\n this.start_profile_time = Date.now();\n this.add_timestamp(\"START\");\n this.word_counts = {};\n }\n count_word(word) {\n if (!this.is_profiling)\n return;\n const name = word.name;\n if (!this.word_counts[name])\n this.word_counts[name] = 0;\n this.word_counts[name] += 1;\n }\n stop_profiling() {\n this.add_timestamp(\"END\");\n this.is_profiling = false;\n }\n add_timestamp(label) {\n if (!this.is_profiling)\n return;\n const timestamp = {\n label: label,\n time_ms: Date.now() - this.start_profile_time,\n };\n this.timestamps.push(timestamp);\n }\n word_histogram() {\n const items = [];\n Object.keys(this.word_counts).forEach((name) => {\n items.push({ word: name, count: this.word_counts[name] });\n });\n const result = items.sort((l, r) => r[\"count\"] - l[\"count\"]);\n return result;\n }\n profile_timestamps() {\n return this.timestamps;\n }\n // ======================\n // Handle tokens\n async handle_token(token) {\n if (token.type == tokenizer_1.TokenType.STRING)\n this.handle_string_token(token);\n else if (token.type == tokenizer_1.TokenType.COMMENT)\n this.handle_comment_token(token);\n else if (token.type == tokenizer_1.TokenType.START_ARRAY)\n this.handle_start_array_token(token);\n else if (token.type == tokenizer_1.TokenType.END_ARRAY)\n this.handle_end_array_token(token);\n else if (token.type == tokenizer_1.TokenType.START_MODULE)\n await this.handle_start_module_token(token);\n else if (token.type == tokenizer_1.TokenType.END_MODULE)\n this.handle_end_module_token(token);\n else if (token.type == tokenizer_1.TokenType.START_DEF)\n this.handle_start_definition_token(token);\n else if (token.type == tokenizer_1.TokenType.START_MEMO)\n this.handle_start_memo_token(token);\n else if (token.type == tokenizer_1.TokenType.END_DEF)\n this.handle_end_definition_token(token);\n else if (token.type == tokenizer_1.TokenType.WORD)\n await this.handle_word_token(token);\n else if (token.type == tokenizer_1.TokenType.EOS) {\n return;\n }\n else {\n throw new errors_1.UnknownTokenError(this.get_top_input_string(), token.string, this.string_location);\n }\n }\n handle_string_token(token) {\n const value = new tokenizer_2.PositionedString(token.string, token.location);\n this.handle_word(new module_1.PushValueWord(\"\", value));\n }\n // Start/end module tokens are treated as IMMEDIATE words *and* are also compiled\n async handle_start_module_token(token) {\n const self = this;\n const word = new StartModuleWord(token.string);\n if (self.is_compiling)\n self.cur_definition.add_word(word);\n self.count_word(word); // For profiling\n word.execute(self);\n }\n async handle_end_module_token(_token) {\n const self = this;\n const word = new EndModuleWord();\n if (self.is_compiling)\n self.cur_definition.add_word(word);\n self.count_word(word);\n word.execute(self);\n }\n handle_start_array_token(token) {\n this.handle_word(new module_1.PushValueWord(\"\", token));\n }\n handle_end_array_token(_token) {\n this.handle_word(new EndArrayWord());\n }\n handle_comment_token(_token) {\n // console.log(\"Comment:\", token.string);\n }\n handle_start_definition_token(token) {\n if (this.is_compiling) {\n throw new errors_1.MissingSemicolonError(this.get_top_input_string(), this.previous_token?.location);\n }\n this.cur_definition = new module_1.DefinitionWord(token.string);\n this.is_compiling = true;\n this.is_memo_definition = false;\n }\n handle_start_memo_token(token) {\n if (this.is_compiling) {\n throw new errors_1.MissingSemicolonError(this.get_top_input_string(), this.previous_token?.location);\n }\n this.cur_definition = new module_1.DefinitionWord(token.string);\n this.is_compiling = true;\n this.is_memo_definition = true;\n }\n handle_end_definition_token(token) {\n if (!this.is_compiling || !this.cur_definition) {\n throw new errors_1.ExtraSemicolonError(this.get_top_input_string(), token.location);\n }\n if (this.is_memo_definition) {\n this.cur_module().add_memo_words(this.cur_definition);\n }\n else {\n this.cur_module().add_word(this.cur_definition);\n }\n this.is_compiling = false;\n }\n async handle_word_token(token) {\n const word = this.find_word(token.string);\n if (!word) {\n throw new errors_1.UnknownWordError(this.get_top_input_string(), token.string, token.location);\n }\n await this.handle_word(word, token.location);\n return;\n }\n async handle_word(word, location = null) {\n if (this.is_compiling) {\n word.set_location(location);\n this.cur_definition.add_word(word);\n }\n else {\n this.count_word(word);\n await word.execute(this);\n }\n }\n /**\n * Execute streaming Forthic code.\n *\n * @param fullCode - The complete Forthic code from the start up to the current point.\n * @param done - When false, execute tokens up to (but not including) the last one (if more than one token exists).\n * When true, execute the final token as well.\n */\n async *streamingRun(codeStream, done = false, reference_location = null) {\n // Create a new Tokenizer for the full string.\n const tokenizer = new tokenizer_1.Tokenizer(codeStream, reference_location, true);\n const tokens = [];\n let eosFound = false;\n this.tokenizer_stack.push(tokenizer);\n // Gather tokens from the beginning.\n while (true) {\n const token = tokenizer.next_token();\n if (!token) {\n break;\n }\n // If we hit an EOS token then push it and break.\n if (token.type === tokenizer_1.TokenType.EOS) {\n tokens.push(token);\n eosFound = true;\n break;\n }\n tokens.push(token);\n }\n const delta = eosFound ? undefined : tokenizer.get_string_delta();\n this.tokenizer_stack.pop();\n let newStop = findLastWordOrEOS(tokens);\n if (eosFound && !done) {\n newStop--;\n }\n if (!eosFound && !done) {\n newStop++;\n }\n // Execute only tokens we have not executed previously.\n for (let i = this.streaming_token_index; i < newStop; i++) {\n const token = tokens[i];\n if (!token) {\n continue;\n }\n await this.handle_token(token);\n if (this.stream &&\n (token.type !== tokenizer_1.TokenType.WORD || token.string !== \"START_LOG\")) {\n yield token.string;\n }\n this.previous_token = token;\n }\n if (this.stream && !eosFound) {\n // Yield string delta if we're streaming and tokenizer has a delta\n const newPortion = delta.substring(this.previous_delta_length);\n if (newPortion) {\n yield { stringDelta: newPortion };\n }\n this.previous_delta_length = delta.length;\n }\n if (done) {\n this.endStream();\n return;\n }\n // Update our pointer and reset if done\n this.streaming_token_index = newStop;\n }\n startStream() {\n this.stream = true;\n this.previous_delta_length = 0;\n this.streaming_token_index = 0;\n }\n endStream() {\n this.stream = false;\n this.previous_delta_length = 0;\n this.streaming_token_index = 0;\n }\n}\nexports.Interpreter = Interpreter;\nfunction findLastWordOrEOS(tokens) {\n return tokens.findLastIndex((token) => token.type === tokenizer_1.TokenType.WORD || token.type === tokenizer_1.TokenType.EOS);\n}\nfunction dup_interpreter(interp) {\n const interp_any = interp;\n const result = new Interpreter();\n result.app_module = interp_any.app_module.dup();\n result.module_stack = [result.app_module];\n result.stack = interp_any.stack.slice();\n result.registered_modules = interp_any.registered_modules;\n result.screens = { ...interp_any.screens };\n return result;\n}\n//# sourceMappingURL=interpreter.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./forthic/interpreter.js\"), exports);\n__exportStar(require(\"./forthic/tokenizer\"), exports);\n__exportStar(require(\"./forthic/module.js\"), exports);\n__exportStar(require(\"./forthic/errors.js\"), exports);\n//# sourceMappingURL=index.js.map","import { Interpreter } from \"@forthic/interp\"\n\n(async () => {\n const interp = new Interpreter();\n await interp.run(\"[1 2 3] '3 *' MAP\");\n const result = interp.stack_pop();\n console.log(\"Howdy!\", {result});\n})();"],"names":["tokenizer","TokenType","Token","type","string","location","__publicField","Tokenizer","reference_location","streaming","CodeLocation","result","char","index","num_chars","InvalidInputPositionError","InvalidWordNameError","delim","string_delimiter","token","UnterminatedStringError","screen_name","line","column","start_pos","end_pos","PositionedString","TokenizerError","note","input","message","errors","get_error_description","ForthicError","forthic","UnknownWordError","word","InvalidVariableNameError","var_name","addl_note","UnknownScreenError","UnknownModuleError","module_name","TooManyAttemptsError","num_attempts","max_attempts","WordExecutionError","word_name","error","ModuleError","StackUnderflowError","UnknownTokenError","MissingSemicolonError","ExtraSemicolonError","IntentionalStopError","forthicError","line_num","lines","error_line","module","errors_1","require$$0","errors_2","Variable","name","value","val","Word","_interp","_options","PushValueWord","interp","DefinitionWord","i","e","ModuleWord","handler","ImportedWord","module_word","prefix","ModuleMemoWord","ModuleMemoBangWord","memo_word","ModuleMemoBangAtWord","Module","forthic_code","self","key","prefixes","word_func","names","rec","new_module","w","varname","var_result","utils","is_string","is_object","is_record","is_array","is_empty_object","pretty_print","to_string","is_valid_date","to_date","date_to_string","date_to_int","obj","date","parsedDate","m","y","m_str","d_str","digits","map_word","interpreter_1","MapWord","items","forthic_location","flags","num_items","group_size","groups","interp_runs","group","new_interp","interp_run","run_results","array_result","object_result","res","map_value","descend_record","record","depth","accum","keys","k","item","descend_list","global_module","module_1","utils_1","require$$1","map_word_1","require$$2","tokenizer_1","require$$3","require$$4","DLE","GlobalModule","str_val","match","year","month","day","hours","minutes","element_name","Result","varnames","v","variable","string_location","key_vals","pair","field","fields","drill_for_value","ensure_field","cur_rec","container","new_keys","old_keys","new_to_old","values","field_val","fv","size","group_items","num_groups","remaining","extract_rec","ks","lowercased_key","execute_returning_error","first_key","sub_record","second_key","container2","container1","value2","fend","fend_string_location","fstart","fstart_string_location","array","start_found","end_found","start_index","end_index","end","start","length","normalize_index","step","indexes","rcontainer","lcontainer","difference","l","r","lkeys","rkeys","diff","intersection","intersect","union","keyset","n","rest","taken","taken_keys","rest_keys","element","j","temp","flag_string_position","comparator","sort_without_comparator","sort_with_forthic","make_aug_array","vals","aug_val","cmp_items","l_val","r_val","de_aug_array","aug_vals","aug_array","sort_with_key_func","key_func","nested","add_to_record_result","new_key","fully_flatten_record","record_keys","flatten_record","flatten_array","initial","a","b","str2","sep","strings","ch","replace","text","pattern","re_pattern","matches","num","time","date_string","day_of_week","normalize_day","today","delta_days","num_days","r_date","l_date","ms_per_day","dt_string","datetime","timestamp","sum","numbers","compute_number_mean","compute_non_number_mean","objects","non_null_objects","obj_str","compute_object_mean","records","compute_mean","is_all_numbers","is_all_records","select_non_null_values","non_null_values","num2","required_vals","rv","str","buckets","low","high","getRandomIntInclusive","min","max","start_ranges","fvalue","range_start","bucket","overwrite","delay_ms","num_interps","label","urlencoded","clean_string","c","object","histogram","timestamps","prev_time","t","default_value","default_forthic","key_val","num_times","num_places","json","screen_forthic","stack","f","fully_flatten_array","interpreter","dup_interpreter","global_module_1","tokenizer_2","StartModuleWord","EndModuleWord","EndArrayWord","Interpreter","maxAttempts","handleError","module_id","module_flags","screen","numAttempts","positioned_string","_token","_a","codeStream","done","tokens","eosFound","delta","newStop","findLastWordOrEOS","newPortion","interp_any","__createBinding","this","o","k2","desc","__exportStar","exports","p"],"mappings":"iUACA,OAAO,eAAeA,EAAS,aAAc,CAAE,MAAO,EAAI,CAAE,EAC5DA,EAAA,wBAA8DA,EAAA,iDAAuCA,EAAA,iBAA+CA,EAAA,yBAAuBA,EAAA,IAA2BA,EAAA,kBAAuB,OAG7N,IAAIC,GACH,SAAUA,EAAW,CAClBA,EAAUA,EAAU,OAAY,CAAC,EAAI,SACrCA,EAAUA,EAAU,QAAa,CAAC,EAAI,UACtCA,EAAUA,EAAU,YAAiB,CAAC,EAAI,cAC1CA,EAAUA,EAAU,UAAe,CAAC,EAAI,YACxCA,EAAUA,EAAU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