Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
5ee3c3b1
Commit
5ee3c3b1
authored
9 years ago
by
Etienne Kneuss
Browse files
Options
Downloads
Patches
Plain Diff
Fix name lookup w.r.t. encoding
parent
5a6ac7f4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/scala/leon/LeonOption.scala
+19
-2
19 additions, 2 deletions
src/main/scala/leon/LeonOption.scala
with
19 additions
and
2 deletions
src/main/scala/leon/LeonOption.scala
+
19
−
2
View file @
5ee3c3b1
...
@@ -112,8 +112,25 @@ object OptionsHelpers {
...
@@ -112,8 +112,25 @@ object OptionsHelpers {
val
regexPatterns
=
patterns
map
{
s
=>
val
regexPatterns
=
patterns
map
{
s
=>
import
java.util.regex.Pattern
import
java.util.regex.Pattern
val
p
=
"(.+\\.)?"
+
s
.
replaceAll
(
"\\."
,
"\\\\."
).
replaceAll
(
"_"
,
".+"
)
// We encode the user query, reverting the encoding for . as those are
Pattern
.
compile
(
p
)
// not encoded in our fullnames
val
encoded
=
scala
.
reflect
.
NameTransformer
.
encode
(
s
).
replaceAll
(
"\\$u002E"
,
"."
)
// wildcards become ".*", rest is quoted.
var
p
=
encoded
.
split
(
"_"
).
toList
.
map
(
Pattern
.
quote
).
mkString
(
".*"
)
// We account for _ at begining and end
if
(
encoded
.
endsWith
(
"_"
))
{
p
+=
".*"
}
if
(
encoded
.
startsWith
(
"_"
))
{
p
=
".*"
+
p
}
// Finally, we match qualified suffixes (e.g. searching for 'size' will
// match 'List.size' but not 'thesize')
Pattern
.
compile
(
"(.+\\.)?"
+
p
)
}
}
{
(
name
:
String
)
=>
regexPatterns
.
exists
(
p
=>
p
.
matcher
(
name
).
matches
())
}
{
(
name
:
String
)
=>
regexPatterns
.
exists
(
p
=>
p
.
matcher
(
name
).
matches
())
}
...
...
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