Last active
December 29, 2020 14:01
-
-
Save BonyChops/4026151655675c74e831cec41f460e43 to your computer and use it in GitHub Desktop.
Generate C header from C source
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
const fs = require('fs'); | |
const filePath = "mulprec_test.c"; | |
const fileData = fs.readFileSync(filePath).toString(); | |
result = fileData.split("\n").filter(line => line.match(/^(int|double|NUMBER|bool|void).*/)).map(line => line.replace(/(\s)*{(\s)*$/,";")).join("\n"); | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment