x/melody@v0.18.1

Melody is a language that compiles to regular expressions and aims to be more easily readable and maintainable
GitHub Stars
3765
Latest

Melody

Deno bindings for the Melody language compiler

Usage

import init, { compiler } from "https://deno.land/x/melody/melody_wasm.js";

await init();

const source = `
  <start>;

  option of "v";

  capture major {
    some of <digit>;
  }

  ".";

  capture minor {
    some of <digit>;
  }

  ".";

  capture patch {
    some of <digit>;
  }

  <end>;
`;

try {
  const output = compiler(source);
  new RegExp(output).test("v1.1.1"); // true
} catch (error) {
  // handle compilation error
}