Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
6f5dbd5b
Commit
6f5dbd5b
authored
Nov 19, 2010
by
Adam Wardynski
Browse files
Options
Downloads
Patches
Plain Diff
Update Equals operator to reflect recent changes
parent
e5557334
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libwccl/ops/equals.h
+7
-15
7 additions, 15 deletions
libwccl/ops/equals.h
with
7 additions
and
15 deletions
libwccl/ops/equals.h
+
7
−
15
View file @
6f5dbd5b
...
...
@@ -44,8 +44,8 @@ protected:
* False otherwise.
*/
virtual
BaseRetValPtr
apply_internal
(
const
FunExecContext
&
context
)
const
{
boost
::
shared_ptr
<
T
>
arg1
=
this
->
arg1_expr_
->
apply
(
context
);
boost
::
shared_ptr
<
T
>
arg2
=
this
->
arg2_expr_
->
apply
(
context
);
const
boost
::
shared_ptr
<
const
T
>
&
arg1
=
this
->
arg1_expr_
->
apply
(
context
);
const
boost
::
shared_ptr
<
const
T
>
&
arg2
=
this
->
arg2_expr_
->
apply
(
context
);
if
(
arg1
->
equals
(
*
arg2
))
{
return
Predicate
::
True
(
context
);
}
...
...
@@ -87,22 +87,14 @@ protected:
typedef
FunctionBase
::
BaseRetValPtr
BaseRetValPtr
;
/**
* Take values of arguments from expressions and return True if
they are equal,
* False otherwise.
* Take values of arguments from expressions and return True if
Positions
*
are equal, in given context,
False otherwise.
*/
virtual
BaseRetValPtr
apply_internal
(
const
FunExecContext
&
context
)
const
{
boost
::
shared_ptr
<
Position
>
arg1
=
this
->
arg1_expr_
->
apply
(
context
);
boost
::
shared_ptr
<
Position
>
arg2
=
this
->
arg2_expr_
->
apply
(
context
);
if
(
arg1
->
equals
(
*
arg2
))
{
const
boost
::
shared_ptr
<
const
Position
>
&
arg1
=
this
->
arg1_expr_
->
apply
(
context
);
const
boost
::
shared_ptr
<
const
Position
>
&
arg2
=
this
->
arg2_expr_
->
apply
(
context
);
if
(
arg1
->
equals
(
*
arg2
,
context
.
sentence_context
()
))
{
return
Predicate
::
True
(
context
);
}
else
{
//in the given context both positions can still point nowhere
//even if they have different underlying value
int
abs_pos1
=
context
.
get_abs_position
(
*
arg1
);
int
abs_pos2
=
context
.
get_abs_position
(
*
arg2
);
if
(
!
context
.
is_inside
(
abs_pos1
)
&&
!
context
.
is_inside
(
abs_pos2
))
{
return
Predicate
::
True
(
context
);
}
}
return
Predicate
::
False
(
context
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment