files.forEach(function(file) { filePath = path.resolve(process.cwd(), file); logger.log('debug', 'Reading file: %s', filePath); try { css = fs.readFileSync(filePath, 'utf8'); logger.log('debug', 'CSS for %s, ', filePath, css); } catch (err) { logger.error('Couldn\'t read file %s', filePath); } ast = gonzales.cssToAST(css); logger.log('debug', 'AST for %s, ', filePath, ast); })
processString: function(text, syntax, filename) { if (!text) return text; var tree; var string = JSON.stringify; try { tree = gonzales.cssToAST({ syntax: syntax, css: text }); } catch (e) { throw new Error('Parsing error at ' + filename + ': ' + e.message); } if (typeof tree === 'undefined') { throw new Error('Undefined tree at ' + filename + ': ' + string(text) + ' => ' + string(tree)); } tree = this.processTree(tree); if (this._detect) { return this._getDetectedOptions(this._detected); } else { return gonzales.astToCSS({ syntax: syntax, ast: tree }); } },