Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
fddfbe2d
Commit
fddfbe2d
authored
Feb 16, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some minor code improvements.
parent
caa49342
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
src/node.py
src/node.py
+8
-6
No files found.
src/node.py
View file @
fddfbe2d
...
...
@@ -358,7 +358,7 @@ class Scope(object):
return
isinstance
(
other
,
Scope
)
and
self
.
node
==
other
.
node
\
and
self
.
nodes
==
other
.
nodes
def
remove
(
self
,
node
,
replacement
=
None
):
def
remove
(
self
,
node
,
**
kwargs
):
if
node
.
is_leaf
:
node_cmp
=
hash
(
node
)
else
:
...
...
@@ -371,8 +371,8 @@ class Scope(object):
n_cmp
=
n
if
n_cmp
==
node_cmp
:
if
replacement
!=
None
:
self
[
i
]
=
replacement
if
'replacement'
in
kwargs
:
self
[
i
]
=
kwargs
[
'replacement'
]
else
:
del
self
.
nodes
[
i
]
...
...
@@ -416,7 +416,9 @@ def get_scope(node):
def
negate
(
node
,
n
=
1
):
"""Negate the given node n times."""
node
=
node
.
clone
()
node
.
negated
=
n
assert
n
>=
0
return
node
new_node
=
node
.
clone
()
new_node
.
negated
=
n
return
new_node
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