function parse(text,config,filePath){var parser=void 0,parserOptions={loc:true,range:true,raw:true,tokens:true,comment:true,attachComment:true,filePath:filePath};try{switch(config.parser){case'babel-eslint':parser=require("babel-eslint");break;default:parser=require(config.parser);}}catch(ex){messages.push({ruleId:null,fatal:true,severity:2,source:null,message:ex.message,line:0,column:0});return null;}// merge in any additional parser options
if(config.parserOptions){parserOptions=(0,_assign4.default)({},config.parserOptions,parserOptions);}/*
         * Check for parsing errors first. If there's a parsing error, nothing
         * else can happen. However, a parsing error does not throw an error
         * from this method - it's just considered a fatal error message, a
         * problem that ESLint identified just like any other.
         */try{if(typeof parser.parseForESLint==="function"){return parser.parseForESLint(text,parserOptions);}return parser.parse(text,parserOptions);}catch(ex){// If the message includes a leading line number, strip it:
var message=ex.message.replace(/^line \d+:/i,"").trim();var source=ex.lineNumber?SourceCode.splitLines(text)[ex.lineNumber-1]:null;messages.push({ruleId:null,fatal:true,severity:2,source:source,message:"Parsing error: "+message,line:ex.lineNumber,column:ex.column});return null;}}
Parses text into an AST. Moved out here because the try-catch prevents
optimization of functions, so it's best to keep the try-catch as isolated
as possible
@param {string} text The text to parse.
@param {Object} config The ESLint configuration object.
@param {string} filePath The path to the file being parsed.
@returns {ASTNode|CustomParseResult} The AST or parse result if successful,
     or null if not.
@private