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
123d6370
Verified
Commit
123d6370
authored
Sep 28, 2017
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move all builtin entries to one module
parent
9bb1a000
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
61 deletions
+68
-61
backend/BuiltinSyntax.dcl
backend/BuiltinSyntax.dcl
+0
-5
backend/Builtins.dcl
backend/Builtins.dcl
+9
-0
backend/Builtins.icl
backend/Builtins.icl
+52
-1
backend/builddb.icl
backend/builddb.icl
+7
-55
No files found.
backend/BuiltinSyntax.dcl
deleted
100644 → 0
View file @
9bb1a000
definition
module
BuiltinSyntax
from
CloogleDB
import
::
SyntaxEntry
,
::
SyntaxResultExtras
builtin_syntax
::
[([
String
],
SyntaxEntry
)]
backend/Builtins.dcl
0 → 100644
View file @
123d6370
definition
module
Builtins
from
CloogleDB
import
::
Location
,
::
FunctionEntry
,
::
ClassEntry
,
::
TypeDefEntry
,
::
SyntaxEntry
,
::
SyntaxResultExtras
builtin_functions
::
[(
Location
,
FunctionEntry
)]
builtin_classes
::
[(
Location
,
ClassEntry
)]
builtin_types
::
[(
Location
,
TypeDefEntry
)]
builtin_syntax
::
[([
String
],
SyntaxEntry
)]
backend/Builtin
Syntax
.icl
→
backend/Builtin
s
.icl
View file @
123d6370
implementation
module
Builtin
Syntax
implementation
module
Builtin
s
import
StdBool
import
StdEnum
...
...
@@ -7,12 +7,63 @@ import StdList
import
StdOverloaded
import
StdString
from
Data
.
Func
import
$
import
Data
.
Maybe
import
Text
import
Type
import
Cloogle
import
CloogleDB
builtin_functions
::
[(
Location
,
FunctionEntry
)]
builtin_functions
=
[
(
Builtin
"if"
,
{
zero
&
fe_type
=
Just
$
Func
[
Type
"Bool"
[],
Var
"a"
,
Var
"a"
]
(
Var
"a"
)
[]}
)
,
(
Builtin
"dynamic"
,
{
zero
&
fe_type
=
Just
$
Func
[
Var
"a"
]
(
Type
"Dynamic"
[])
[
Instance
"TC"
[
Var
"a"
]]}
)
]
builtin_classes
::
[(
Location
,
ClassEntry
)]
builtin_classes
=
[
(
Builtin
"TC"
,
{
ce_vars
=[
"v"
]
,
ce_context
=[]
,
ce_documentation
=
Nothing
,
ce_members
=[]
,
ce_instances
=[]
,
ce_derivations
=[]
}
)
]
builtin_types
::
[(
Location
,
TypeDefEntry
)]
builtin_types
=
[
(
Builtin
"Bool"
,
{
deft
&
tde_typedef
.
td_name
=
"Bool"
,
tde_typedef
.
td_rhs
=
TDRCons
False
[
{
defc
&
cons_name
=
"False"
}
,
{
defc
&
cons_name
=
"True"
}
]
}
)
,
(
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"
,
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"
,
tde_typedef
.
td_uniq
=
True
}
)
]
where
deft
=
{
tde_typedef
={
td_name
=
""
,
td_uniq
=
False
,
td_args
=[],
td_rhs
=
TDRAbstract
},
tde_doc
=
Nothing
}
defc
=
{
cons_name
=
""
,
cons_args
=[],
cons_exi_vars
=[],
cons_context
=[],
cons_priority
=
Nothing
}
builtin_syntax
::
[([
String
],
SyntaxEntry
)]
builtin_syntax
=
bs_arrays
++
...
...
backend/builddb.icl
View file @
123d6370
...
...
@@ -21,7 +21,7 @@ import Type
from
CloogleDBFactory
import
::
TemporaryDB
,
newTemporaryDb
,
finaliseDb
,
findModules
,
indexModule
,
constructor_functions
,
record_functions
import
Builtin
Syntax
import
Builtin
s
::
CLI
=
{
help
::
Bool
,
version
::
Bool
...
...
@@ -91,13 +91,13 @@ Start w
#
mods
=
flatten
modss
#!
(
db
,
w
)
=
loop
cli
.
root
mods
newTemporaryDb
w
#!
db
=
finaliseDb
db
newDb
#!
db
=
putFunctions
predefFunctions
db
#!
db
=
putClasses
predefClasses
db
#!
db
=
putTypes
predefTypes
db
#!
db
=
putFunctions
(
flatten
$
map
constructor_functions
predefTypes
)
db
#!
db
=
putFunctions
(
flatten
$
map
record_functions
predefTypes
)
db
#!
db
=
syncDb
2
db
#!
db
=
putFunctions
builtin_functions
db
#!
db
=
putClasses
builtin_classes
db
#!
db
=
putTypes
builtin_types
db
#!
db
=
putFunctions
(
flatten
$
map
constructor_functions
builtin_types
)
db
#!
db
=
putFunctions
(
flatten
$
map
record_functions
builtin_types
)
db
#!
db
=
putSyntaxElems
builtin_syntax
db
#!
db
=
syncDb
2
db
#!
(
ok1
,
w
)
=
fclose
(
printStats
db
stderr
)
w
#!
f
=
saveDb
db
f
#!
(
ok2
,
w
)
=
fclose
f
w
...
...
@@ -153,51 +153,3 @@ where
,
syntaxCount
db
]
pad
n
i
=
{
' '
\\
_
<-
[
0
..
n
-
size
(
toString
i
)
-1
]}
+++
toString
i
predefFunctions
::
[(
Location
,
FunctionEntry
)]
predefFunctions
=
[
(
Builtin
"if"
,
{
zero
&
fe_type
=
Just
$
Func
[
Type
"Bool"
[],
Var
"a"
,
Var
"a"
]
(
Var
"a"
)
[]}
)
,
(
Builtin
"dynamic"
,
{
zero
&
fe_type
=
Just
$
Func
[
Var
"a"
]
(
Type
"Dynamic"
[])
[
Instance
"TC"
[
Var
"a"
]]}
)
]
predefClasses
::
[(
Location
,
ClassEntry
)]
predefClasses
=
[
(
Builtin
"TC"
,
{
ce_vars
=[
"v"
]
,
ce_context
=[]
,
ce_documentation
=
Nothing
,
ce_members
=[]
,
ce_instances
=[]
,
ce_derivations
=[]
}
)
]
predefTypes
::
[(
Location
,
TypeDefEntry
)]
predefTypes
=
[
(
Builtin
"Bool"
,
{
deft
&
tde_typedef
.
td_name
=
"Bool"
,
tde_typedef
.
td_rhs
=
TDRCons
False
[
{
defc
&
cons_name
=
"False"
}
,
{
defc
&
cons_name
=
"True"
}
]
}
)
,
(
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"
,
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"
,
tde_typedef
.
td_uniq
=
True
}
)
]
where
deft
=
{
tde_typedef
={
td_name
=
""
,
td_uniq
=
False
,
td_args
=[],
td_rhs
=
TDRAbstract
},
tde_doc
=
Nothing
}
defc
=
{
cons_name
=
""
,
cons_args
=[],
cons_exi_vars
=[],
cons_context
=[],
cons_priority
=
Nothing
}
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