From 5d13091cd9dc5ad82458f88ec6915d27f44c3eb7 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 21 Jul 2025 22:47:14 +0200 Subject: [PATCH] Mon 21 Jul 22:43:21 CEST 2025 --- js/dos/afvm_dictionary.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 js/dos/afvm_dictionary.js diff --git a/js/dos/afvm_dictionary.js b/js/dos/afvm_dictionary.js new file mode 100644 index 0000000..ee7371e --- /dev/null +++ b/js/dos/afvm_dictionary.js @@ -0,0 +1,31 @@ +/** + * Created by sbosse on 3/8/15. + */ +var Types = require('./afvm_types'); + +var assert = function(condition, message) { + if (!condition) + throw Error("[afvm_dictionary]" + (typeof message !== "undefined" ? ": " + message : "")); +}; + +var Dictionary = function () { + this.DICT = []; +}; + +Dictionary.prototype.Lookup = function (name) { + var _dict_off,_dict,_dict_entry,_dict_size; + _dict_off = -1; + _dict = this.DICT; + _dict_size = _dict.length; + for (i=0;i<_dict_size && _dict_off==-1;i++) { + _dict_entry = _dict[i]; + if (_dict_entry.dict_name == name) + _dict_off = _dict_entry.dict_coff + } + return _dict_off; +}; + + +module.exports = { + Dictionary: Dictionary +};