Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
d0a52fb3
Commit
d0a52fb3
authored
14 years ago
by
ilor
Browse files
Options
Downloads
Patches
Plain Diff
MatchVector first_token and last_token
parent
80dcc6b3
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libwccl/values/matchvector.cpp
+24
-6
24 additions, 6 deletions
libwccl/values/matchvector.cpp
with
24 additions
and
6 deletions
libwccl/values/matchvector.cpp
+
24
−
6
View file @
d0a52fb3
...
...
@@ -29,16 +29,34 @@ std::string MatchVector::var_repr(const std::string &var_name)
Position
MatchVector
::
first_token
()
const
{
Position
p
;
// TODO
return
p
;
if
(
matches_
.
empty
())
{
return
Position
(
Position
::
Nowhere
);
}
else
{
Position
p
=
matches_
.
front
()
->
first_token
();
for
(
size_t
i
=
1
;
i
<
matches_
.
end
();
++
i
)
{
Position
c
=
matches_
[
i
]
->
first_token
();
if
(
c
.
get_value
()
<
p
.
get_value
())
{
p
=
c
;
}
}
return
p
;
}
}
Position
MatchVector
::
last_token
()
const
{
Position
p
;
// TODO
return
p
;
if
(
matches_
.
empty
())
{
return
Position
(
Position
::
Nowhere
);
}
else
{
Position
p
=
matches_
.
front
()
->
last_token
();
for
(
size_t
i
=
1
;
i
<
matches_
.
end
();
++
i
)
{
Position
c
=
matches_
[
i
]
->
last_token
();
if
(
c
.
get_value
()
>
p
.
get_value
())
{
p
=
c
;
}
}
return
p
;
}
}
bool
MatchVector
::
empty
()
const
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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