| 
									
										
										
										
											2019-11-30 03:24:13 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Tobias Koppers @sokra | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | "use strict"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const AbstractMethodError = require("./AbstractMethodError"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** @typedef {import("./Compilation")} Compilation */ | 
					
						
							|  |  |  | /** @typedef {import("./NormalModule")} NormalModule */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** @typedef {Record<string, any>} PreparsedAst */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							| 
									
										
										
										
											2019-12-02 05:46:17 +08:00
										 |  |  |  * @typedef {Object} ParserStateBase | 
					
						
							| 
									
										
										
										
											2019-11-30 03:24:13 +08:00
										 |  |  |  * @property {NormalModule} current | 
					
						
							|  |  |  |  * @property {NormalModule} module | 
					
						
							|  |  |  |  * @property {Compilation} compilation | 
					
						
							|  |  |  |  * @property {TODO} options | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-02 05:46:17 +08:00
										 |  |  | /** @typedef {Record<string, any> & ParserStateBase} ParserState */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-30 03:24:13 +08:00
										 |  |  | class Parser { | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {string | Buffer | PreparsedAst} source the source to parse | 
					
						
							|  |  |  | 	 * @param {ParserState} state the parser state | 
					
						
							|  |  |  | 	 * @returns {ParserState} the parser state | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	parse(source, state) { | 
					
						
							|  |  |  | 		throw new AbstractMethodError(); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = Parser; |