diff options
Diffstat (limited to 'src/modules.js')
-rw-r--r-- | src/modules.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/modules.js b/src/modules.js index 0b00107c..f1f5f487 100644 --- a/src/modules.js +++ b/src/modules.js @@ -119,6 +119,25 @@ var Types = { this.types = temp; }, + // Remove all data not needed during runtime (like line numbers, JS, etc.) + cleanForRuntime: function() { + values(this.types).forEach(function(type) { + delete type.intertype; + delete type.name_; + delete type.lineNum; + delete type.lines; + delete type.needsFlattening; + delete type.JS; + }); + keys(this.types).forEach(function(longer) { + var shorter = longer.replace('%struct.', '').replace('%class.'); + if (shorter === longer) return; + if (shorter in this.types) return; + this.types[shorter] = this.types[longer]; + delete this.types[longer]; + }, this); + }, + needAnalysis: {} // Types noticed during parsing, that need analysis }; |