How to use the gonzales-pe.astToSrc function in gonzales-pe

To help you get started, we’ve selected a few gonzales-pe 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 lightningtgc / sublime-cssorder / node_modules / cssorder / node_modules / csscomb / node_modules / csscomb-core / lib / core.js View on Github external
// TODO: Parse different syntaxes
        _this.syntax = syntax || 'css';

        try {
            tree = gonzales.srcToAST({ src: text, syntax: syntax, rule: context });
        } catch (e) {
            var version = require('../package.json').version;
            var message = [filename,
                           e.message,
                          'CSScomb Core version: ' + version];
            e.stack = e.message = message.join('\n');
            throw e;
        }

        tree = processTree(tree);
        return gonzales.astToSrc({ syntax: syntax, ast: tree });
    };