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
5f07816c
Verified
Commit
5f07816c
authored
Sep 28, 2017
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add language report documentation for other builtins
parent
a0aad04f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
30 deletions
+29
-30
backend/Builtins.icl
backend/Builtins.icl
+12
-14
backend/Cloogle
backend/Cloogle
+1
-1
frontend/api.js
frontend/api.js
+16
-15
No files found.
backend/Builtins.icl
View file @
5f07816c
...
...
@@ -19,17 +19,17 @@ import CloogleDB
builtin_functions
::
[(
Location
,
FunctionEntry
)]
builtin_functions
=
[
(
Builtin
"if"
=
[
(
Builtin
"if"
[
CLR
5
"3.4.2"
"_Toc311798001"
]
,
{
zero
&
fe_type
=
Just
$
Func
[
Type
"Bool"
[],
Var
"a"
,
Var
"a"
]
(
Var
"a"
)
[]}
)
,
(
Builtin
"dynamic"
,
(
Builtin
"dynamic"
[
CLR
10
"8.1"
"_Toc311798076"
]
,
{
zero
&
fe_type
=
Just
$
Func
[
Var
"a"
]
(
Type
"Dynamic"
[])
[
Instance
"TC"
[
Var
"a"
]]}
)
]
builtin_classes
::
[(
Location
,
ClassEntry
)]
builtin_classes
=
[
(
Builtin
"TC"
=
[
(
Builtin
"TC"
[
CLR
10
"8.1.4"
"_Toc311798080"
]
,
{
ce_vars
=[
"v"
]
,
ce_context
=[]
,
ce_documentation
=
Nothing
...
...
@@ -42,7 +42,7 @@ builtin_classes
builtin_types
::
[(
Location
,
TypeDefEntry
)]
builtin_types
=
[
(
Builtin
"Bool"
=
[
(
Builtin
"Bool"
[
CLR
6
"4.1"
"_Toc311798017"
]
,
{
deft
&
tde_typedef
.
td_name
=
"Bool"
,
tde_typedef
.
td_rhs
=
TDRCons
False
...
...
@@ -51,14 +51,14 @@ builtin_types
]
}
)
,
(
Builtin
"Int"
,
{
deft
&
tde_typedef
.
td_name
=
"Int"
}
)
,
(
Builtin
"Real"
,
{
deft
&
tde_typedef
.
td_name
=
"Real"
}
)
,
(
Builtin
"Char"
,
{
deft
&
tde_typedef
.
td_name
=
"Char"
}
)
,
(
Builtin
"String"
,
{
deft
&
tde_typedef
.
td_name
=
"String"
,
,
(
Builtin
"Int"
[
CLR
6
"4.1"
"_Toc311798017"
],
{
deft
&
tde_typedef
.
td_name
=
"Int"
}
)
,
(
Builtin
"Real"
[
CLR
6
"4.1"
"_Toc311798017"
],
{
deft
&
tde_typedef
.
td_name
=
"Real"
}
)
,
(
Builtin
"Char"
[
CLR
6
"4.1"
"_Toc311798017"
],
{
deft
&
tde_typedef
.
td_name
=
"Char"
}
)
,
(
Builtin
"String"
[
CLR
6
"4.7"
"_Toc311798037"
],
{
deft
&
tde_typedef
.
td_name
=
"String"
,
tde_typedef
.
td_rhs
=
TDRSynonym
(
Type
"_#Array"
[
Type
"Char"
[]])
}
)
,
(
Builtin
"Dynamic"
,
{
deft
&
tde_typedef
.
td_name
=
"Dynamic"
}
)
,
(
Builtin
"File"
,
{
deft
&
tde_typedef
.
td_name
=
"File"
}
)
,
(
Builtin
"World"
,
{
deft
&
tde_typedef
.
td_name
=
"World"
,
,
(
Builtin
"Dynamic"
[
CLR
10
"8"
"_Toc311798077"
],
{
deft
&
tde_typedef
.
td_name
=
"Dynamic"
}
)
,
(
Builtin
"File"
[
CLR
6
"4.7"
"_Toc311798037"
],
{
deft
&
tde_typedef
.
td_name
=
"File"
}
)
,
(
Builtin
"World"
[
CLR
6
"4.7"
"_Toc311798037"
],
{
deft
&
tde_typedef
.
td_name
=
"World"
,
tde_typedef
.
td_uniq
=
True
}
)
:
lists
]
...
...
@@ -69,13 +69,11 @@ where
lists
=
[
make_list
kind
spine
\\
kind
<-
[[],
[
'#'
],
[
'!'
],
[
'|'
]],
spine
<-
[[],
[
'!'
]]
|
kind
<>
[
'|'
]
||
spine
<>
[
'!'
]]
where
make_list
::
[
Char
]
[
Char
]
->
(
Location
,
TypeDefEntry
)
make_list
k
s
=
(
Builtin
higherorder
,
make_list
k
s
=
(
Builtin
higherorder
[
CLR
6
"4.2"
"_Toc311798019"
]
,
{
deft
&
tde_typedef
.
td_name
=
toString
([
'_
'
:k] ++ [
'
List'
]
++
s
)
,
tde_typedef
.
td_args
=
[
Var
"a"
]
,
tde_doc
=
Just
$
TypeDoc
(
Just
$
"A"
+
kind
+
spine
+
" list.
\n\n
"
+
description
)
[
"The type of the list elements."
]
Nothing
// , syntax_doc_locations = [CLR 6 "4.2" "_Toc311798019"]
// , syntax_examples = map (EXs "Function" "macro") ["f :: " <+ lista <+ " -> a", "ints = " <+ listints]
})
where
higherorder
=
toString
([
'[
'
:k] ++ s` ++ ['
]'])
...
...
Cloogle
@
6b1321a5
Compare
4ab43ae8
...
6b1321a5
Subproject commit
4ab43ae83d028153296dbdfb29224626ade29eab
Subproject commit
6b1321a537abec27a211b59aed4ecec57f4b2ba6
frontend/api.js
View file @
5f07816c
...
...
@@ -343,7 +343,7 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag
'
<a href="
'
+
iclUrl
+
'
" target="_blank">icl
'
+
iclLine
+
'
</a>)
'
;
if
(
'
builtin
'
in
basic
&&
basic
[
'
builtin
'
])
basicText
=
[[
'
Clean core. The actual implementation may differ.
For documentation, see the Clean language report.
'
]];
basicText
=
[[
'
Clean core. The actual implementation may differ.
'
]];
var
toggler
=
''
;
if
(
hidden
.
length
>
0
)
{
...
...
@@ -370,6 +370,21 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag
var
meta
=
[];
var
hidden
=
[];
if
(
'
langrep_documentation
'
in
basic
&&
basic
[
'
langrep_documentation
'
].
length
>
0
)
{
var
doc
=
'
See the language report:
'
;
for
(
var
i
in
basic
[
'
langrep_documentation
'
])
{
var
loc
=
basic
[
'
langrep_documentation
'
][
i
];
if
(
i
!=
0
)
doc
+=
'
;
'
;
doc
+=
'
<a target="_blank"
'
+
'
href="/doc/#
'
+
loc
.
clr_file
+
'
;jump=
'
+
loc
.
clr_heading
+
'
">
'
+
loc
.
clr_section
+
'
</a>
'
;
}
doc
+=
'
.
'
;
meta
.
push
(
doc
);
}
if
(
'
documentation
'
in
basic
)
meta
.
push
(
markupDocumentation
(
basic
[
'
documentation
'
]));
...
...
@@ -514,20 +529,6 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag
highlightFunction
(
'
import
'
+
basic
[
'
modul
'
]));
case
'
SyntaxResult
'
:
var
urls
=
''
;
if
(
extra
[
'
syntax_doc_location
'
].
length
>
0
)
{
urls
+=
'
(
'
;
for
(
var
i
in
extra
[
'
syntax_doc_location
'
])
{
var
loc
=
extra
[
'
syntax_doc_location
'
][
i
][
1
];
if
(
i
!=
0
)
urls
+=
'
;
'
;
urls
+=
'
<a target="_blank"
'
+
'
href="/doc/#
'
+
loc
.
clr_file
+
'
;jump=
'
+
loc
.
clr_heading
+
'
">
'
+
'
Section
'
+
loc
.
clr_section
+
'
of the Language report v
'
+
loc
.
clr_version
+
'
</a>
'
;
}
urls
+=
'
)
'
;
}
var
toggler
=
''
;
if
(
extra
[
'
syntax_examples
'
].
length
>
0
)
{
toggler
=
'
<div class="toggler" title="More details" onclick="toggle(this)">
'
+
...
...
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