OLD | NEW |
1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
3 | 3 |
4 library engine; | 4 library engine; |
5 | 5 |
6 import 'java_core.dart'; | 6 import 'java_core.dart'; |
7 import 'java_engine.dart'; | 7 import 'java_engine.dart'; |
8 import 'utilities_collection.dart'; | 8 import 'utilities_collection.dart'; |
9 import 'utilities_general.dart'; | 9 import 'utilities_general.dart'; |
10 import 'instrumentation.dart'; | 10 import 'instrumentation.dart'; |
11 import 'error.dart'; | 11 import 'error.dart'; |
12 import 'source.dart'; | 12 import 'source.dart'; |
13 import 'scanner.dart' show Token, Scanner, CharSequenceReader; | 13 import 'scanner.dart' show Token, Scanner, CharSequenceReader, CharacterReader,
IncrementalScanner; |
14 import 'ast.dart'; | 14 import 'ast.dart'; |
15 import 'parser.dart' show Parser; | 15 import 'parser.dart' show Parser, IncrementalParser; |
16 import 'sdk.dart' show DartSdk; | 16 import 'sdk.dart' show DartSdk; |
17 import 'element.dart'; | 17 import 'element.dart'; |
18 import 'resolver.dart'; | 18 import 'resolver.dart'; |
19 import 'html.dart' show XmlTagNode, XmlAttributeNode, RecursiveXmlVisitor, HtmlS
canner, HtmlScanResult, HtmlParser, HtmlParseResult, HtmlScriptTagNode, HtmlUnit
; | 19 import 'html.dart' show XmlTagNode, XmlAttributeNode, RecursiveXmlVisitor, HtmlS
canner, HtmlScanResult, HtmlParser, HtmlParseResult, HtmlScriptTagNode, HtmlUnit
; |
20 | 20 |
21 /** | 21 /** |
22 * The unique instance of the class `AnalysisEngine` serves as the entry point f
or the | 22 * The unique instance of the class `AnalysisEngine` serves as the entry point f
or the |
23 * functionality provided by the analysis engine. | 23 * functionality provided by the analysis engine. |
24 * | 24 * |
25 * @coverage dart.engine | 25 * @coverage dart.engine |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 */ | 684 */ |
685 AnalysisException.con3(Exception cause) : super.withCause(cause); | 685 AnalysisException.con3(Exception cause) : super.withCause(cause); |
686 } | 686 } |
687 | 687 |
688 /** | 688 /** |
689 * The interface `AnalysisOptions` defines the behavior of objects that provide
access to a | 689 * The interface `AnalysisOptions` defines the behavior of objects that provide
access to a |
690 * set of analysis options used to control the behavior of an analysis context. | 690 * set of analysis options used to control the behavior of an analysis context. |
691 */ | 691 */ |
692 abstract class AnalysisOptions { | 692 abstract class AnalysisOptions { |
693 /** | 693 /** |
| 694 * Return `true` if analysis is to parse and analyze function bodies. |
| 695 * |
| 696 * @return `true` if analysis is to parse and analyzer function bodies |
| 697 */ |
| 698 bool get analyzeFunctionBodies; |
| 699 |
| 700 /** |
694 * Return the maximum number of sources for which AST structures should be kep
t in the cache. | 701 * Return the maximum number of sources for which AST structures should be kep
t in the cache. |
695 * | 702 * |
696 * @return the maximum number of sources for which AST structures should be ke
pt in the cache | 703 * @return the maximum number of sources for which AST structures should be ke
pt in the cache |
697 */ | 704 */ |
698 int get cacheSize; | 705 int get cacheSize; |
699 | 706 |
700 /** | 707 /** |
701 * Return `true` if analysis is to generate dart2js related hint results. | 708 * Return `true` if analysis is to generate dart2js related hint results. |
702 * | 709 * |
703 * @return `true` if analysis is to generate dart2js related hint results | 710 * @return `true` if analysis is to generate dart2js related hint results |
704 */ | 711 */ |
705 bool get dart2jsHint; | 712 bool get dart2jsHint; |
706 | 713 |
707 /** | 714 /** |
708 * Return `true` if analysis is to generate hint results (e.g. type inference
based | 715 * Return `true` if analysis is to generate hint results (e.g. type inference
based |
709 * information and pub best practices). | 716 * information and pub best practices). |
710 * | 717 * |
711 * @return `true` if analysis is to generate hint results | 718 * @return `true` if analysis is to generate hint results |
712 */ | 719 */ |
713 bool get hint; | 720 bool get hint; |
| 721 |
| 722 /** |
| 723 * Return `true` if incremental analysis should be used. |
| 724 * |
| 725 * @return `true` if incremental analysis should be used |
| 726 */ |
| 727 bool get incremental; |
| 728 |
| 729 /** |
| 730 * Return `true` if analysis is to parse comments. |
| 731 * |
| 732 * @return `true` if analysis is to parse comments |
| 733 */ |
| 734 bool get preserveComments; |
714 } | 735 } |
715 | 736 |
716 /** | 737 /** |
717 * Instances of the class `AnalysisResult` | 738 * Instances of the class `AnalysisResult` |
718 */ | 739 */ |
719 class AnalysisResult { | 740 class AnalysisResult { |
720 /** | 741 /** |
721 * The change notices associated with this result, or `null` if there were no
changes and | 742 * The change notices associated with this result, or `null` if there were no
changes and |
722 * there is no more work to be done. | 743 * there is no more work to be done. |
723 */ | 744 */ |
(...skipping 2932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3656 } | 3677 } |
3657 return resolveCompilationUnit2(unitSource, library.source); | 3678 return resolveCompilationUnit2(unitSource, library.source); |
3658 } | 3679 } |
3659 | 3680 |
3660 CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySourc
e) => getDartResolutionData2(unitSource, librarySource, DartEntry.RESOLVED_UNIT,
null); | 3681 CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySourc
e) => getDartResolutionData2(unitSource, librarySource, DartEntry.RESOLVED_UNIT,
null); |
3661 | 3682 |
3662 HtmlUnit resolveHtmlUnit(Source htmlSource) => parseHtmlUnit(htmlSource); | 3683 HtmlUnit resolveHtmlUnit(Source htmlSource) => parseHtmlUnit(htmlSource); |
3663 | 3684 |
3664 void set analysisOptions(AnalysisOptions options) { | 3685 void set analysisOptions(AnalysisOptions options) { |
3665 { | 3686 { |
3666 bool needsRecompute = this._options.dart2jsHint != options.dart2jsHint ||
(this._options.hint && !options.hint); | 3687 bool needsRecompute = this._options.analyzeFunctionBodies != options.analy
zeFunctionBodies || this._options.dart2jsHint != options.dart2jsHint || (this._o
ptions.hint && !options.hint) || this._options.preserveComments != options.prese
rveComments; |
3667 int cacheSize = options.cacheSize; | 3688 int cacheSize = options.cacheSize; |
3668 if (this._options.cacheSize != cacheSize) { | 3689 if (this._options.cacheSize != cacheSize) { |
3669 this._options.cacheSize = cacheSize; | 3690 this._options.cacheSize = cacheSize; |
3670 _cache.maxCacheSize = cacheSize; | 3691 _cache.maxCacheSize = cacheSize; |
3671 int maxPriorityOrderSize = cacheSize - _PRIORITY_ORDER_SIZE_DELTA; | 3692 int maxPriorityOrderSize = cacheSize - _PRIORITY_ORDER_SIZE_DELTA; |
3672 if (_priorityOrder.length > maxPriorityOrderSize) { | 3693 if (_priorityOrder.length > maxPriorityOrderSize) { |
3673 List<Source> newPriorityOrder = new List<Source>(maxPriorityOrderSize)
; | 3694 List<Source> newPriorityOrder = new List<Source>(maxPriorityOrderSize)
; |
3674 JavaSystem.arraycopy(_priorityOrder, 0, newPriorityOrder, 0, maxPriori
tyOrderSize); | 3695 JavaSystem.arraycopy(_priorityOrder, 0, newPriorityOrder, 0, maxPriori
tyOrderSize); |
3675 _priorityOrder = newPriorityOrder; | 3696 _priorityOrder = newPriorityOrder; |
3676 } | 3697 } |
3677 } | 3698 } |
| 3699 this._options.analyzeFunctionBodies = options.analyzeFunctionBodies; |
3678 this._options.dart2jsHint = options.dart2jsHint; | 3700 this._options.dart2jsHint = options.dart2jsHint; |
3679 this._options.hint = options.hint; | 3701 this._options.hint = options.hint; |
| 3702 this._options.incremental = options.incremental; |
| 3703 this._options.preserveComments = options.preserveComments; |
3680 if (needsRecompute) { | 3704 if (needsRecompute) { |
3681 invalidateAllResolutionInformation(); | 3705 invalidateAllResolutionInformation(); |
3682 } | 3706 } |
3683 } | 3707 } |
3684 } | 3708 } |
3685 | 3709 |
3686 void set analysisPriorityOrder(List<Source> sources) { | 3710 void set analysisPriorityOrder(List<Source> sources) { |
3687 { | 3711 { |
3688 if (sources == null || sources.isEmpty) { | 3712 if (sources == null || sources.isEmpty) { |
3689 _priorityOrder = Source.EMPTY_ARRAY; | 3713 _priorityOrder = Source.EMPTY_ARRAY; |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4207 * or `null` if there is no more work to be done. | 4231 * or `null` if there is no more work to be done. |
4208 * | 4232 * |
4209 * @return the next task that needs to be performed | 4233 * @return the next task that needs to be performed |
4210 */ | 4234 */ |
4211 AnalysisTask get nextTaskAnalysisTask { | 4235 AnalysisTask get nextTaskAnalysisTask { |
4212 { | 4236 { |
4213 bool hintsEnabled = _options.hint; | 4237 bool hintsEnabled = _options.hint; |
4214 if (_incrementalAnalysisCache != null && _incrementalAnalysisCache.hasWork
()) { | 4238 if (_incrementalAnalysisCache != null && _incrementalAnalysisCache.hasWork
()) { |
4215 AnalysisTask task = new IncrementalAnalysisTask(this, _incrementalAnalys
isCache); | 4239 AnalysisTask task = new IncrementalAnalysisTask(this, _incrementalAnalys
isCache); |
4216 _incrementalAnalysisCache = null; | 4240 _incrementalAnalysisCache = null; |
| 4241 if (_options.incremental) { |
| 4242 return task; |
| 4243 } |
4217 } | 4244 } |
4218 for (Source source in _priorityOrder) { | 4245 for (Source source in _priorityOrder) { |
4219 AnalysisTask task = getNextTaskAnalysisTask2(source, _cache.get(source),
true, hintsEnabled); | 4246 AnalysisTask task = getNextTaskAnalysisTask2(source, _cache.get(source),
true, hintsEnabled); |
4220 if (task != null) { | 4247 if (task != null) { |
4221 return task; | 4248 return task; |
4222 } | 4249 } |
4223 } | 4250 } |
4224 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { | 4251 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { |
4225 AnalysisTask task = getNextTaskAnalysisTask2(entry.getKey(), entry.getVa
lue(), false, hintsEnabled); | 4252 AnalysisTask task = getNextTaskAnalysisTask2(entry.getKey(), entry.getVa
lue(), false, hintsEnabled); |
4226 if (task != null) { | 4253 if (task != null) { |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5319 * The maximum number of sources for which data should be kept in the cache. | 5346 * The maximum number of sources for which data should be kept in the cache. |
5320 */ | 5347 */ |
5321 static int DEFAULT_CACHE_SIZE = 64; | 5348 static int DEFAULT_CACHE_SIZE = 64; |
5322 | 5349 |
5323 /** | 5350 /** |
5324 * The maximum number of sources for which AST structures should be kept in th
e cache. | 5351 * The maximum number of sources for which AST structures should be kept in th
e cache. |
5325 */ | 5352 */ |
5326 int _cacheSize = DEFAULT_CACHE_SIZE; | 5353 int _cacheSize = DEFAULT_CACHE_SIZE; |
5327 | 5354 |
5328 /** | 5355 /** |
| 5356 * A flag indicating whether analysis is to parse and analyze function bodies. |
| 5357 */ |
| 5358 bool _analyzeFunctionBodies = true; |
| 5359 |
| 5360 /** |
5329 * A flag indicating whether analysis is to generate dart2js related hint resu
lts. | 5361 * A flag indicating whether analysis is to generate dart2js related hint resu
lts. |
5330 */ | 5362 */ |
5331 bool _dart2jsHint = true; | 5363 bool _dart2jsHint = true; |
5332 | 5364 |
5333 /** | 5365 /** |
5334 * A flag indicating whether analysis is to generate hint results (e.g. type i
nference based | 5366 * A flag indicating whether analysis is to generate hint results (e.g. type i
nference based |
5335 * information and pub best practices). | 5367 * information and pub best practices). |
5336 */ | 5368 */ |
5337 bool _hint = true; | 5369 bool _hint = true; |
5338 | 5370 |
5339 /** | 5371 /** |
| 5372 * A flag indicating whether incremental analysis should be used. |
| 5373 */ |
| 5374 bool _incremental = false; |
| 5375 |
| 5376 /** |
| 5377 * flag indicating whether analysis is to parse comments. |
| 5378 */ |
| 5379 bool _preserveComments = true; |
| 5380 |
| 5381 /** |
5340 * Initialize a newly created set of analysis options to have their default va
lues. | 5382 * Initialize a newly created set of analysis options to have their default va
lues. |
5341 */ | 5383 */ |
5342 AnalysisOptionsImpl(); | 5384 AnalysisOptionsImpl(); |
5343 | 5385 |
5344 /** | 5386 /** |
5345 * Initialize a newly created set of analysis options to have the same values
as those in the | 5387 * Initialize a newly created set of analysis options to have the same values
as those in the |
5346 * given set of analysis options. | 5388 * given set of analysis options. |
5347 * | 5389 * |
5348 * @param options the analysis options whose values are being copied | 5390 * @param options the analysis options whose values are being copied |
5349 */ | 5391 */ |
5350 AnalysisOptionsImpl.con1(AnalysisOptions options) { | 5392 AnalysisOptionsImpl.con1(AnalysisOptions options) { |
5351 _cacheSize = options.cacheSize; | 5393 _cacheSize = options.cacheSize; |
5352 _dart2jsHint = options.dart2jsHint; | 5394 _dart2jsHint = options.dart2jsHint; |
5353 _hint = options.hint; | 5395 _hint = options.hint; |
| 5396 _incremental = options.incremental; |
5354 } | 5397 } |
5355 | 5398 |
| 5399 bool get analyzeFunctionBodies => _analyzeFunctionBodies; |
| 5400 |
5356 int get cacheSize => _cacheSize; | 5401 int get cacheSize => _cacheSize; |
5357 | 5402 |
5358 bool get dart2jsHint => _dart2jsHint; | 5403 bool get dart2jsHint => _dart2jsHint; |
5359 | 5404 |
5360 bool get hint => _hint; | 5405 bool get hint => _hint; |
5361 | 5406 |
| 5407 bool get incremental => _incremental; |
| 5408 |
| 5409 bool get preserveComments => _preserveComments; |
| 5410 |
| 5411 /** |
| 5412 * Set whether analysis is to parse and analyze function bodies. |
| 5413 * |
| 5414 * @param analyzeFunctionBodies `true` if analysis is to parse and analyze fun
ction bodies |
| 5415 */ |
| 5416 void set analyzeFunctionBodies(bool analyzeFunctionBodies) { |
| 5417 this._analyzeFunctionBodies = analyzeFunctionBodies; |
| 5418 } |
| 5419 |
5362 /** | 5420 /** |
5363 * Set the maximum number of sources for which AST structures should be kept i
n the cache to the | 5421 * Set the maximum number of sources for which AST structures should be kept i
n the cache to the |
5364 * given size. | 5422 * given size. |
5365 * | 5423 * |
5366 * @param cacheSize the maximum number of sources for which AST structures sho
uld be kept in the | 5424 * @param cacheSize the maximum number of sources for which AST structures sho
uld be kept in the |
5367 * cache | 5425 * cache |
5368 */ | 5426 */ |
5369 void set cacheSize(int cacheSize) { | 5427 void set cacheSize(int cacheSize) { |
5370 this._cacheSize = cacheSize; | 5428 this._cacheSize = cacheSize; |
5371 } | 5429 } |
5372 | 5430 |
5373 /** | 5431 /** |
5374 * Set whether analysis is to generate dart2js related hint results. | 5432 * Set whether analysis is to generate dart2js related hint results. |
5375 * | 5433 * |
5376 * @param hint `true` if analysis is to generate dart2js related hint results | 5434 * @param hint `true` if analysis is to generate dart2js related hint results |
5377 */ | 5435 */ |
5378 void set dart2jsHint(bool dart2jsHints) { | 5436 void set dart2jsHint(bool dart2jsHints) { |
5379 this._dart2jsHint = dart2jsHints; | 5437 this._dart2jsHint = dart2jsHints; |
5380 } | 5438 } |
5381 | 5439 |
5382 /** | 5440 /** |
5383 * Set whether analysis is to generate hint results (e.g. type inference based
information and pub | 5441 * Set whether analysis is to generate hint results (e.g. type inference based
information and pub |
5384 * best practices). | 5442 * best practices). |
5385 * | 5443 * |
5386 * @param hint `true` if analysis is to generate hint results | 5444 * @param hint `true` if analysis is to generate hint results |
5387 */ | 5445 */ |
5388 void set hint(bool hint) { | 5446 void set hint(bool hint) { |
5389 this._hint = hint; | 5447 this._hint = hint; |
5390 } | 5448 } |
| 5449 |
| 5450 /** |
| 5451 * Set whether incremental analysis should be used. |
| 5452 * |
| 5453 * @param incremental `true` if incremental analysis should be used |
| 5454 */ |
| 5455 void set incremental(bool incremental) { |
| 5456 this._incremental = incremental; |
| 5457 } |
| 5458 |
| 5459 /** |
| 5460 * Set whether analysis is to parse comments. |
| 5461 * |
| 5462 * @param preserveComments `true` if analysis is to parse comments |
| 5463 */ |
| 5464 void set preserveComments(bool preserveComments) { |
| 5465 this._preserveComments = preserveComments; |
| 5466 } |
5391 } | 5467 } |
5392 | 5468 |
5393 /** | 5469 /** |
5394 * Instances of the class `ChangeNoticeImpl` represent a change to the analysis
results | 5470 * Instances of the class `ChangeNoticeImpl` represent a change to the analysis
results |
5395 * associated with a given source. | 5471 * associated with a given source. |
5396 * | 5472 * |
5397 * @coverage dart.engine | 5473 * @coverage dart.engine |
5398 */ | 5474 */ |
5399 class ChangeNoticeImpl implements ChangeNotice { | 5475 class ChangeNoticeImpl implements ChangeNotice { |
5400 /** | 5476 /** |
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7195 * @return the source | 7271 * @return the source |
7196 */ | 7272 */ |
7197 Source get source => cache != null ? cache.source : null; | 7273 Source get source => cache != null ? cache.source : null; |
7198 | 7274 |
7199 String get taskDescription => "incremental analysis ${(cache != null ? cache.s
ource : "null")}"; | 7275 String get taskDescription => "incremental analysis ${(cache != null ? cache.s
ource : "null")}"; |
7200 | 7276 |
7201 void internalPerform() { | 7277 void internalPerform() { |
7202 if (cache == null) { | 7278 if (cache == null) { |
7203 return; | 7279 return; |
7204 } | 7280 } |
7205 compilationUnit = cache.resolvedUnit; | 7281 if (cache.oldLength > 0 || cache.newLength > 30) { |
| 7282 return; |
| 7283 } |
| 7284 CharacterReader reader = new CharSequenceReader(new CharSequence(cache.newCo
ntents)); |
| 7285 BooleanErrorListener errorListener = new BooleanErrorListener(); |
| 7286 IncrementalScanner scanner = new IncrementalScanner(cache.source, reader, er
rorListener); |
| 7287 Token oldTokens = cache.resolvedUnit.beginToken; |
| 7288 Token newTokens = scanner.rescan(oldTokens, cache.offset, cache.oldLength, c
ache.newLength); |
| 7289 if (errorListener.errorReported) { |
| 7290 return; |
| 7291 } |
| 7292 IncrementalParser parser = new IncrementalParser(cache.source, scanner.token
Map, AnalysisErrorListener.NULL_LISTENER); |
| 7293 compilationUnit = parser.reparse(cache.resolvedUnit, scanner.leftToken, scan
ner.rightToken, cache.offset, cache.offset + cache.oldLength); |
7206 } | 7294 } |
7207 } | 7295 } |
7208 | 7296 |
7209 /** | 7297 /** |
7210 * Instances of the class `ParseDartTask` parse a specific source as a Dart file
. | 7298 * Instances of the class `ParseDartTask` parse a specific source as a Dart file
. |
7211 */ | 7299 */ |
7212 class ParseDartTask extends AnalysisTask { | 7300 class ParseDartTask extends AnalysisTask { |
7213 /** | 7301 /** |
7214 * The source to be parsed. | 7302 * The source to be parsed. |
7215 */ | 7303 */ |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7330 } on JavaException catch (exception) { | 7418 } on JavaException catch (exception) { |
7331 modificationTime = source.modificationStamp; | 7419 modificationTime = source.modificationStamp; |
7332 throw new AnalysisException.con3(exception); | 7420 throw new AnalysisException.con3(exception); |
7333 } | 7421 } |
7334 } finally { | 7422 } finally { |
7335 timeCounterScan.stop(); | 7423 timeCounterScan.stop(); |
7336 } | 7424 } |
7337 TimeCounter_TimeCounterHandle timeCounterParse = PerformanceStatistics.parse
.start(); | 7425 TimeCounter_TimeCounterHandle timeCounterParse = PerformanceStatistics.parse
.start(); |
7338 try { | 7426 try { |
7339 Parser parser = new Parser(source, errorListener); | 7427 Parser parser = new Parser(source, errorListener); |
| 7428 parser.parseFunctionBodies = context.analysisOptions.analyzeFunctionBodies
; |
7340 compilationUnit = parser.parseCompilationUnit(token[0]); | 7429 compilationUnit = parser.parseCompilationUnit(token[0]); |
7341 errors = errorListener.getErrors2(source); | 7430 errors = errorListener.getErrors2(source); |
7342 for (Directive directive in compilationUnit.directives) { | 7431 for (Directive directive in compilationUnit.directives) { |
7343 if (directive is ExportDirective) { | 7432 if (directive is ExportDirective) { |
7344 Source exportSource = resolveSource(source, directive as ExportDirecti
ve); | 7433 Source exportSource = resolveSource(source, directive as ExportDirecti
ve); |
7345 if (exportSource != null) { | 7434 if (exportSource != null) { |
7346 _exportedSources.add(exportSource); | 7435 _exportedSources.add(exportSource); |
7347 } | 7436 } |
7348 } else if (directive is ImportDirective) { | 7437 } else if (directive is ImportDirective) { |
7349 Source importSource = resolveSource(source, directive as ImportDirecti
ve); | 7438 Source importSource = resolveSource(source, directive as ImportDirecti
ve); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7411 class Source_ContentReceiver_11 implements Source_ContentReceiver { | 7500 class Source_ContentReceiver_11 implements Source_ContentReceiver { |
7412 final ParseDartTask ParseDartTask_this; | 7501 final ParseDartTask ParseDartTask_this; |
7413 | 7502 |
7414 RecordingErrorListener errorListener; | 7503 RecordingErrorListener errorListener; |
7415 | 7504 |
7416 List<Token> token; | 7505 List<Token> token; |
7417 | 7506 |
7418 Source_ContentReceiver_11(this.ParseDartTask_this, this.errorListener, this.to
ken); | 7507 Source_ContentReceiver_11(this.ParseDartTask_this, this.errorListener, this.to
ken); |
7419 | 7508 |
7420 void accept(CharBuffer contents, int modificationTime) { | 7509 void accept(CharBuffer contents, int modificationTime) { |
| 7510 doScan(contents, modificationTime); |
| 7511 } |
| 7512 |
| 7513 void accept2(String contents, int modificationTime) { |
| 7514 doScan(new CharSequence(contents), modificationTime); |
| 7515 } |
| 7516 |
| 7517 void doScan(CharSequence contents, int modificationTime) { |
7421 ParseDartTask_this.modificationTime = modificationTime; | 7518 ParseDartTask_this.modificationTime = modificationTime; |
7422 Scanner scanner = new Scanner(ParseDartTask_this.source, new CharSequenceRea
der(contents), errorListener); | 7519 Scanner scanner = new Scanner(ParseDartTask_this.source, new CharSequenceRea
der(contents), errorListener); |
| 7520 scanner.preserveComments = ParseDartTask_this.context.analysisOptions.preser
veComments; |
7423 token[0] = scanner.tokenize(); | 7521 token[0] = scanner.tokenize(); |
7424 ParseDartTask_this.lineInfo = new LineInfo(scanner.lineStarts); | 7522 ParseDartTask_this.lineInfo = new LineInfo(scanner.lineStarts); |
7425 } | 7523 } |
7426 | |
7427 void accept2(String contents, int modificationTime) { | |
7428 ParseDartTask_this.modificationTime = modificationTime; | |
7429 Scanner scanner = new Scanner(ParseDartTask_this.source, new CharSequenceRea
der(new CharSequence(contents)), errorListener); | |
7430 token[0] = scanner.tokenize(); | |
7431 ParseDartTask_this.lineInfo = new LineInfo(scanner.lineStarts); | |
7432 } | |
7433 } | 7524 } |
7434 | 7525 |
7435 /** | 7526 /** |
7436 * Instances of the class `ParseHtmlTask` parse a specific source as an HTML fil
e. | 7527 * Instances of the class `ParseHtmlTask` parse a specific source as an HTML fil
e. |
7437 */ | 7528 */ |
7438 class ParseHtmlTask extends AnalysisTask { | 7529 class ParseHtmlTask extends AnalysisTask { |
7439 /** | 7530 /** |
7440 * The source to be parsed. | 7531 * The source to be parsed. |
7441 */ | 7532 */ |
7442 Source source; | 7533 Source source; |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7843 | 7934 |
7844 void logError3(Exception exception) { | 7935 void logError3(Exception exception) { |
7845 } | 7936 } |
7846 | 7937 |
7847 void logInformation(String message) { | 7938 void logInformation(String message) { |
7848 } | 7939 } |
7849 | 7940 |
7850 void logInformation2(String message, Exception exception) { | 7941 void logInformation2(String message, Exception exception) { |
7851 } | 7942 } |
7852 } | 7943 } |
OLD | NEW |