refactor(compiler): re-arrange files

This commit is contained in:
Victor Berchet
2016-07-21 11:41:25 -07:00
parent cc5cfe87c3
commit 1b77604ee2
58 changed files with 176 additions and 170 deletions

View File

@ -6,18 +6,18 @@
* found in the LICENSE file at https://angular.io/license
*/
import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '../../core/testing/testing_internal';
import {CssLexer, CssLexerMode, CssScannerError, CssToken, CssTokenType} from '../src/css_lexer';
import {isPresent} from '../src/facade/lang';
import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '../../../core/testing/testing_internal';
import {CssLexer, CssLexerMode, CssScannerError, CssToken, CssTokenType} from '../../src/css_parser/css_lexer';
import {isPresent} from '../../src/facade/lang';
export function main() {
function tokenize(
code: any /** TODO #9100 */, trackComments: boolean = false,
code: string, trackComments: boolean = false,
mode: CssLexerMode = CssLexerMode.ALL): CssToken[] {
var scanner = new CssLexer().scan(code, trackComments);
const scanner = new CssLexer().scan(code, trackComments);
scanner.setMode(mode);
var tokens: any[] /** TODO #9100 */ = [];
var tokens: CssToken[] = [];
var output = scanner.scan();
while (output != null) {
var error = output.error;
@ -316,7 +316,7 @@ export function main() {
describe('Media Query Mode', () => {
it('should validate media queries with a reduced subset of valid characters', () => {
function tokenizeQuery(code: any /** TODO #9100 */) {
function tokenizeQuery(code: string) {
return tokenize(code, false, CssLexerMode.MEDIA_QUERY);
}
@ -357,7 +357,7 @@ export function main() {
'Style Block Mode', () => {
it('should style blocks with a reduced subset of valid characters',
() => {
function tokenizeStyles(code: any /** TODO #9100 */) {
function tokenizeStyles(code: string) {
return tokenize(code, false, CssLexerMode.STYLE_BLOCK);
}

View File

@ -6,11 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '../../core/testing/testing_internal';
import {CssBlockAst, CssBlockDefinitionRuleAst, CssBlockRuleAst, CssDefinitionAst, CssInlineRuleAst, CssKeyframeDefinitionAst, CssKeyframeRuleAst, CssMediaQueryRuleAst, CssRuleAst, CssSelectorAst, CssSelectorRuleAst, CssStyleSheetAst, CssStyleValueAst} from '../src/css_ast';
import {BlockType, CssParseError, CssParser, CssToken, ParsedCssResult} from '../src/css_parser';
import {BaseException} from '../src/facade/exceptions';
import {ParseLocation} from '../src/parse_util';
import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '../../../core/testing/testing_internal';
import {CssBlockAst, CssBlockDefinitionRuleAst, CssBlockRuleAst, CssDefinitionAst, CssInlineRuleAst, CssKeyframeDefinitionAst, CssKeyframeRuleAst, CssMediaQueryRuleAst, CssSelectorRuleAst, CssStyleSheetAst, CssStyleValueAst} from '../../src/css_parser/css_ast';
import {BlockType, CssParseError, CssParser, CssToken, ParsedCssResult} from '../../src/css_parser/css_parser';
import {BaseException} from '../../src/facade/exceptions';
import {ParseLocation} from '../../src/parse_util';
export function assertTokens(tokens: CssToken[], valuesArr: string[]) {
for (var i = 0; i < tokens.length; i++) {

View File

@ -6,11 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '../../core/testing/testing_internal';
import {CssAst, CssAstVisitor, CssAtRulePredicateAst, CssBlockAst, CssBlockDefinitionRuleAst, CssBlockRuleAst, CssDefinitionAst, CssInlineRuleAst, CssKeyframeDefinitionAst, CssKeyframeRuleAst, CssMediaQueryRuleAst, CssPseudoSelectorAst, CssRuleAst, CssSelectorAst, CssSelectorRuleAst, CssSimpleSelectorAst, CssStyleSheetAst, CssStyleValueAst, CssStylesBlockAst, CssUnknownRuleAst, CssUnknownTokenListAst} from '../src/css_ast';
import {BlockType, CssParseError, CssParser, CssToken} from '../src/css_parser';
import {BaseException} from '../src/facade/exceptions';
import {isPresent} from '../src/facade/lang';
import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '../../../core/testing/testing_internal';
import {CssAst, CssAstVisitor, CssAtRulePredicateAst, CssBlockAst, CssBlockDefinitionRuleAst, CssBlockRuleAst, CssDefinitionAst, CssInlineRuleAst, CssKeyframeDefinitionAst, CssKeyframeRuleAst, CssMediaQueryRuleAst, CssPseudoSelectorAst, CssRuleAst, CssSelectorAst, CssSelectorRuleAst, CssSimpleSelectorAst, CssStyleSheetAst, CssStyleValueAst, CssStylesBlockAst, CssUnknownRuleAst, CssUnknownTokenListAst} from '../../src/css_parser/css_ast';
import {BlockType, CssParseError, CssParser, CssToken} from '../../src/css_parser/css_parser';
import {BaseException} from '../../src/facade/exceptions';
import {isPresent} from '../../src/facade/lang';
function _assertTokens(tokens: CssToken[], valuesArr: string[]): void {
expect(tokens.length).toEqual(valuesArr.length);

View File

@ -8,7 +8,7 @@
import {AST, AstVisitor, Binary, BindingPipe, Chain, Conditional, EmptyExpr, FunctionCall, ImplicitReceiver, Interpolation, KeyedRead, KeyedWrite, LiteralArray, LiteralMap, LiteralPrimitive, MethodCall, PrefixNot, PropertyRead, PropertyWrite, Quote, SafeMethodCall, SafePropertyRead} from '../../src/expression_parser/ast';
import {StringWrapper, isPresent, isString} from '../../src/facade/lang';
import {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from '../../src/interpolation_config';
import {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from '../../src/html_parser/interpolation_config';
class Unparser implements AstVisitor {
private static _quoteRegExp = /"/g;

View File

@ -6,11 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ddescribe, describe, expect, iit, it} from '../../core/testing/testing_internal';
import {ExpansionResult, expandNodes} from '../src/expander';
import {HtmlAttrAst, HtmlElementAst, HtmlTextAst} from '../src/html_ast';
import {HtmlParser} from '../src/html_parser';
import {ParseError} from '../src/parse_util';
import {ddescribe, describe, expect, iit, it} from '../../../core/testing/testing_internal';
import {ExpansionResult, expandNodes} from '../../src/html_parser/expander';
import {HtmlAttrAst, HtmlElementAst, HtmlTextAst} from '../../src/html_parser/html_ast';
import {HtmlParser} from '../../src/html_parser/html_parser';
import {ParseError} from '../../src/parse_util';
import {humanizeNodes} from './html_ast_spec_utils';

View File

@ -1,6 +1,6 @@
import {HtmlAst, HtmlAstVisitor, HtmlAttrAst, HtmlCommentAst, HtmlElementAst, HtmlExpansionAst, HtmlExpansionCaseAst, HtmlTextAst, htmlVisitAll} from '@angular/compiler/src/html_ast';
import {HtmlParser} from '@angular/compiler/src/html_parser';
import {beforeEach, ddescribe, describe, expect, it} from '@angular/core/testing/testing_internal';
import {beforeEach, ddescribe, describe, expect, it} from '../../../core/testing/testing_internal';
import {HtmlAst, HtmlAstVisitor, HtmlAttrAst, HtmlCommentAst, HtmlElementAst, HtmlExpansionAst, HtmlExpansionCaseAst, HtmlTextAst, htmlVisitAll} from '../../src/html_parser/html_ast';
import {HtmlParser} from '../../src/html_parser/html_parser';
export function main() {
describe('HtmlAst serilaizer', () => {

View File

@ -6,11 +6,10 @@
* found in the LICENSE file at https://angular.io/license
*/
import {HtmlAst, HtmlAstVisitor, HtmlAttrAst, HtmlCommentAst, HtmlElementAst, HtmlExpansionAst, HtmlExpansionCaseAst, HtmlTextAst, htmlVisitAll} from '@angular/compiler/src/html_ast';
import {HtmlParseTreeResult} from '@angular/compiler/src/html_parser';
import {ParseLocation} from '@angular/compiler/src/parse_util';
import {BaseException} from '../src/facade/exceptions';
import {BaseException} from '../../src/facade/exceptions';
import {HtmlAst, HtmlAstVisitor, HtmlAttrAst, HtmlCommentAst, HtmlElementAst, HtmlExpansionAst, HtmlExpansionCaseAst, HtmlTextAst, htmlVisitAll} from '../../src/html_parser/html_ast';
import {HtmlParseTreeResult} from '../../src/html_parser/html_parser';
import {ParseLocation} from '../../src/parse_util';
export function humanizeDom(
parseResult: HtmlParseTreeResult, addSourceSpan: boolean = false): any[] {

View File

@ -6,10 +6,10 @@
* found in the LICENSE file at https://angular.io/license
*/
import {HtmlToken, HtmlTokenError, HtmlTokenType, tokenizeHtml} from '@angular/compiler/src/html_lexer';
import {InterpolationConfig} from '@angular/compiler/src/interpolation_config';
import {ParseLocation, ParseSourceFile, ParseSourceSpan} from '@angular/compiler/src/parse_util';
import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '@angular/core/testing/testing_internal';
import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '../../../core/testing/testing_internal';
import {HtmlToken, HtmlTokenError, HtmlTokenType, tokenizeHtml} from '../../src/html_parser/html_lexer';
import {InterpolationConfig} from '../../src/html_parser/interpolation_config';
import {ParseLocation, ParseSourceFile, ParseSourceSpan} from '../../src/parse_util';
export function main() {
describe('HtmlLexer', () => {

View File

@ -6,11 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
import {HtmlAttrAst, HtmlCommentAst, HtmlElementAst, HtmlExpansionAst, HtmlExpansionCaseAst, HtmlTextAst} from '@angular/compiler/src/html_ast';
import {HtmlTokenType} from '@angular/compiler/src/html_lexer';
import {HtmlParseTreeResult, HtmlParser, HtmlTreeError} from '@angular/compiler/src/html_parser';
import {ParseError} from '@angular/compiler/src/parse_util';
import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '@angular/core/testing/testing_internal';
import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '../../../core/testing/testing_internal';
import {HtmlAttrAst, HtmlCommentAst, HtmlElementAst, HtmlExpansionAst, HtmlExpansionCaseAst, HtmlTextAst} from '../../src/html_parser/html_ast';
import {HtmlTokenType} from '../../src/html_parser/html_lexer';
import {HtmlParseTreeResult, HtmlParser, HtmlTreeError} from '../../src/html_parser/html_parser';
import {ParseError} from '../../src/parse_util';
import {humanizeDom, humanizeDomSourceSpans, humanizeLineColumn} from './html_ast_spec_utils';

View File

@ -6,11 +6,12 @@
* found in the LICENSE file at https://angular.io/license
*/
import {HtmlParser} from '@angular/compiler/src/html_parser';
import {Catalog, strHash} from '@angular/compiler/src/i18n/catalog';
import {DEFAULT_INTERPOLATION_CONFIG} from '@angular/compiler/src/interpolation_config';
import {beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
import {HtmlParser} from '../../src/html_parser/html_parser';
import {DEFAULT_INTERPOLATION_CONFIG} from '../../src/html_parser/interpolation_config';
import Serializable = webdriver.Serializable;
import {Serializer} from '@angular/compiler/src/i18n/serializers/serializer';
import {serializeAst} from '@angular/compiler/src/i18n/catalog';

View File

@ -6,11 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
import {HtmlParser} from '@angular/compiler/src/html_parser';
import {ExtractionResult, extractAstMessages} from '@angular/compiler/src/i18n/extractor';
import {beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
import {serializeAst} from '../html_ast_serializer_spec'
import {HtmlParser} from '../../src/html_parser/html_parser';
import {serializeAst} from '../html_parser/html_ast_serializer_spec'
export function main() {
ddescribe(

View File

@ -8,17 +8,17 @@
import {Lexer as ExpressionLexer} from '@angular/compiler/src/expression_parser/lexer';
import {Parser as ExpressionParser} from '@angular/compiler/src/expression_parser/parser';
import {HtmlAttrAst, HtmlElementAst, HtmlTextAst} from '@angular/compiler/src/html_ast';
import {HtmlParseTreeResult, HtmlParser} from '@angular/compiler/src/html_parser';
import {I18nHtmlParser} from '@angular/compiler/src/i18n/i18n_html_parser';
import {Message, id} from '@angular/compiler/src/i18n/message';
import {deserializeXmb} from '@angular/compiler/src/i18n/xmb_serializer';
import {InterpolationConfig} from '@angular/compiler/src/interpolation_config';
import {ParseError} from '@angular/compiler/src/parse_util';
import {humanizeDom} from '@angular/compiler/test/html_ast_spec_utils';
import {ddescribe, describe, expect, iit, it} from '@angular/core/testing/testing_internal';
import {StringMapWrapper} from '../../src/facade/collection';
import {HtmlAttrAst, HtmlElementAst, HtmlTextAst} from '../../src/html_parser/html_ast';
import {HtmlParseTreeResult, HtmlParser} from '../../src/html_parser/html_parser';
import {InterpolationConfig} from '../../src/html_parser/interpolation_config';
import {humanizeDom} from '../html_parser/html_ast_spec_utils';
export function main() {
describe('I18nHtmlParser', () => {

View File

@ -6,12 +6,13 @@
* found in the LICENSE file at https://angular.io/license
*/
import {HtmlParser} from '@angular/compiler/src/html_parser';
import {serializeAst} from '@angular/compiler/src/i18n/catalog';
import {extractI18nMessages} from '@angular/compiler/src/i18n/i18n_parser';
import {DEFAULT_INTERPOLATION_CONFIG} from '@angular/compiler/src/interpolation_config';
import {ddescribe, describe, expect, it} from '@angular/core/testing/testing_internal';
import {HtmlParser} from '../../src/html_parser/html_parser';
import {DEFAULT_INTERPOLATION_CONFIG} from '../../src/html_parser/interpolation_config';
export function main() {
ddescribe('I18nParser', () => {

View File

@ -8,11 +8,12 @@
import {Lexer as ExpressionLexer} from '@angular/compiler/src/expression_parser/lexer';
import {Parser as ExpressionParser} from '@angular/compiler/src/expression_parser/parser';
import {HtmlParser} from '@angular/compiler/src/html_parser';
import {Message} from '@angular/compiler/src/i18n/message';
import {MessageExtractor, removeDuplicates} from '@angular/compiler/src/i18n/message_extractor';
import {beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
import {HtmlParser} from '../../src/html_parser/html_parser';
export function main() {
describe('MessageExtractor', () => {

View File

@ -6,12 +6,13 @@
* found in the LICENSE file at https://angular.io/license
*/
import {HtmlParser} from '@angular/compiler/src/html_parser';
import {Catalog} from '@angular/compiler/src/i18n/catalog';
import {XmbSerializer} from '@angular/compiler/src/i18n/serializers/xmb';
import {DEFAULT_INTERPOLATION_CONFIG} from '@angular/compiler/src/interpolation_config';
import {beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
import {HtmlParser} from '../../../src/html_parser/html_parser';
import {DEFAULT_INTERPOLATION_CONFIG} from '../../../src/html_parser/interpolation_config';
export function main(): void {
ddescribe('XMB serializer', () => {

View File

@ -6,12 +6,13 @@
* found in the LICENSE file at https://angular.io/license
*/
import {HtmlAst} from '@angular/compiler/src/html_ast';
import {Message, id} from '@angular/compiler/src/i18n/message';
import {deserializeXmb, serializeXmb} from '@angular/compiler/src/i18n/xmb_serializer';
import {ParseError, ParseSourceSpan} from '@angular/compiler/src/parse_util';
import {beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
import {HtmlAst} from '../../src/html_parser/html_ast';
export function main() {
describe('Xmb', () => {
describe('Xmb Serialization', () => {

View File

@ -6,13 +6,14 @@
* found in the LICENSE file at https://angular.io/license
*/
import {HtmlElementAst} from '@angular/compiler/src/html_ast';
import {HtmlParser} from '@angular/compiler/src/html_parser';
import {DomElementSchemaRegistry} from '@angular/compiler/src/schema/dom_element_schema_registry';
import {CUSTOM_ELEMENTS_SCHEMA, SecurityContext} from '@angular/core';
import {beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
import {browserDetection} from '@angular/platform-browser/testing/browser_util';
import {HtmlElementAst} from '../../src/html_parser/html_ast';
import {HtmlParser} from '../../src/html_parser/html_parser';
import {extractSchema} from './schema_extractor';
export function main() {

View File

@ -9,19 +9,19 @@
import {CompileDiDependencyMetadata, CompileDirectiveMetadata, CompilePipeMetadata, CompileProviderMetadata, CompileQueryMetadata, CompileTemplateMetadata, CompileTokenMetadata, CompileTypeMetadata} from '@angular/compiler/src/compile_metadata';
import {DomElementSchemaRegistry} from '@angular/compiler/src/schema/dom_element_schema_registry';
import {ElementSchemaRegistry} from '@angular/compiler/src/schema/element_schema_registry';
import {AttrAst, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, DirectiveAst, ElementAst, EmbeddedTemplateAst, NgContentAst, PropertyBindingType, ProviderAstType, ReferenceAst, TemplateAst, TemplateAstVisitor, TextAst, VariableAst, templateVisitAll} from '@angular/compiler/src/template_ast';
import {TEMPLATE_TRANSFORMS, TemplateParser, splitClasses} from '@angular/compiler/src/template_parser';
import {AttrAst, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, DirectiveAst, ElementAst, EmbeddedTemplateAst, NgContentAst, PropertyBindingType, ProviderAstType, ReferenceAst, TemplateAst, TemplateAstVisitor, TextAst, VariableAst, templateVisitAll} from '@angular/compiler/src/template_parser/template_ast';
import {TEMPLATE_TRANSFORMS, TemplateParser, splitClasses} from '@angular/compiler/src/template_parser/template_parser';
import {MockSchemaRegistry} from '@angular/compiler/testing';
import {SchemaMetadata, SecurityContext} from '@angular/core';
import {Console} from '@angular/core/src/console';
import {TestBed} from '@angular/core/testing';
import {afterEach, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
import {Identifiers, identifierToken} from '../src/identifiers';
import {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from '../src/interpolation_config';
import {Identifiers, identifierToken} from '../../src/identifiers';
import {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from '../../src/html_parser/interpolation_config';
import {unparse} from './expression_parser/unparser';
import {TEST_COMPILER_PROVIDERS} from './test_bindings';
import {unparse} from '../expression_parser/unparser';
import {TEST_COMPILER_PROVIDERS} from '../test_bindings';
var someModuleUrl = 'package:someModule';

View File

@ -6,17 +6,18 @@
* found in the LICENSE file at https://angular.io/license
*/
import {HtmlParser} from '@angular/compiler/src/html_parser';
import {PreparsedElement, PreparsedElementType, preparseElement} from '@angular/compiler/src/template_preparser';
import {afterEach, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
import {afterEach, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '../../../core/testing/testing_internal';
import {HtmlElementAst} from '../../src/html_parser/html_ast';
import {HtmlParser} from '../../src/html_parser/html_parser';
import {PreparsedElement, PreparsedElementType, preparseElement} from '../../src/template_parser/template_preparser';
export function main() {
describe('preparseElement', () => {
var htmlParser: any /** TODO #9100 */;
var htmlParser: HtmlParser;
beforeEach(inject([HtmlParser], (_htmlParser: HtmlParser) => { htmlParser = _htmlParser; }));
function preparse(html: string): PreparsedElement {
return preparseElement(htmlParser.parse(html, 'TestComp').rootNodes[0]);
return preparseElement(htmlParser.parse(html, 'TestComp').rootNodes[0] as HtmlElementAst);
}
it('should detect script elements', inject([HtmlParser], (htmlParser: HtmlParser) => {