Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
7e056b83
Commit
7e056b83
authored
Apr 28, 2014
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle sperator empty case. And reformat code.
parent
32cd891e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
src/runtime/str.cpp
src/runtime/str.cpp
+11
-9
No files found.
src/runtime/str.cpp
View file @
7e056b83
...
...
@@ -353,16 +353,18 @@ Box* strSplit2(BoxedString* self, BoxedString* sep) {
BoxedList
*
rtn
=
new
BoxedList
();
if
(
sep
->
cls
==
str_cls
)
{
llvm
::
SmallVector
<
llvm
::
StringRef
,
16
>
parts
;
llvm
::
StringRef
(
self
->
s
).
split
(
parts
,
sep
->
s
);
if
(
sep
->
cls
==
str_cls
)
{
if
(
!
sep
->
s
.
empty
())
{
llvm
::
SmallVector
<
llvm
::
StringRef
,
16
>
parts
;
llvm
::
StringRef
(
self
->
s
).
split
(
parts
,
sep
->
s
);
for
(
const
auto
&
s
:
parts
)
listAppendInternal
(
rtn
,
boxString
(
s
.
str
()));
}
else
{
for
(
const
auto
&
s
:
parts
)
listAppendInternal
(
rtn
,
boxString
(
s
.
str
()));
}
else
{
fprintf
(
stderr
,
"ValueError: empty separator
\n
"
);
raiseExc
();
}
}
else
{
fprintf
(
stderr
,
"TypeError: expected a character buffer object
\n
"
);
raiseExc
();
}
...
...
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