How to use the oc.compileModule 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 / compile.js View on Github external
addFile: function(file){
        console.info("compiling '" + file + "...")
        var text = fs.readFileSync(file, "utf8");
        var stream = new Stream(text);
        var module = oc.compileModule(
              stream,
              this.__rtl,
              this.__resolveModule.bind(this),
              function(e){this.__handleErrors(file, e);}.bind(this)
              );
        if (!module)
            return undefined;

        this.__code += module.code();

        var symbol = module.symbol();
        this.__modules[symbol.id()] = symbol.info();
        return symbol.info();
    },
    code: function(){return this.__rtl.generate() + this.__code;},

oc

A framework for developing and distributing html components

MIT
Latest version published 1 month ago

Package Health Score

78 / 100
Full package analysis