diff options
| author | Misko Hevery | 2010-08-18 17:34:14 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-08-18 17:34:14 -0700 |
| commit | 9632c99b0a2b7e685381042cff8a78c059473f7f (patch) | |
| tree | 6957db15f3ee2c7831f054b020488fb38a416cb5 | |
| parent | 5ddd8d958686c5075b6c58b700f19b4bdea90e1d (diff) | |
| download | angular.js-9632c99b0a2b7e685381042cff8a78c059473f7f.tar.bz2 | |
move static field from Lexer to hidden namespace
| -rw-r--r-- | src/Parser.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Parser.js b/src/Parser.js index bec1b13a..384d0386 100644 --- a/src/Parser.js +++ b/src/Parser.js @@ -6,7 +6,7 @@ function Lexer(text, parsStrings){ this.index = 0; } -Lexer.OPERATORS = { +OPERATORS = { 'null':function(self){return _null;}, 'true':function(self){return true;}, 'false':function(self){return false;}, @@ -31,7 +31,7 @@ Lexer.OPERATORS = { '|':function(self, a,b){return b(self, a);}, '!':function(self, a){return !a;} }; -Lexer.ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'}; +ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'}; Lexer.prototype = { peek: function() { @@ -44,7 +44,6 @@ Lexer.prototype = { parse: function() { var tokens = this.tokens; - var OPERATORS = Lexer.OPERATORS; var canStartRegExp = true; while (this.index < this.text.length) { var ch = this.text.charAt(this.index); @@ -149,7 +148,7 @@ Lexer.prototype = { } this.index++; } - var fn = Lexer.OPERATORS[ident]; + var fn = OPERATORS[ident]; if (!fn) { fn = getterFn(ident); fn.isAssignable = ident; @@ -173,7 +172,7 @@ Lexer.prototype = { this.index += 4; string += String.fromCharCode(parseInt(hex, 16)); } else { - var rep = Lexer.ESCAPE[ch]; + var rep = ESCAPE[ch]; if (rep) { string += rep; } else { |
