Changeset 122
- Timestamp:
- 01/06/08 07:37:35 (11 months ago)
- Files:
-
- branches/1.9/source/interpreter.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.9/source/interpreter.d
r121 r122 1 1 2 2 private import 3 methods, // for debugging only 3 4 structure, 4 5 text, … … 6 7 7 8 private import 8 std.string; 9 std.string; // for debugging only 9 10 10 11 uint line = 1; … … 257 258 return; 258 259 case '{': 259 Value[] buffer; 260 const_string[] b1; 261 Value[] b2; 262 uint len = 0; 260 263 parenCount++; 261 264 c++; 262 parseObjectLiteral(); 265 while(1) { 266 parseOptionalWS(); 267 parseOperand(); 268 assert(v.type == TYPE.IDENT || v.type == TYPE.STRING, MESSAGE_unexpected_token); 269 b1 ~= v.s; 270 len++; 271 parseOptionalWS(); 272 assert(c[0] == ':', MESSAGE_unexpected_token); 273 parseOptionalWS(); 274 parseOperand(); 275 b2 ~= v; 276 parseOptionalWS(); 277 if(c[0] != ',') 278 break; 279 c++; 280 } 263 281 assert(*c == '}', MESSAGE_unmatched_parenthesis); 282 c++; 283 v.length = len; 284 v.keys = &b1[0]; 285 v.values = &b2[0]; 286 v.type = TYPE.OBJECT; 287 printf("%.*s",Object_prototype_toSource(v,context)); 264 288 return; 265 289 default:
