import { parse as babelParse } from '@babel/parser';
import { getCurrentParsingFile, logCore } from '../utils.js';
export function parseComBabel(codigo, plugins) {
    const defaultPlugins = ['typescript', 'jsx', 'decorators-legacy',
        'importAttributes', 'importAssertions',
        'classProperties', 'classPrivateProperties', 'classPrivateMethods', 'optionalChaining', 'nullishCoalescingOperator', 'topLevelAwait'];
    const options = {
        sourceType: 'unambiguous',
        plugins: (Array.isArray(plugins) ? plugins : defaultPlugins)
    };
    try {
        return babelParse(codigo, options);
    }
    catch (erro) {
        logCore.erroBabel(erro.message, getCurrentParsingFile());
        return null;
    }
}
//# sourceMappingURL=babel.js.map