forked from olcxjas-softworks/LarpixClient
Add capacitorjs runtime
This commit is contained in:
parent
d0ece489ee
commit
f90c0e6c40
8362 changed files with 1502407 additions and 1 deletions
20
node_modules/chevrotain/diagrams/src/diagrams_serializer.js
generated
vendored
Normal file
20
node_modules/chevrotain/diagrams/src/diagrams_serializer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* @param {string} targetFilePath - The path and file name to serialize to.
|
||||
* @param {string} varName - The name of the global variable to expose the serialized contents/
|
||||
* @param {chevrotain.Parser} parserInstance - A parser instance whose grammar will be serialized.
|
||||
*/
|
||||
function serializeGrammarToFile(targetFilePath, varName, parserInstance) {
|
||||
var fs = require("fs")
|
||||
var serializedGrammar = parserInstance.getSerializedGastProductions()
|
||||
var serializedGrammarText = JSON.stringify(serializedGrammar, null, "\t")
|
||||
|
||||
// generated a JavaScript file which exports the serialized grammar on the global scope (Window)
|
||||
fs.writeFileSync(
|
||||
targetFilePath,
|
||||
"var " + varName + " = " + serializedGrammarText
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
serializeGrammarToFile: serializeGrammarToFile
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue