blob: 5c4b1736940d86691612e8d356271bc33deb85f9 [file] [log] [blame]
"use strict";
const getSyntax = require("./get-syntax");
const patch = require("./patch-postcss");
function parser (source, lang, opts) {
patch();
const syntax = getSyntax(lang, opts);
const root = syntax.parse(source, opts);
root.source.syntax = syntax;
root.source.lang = lang;
return root;
}
module.exports = parser;