| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library engine.resolver; | 5 library engine.resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import "dart:math" as math; | 8 import "dart:math" as math; |
| 9 | 9 |
| 10 import 'java_core.dart'; | 10 import 'java_core.dart'; |
| (...skipping 5401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5412 * The analysis context in which the element model will be built. | 5412 * The analysis context in which the element model will be built. |
| 5413 */ | 5413 */ |
| 5414 final InternalAnalysisContext _context; | 5414 final InternalAnalysisContext _context; |
| 5415 | 5415 |
| 5416 /** | 5416 /** |
| 5417 * The error listener to which errors will be reported. | 5417 * The error listener to which errors will be reported. |
| 5418 */ | 5418 */ |
| 5419 RecordingErrorListener _errorListener; | 5419 RecordingErrorListener _errorListener; |
| 5420 | 5420 |
| 5421 /** | 5421 /** |
| 5422 * The modification time of the source for which an element is being built. | |
| 5423 */ | |
| 5424 int _modificationStamp = 0; | |
| 5425 | |
| 5426 /** | |
| 5427 * The HTML element being built. | 5422 * The HTML element being built. |
| 5428 */ | 5423 */ |
| 5429 HtmlElementImpl _htmlElement; | 5424 HtmlElementImpl _htmlElement; |
| 5430 | 5425 |
| 5431 /** | 5426 /** |
| 5432 * The elements in the path from the HTML unit to the current tag node. | 5427 * The elements in the path from the HTML unit to the current tag node. |
| 5433 */ | 5428 */ |
| 5434 List<ht.XmlTagNode> _parentNodes; | 5429 List<ht.XmlTagNode> _parentNodes; |
| 5435 | 5430 |
| 5436 /** | 5431 /** |
| (...skipping 12 matching lines...) Expand all Loading... |
| 5449 * @param context the analysis context in which the element model will be buil
t | 5444 * @param context the analysis context in which the element model will be buil
t |
| 5450 */ | 5445 */ |
| 5451 HtmlUnitBuilder(this._context) { | 5446 HtmlUnitBuilder(this._context) { |
| 5452 this._errorListener = new RecordingErrorListener(); | 5447 this._errorListener = new RecordingErrorListener(); |
| 5453 } | 5448 } |
| 5454 | 5449 |
| 5455 /** | 5450 /** |
| 5456 * Build the HTML element for the given source. | 5451 * Build the HTML element for the given source. |
| 5457 * | 5452 * |
| 5458 * @param source the source describing the compilation unit | 5453 * @param source the source describing the compilation unit |
| 5459 * @param modificationStamp the modification time of the source for which an e
lement is being | |
| 5460 * built | |
| 5461 * @param unit the AST structure representing the HTML | 5454 * @param unit the AST structure representing the HTML |
| 5462 * @throws AnalysisException if the analysis could not be performed | 5455 * @throws AnalysisException if the analysis could not be performed |
| 5463 */ | 5456 */ |
| 5464 HtmlElementImpl buildHtmlElement(Source source, int modificationStamp, ht.Html
Unit unit) { | 5457 HtmlElementImpl buildHtmlElement(Source source, ht.HtmlUnit unit) { |
| 5465 this._modificationStamp = modificationStamp; | |
| 5466 HtmlElementImpl result = new HtmlElementImpl(_context, source.shortName); | 5458 HtmlElementImpl result = new HtmlElementImpl(_context, source.shortName); |
| 5467 result.source = source; | 5459 result.source = source; |
| 5468 _htmlElement = result; | 5460 _htmlElement = result; |
| 5469 unit.accept(this); | 5461 unit.accept(this); |
| 5470 _htmlElement = null; | 5462 _htmlElement = null; |
| 5471 unit.element = result; | 5463 unit.element = result; |
| 5472 return result; | 5464 return result; |
| 5473 } | 5465 } |
| 5474 | 5466 |
| 5475 /** | 5467 /** |
| (...skipping 10343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15819 _errorListener.onError( | 15811 _errorListener.onError( |
| 15820 new AnalysisError.con2( | 15812 new AnalysisError.con2( |
| 15821 element.source, | 15813 element.source, |
| 15822 element.nameOffset, | 15814 element.nameOffset, |
| 15823 element.displayName.length, | 15815 element.displayName.length, |
| 15824 errorCode, | 15816 errorCode, |
| 15825 arguments)); | 15817 arguments)); |
| 15826 } | 15818 } |
| 15827 } | 15819 } |
| 15828 } | 15820 } |
| OLD | NEW |