Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
cloogle.org
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cloogle
cloogle.org
Commits
53ccb7c4
Verified
Commit
53ccb7c4
authored
Aug 22, 2016
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter on library
parent
51a3da44
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
README.md
README.md
+1
-0
backend/CloogleServer.icl
backend/CloogleServer.icl
+11
-2
frontend/api.php
frontend/api.php
+3
-0
No files found.
README.md
View file @
53ccb7c4
...
...
@@ -185,6 +185,7 @@ JSON request with at least one of the following fields:
*
`name`
, the name of the function to search for.
*
`className`
, the name of the class to search for.
*
`typeName`
, the name of the type to search for.
*
`libraries`
, a list of names of libraries to search in.
*
`modules`
, a list of names of modules to search in.
*
`page`
: 0 for the first
*n*
results, 1 for the next
*n*
, etc.
...
...
backend/CloogleServer.icl
View file @
53ccb7c4
...
...
@@ -33,6 +33,7 @@ import Levenshtein
,
className
::
Maybe
String
,
typeName
::
Maybe
String
,
modules
::
Maybe
[
String
]
,
libraries
::
Maybe
[
String
]
,
page
::
Maybe
Int
}
...
...
@@ -99,6 +100,7 @@ where
,
className
=
Nothing
,
typeName
=
Nothing
,
modules
=
Nothing
,
libraries
=
Nothing
,
page
=
Nothing
}
...
...
@@ -152,7 +154,7 @@ where
handle
::
!
TypeDB
!(
Maybe
Request
)
!*
World
->
*(!
Response
,
!*
World
)
handle
_
Nothing
w
=
(
err
E_INVALIDINPUT
"Couldn't parse input"
,
w
)
handle
db
(
Just
request
=:{
unify
,
name
,
modules
,
page
})
w
handle
db
(
Just
request
=:{
unify
,
name
,
page
})
w
|
isJust
name
&&
size
(
fromJust
name
)
>
40
=
(
err
E_INVALIDNAME
"function name too long"
,
w
)
|
isJust
name
&&
any
isSpace
(
fromString
$
fromJust
name
)
...
...
@@ -190,7 +192,10 @@ where
suggs
_
_
_
=
Nothing
search
::
!
Request
!
TypeDB
->
[
Result
]
search
{
unify
,
name
,
className
,
typeName
,
modules
,
page
}
db
search
{
unify
,
name
,
className
,
typeName
,
modules
,
libraries
,
page
}
db
#
db
=
case
libraries
of
(
Just
ls
)
=
filterLocations
(
isLibMatch
ls
)
db
Nothing
=
db
#
db
=
case
modules
of
(
Just
ms
)
=
filterLocations
(
isModMatch
ms
)
db
Nothing
=
db
...
...
@@ -375,6 +380,10 @@ where
isModMatch
mods
(
Location
_
mod
_
_)
=
isMember
mod
mods
isModMatch
_
(
Builtin
_)
=
False
isLibMatch
::
![
String
]
Location
->
Bool
isLibMatch
libs
(
Location
lib
_
_
_)
=
isMember
lib
libs
isLibMatch
_
(
Builtin
_)
=
False
log
::
(
LogMessage
(
Maybe
Request
)
Response
)
IPAddress
*
World
->
*(
IPAddress
,
*
World
)
log
msg
s
w
...
...
frontend/api.php
View file @
53ccb7c4
...
...
@@ -34,6 +34,9 @@ if($_SERVER['REQUEST_METHOD'] !== 'GET'){
$command
[
'unify'
]
=
$unify
;
}
if
(
isset
(
$_GET
[
'lib'
]))
{
$command
[
'libraries'
]
=
explode
(
','
,
$_GET
[
'lib'
]);
}
if
(
isset
(
$_GET
[
'mod'
]))
{
$command
[
'modules'
]
=
explode
(
','
,
$_GET
[
'mod'
]);
}
...
...
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