Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: src/json-parser.h

Issue 9231009: More spelling changes. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/isolate.cc ('k') | src/jsregexp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 // Parse a single JSON value from input (grammar production JSONValue). 124 // Parse a single JSON value from input (grammar production JSONValue).
125 // A JSON value is either a (double-quoted) string literal, a number literal, 125 // A JSON value is either a (double-quoted) string literal, a number literal,
126 // one of "true", "false", or "null", or an object or array literal. 126 // one of "true", "false", or "null", or an object or array literal.
127 Handle<Object> ParseJsonValue(); 127 Handle<Object> ParseJsonValue();
128 128
129 // Parse a JSON object literal (grammar production JSONObject). 129 // Parse a JSON object literal (grammar production JSONObject).
130 // An object literal is a squiggly-braced and comma separated sequence 130 // An object literal is a squiggly-braced and comma separated sequence
131 // (possibly empty) of key/value pairs, where the key is a JSON string 131 // (possibly empty) of key/value pairs, where the key is a JSON string
132 // literal, the value is a JSON value, and the two are separated by a colon. 132 // literal, the value is a JSON value, and the two are separated by a colon.
133 // A JSON array dosn't allow numbers and identifiers as keys, like a 133 // A JSON array doesn't allow numbers and identifiers as keys, like a
134 // JavaScript array. 134 // JavaScript array.
135 Handle<Object> ParseJsonObject(); 135 Handle<Object> ParseJsonObject();
136 136
137 // Parses a JSON array literal (grammar production JSONArray). An array 137 // Parses a JSON array literal (grammar production JSONArray). An array
138 // literal is a square-bracketed and comma separated sequence (possibly empty) 138 // literal is a square-bracketed and comma separated sequence (possibly empty)
139 // of JSON values. 139 // of JSON values.
140 // A JSON array doesn't allow leaving out values from the sequence, nor does 140 // A JSON array doesn't allow leaving out values from the sequence, nor does
141 // it allow a terminal comma, like a JavaScript array does. 141 // it allow a terminal comma, like a JavaScript array does.
142 Handle<Object> ParseJsonArray(); 142 Handle<Object> ParseJsonArray();
143 143
(...skipping 26 matching lines...) Expand all
170 source_ = source; 170 source_ = source;
171 source_length_ = source_->length(); 171 source_length_ = source_->length();
172 172
173 // Optimized fast case where we only have ASCII characters. 173 // Optimized fast case where we only have ASCII characters.
174 if (seq_ascii) { 174 if (seq_ascii) {
175 seq_source_ = Handle<SeqAsciiString>::cast(source_); 175 seq_source_ = Handle<SeqAsciiString>::cast(source_);
176 } 176 }
177 177
178 // Set initial position right before the string. 178 // Set initial position right before the string.
179 position_ = -1; 179 position_ = -1;
180 // Advance to the first character (posibly EOS) 180 // Advance to the first character (possibly EOS)
181 AdvanceSkipWhitespace(); 181 AdvanceSkipWhitespace();
182 Handle<Object> result = ParseJsonValue(); 182 Handle<Object> result = ParseJsonValue();
183 if (result.is_null() || c0_ != kEndOfString) { 183 if (result.is_null() || c0_ != kEndOfString) {
184 // Parse failed. Current character is the unexpected token. 184 // Parse failed. Current character is the unexpected token.
185 185
186 const char* message; 186 const char* message;
187 Factory* factory = isolate()->factory(); 187 Factory* factory = isolate()->factory();
188 Handle<JSArray> array; 188 Handle<JSArray> array;
189 189
190 switch (c0_) { 190 switch (c0_) {
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 } 591 }
592 ASSERT_EQ('"', c0_); 592 ASSERT_EQ('"', c0_);
593 // Advance past the last '"'. 593 // Advance past the last '"'.
594 AdvanceSkipWhitespace(); 594 AdvanceSkipWhitespace();
595 return result; 595 return result;
596 } 596 }
597 597
598 } } // namespace v8::internal 598 } } // namespace v8::internal
599 599
600 #endif // V8_JSON_PARSER_H_ 600 #endif // V8_JSON_PARSER_H_
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/jsregexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698