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
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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cloogle
Cloogle
Commits
31231ba8
Commit
31231ba8
authored
Aug 17, 2016
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added CleanPrettyPrint; macros in builddb
parent
ed79b665
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
7 deletions
+31
-7
CleanPrettyPrint
CleanPrettyPrint
+1
-0
Makefile
Makefile
+1
-1
TypeDB.dcl
TypeDB.dcl
+2
-0
TypeDB.icl
TypeDB.icl
+10
-3
builddb.icl
builddb.icl
+17
-3
No files found.
CleanPrettyPrint
@
2a3bb584
Subproject commit 2a3bb584e1f3dfb3caf6df0a1eb8b4ed9f41fffc
Makefile
View file @
31231ba8
...
...
@@ -23,7 +23,7 @@ man: $(MAN)
%.prj
:
$(CPM)
project
$(
basename
$@
)
create
$(SED)
-i
's/\(Target:[ \t]\+\)StdEnv/\1CleanPlatform/'
$@
$(SED)
-i
's/[ \t]\+Path:[ \t]\+{Project}/&\n&\/CleanLevenshtein\n&\/CleanTypeUnifier\n&\/CleanTypeUnifier\/clean-compiler\/main\/\n&\/CleanTypeUnifier\/clean-compiler\/frontend\/\n&\/CleanTypeUnifier\/clean-compiler\/backend\/\n&\/CleanTypeUnifier\/clean-compiler\/main\/Unix\//'
$@
$(SED)
-i
's/[ \t]\+Path:[ \t]\+{Project}/&\n&\/CleanLevenshtein\n&\/Clean
PrettyPrint\n&\/Clean
TypeUnifier\n&\/CleanTypeUnifier\/clean-compiler\/main\/\n&\/CleanTypeUnifier\/clean-compiler\/frontend\/\n&\/CleanTypeUnifier\/clean-compiler\/backend\/\n&\/CleanTypeUnifier\/clean-compiler\/main\/Unix\//'
$@
$(SED)
-i
's/\([ \t]\+Path:[ \t]\+\){Project}$$/&\n\1{Application}\/lib\/ArgEnv\/\n\1{Application}\/lib\/TCPIP\//'
$@
$(SED)
-i
's/\(
$(
basename
$@
)
\).exe/\1/'
$@
$(SED)
-i
's/\(Output:[ \t]\+\)ShowConstructors/\1NoConsole/'
$@
...
...
TypeDB.dcl
View file @
31231ba8
...
...
@@ -63,6 +63,8 @@ findFunction`` :: [(FunctionLocation ExtendedType -> Bool)] TypeDB
->
[(
FunctionLocation
,
ExtendedType
)]
getMacro
::
MacroLocation
TypeDB
->
Maybe
Macro
putMacro
::
MacroLocation
Macro
TypeDB
->
TypeDB
putMacros
::
[(
MacroLocation
,
Macro
)]
TypeDB
->
TypeDB
getInstances
::
Class
TypeDB
->
[
Type
]
putInstance
::
Class
Type
TypeDB
->
TypeDB
...
...
TypeDB.icl
View file @
31231ba8
...
...
@@ -28,13 +28,13 @@ printersperse ia a bs = intercalate (print False a) (map (print ia) bs)
derive
gEq
ClassOrGeneric
,
FunctionLocation
,
ClassLocation
,
Type
,
TypeDB
,
TypeExtras
,
TE_Priority
,
ExtendedType
,
TypeDef
,
TypeLocation
,
TypeDefRhs
,
RecordField
,
Constructor
,
Kind
RecordField
,
Constructor
,
Kind
,
MacroLocation
,
Macro
derive
JSONEncode
ClassOrGeneric
,
FunctionLocation
,
ClassLocation
,
Type
,
TypeDB
,
TypeExtras
,
TE_Priority
,
ExtendedType
,
TypeDef
,
TypeLocation
,
TypeDefRhs
,
RecordField
,
Constructor
,
Kind
TypeDefRhs
,
RecordField
,
Constructor
,
Kind
,
MacroLocation
,
Macro
derive
JSONDecode
ClassOrGeneric
,
FunctionLocation
,
ClassLocation
,
Type
,
TypeDB
,
TypeExtras
,
TE_Priority
,
ExtendedType
,
TypeDef
,
TypeLocation
,
TypeDefRhs
,
RecordField
,
Constructor
,
Kind
TypeDefRhs
,
RecordField
,
Constructor
,
Kind
,
MacroLocation
,
Macro
instance
zero
TypeDB
where
...
...
@@ -106,6 +106,13 @@ findFunction`` :: [(FunctionLocation ExtendedType -> Bool)] TypeDB
findFunction``
fs
{
functionmap
}
=
toList
$
foldr
filterWithKey
functionmap
fs
getMacro
::
MacroLocation
TypeDB
->
Maybe
Macro
getMacro
loc
{
macromap
}
=
get
loc
macromap
putMacro
::
MacroLocation
Macro
TypeDB
->
TypeDB
putMacro
ml
m
db
=:{
macromap
}
=
{
db
&
macromap
=
put
ml
m
macromap
}
putMacros
::
[(
MacroLocation
,
Macro
)]
TypeDB
->
TypeDB
putMacros
ms
db
=
foldr
(\(
loc
,
m
)
db
->
putMacro
loc
m
db
)
db
ms
getInstances
::
Class
TypeDB
->
[
Type
]
getInstances
c
{
instancemap
}
=
if
(
isNothing
ts
)
[]
(
fromJust
ts
)
...
...
builddb.icl
View file @
31231ba8
...
...
@@ -2,7 +2,7 @@ module builddb
// Project libraries
import
qualified
TypeDB
as
DB
from
TypeDB
import
::
TypeExtras
{..},
instance
zero
TypeExtras
from
TypeDB
import
::
TypeExtras
{..},
instance
zero
TypeExtras
,
::
Macro
{..}
// StdEnv
import
StdFile
,
StdList
,
StdMisc
,
StdArray
,
StdBool
,
StdString
,
StdTuple
...
...
@@ -17,6 +17,9 @@ import qualified Type as T
from
Type
import
class
print
(
print
),
instance
print
[
a
],
instance
print
String
import
CoclUtils
// CleanPrettyPrint
import
CleanPrettyPrint
// frontend
//import Heap, compile, parse, predef
import
Heap
...
...
@@ -27,13 +30,15 @@ from compile import empty_cache, ::DclCache{hash_table}
from
general
import
::
Optional
(..)
from
syntax
import
::
SymbolTable
,
::
SymbolTableEntry
,
::
Ident
{..},
::
SymbolPtr
,
::
Position
(
NoPos
),
::
Module
{
mod_ident
,
mod_defs
},
::
ParsedDefinition
(
PD_TypeSpec
,
PD_Instance
,
PD_Class
,
PD_Type
,
PD_Generic
,
PD_Derive
),
::
ParsedDefinition
(
PD_TypeSpec
,
PD_Instance
,
PD_Class
,
PD_Type
,
PD_Generic
,
PD_Derive
,
PD_Function
),
::
FunSpecials
,
::
Priority
,
::
ParsedModule
,
::
SymbolType
,
::
ParsedInstanceAndMembers
{..},
::
ParsedInstance
{
pi_ident
,
pi_types
},
::
Type
,
::
ClassDef
{
class_ident
,
class_args
,
class_context
},
::
TypeVar
,
::
ParsedTypeDef
,
::
TypeDef
,
::
GenericDef
{
gen_ident
,
gen_type
,
gen_vars
},
::
GenericCaseDef
{
gc_type
,
gc_gcf
},
::
GenericCaseFunctions
(
GCF
),
::
GCF
::
GenericCaseDef
{
gc_type
,
gc_gcf
},
::
GenericCaseFunctions
(
GCF
),
::
GCF
,
::
FunKind
(
FK_Macro
),
::
Rhs
,
::
ParsedExpr
from
scanner
import
::
Priority
(..),
::
Assoc
(..)
from
parse
import
wantModule
...
...
@@ -159,6 +164,7 @@ getModuleTypes root mod lib cache db w
#
db
=
'
DB
'.
putFunctions
(
flatten
$
map
constructor_functions
typedefs
)
db
#
db
=
'
DB
'.
putFunctions
(
pd_generics
lib
mod
pm
.
mod_defs
)
db
#
db
=
'
DB
'.
putDerivationss
(
pd_derivations
pm
.
mod_defs
)
db
#
db
=
'
DB
'.
putMacros
(
pd_macros
lib
mod
pm
.
mod_defs
)
db
=
(
db
,
cache
,
w
)
where
mkdir
::
String
->
String
...
...
@@ -175,6 +181,14 @@ where
=
take
(
length
lib
-
length
mod
-
1
)
lib
=
lib
pd_macros
::
String
String
[
ParsedDefinition
]
->
[('
DB
'.
MacroLocation
,
'
DB
'.
Macro
)]
pd_macros
lib
mod
pds
=
[(
'
DB
'.
ML
lib
mod
id
.
id_name
,
{
macro_rhs
=
cpp
rhs
,
macro_extras
=
zero
}
)
\\
PD_Function
_
id
isinfix
args
rhs
FK_Macro
<-
pds
]
pd_derivations
::
[
ParsedDefinition
]
->
[('
DB
'.
GenericName
,
['
DB
'.
Type
])]
pd_derivations
pds
=
[(
id
.
id_name
,
[
'T'
.
toType
gc_type
])
...
...
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