Last active
June 11, 2020 21:22
-
-
Save hayleyxyz/bd263050c0e6a9b247abf4a6f0ee1226 to your computer and use it in GitHub Desktop.
Parse consts from https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowshookexa#parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.clear(); | |
DOC_COMMENT = '\n/// '; | |
arr = [ ] | |
document.body.querySelectorAll('tbody tr').forEach((tr, index, list) => { | |
const td0 = tr.children[0]; | |
const td1 = tr.children[1]; | |
const v = td0.textContent.match(/[A-Z_]+/); | |
const n = td0.textContent.match(/[-\d]+/); | |
if(v && n) { | |
let faketd1 = document.createElement('td'); | |
faketd1.innerHTML = td1.innerHTML; | |
faketd1.innerHTML = faketd1.innerHTML.trim().replace(/\r?\n/gm, DOC_COMMENT); | |
faketd1.querySelectorAll('p').forEach((p) => { | |
p.after(DOC_COMMENT + p.innerHTML); | |
p.remove(); | |
}); | |
arr.push([ v.pop(), n.pop(), faketd1.innerHTML ]); | |
} | |
}); | |
x = arr.map((x) => ` | |
/// <summary> | |
/// ${x[2]} | |
/// </summary> | |
internal const int ${x[0]} = ${x[1]};`).join('\n'); | |
console.log(x); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment