Revert "feat(change_detection): make INTERPOLATE_REGEXP customizable (#7417)"
This reverts commit c3fafa0651
.
The symbols should be configured at the component level and not be global to the compiler.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import {Injectable, Inject} from '@angular/core';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {isBlank, isPresent, StringWrapper} from '../../src/facade/lang';
|
||||
import {BaseException} from '../../src/facade/exceptions';
|
||||
import {ListWrapper} from '../../src/facade/collection';
|
||||
@ -46,10 +46,11 @@ import {
|
||||
AstVisitor,
|
||||
Quote
|
||||
} from './ast';
|
||||
import {CompilerConfig} from '../config';
|
||||
|
||||
|
||||
var _implicitReceiver = new ImplicitReceiver();
|
||||
// TODO(tbosch): Cannot make this const/final right now because of the transpiler...
|
||||
var INTERPOLATION_REGEXP = /\{\{([\s\S]*?)\}\}/g;
|
||||
|
||||
class ParseException extends BaseException {
|
||||
constructor(message: string, input: string, errLocation: string, ctxLocation?: any) {
|
||||
@ -68,9 +69,7 @@ export class TemplateBindingParseResult {
|
||||
@Injectable()
|
||||
export class Parser {
|
||||
constructor(/** @internal */
|
||||
public _lexer: Lexer,
|
||||
/** @internal */
|
||||
public _config: CompilerConfig) {}
|
||||
public _lexer: Lexer) {}
|
||||
|
||||
parseAction(input: string, location: any): ASTWithSource {
|
||||
this._checkNoInterpolation(input, location);
|
||||
@ -138,7 +137,7 @@ export class Parser {
|
||||
}
|
||||
|
||||
splitInterpolation(input: string, location: string): SplitInterpolation {
|
||||
var parts = StringWrapper.split(input, this._config.interpolateRegexp);
|
||||
var parts = StringWrapper.split(input, INTERPOLATION_REGEXP);
|
||||
if (parts.length <= 1) {
|
||||
return null;
|
||||
}
|
||||
@ -188,7 +187,7 @@ export class Parser {
|
||||
}
|
||||
|
||||
private _checkNoInterpolation(input: string, location: any): void {
|
||||
var parts = StringWrapper.split(input, this._config.interpolateRegexp);
|
||||
var parts = StringWrapper.split(input, INTERPOLATION_REGEXP);
|
||||
if (parts.length > 1) {
|
||||
throw new ParseException('Got interpolation ({{}}) where expression was expected', input,
|
||||
`at column ${this._findInterpolationErrorColumn(parts, 1)} in`,
|
||||
|
Reference in New Issue
Block a user