feat: allow the grammar to log to stdout
This commit is contained in:
parent
f2bd0f004f
commit
000c2f4dec
2 changed files with 31 additions and 8 deletions
|
|
@ -385,7 +385,7 @@ function grammar(baseGrammar, options) {
|
|||
throw new Error("Grammar must have at least one rule.");
|
||||
}
|
||||
|
||||
return {name, word, rules, extras, conflicts, precedences, externals, inline, supertypes};
|
||||
return { name, word, rules, extras, conflicts, precedences, externals, inline, supertypes };
|
||||
}
|
||||
|
||||
function checkArguments(ruleCount, caller, callerName, suffix = '') {
|
||||
|
|
@ -419,4 +419,4 @@ global.grammar = grammar;
|
|||
global.field = field;
|
||||
|
||||
const result = require(process.env.TREE_SITTER_GRAMMAR_PATH);
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
process.stdout.write(JSON.stringify(result, null, null));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue