How to use the oc.compile function in oc

To help you get started, we’ve selected a few oc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vladfolts / oberonjs / test / test_compile.js View on Github external
function compile(src, language){
    var text = fs.readFileSync(src, "utf8");
    var errors = "";
    var result = oc.compile(text, language, function(e){errors += e;}, extractOptions(text));
    if (errors)
        throw new Test.TestError(errors);
    return result;
}
github vladfolts / oberonjs / test / test_compile.js View on Github external
function expectError(src, dirs, language){
    var text = fs.readFileSync(src, "utf8");
    var errors = "";
    try {
        oc.compile(text, language, function(e){errors += e + "\n";});
    }
    catch (e){
        errors += e;
    }
    if (!errors.length)
        throw new Test.TestError("compiler error expected");
    var resultName = path.basename(src).replace(".ob", ".txt");
    compareResults(errors, resultName, dirs);
}

oc

A framework for developing and distributing html components

MIT
Latest version published 2 months ago

Package Health Score

78 / 100
Full package analysis