1 | import { TextRange } from './TextRange';
|
2 | import { ParserContext } from './ParserContext';
|
3 | import { LineExtractor } from './LineExtractor';
|
4 | import { Tokenizer } from './Tokenizer';
|
5 | import { NodeParser } from './NodeParser';
|
6 | import { TSDocConfiguration } from '../configuration/TSDocConfiguration';
|
7 | import { ParagraphSplitter } from './ParagraphSplitter';
|
8 |
|
9 |
|
10 |
|
11 | var TSDocParser = (function () {
|
12 | function TSDocParser(configuration) {
|
13 | if (configuration) {
|
14 | this.configuration = configuration;
|
15 | }
|
16 | else {
|
17 | this.configuration = new TSDocConfiguration();
|
18 | }
|
19 | }
|
20 | TSDocParser.prototype.parseString = function (text) {
|
21 | return this.parseRange(TextRange.fromString(text));
|
22 | };
|
23 | TSDocParser.prototype.parseRange = function (range) {
|
24 | var parserContext = new ParserContext(this.configuration, range);
|
25 | if (LineExtractor.extract(parserContext)) {
|
26 | parserContext.tokens = Tokenizer.readTokens(parserContext.lines);
|
27 | var nodeParser = new NodeParser(parserContext);
|
28 | nodeParser.parse();
|
29 | ParagraphSplitter.splitParagraphs(parserContext.docComment);
|
30 | }
|
31 | return parserContext;
|
32 | };
|
33 | return TSDocParser;
|
34 | }());
|
35 | export { TSDocParser };
|
36 |
|
\ | No newline at end of file |