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
1c6ae0a1
Verified
Commit
1c6ae0a1
authored
Nov 19, 2017
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Derive types for basic macros
parent
f951e082
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
13 deletions
+23
-13
CleanTypeUnifier
CleanTypeUnifier
+1
-1
CloogleDBFactory.icl
CloogleDBFactory.icl
+15
-9
README.md
README.md
+7
-3
No files found.
CleanTypeUnifier
@
eff41df0
Compare
3bf6da2a
...
eff41df0
Subproject commit
3bf6da2acd1389d5558cb70f043981ce84d157b8
Subproject commit
eff41df0ccb7b171a8c62d95406faa008b34d443
CloogleDBFactory.icl
View file @
1c6ae0a1
...
...
@@ -288,22 +288,22 @@ where
pd_rewriterules
dcl
defs
st
=
[(
setLine
dcl
pos
{
zero
&
name
=
Just
id
.
id_name
}
,
let
doc
=
findDoc
hideIsUsedReturn
parseFunctionDoc
id
st
in
if
(
isNothing
(
findTypeSpec
id
defs
)
&&
needsTypeWarning
doc
)
(
trace_n
$
"Doc warning: expected @type for '"
+++
id
.
id_name
+++
"'"
)
(\
x
->
x
)
trace_type_warning
id
{
zero
&
fe_kind
=
Macro
,
fe_type
=
getTypeDoc
=<<
doc
,
fe_representation
=
Just
$
priostring
id
+++
cpp
pd
,
fe_type
=
pdType
pd
<|>
(
getTypeDoc
=<<
doc
)
,
fe_representation
=
Just
$
priostring
id
pd
+++
cpp
pd
,
fe_priority
=
findPrio
id
>>=
'T'
.
toMaybePriority
,
fe_documentation
=
doc
}
)
\\
pd
=:(
PD_Function
pos
id
isinfix
args
rhs
_)
<-
defs
]
where
priostring
::
Ident
->
String
priostring
id
=
case
findTypeSpec
id
defs
of
Nothing
=
""
(
Just
pri
)
=
cpp
pri
+++
"
\n
"
priostring
::
Ident
ParsedDefinition
->
String
priostring
id
pd
=
case
findTypeSpec
id
defs
of
Just
td
->
cpp
td
+++
"
\n
"
Nothing
->
case
pdType
pd
of
Just
t
->
id
.
id_name
+++
" :: "
+++
concat
(
print
False
t
)
+++
"
\n
"
Nothing
->
""
findPrio
::
Ident
->
Maybe
Priority
findPrio
id
=
(\(
PD_TypeSpec
_
_
p
_
_)
->
p
)
<$>
findTypeSpec
id
defs
...
...
@@ -318,6 +318,12 @@ where
needsTypeWarning
Nothing
=
True
needsTypeWarning
(
Just
(
FunctionDoc
_
_
_
_
t
))
=
isNothing
t
trace_type_warning
::
!
Ident
!
FunctionEntry
->
FunctionEntry
trace_type_warning
id
fe
|
isJust
(
findTypeSpec
id
defs
)
=
fe
|
isJust
fe
.
fe_type
=
fe
|
otherwise
=
trace_n
(
"Doc warning: expected @type for '"
+++
id
.
id_name
+++
"'"
)
fe
pd_derivations
::
!
Bool
![
ParsedDefinition
]
->
[('
DB
'.
Name
,
[('
DB
'.
Type
,
String
,
LocationInModule
)])]
pd_derivations
dcl
defs
=
[(
id
.
id_name
,
[(
'T'
.
toType
gc_type
,
cpp
gc_type
,
setLine
dcl
gc_pos
zero
)])
...
...
README.md
View file @
1c6ae0a1
...
...
@@ -97,13 +97,17 @@ different syntax elements, and what they should document.
| Function | !
[][
y
]
| !
[][
y
]
| !
[][
y
]
| | |
| Generic | !
[][
y
]
| !
[][
y
]
| !
[][
y
]
| | !
[][
y
]
|
| Instance | | | | | |
| Macro | !
[][
y
]
| !
[][
y
]
| !
[][
y
]
| !
[][
y
]
|
|
| Macro | !
[][
y
]
| !
[][
y
]
| !
[][
y
]
| !
[][
y
]
<sup>
2
</sup>
|
|
| Module | !
[][
y
]
| | | | |
| Record field | !
[][
y
]
| | | | |
| Type | !
[][
y
]
| | | | !
[][
y
]
| !
[][
y
]
, for type synonyms
<sup>
Note 1: only for shorthand classes like
`class zero a :: a`
, where there
is no other place for the documentation of the class member.
</sup>
<sup>
1: only for shorthand classes like
`class zero a :: a`
, where there is no other
place for the documentation of the class member.
2: for simple macros (depending on what CleanTypeUnifier's
`pdType`
can do),
`CloogleDBFactory`
can derive the type.
</sup>
| Field | Description
|-------------------|-------------
...
...
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