Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Cloogle
Cloogle
Commits
c59d8995
Verified
Commit
c59d8995
authored
Nov 17, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include kind of element in UniqueResultIdentifier
parent
929f03ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
Cloogle/Search/Rank.dcl
Cloogle/Search/Rank.dcl
+2
-2
Cloogle/Search/Rank.icl
Cloogle/Search/Rank.icl
+14
-2
No files found.
Cloogle/Search/Rank.dcl
View file @
c59d8995
...
...
@@ -42,9 +42,9 @@ symbolicDistance :: !CloogleEntry ![Annotation] -> RankInformation
=
LT
!
UniqueResultIdentifier
!
UniqueResultIdentifier
//* arg1 should have lower distance than arg2
/**
* @representation module name
and
name of element
* @representation
kind (e.g. Function for FunctionEntry),
module name
,
name of element
*/
::
UniqueResultIdentifier
:==
(!
String
,
!
String
)
::
UniqueResultIdentifier
:==
(!
String
,
!
String
,
!
String
)
/**
* Find suitable ranking settings given a set of constraints. This requires Z3
...
...
Cloogle/Search/Rank.icl
View file @
c59d8995
...
...
@@ -84,10 +84,22 @@ where
count
nt
nf
nc
[]
=
(
nt
,
nf
,
nc
)
match
::
!
UniqueResultIdentifier
!
CloogleEntry
->
Bool
match
(
mod
,
name
)
ce
=
case
getLocation
ce
of
match
(
thing
,
mod
,
name
)
ce
|
thing
<>
descriptorName
ce
=
False
|
otherwise
=
case
getLocation
ce
of
Just
(
Location
_
cemod
_
_
_
cename
)
->
mod
==
cemod
&&
name
==
cename
Just
(
Builtin
cename
_)
->
mod
==
"_builtin"
&&
name
==
cename
_
->
abort
"error in match of UniqueResultIdentifier
\n
"
where
descriptorName
::
!
CloogleEntry
->
String
descriptorName
(
FunctionEntry
_)
=
"Function"
descriptorName
(
TypeDefEntry
_)
=
"TypeDef"
descriptorName
(
ModuleEntry
_)
=
"Module"
descriptorName
(
ClassEntry
_)
=
"Class"
descriptorName
(
InstanceEntry
_)
=
"Instance"
descriptorName
(
DeriveEntry
_)
=
"Derive"
descriptorName
(
SyntaxEntry
_)
=
"Syntax"
descriptorName
(
ABCInstructionEntry
_)
=
"ABCInstruction"
findRankSettings
::
![(
Request
,
RankConstraint
)]
!*
CloogleDB
!*
World
->
*(!
MaybeError
String
RankSettings
,
*
CloogleDB
,
!*
World
)
...
...
@@ -172,7 +184,7 @@ findConstraints [(req,LT urid1 urid2):rest] cdb
#
(
rest
,
cdb
)
=
findConstraints
rest
cdb
=
([
this
:
rest
],
cdb
)
where
findEntry
orgsearchtype
allsyns
usedsyns
urid
=:(
mod
,
name
)
entries
cdb
findEntry
orgsearchtype
allsyns
usedsyns
urid
=:(
_,
mod
,
name
)
entries
cdb
=
case
filter
(\(
e
,_)
->
match
urid
e
)
entries
of
[(
e1
=:
FunctionEntry
fe
,
annots
):[]]
#
(
unif
,
usedsyns
,
required_context
,
cdb
)
=
unifyInformation
orgsearchtype
allsyns
usedsyns
fe
cdb
...
...
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