|
1 | 1 | /***
|
2 | 2 | * ==++==
|
3 | 3 | *
|
4 |
| -* Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 | +* Copyright (c) Microsoft Corporation. All rights reserved. |
5 | 5 | * Licensed under the Apache License, Version 2.0 (the "License");
|
6 | 6 | * you may not use this file except in compliance with the License.
|
7 | 7 | * You may obtain a copy of the License at
|
8 | 8 | * http://www.apache.org/licenses/LICENSE-2.0
|
9 |
| -* |
| 9 | +* |
10 | 10 | * Unless required by applicable law or agreed to in writing, software
|
11 | 11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
12 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
31 | 31 | #include <array>
|
32 | 32 |
|
33 | 33 | #if defined(_MSC_VER)
|
34 |
| -#pragma warning(disable : 4127) // allow expressions like while(true) pass |
| 34 | +#pragma warning(disable : 4127) // allow expressions like while(true) pass |
35 | 35 | #endif
|
36 | 36 | using namespace web;
|
37 | 37 | using namespace web::json;
|
38 | 38 | using namespace utility;
|
39 | 39 | using namespace utility::conversions;
|
40 | 40 |
|
41 |
| -std::array<signed char,128> _hexval = {{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 41 | +std::array<signed char,128> _hexval = {{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
42 | 42 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
43 | 43 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
44 | 44 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
|
@@ -74,7 +74,7 @@ template <typename CharType>
|
74 | 74 | class JSON_Parser
|
75 | 75 | {
|
76 | 76 | public:
|
77 |
| - JSON_Parser() |
| 77 | + JSON_Parser() |
78 | 78 | : m_currentLine(1),
|
79 | 79 | m_eof(std::char_traits<CharType>::eof()),
|
80 | 80 | m_currentColumn(1),
|
@@ -171,15 +171,15 @@ class JSON_Parser
|
171 | 171 | void CreateToken(typename JSON_Parser<CharType>::Token& tk, typename Token::Kind kind, Location &start)
|
172 | 172 | {
|
173 | 173 | tk.kind = kind;
|
174 |
| - tk.start = start; |
| 174 | + tk.start = start; |
175 | 175 | tk.string_val.clear();
|
176 | 176 | }
|
177 | 177 |
|
178 | 178 | void CreateToken(typename JSON_Parser<CharType>::Token& tk, typename Token::Kind kind)
|
179 | 179 | {
|
180 | 180 | tk.kind = kind;
|
181 |
| - tk.start.m_line = m_currentLine; |
182 |
| - tk.start.m_column = m_currentColumn; |
| 181 | + tk.start.m_line = m_currentLine; |
| 182 | + tk.start.m_column = m_currentColumn; |
183 | 183 | tk.string_val.clear();
|
184 | 184 | }
|
185 | 185 |
|
@@ -400,16 +400,16 @@ namespace
|
400 | 400 | }
|
401 | 401 | #endif
|
402 | 402 |
|
403 |
| - static double anystod(const char* str) |
| 403 | + static double anystod(const char* str) |
404 | 404 | {
|
405 | 405 | #ifdef _MS_WINDOWS
|
406 | 406 | return _strtod_l(str, nullptr, utility::details::scoped_c_thread_locale::c_locale());
|
407 | 407 | #else
|
408 |
| - return strtod(str, nullptr); |
| 408 | + return strtod(str, nullptr); |
409 | 409 | #endif
|
410 | 410 | }
|
411 |
| - static double anystod(const wchar_t* str) |
412 |
| - { |
| 411 | + static double anystod(const wchar_t* str) |
| 412 | + { |
413 | 413 | #ifdef _MS_WINDOWS
|
414 | 414 | return _wcstod_l(str, nullptr, utility::details::scoped_c_thread_locale::c_locale());
|
415 | 415 | #else
|
@@ -726,7 +726,7 @@ inline bool JSON_Parser<CharType>::handle_unescape_char(Token &token)
|
726 | 726 | return true;
|
727 | 727 | case 'u':
|
728 | 728 | {
|
729 |
| - // A four-hexdigit unicode character |
| 729 | + // A four-hexdigit Unicode character |
730 | 730 | int decoded = 0;
|
731 | 731 | for (int i = 0; i < 4; ++i)
|
732 | 732 | {
|
@@ -961,14 +961,14 @@ std::unique_ptr<web::json::details::_Object> JSON_Parser<CharType>::_ParseObject
|
961 | 961 | auto obj = utility::details::make_unique<web::json::details::_Object>(g_keep_json_object_unsorted);
|
962 | 962 | auto& elems = obj->m_object.m_elements;
|
963 | 963 |
|
964 |
| - if ( tkn.kind != JSON_Parser<CharType>::Token::TKN_CloseBrace ) |
| 964 | + if ( tkn.kind != JSON_Parser<CharType>::Token::TKN_CloseBrace ) |
965 | 965 | {
|
966 | 966 | while ( true )
|
967 | 967 | {
|
968 | 968 | // State 1: New field or end of object, looking for field name or closing brace
|
969 | 969 |
|
970 | 970 | std::basic_string<CharType> fieldName;
|
971 |
| - |
| 971 | + |
972 | 972 | switch ( tkn.kind )
|
973 | 973 | {
|
974 | 974 | case JSON_Parser<CharType>::Token::TKN_StringLiteral:
|
@@ -1033,7 +1033,7 @@ std::unique_ptr<web::json::details::_Array> JSON_Parser<CharType>::_ParseArray(t
|
1033 | 1033 |
|
1034 | 1034 | auto result = utility::details::make_unique<web::json::details::_Array>();
|
1035 | 1035 |
|
1036 |
| - if ( tkn.kind != JSON_Parser<CharType>::Token::TKN_CloseBracket ) |
| 1036 | + if ( tkn.kind != JSON_Parser<CharType>::Token::TKN_CloseBracket ) |
1037 | 1037 | {
|
1038 | 1038 | while ( true )
|
1039 | 1039 | {
|
@@ -1091,7 +1091,7 @@ std::unique_ptr<web::json::details::_Value> JSON_Parser<CharType>::_ParseValue(t
|
1091 | 1091 | return std::move(value);
|
1092 | 1092 | }
|
1093 | 1093 |
|
1094 |
| - case JSON_Parser<CharType>::Token::TKN_NumberLiteral: |
| 1094 | + case JSON_Parser<CharType>::Token::TKN_NumberLiteral: |
1095 | 1095 | {
|
1096 | 1096 | auto value = utility::details::make_unique<web::json::details::_Number>(tkn.double_val);
|
1097 | 1097 | GetNextToken(tkn);
|
|
0 commit comments