| 48301 | return text.charAt(at); |
| 48302 | }, |
| 48303 | identifier = function identifier() { |
| 48304 | |
| 48305 | // Parse an identifier. Normally, reserved words are disallowed here, but we |
| 48306 | // only use this for unquoted object keys, where reserved words are allowed, |
| 48307 | // so we don't check for those here. References: |
| 48308 | // - http://es5.github.com/#x7.6 |
| 48309 | // - https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Variables |
| 48310 | // - http://docstore.mik.ua/orelly/webprog/jscript/ch02_07.htm |
| 48311 | // TODO Identifiers can have Unicode "letters" in them; add support for those. |
| 48312 | |
| 48313 | var key = ch; |
| 48314 | |
| 48315 | // Identifiers must start with a letter, _ or $. |
| 48316 | if (ch !== '_' && ch !== '$' && (ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z')) { |
| 48317 | error("Bad identifier as unquoted key"); |
| 48318 | } |
| 48319 | |
| 48320 | // Subsequent characters can contain digits. |
| 48321 | while (next() && (ch === '_' || ch === '$' || ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch >= '0' && ch <= '9')) { |
| 48322 | key += ch; |
| 48323 | } |
| 48324 | |
| 48325 | return key; |
| 48326 | }, |
| 48327 | number = function number() { |
| 48328 | |
| 48329 | // Parse a number value. |