aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMisko Hevery2010-10-20 07:22:15 -0700
committerMisko Hevery2010-10-20 07:22:15 -0700
commit9c8b1800b90e14b643bab6ada8e96f8f850e84a6 (patch)
treea2e7642934141bb1a4b7541bff3f2e9f08f39dfb /src
parenta27198d52e61adb9cedde04e51bbec74e66089da (diff)
downloadangular.js-9c8b1800b90e14b643bab6ada8e96f8f850e84a6.tar.bz2
fixed negative numbers in Json
Diffstat (limited to 'src')
-rw-r--r--src/Parser.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Parser.js b/src/Parser.js
index 0970144f..7ad65f32 100644
--- a/src/Parser.js
+++ b/src/Parser.js
@@ -32,7 +32,7 @@ function lex(text, parseStringsForObjects){
index = 0,
json = [],
ch,
- lastCh = ','; // can start regexp
+ lastCh = ':'; // can start regexp
while (index < text.length) {
ch = text.charAt(index);
@@ -64,7 +64,7 @@ function lex(text, parseStringsForObjects){
tokens.push({index:index, text:ch2, fn:fn2});
index += 2;
} else if (fn) {
- tokens.push({index:index, text:ch, fn:fn});
+ tokens.push({index:index, text:ch, fn:fn, json: was('[,:') && is('+-')});
index += 1;
} else {
throw "Lexer Error: Unexpected next character [" +