OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 308 matching lines...) Loading... |
319 return ReportUnexpectedCharacter(); | 319 return ReportUnexpectedCharacter(); |
320 } | 320 } |
321 } | 321 } |
322 AdvanceSkipWhitespace(); | 322 AdvanceSkipWhitespace(); |
323 return json_object; | 323 return json_object; |
324 } | 324 } |
325 | 325 |
326 // Parse a JSON array. Position must be right at '['. | 326 // Parse a JSON array. Position must be right at '['. |
327 template <bool seq_ascii> | 327 template <bool seq_ascii> |
328 Handle<Object> JsonParser<seq_ascii>::ParseJsonArray() { | 328 Handle<Object> JsonParser<seq_ascii>::ParseJsonArray() { |
329 ZoneScope zone_scope(isolate(), DELETE_ON_EXIT); | 329 ZoneScope zone_scope(zone(), DELETE_ON_EXIT); |
330 ZoneList<Handle<Object> > elements(4, zone()); | 330 ZoneList<Handle<Object> > elements(4, zone()); |
331 ASSERT_EQ(c0_, '['); | 331 ASSERT_EQ(c0_, '['); |
332 | 332 |
333 AdvanceSkipWhitespace(); | 333 AdvanceSkipWhitespace(); |
334 if (c0_ != ']') { | 334 if (c0_ != ']') { |
335 do { | 335 do { |
336 Handle<Object> element = ParseJsonValue(); | 336 Handle<Object> element = ParseJsonValue(); |
337 if (element.is_null()) return ReportUnexpectedCharacter(); | 337 if (element.is_null()) return ReportUnexpectedCharacter(); |
338 elements.Add(element, zone()); | 338 elements.Add(element, zone()); |
339 } while (MatchSkipWhiteSpace(',')); | 339 } while (MatchSkipWhiteSpace(',')); |
(...skipping 255 matching lines...) Loading... |
595 } | 595 } |
596 ASSERT_EQ('"', c0_); | 596 ASSERT_EQ('"', c0_); |
597 // Advance past the last '"'. | 597 // Advance past the last '"'. |
598 AdvanceSkipWhitespace(); | 598 AdvanceSkipWhitespace(); |
599 return result; | 599 return result; |
600 } | 600 } |
601 | 601 |
602 } } // namespace v8::internal | 602 } } // namespace v8::internal |
603 | 603 |
604 #endif // V8_JSON_PARSER_H_ | 604 #endif // V8_JSON_PARSER_H_ |
OLD | NEW |