Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikang
lib_base
Commits
ec083cdc
Commit
ec083cdc
authored
Mar 29, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
547d0803
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
script/garble/insert.py
+11
-9
No files found.
script/garble/insert.py
View file @
ec083cdc
...
...
@@ -49,7 +49,10 @@ def get_rand_code(isInFunc):
return
code
def
get_brackets
(
line
):
left
=
line
.
count
(
"{"
)
right
=
line
.
count
(
"}"
)
return
left
-
right
def
process_file_content
(
path
,
file_name
):
# print("processing content: %s..." % path)
...
...
@@ -88,16 +91,15 @@ def process_file_content(path, file_name):
if
" class "
in
line
and
"{"
in
line
:
func_level
=
0
if
"//interference code"
not
in
line
and
\
(
"){
\n
"
in
line
or
") {
\n
"
in
line
)
and
\
if
(
"){
\n
"
in
line
or
") {
\n
"
in
line
)
and
\
func_level
==
0
and
\
not
isReturn
:
func_level
=
1
elif
func_level
>
0
:
if
"//interference code"
not
in
line
and
"{
\n
"
in
line
:
func_level
+=
1
if
"//interference code"
not
in
line
and
"}
\n
"
in
line
:
func_level
-=
1
func_level
=
get_brackets
(
line
)
elif
func_level
!=
0
:
func_level
+=
get_brackets
(
line
)
if
func_level
<
0
:
func_level
=
0
#需要忽略的行
...
...
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