diff --git a/test/vlogFast.js b/script/test/vlogFast.js similarity index 63% rename from test/vlogFast.js rename to script/test/vlogFast.js index 8c53606..fbb6a76 100644 --- a/test/vlogFast.js +++ b/script/test/vlogFast.js @@ -1,8 +1,8 @@ -const { vlogFast } = require('../resources/hdlParser'); +const { vlogFast } = require('../../resources/hdlParser'); const testFile = 'c:/Users/11934/Project/Digital-IDE/Digital-Test/Verilog/dependence_test/parent.v'; (async () => { - const fast = vlogFast(testFile); + const fast = await vlogFast(testFile); console.log(JSON.stringify(fast, null, ' ')); })(); \ No newline at end of file diff --git a/src/hdlParser/util.ts b/src/hdlParser/util.ts index 95a701d..8880ae9 100644 --- a/src/hdlParser/util.ts +++ b/src/hdlParser/util.ts @@ -4,23 +4,23 @@ import { HdlLangID } from '../global/enum'; import { AbsPath } from '../global'; namespace HdlSymbol { - export async function fast(path: AbsPath): Promise { + export function fast(path: AbsPath): Promise { const langID = hdlFile.getLanguageId(path); switch (langID) { case HdlLangID.Verilog: return vlogFast(path); case HdlLangID.Vhdl: return vhdlFast(path); case HdlLangID.SystemVerilog: return svFast(path); - default: return undefined; + default: return new Promise(resolve => resolve(undefined)); } } - export async function all(path: AbsPath): Promise { + export function all(path: AbsPath): Promise { const langID = hdlFile.getLanguageId(path); switch (langID) { case HdlLangID.Verilog: return vlogAll(path); case HdlLangID.Vhdl: return vhdlAll(path); case HdlLangID.SystemVerilog: return svAll(path); - default: return undefined; + default: return new Promise(resolve => resolve(undefined)); } } }