Skip to main content
Module

x/ohm_js/src/makeRecipe.js

A library and language for building parsers, interpreters, compilers, etc.
Go to Latest
File
import {Builder} from './Builder.js';
export function makeRecipe(recipe) { if (typeof recipe === 'function') { return recipe.call(new Builder()); } else { if (typeof recipe === 'string') { // stringified JSON recipe recipe = JSON.parse(recipe); } return new Builder().fromRecipe(recipe); }}