Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d9c0631d
Commit
d9c0631d
authored
Oct 11, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strip trailing spaces in _json.c
parent
c4f281eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
Modules/_json.c
Modules/_json.c
+15
-15
No files found.
Modules/_json.c
View file @
d9c0631d
...
...
@@ -218,7 +218,7 @@ ascii_escape_unicode(PyObject *pystr)
output_size
++
;
else
{
switch
(
c
)
{
case
'\\'
:
case
'"'
:
case
'\b'
:
case
'\f'
:
case
'\\'
:
case
'"'
:
case
'\b'
:
case
'\f'
:
case
'\n'
:
case
'\r'
:
case
'\t'
:
output_size
+=
2
;
break
;
default:
...
...
@@ -434,7 +434,7 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
raise_errmsg
(
"Unpaired high surrogate"
,
pystr
,
end
-
5
);
goto
bail
;
}
if
(
PyUnicode_READ
(
kind
,
buf
,
next
++
)
!=
'\\'
||
if
(
PyUnicode_READ
(
kind
,
buf
,
next
++
)
!=
'\\'
||
PyUnicode_READ
(
kind
,
buf
,
next
++
)
!=
'u'
)
{
raise_errmsg
(
"Unpaired high surrogate"
,
pystr
,
end
-
5
);
goto
bail
;
...
...
@@ -1027,9 +1027,9 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
break
;
case
'f'
:
/* false */
if
((
idx
+
4
<
length
)
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
1
)
==
'a'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
2
)
==
'l'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
3
)
==
's'
&&
if
((
idx
+
4
<
length
)
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
1
)
==
'a'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
2
)
==
'l'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
3
)
==
's'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
4
)
==
'e'
)
{
Py_INCREF
(
Py_False
);
*
next_idx_ptr
=
idx
+
5
;
...
...
@@ -1038,32 +1038,32 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
break
;
case
'N'
:
/* NaN */
if
((
idx
+
2
<
length
)
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
1
)
==
'a'
&&
if
((
idx
+
2
<
length
)
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
1
)
==
'a'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
2
)
==
'N'
)
{
return
_parse_constant
(
s
,
"NaN"
,
idx
,
next_idx_ptr
);
}
break
;
case
'I'
:
/* Infinity */
if
((
idx
+
7
<
length
)
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
1
)
==
'n'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
2
)
==
'f'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
3
)
==
'i'
&&
if
((
idx
+
7
<
length
)
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
1
)
==
'n'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
2
)
==
'f'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
3
)
==
'i'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
4
)
==
'n'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
5
)
==
'i'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
6
)
==
't'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
5
)
==
'i'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
6
)
==
't'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
7
)
==
'y'
)
{
return
_parse_constant
(
s
,
"Infinity"
,
idx
,
next_idx_ptr
);
}
break
;
case
'-'
:
/* -Infinity */
if
((
idx
+
8
<
length
)
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
1
)
==
'I'
&&
if
((
idx
+
8
<
length
)
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
1
)
==
'I'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
2
)
==
'n'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
3
)
==
'f'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
4
)
==
'i'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
4
)
==
'i'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
5
)
==
'n'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
6
)
==
'i'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
7
)
==
't'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
6
)
==
'i'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
7
)
==
't'
&&
PyUnicode_READ
(
kind
,
str
,
idx
+
8
)
==
'y'
)
{
return
_parse_constant
(
s
,
"-Infinity"
,
idx
,
next_idx_ptr
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment