| 29 | import {BaseDemangler} from './base.js'; |
| 30 | |
| 31 | export class PascalDemangler extends BaseDemangler { |
| 32 | static get key() { |
| 33 | return 'pascal'; |
| 34 | } |
| 35 | |
| 36 | symbolStore: SymbolStore; |
| 37 | fixedsymbols: Record<string, string>; |
| 38 | ignoredsymbols: string[]; |
| 39 | |
| 40 | constructor(demanglerExe: string, compiler: BaseCompiler, demanglerArguments: string[] = []) { |
| 41 | super(demanglerExe, compiler, demanglerArguments); |
| 42 | |
| 43 | this.symbolStore = new SymbolStore(); |
| 44 | this.fixedsymbols = {}; |
| 45 | this.ignoredsymbols = []; |
| 46 | |
| 47 | this.initBasicSymbols(); |
| 48 | } |
| 49 | |
| 50 | protected initBasicSymbols() { |
| 51 | this.fixedsymbols.OUTPUT_$$_init = 'unit_initialization'; |
| 52 | this.fixedsymbols.OUTPUT_$$_finalize = 'unit_finalization'; |
| 53 | this.fixedsymbols.OUTPUT_$$_init_implicit = 'unit_initialization_implicit'; |
| 54 | this.fixedsymbols.OUTPUT_$$_finalize_implicit = 'unit_finalization_implicit'; |
| 55 | this.fixedsymbols.OUTPUT_init = 'unit_initialization'; |
| 56 | this.fixedsymbols.OUTPUT_finalize = 'unit_finalization'; |
| 57 | this.fixedsymbols.OUTPUT_init_implicit = 'unit_initialization_implicit'; |
| 58 | this.fixedsymbols.OUTPUT_finalize_implicit = 'unit_finalization_implicit'; |
| 59 | |
| 60 | this.ignoredsymbols = [ |
| 61 | '.L', |
| 62 | 'VMT_$', |
| 63 | 'INIT_$', |
| 64 | 'INIT$_$', |
| 65 | 'FINALIZE$_$', |
| 66 | 'RTTI_$', |
| 67 | 'VMT_OUTPUT_', |
| 68 | 'INIT$_OUTPUT', |
| 69 | 'RTTI_OUTPUT_', |
| 70 | 'FINALIZE$_OUTPUT', |
| 71 | '_$', |
| 72 | 'DEBUGSTART_$', |
| 73 | 'DEBUGEND_$', |
| 74 | 'DBG_$', |
| 75 | 'DBG2_$', |
| 76 | 'DBGREF_$', |
| 77 | 'DEBUGSTART_OUTPUT', |
| 78 | 'DEBUGEND_OUTPUT', |
| 79 | 'DBG_OUTPUT_', |
| 80 | 'DBG2_OUTPUT_', |
| 81 | 'DBGREF_OUTPUT_', |
| 82 | ]; |
| 83 | } |
| 84 | |
| 85 | public shouldIgnoreSymbol(text: string) { |
| 86 | for (const k in this.ignoredsymbols) { |
| 87 | if (text.startsWith(this.ignoredsymbols[k])) { |
| 88 | return true; |
nothing calls this directly
no outgoing calls
no test coverage detected