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
3b5eeb8e
Verified
Commit
3b5eeb8e
authored
Sep 08, 2017
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add clean-compiler and clean-ide as apps
parent
c56ed08e
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
66 additions
and
36 deletions
+66
-36
README.md
README.md
+1
-0
backend/Cloogle
backend/Cloogle
+1
-1
backend/CloogleServer.icl
backend/CloogleServer.icl
+2
-0
backend/Dockerfile
backend/Dockerfile
+2
-0
backend/builddb.icl
backend/builddb.icl
+30
-28
frontend/Dockerfile
frontend/Dockerfile
+2
-0
frontend/api.js
frontend/api.js
+19
-7
frontend/api.php
frontend/api.php
+4
-0
frontend/index.html
frontend/index.html
+3
-0
frontend/src/index.php
frontend/src/index.php
+2
-0
No files found.
README.md
View file @
3b5eeb8e
...
...
@@ -107,6 +107,7 @@ JSON request with at least one of the following fields:
*
`libraries`
, a list of names of libraries to search in.
*
`include_builtins`
, a boolean, whether language builtins should be searched or not.
*
`include_core`
, a boolean, whether library cores should be searched or not.
*
`include_apps`
, a boolean, whether apps should be searched or not.
*
`modules`
, a list of names of modules to search in.
*
`page`
: 0 for the first
*n*
results, 1 for the next
*n*
, etc.
...
...
Cloogle
@
968da325
Compare
889285d1
...
968da325
Subproject commit
889285d1901740876a5ef3880acd01a934d9634f
Subproject commit
968da325510330201da3db1f7ec01c6f5c107d0a
backend/CloogleServer.icl
View file @
3b5eeb8e
...
...
@@ -46,6 +46,7 @@ CACHE_PREFETCH :== 5
,
c_libraries
::
Maybe
[
String
]
,
c_include_builtins
::
Bool
,
c_include_core
::
Bool
,
c_include_apps
::
Bool
,
c_page
::
Int
}
...
...
@@ -63,6 +64,7 @@ toRequestCacheKey r =
,
c_libraries
=
sort
<$>
r
.
libraries
,
c_include_builtins
=
fromJust
(
r
.
include_builtins
<|>
Just
DEFAULT_INCLUDE_BUILTINS
)
,
c_include_core
=
fromJust
(
r
.
include_core
<|>
Just
DEFAULT_INCLUDE_CORE
)
,
c_include_apps
=
fromJust
(
r
.
include_apps
<|>
Just
DEFAULT_INCLUDE_APPS
)
,
c_page
=
fromJust
(
r
.
page
<|>
Just
0
)
}
...
...
backend/Dockerfile
View file @
3b5eeb8e
...
...
@@ -11,6 +11,8 @@ RUN PACKAGES="make subversion ca-certificates gcc git curl" \
&&
bash
-c
'rm -r /opt/clean/lib/SoccerFun/{Game,Gui,StdLibExt,StdReferee,StdTeam,afbeeldingen,sound}'
\
&&
svn checkout https://svn.cs.ru.nl/repos/clean-libraries/trunk/Libraries/ObjectIO/ObjectIO /opt/clean/lib/ObjectIO
\
&&
svn checkout https://svn.cs.ru.nl/repos/clean-libraries/trunk/Libraries/MersenneTwister /opt/clean/lib/MersenneTwister
\
&&
svn checkout https://svn.cs.ru.nl/repos/clean-compiler/trunk /opt/clean/lib/clean-compiler
\
&&
svn checkout https://svn.cs.ru.nl/repos/clean-ide/trunk /opt/clean/lib/clean-ide
\
&&
git clone https://gitlab.science.ru.nl/mlubbers/CleanSerial /opt/clean/lib/CleanSerial
\
&&
git clone https://github.com/clean-cloogle/Cloogle /opt/clean/lib/Cloogle
\
&&
git clone https://github.com/clean-cloogle/libcloogle /opt/clean/lib/libcloogle
\
...
...
backend/builddb.icl
View file @
3b5eeb8e
...
...
@@ -3,7 +3,7 @@ module builddb
import
StdArray
import
StdBool
import
StdFile
from
StdFunc
import
const
,
o
from
StdFunc
import
const
,
id
,
o
import
StdList
import
StdMisc
import
StdString
...
...
@@ -24,7 +24,7 @@ from CloogleDBFactory import :: TemporaryDB, newTemporaryDb, finaliseDb,
::
CLI
=
{
help
::
Bool
,
version
::
Bool
,
root
::
String
,
libs
::
[(
String
,
String
->
Bool
)]
,
libs
::
[(
String
,
String
ModuleEntry
->
ModuleEntry
)]
,
exclude
::
[
String
]
}
...
...
@@ -32,28 +32,30 @@ instance zero CLI where
zero
=
{
version
=
False
,
help
=
False
,
root
=
"/opt/clean/lib/"
,
libs
=
[
(
"ArgEnv"
,
const
False
)
,
(
"CleanInotify"
,
const
False
)
,
(
"CleanPrettyPrint"
,
const
False
)
,
(
"CleanSerial"
,
const
False
)
,
(
"CleanSnappy"
,
const
False
)
,
(
"CleanTypeUnifier"
,
const
False
)
,
(
"Cloogle"
,
const
False
)
,
(
"Directory"
,
const
False
)
,
(
"Dynamics"
,
const
False
)
,
(
"Gast"
,
const
False
)
,
(
"Generics"
,
const
False
)
,
(
"GraphCopy"
,
const
False
)
,
(
"MersenneTwister"
,
const
False
)
,
(
"ObjectIO"
,
not
o
startsWith
"Std"
)
,
(
"Platform"
,
const
False
)
,
(
"Sapl"
,
const
False
)
,
(
"SoccerFun"
,
const
False
)
,
(
"StdEnv"
,
const
False
)
,
(
"StdLib"
,
const
False
)
,
(
"TCPIP"
,
const
False
)
,
(
"iTasks"
,
const
False
)
,
(
"libcloogle"
,
const
False
)
,
libs
=
[
(
"ArgEnv"
,
const
id
)
,
(
"CleanInotify"
,
const
id
)
,
(
"CleanPrettyPrint"
,
const
id
)
,
(
"CleanSerial"
,
const
id
)
,
(
"CleanSnappy"
,
const
id
)
,
(
"CleanTypeUnifier"
,
const
id
)
,
(
"Cloogle"
,
const
id
)
,
(
"Directory"
,
const
id
)
,
(
"Dynamics"
,
const
id
)
,
(
"Gast"
,
const
id
)
,
(
"Generics"
,
const
id
)
,
(
"GraphCopy"
,
const
id
)
,
(
"MersenneTwister"
,
const
id
)
,
(
"ObjectIO"
,
\
s
me
->
{
me
&
me_is_core
=
not
(
startsWith
"Std"
s
)})
,
(
"Platform"
,
const
id
)
,
(
"Sapl"
,
const
id
)
,
(
"SoccerFun"
,
const
id
)
,
(
"StdEnv"
,
const
id
)
,
(
"StdLib"
,
const
id
)
,
(
"TCPIP"
,
const
id
)
,
(
"iTasks"
,
const
id
)
,
(
"clean-compiler"
,
const
\
me
->
{
me
&
me_is_app
=
True
})
,
(
"clean-ide"
,
const
\
me
->
{
me
&
me_is_app
=
True
})
,
(
"libcloogle"
,
const
id
)
]
,
exclude
=
[
"StdEnv/_startup"
,
"StdEnv/_system"
...
...
@@ -100,11 +102,11 @@ Start w
|
not
ok
=
abort
"Couldn't close stdio"
=
w
where
loop
::
String
[(
String
,
String
,
Bool
)]
!
TemporaryDB
!*
World
->
*(!
TemporaryDB
,
!*
World
)
loop
::
String
[(
String
,
String
,
String
ModuleEntry
->
ModuleEntry
)]
!
TemporaryDB
!*
World
->
*(!
TemporaryDB
,
!*
World
)
loop
_
[]
db
w
=
(
db
,
w
)
loop
root
[(
lib
,
mod
,
iscore
):
list
]
db
w
loop
root
[(
lib
,
mod
,
modf
):
list
]
db
w
#!
w
=
snd
(
fclose
(
stderr
<<<
lib
<<<
": "
<<<
mod
<<<
"
\n
"
)
w
)
#!
(
db
,
w
)
=
indexModule
root
mod
lib
iscore
db
w
#!
(
db
,
w
)
=
indexModule
root
mod
lib
modf
db
w
#!
db
=
eval_all_nodes
db
=
loop
root
list
db
w
...
...
@@ -124,7 +126,7 @@ where
(
"-l"
,
[])
=
Left
"'-l' requires an argument"
(
"-r"
,
[])
=
Left
"'-r' requires an argument"
(
"-r"
,
[
x
:
xs
])
=
(\
c
->{
c
&
root
=
x
})
<$>
parseCLI
xs
(
"-l"
,
[
x
:
xs
])
=
(\
c
->{
c
&
libs
=[(
x
,
const
False
):
c
.
libs
]})
<$>
parseCLI
xs
(
"-l"
,
[
x
:
xs
])
=
(\
c
->{
c
&
libs
=[(
x
,
const
id
):
c
.
libs
]})
<$>
parseCLI
xs
(
x
,
_)
=
Left
$
"Unknown option '"
+++
x
+++
"'"
printStats
::
!
CloogleDB
!*
File
->
*
File
...
...
frontend/Dockerfile
View file @
3b5eeb8e
...
...
@@ -20,6 +20,8 @@ RUN svn checkout https://svn.cs.ru.nl/repos/SoccerFun/src /opt/clean/lib/SoccerF
&&
bash
-c
'rm /opt/clean/lib/SoccerFun/{Team_,RefereeCoach_,Buffer,KeeperChallenger}*'
\
&&
svn checkout https://svn.cs.ru.nl/repos/clean-libraries/trunk/Libraries/MersenneTwister /opt/clean/lib/MersenneTwister
\
&&
svn checkout https://svn.cs.ru.nl/repos/clean-libraries/trunk/Libraries/ObjectIO/ObjectIO /opt/clean/lib/ObjectIO
\
&&
svn checkout https://svn.cs.ru.nl/repos/clean-ide/trunk /opt/clean/lib/clean-ide
\
&&
svn checkout https://svn.cs.ru.nl/repos/clean-compiler/trunk /opt/clean/lib/clean-compiler
\
&&
git clone https://gitlab.science.ru.nl/mlubbers/CleanSerial /opt/clean/lib/CleanSerial
\
&&
git clone https://github.com/clean-cloogle/Cloogle /opt/clean/lib/Cloogle
\
&&
git clone https://github.com/clean-cloogle/libcloogle /opt/clean/lib/libcloogle
\
...
...
frontend/api.js
View file @
3b5eeb8e
...
...
@@ -4,6 +4,7 @@ var sform = document.getElementById('search-form');
var
sresults
=
document
.
getElementById
(
'
search-results
'
);
var
include_builtins_checkbox
=
document
.
getElementById
(
'
include-builtins
'
);
var
include_core_checkbox
=
document
.
getElementById
(
'
include-core
'
);
var
include_apps_checkbox
=
document
.
getElementById
(
'
include-apps
'
);
var
share_button
=
document
.
getElementById
(
'
share-button
'
);
var
share_link
=
document
.
getElementById
(
'
share-link
'
);
...
...
@@ -14,6 +15,7 @@ var old_str = null;
var
old_libs
=
null
;
var
old_include_builtins
=
null
;
var
old_include_core
=
null
;
var
old_include_apps
=
null
;
function
makeGeneralHelp
(
query
)
{
return
'
For general information about Clean,
'
+
...
...
@@ -182,16 +184,17 @@ function makeRequiredContext(context) {
return
html
;
}
function
getResults
(
str
,
libs
,
include_builtins
,
include_core
,
page
)
{
function
getResults
(
str
,
libs
,
include_builtins
,
include_core
,
include_apps
,
page
)
{
if
(
str
==
null
)
str
=
old_str
;
if
(
libs
==
null
)
libs
=
old_libs
;
if
(
include_builtins
==
null
)
include_builtins
=
old_include_builtins
;
if
(
include_core
==
null
)
include_core
=
old_include_core
;
if
(
include_apps
==
null
)
include_apps
=
old_include_apps
;
old_str
=
str
;
old_libs
=
libs
;
old_include_builtins
=
include_builtins
;
old_include_
core
=
include_core
;
old_include_
apps
=
include_apps
;
var
url
=
'
api.php
'
+
'
?str=
'
+
encodeURIComponent
(
str
)
+
...
...
@@ -201,6 +204,8 @@ function getResults(str, libs, include_builtins, include_core, page) {
?
'
&include_builtins=
'
+
encodeURIComponent
(
include_builtins
)
:
''
)
+
(
include_core
!=
-
1
?
'
&include_core=
'
+
encodeURIComponent
(
include_core
)
:
''
)
+
(
include_apps
!=
-
1
?
'
&include_apps=
'
+
encodeURIComponent
(
include_apps
)
:
''
)
+
'
&page=
'
+
page
;
var
xmlHttp
=
new
XMLHttpRequest
();
...
...
@@ -500,7 +505,7 @@ function getResults(str, libs, include_builtins, include_core, page) {
if
(
responsedata
[
'
more_available
'
]
!=
0
)
{
par
.
innerHTML
+=
'
<div id="page-
'
+
(
page
+
1
)
+
'
">
'
+
'
<p id="more" class="remove-at-request">
'
+
'
<a href="javascript:getResults(null,null,null,null,
'
+
(
page
+
1
)
+
'
<a href="javascript:getResults(null,null,null,null,
null,
'
+
(
page
+
1
)
+
'
)">
'
+
responsedata
[
'
more_available
'
]
+
'
more...</a></p>
'
+
'
</div>
'
;
}
...
...
@@ -530,7 +535,9 @@ function getResults(str, libs, include_builtins, include_core, page) {
(
include_builtins
!=
-
1
?
'
%0Ainclude_builtins=
'
+
encodeURIComponent
(
include_builtins
)
:
''
)
+
(
include_core
!=
-
1
?
'
%0Ainclude_core=
'
+
encodeURIComponent
(
include_core
)
:
''
);
?
'
%0Ainclude_core=
'
+
encodeURIComponent
(
include_core
)
:
''
)
+
(
include_apps
!=
-
1
?
'
%0Ainclude_apps=
'
+
encodeURIComponent
(
include_apps
)
:
''
);
if
(
newhash
!=
document
.
location
.
hash
.
substring
(
1
))
{
refresh_on_hash
=
false
;
document
.
location
.
hash
=
'
#
'
+
newhash
;
...
...
@@ -574,13 +581,15 @@ function formsubmit() {
var
libs
=
getLibs
();
var
include_builtins
=
-
1
;
var
include_core
=
-
1
;
var
include_apps
=
-
1
;
if
(
advanced
)
{
var
include_builtins
=
include_builtins_checkbox
.
checked
;
var
include_core
=
include_core_checkbox
.
checked
;
include_builtins
=
include_builtins_checkbox
.
checked
;
include_core
=
include_core_checkbox
.
checked
;
include_apps
=
include_apps_checkbox
.
checked
;
}
sresults
.
innerHTML
+=
'
<div id="page-0"></div>
'
;
getResults
(
q
,
libs
,
include_builtins
,
include_core
,
0
);
getResults
(
q
,
libs
,
include_builtins
,
include_core
,
include_apps
,
0
);
}
return
false
;
};
...
...
@@ -626,6 +635,9 @@ function hashQuery() {
case
"
include_core
"
:
include_core_checkbox
.
checked
=
value
==
'
true
'
;
break
;
case
"
include_apps
"
:
include_apps_checkbox
.
checked
=
value
==
'
true
'
;
break
;
case
"
page
"
:
page
=
value
;
break
;
...
...
frontend/api.php
View file @
3b5eeb8e
...
...
@@ -172,6 +172,10 @@ if ($_SERVER['REQUEST_METHOD'] !== 'GET'){
$command
[
'include_core'
]
=
$_GET
[
'include_core'
]
==
'true'
;
}
if
(
isset
(
$_GET
[
'include_apps'
]))
{
$command
[
'include_apps'
]
=
$_GET
[
'include_apps'
]
==
'true'
;
}
if
(
isset
(
$_GET
[
'mod'
]))
{
$command
[
'modules'
]
=
explode
(
','
,
$_GET
[
'mod'
]);
}
...
...
frontend/index.html
View file @
3b5eeb8e
...
...
@@ -41,6 +41,7 @@
<div>
<label><input
type=
"checkbox"
id=
"include-builtins"
checked=
"checked"
/>
Include language builtins
</label><br/>
<label><input
type=
"checkbox"
id=
"include-core"
/>
Include library core modules
</label><br/>
<label><input
type=
"checkbox"
id=
"include-apps"
/>
Include apps
</label><br/>
<table>
<tr>
<th><a
title=
"Toggle selection"
href=
"javascript:toggleLibSelection('libs-clean-2.4')"
>
Clean 2.4
</a></th>
...
...
@@ -74,6 +75,8 @@
<label><input
type=
"checkbox"
class=
"search-libs"
checked=
"checked"
value=
"CleanPrettyPrint"
/>
CleanPrettyPrint
</label><br/>
<label><input
type=
"checkbox"
class=
"search-libs"
checked=
"checked"
value=
"Cloogle"
/>
Cloogle
</label><br/>
<label><input
type=
"checkbox"
class=
"search-libs"
checked=
"checked"
value=
"SoccerFun"
>
SoccerFun
</label><br/>
<label><input
type=
"checkbox"
class=
"search-libs"
checked=
"checked"
value=
"clean-compiler"
/>
clean-compiler
</label><br/>
<label><input
type=
"checkbox"
class=
"search-libs"
checked=
"checked"
value=
"clean-ide"
/>
clean-ide
</label><br/>
<label><input
type=
"checkbox"
class=
"search-libs"
checked=
"checked"
value=
"libcloogle"
/>
libcloogle
</label><br/>
</td>
</tr>
...
...
frontend/src/index.php
View file @
3b5eeb8e
...
...
@@ -44,6 +44,8 @@
'CleanTypeUnifier'
,
'Cloogle'
,
'SoccerFun'
,
'clean-compiler'
,
'clean-ide'
,
'libcloogle'
,
]
];
...
...
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