Skip to main content
Module

x/ohm_js/test/helpers/testUtil.js

A library and language for building parsers, interpreters, compilers, etc.
Latest
File
import * as ohm from '../../index.mjs';
// --------------------------------------------------------------------// Private stuff// --------------------------------------------------------------------
let nextId = 0;
export function uniqueId() { return nextId++;}
export function makeGrammar(source, optNamespace) { if (Array.isArray(source)) { source = source.join('\n'); } return ohm.grammar(source, optNamespace);}