aboutsummaryrefslogtreecommitdiffstats
path: root/src/parser.js
diff options
context:
space:
mode:
authorMisko Hevery2010-12-07 11:47:24 -0800
committerMisko Hevery2010-12-08 14:36:51 -0800
commite5e69d9b90850eb653883f52c76e28dd870ee067 (patch)
treea6b8fdbffebe9e6a51a0a33327da56db4a860527 /src/parser.js
parentfa722447f89e0215463cb39dfd1532189057fea8 (diff)
downloadangular.js-e5e69d9b90850eb653883f52c76e28dd870ee067.tar.bz2
Remove RegExp parser
- RegExp parser is rearly used, feature, and one should not have RegExps in views anyways, so we are removing it BACKWARD INCOMPATIBLE CHANGE!!!
Diffstat (limited to 'src/parser.js')
-rw-r--r--src/parser.js33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/parser.js b/src/parser.js
index 621b0045..01edb3f1 100644
--- a/src/parser.js
+++ b/src/parser.js
@@ -40,8 +40,6 @@ function lex(text, parseStringsForObjects){
readString(ch);
} else if (isNumber(ch) || is('.') && isNumber(peek())) {
readNumber();
- } else if ( was('({[:,;') && is('/') ) {
- readRegexp();
} else if (isIdent(ch)) {
readIdent();
if (was('{,') && json[0]=='{' &&
@@ -207,37 +205,6 @@ function lex(text, parseStringsForObjects){
}
throwError("Unterminated quote", start);
}
- function readRegexp(quote) {
- var start = index;
- index++;
- var regexp = "";
- var escape = false;
- while (index < text.length) {
- var ch = text.charAt(index);
- if (escape) {
- regexp += ch;
- escape = false;
- } else if (ch === '\\') {
- regexp += ch;
- escape = true;
- } else if (ch === '/') {
- index++;
- var flags = "";
- if (isIdent(text.charAt(index))) {
- readIdent();
- flags = tokens.pop().text;
- }
- var compiledRegexp = new RegExp(regexp, flags);
- tokens.push({index:start, text:regexp, flags:flags,
- fn:function(){return compiledRegexp;}});
- return;
- } else {
- regexp += ch;
- }
- index++;
- }
- throwError("Unterminated RegExp", start);
- }
}
/////////////////////////////////////////