forked from HiwarkhedePrasad/ByteWise
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_fix.js
More file actions
33 lines (31 loc) · 917 Bytes
/
verify_fix.js
File metadata and controls
33 lines (31 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Mock VS Code API BEFORE requiring the module
global.vscode = {
workspace: {
getConfiguration: () => ({
get: (key, def) => def
}),
onDidChangeConfiguration: () => {}
},
window: {
showInformationMessage: () => {},
showWarningMessage: () => {},
showErrorMessage: () => {}
},
Range: class {},
Location: class {},
Position: class {},
Uri: { file: (path) => path }
};
const fs = require('fs');
const { StructAnalyzer } = require('./src/structAnalyzer');
try {
const analyzer = new StructAnalyzer();
const text = fs.readFileSync('test_cases.c', 'utf8');
const structs = analyzer.parseStructs(text);
fs.writeFileSync('verify_output.json', JSON.stringify(structs, null, 2));
console.log("Success");
} catch (e) {
fs.writeFileSync('verify_error.txt', e.stack);
console.error(e);
process.exit(1);
}