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
6987d49d
Verified
Commit
6987d49d
authored
May 08, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow properties without arguments; allow @property-test-with on module level
parent
34a479b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
22 deletions
+33
-22
Doc.dcl
Doc.dcl
+18
-12
Doc.icl
Doc.icl
+15
-10
No files found.
Doc.dcl
View file @
6987d49d
...
@@ -18,18 +18,19 @@ from TypeDef import :: Type
...
@@ -18,18 +18,19 @@ from TypeDef import :: Type
*/
*/
::
MultiLineString
=
MultiLine
!
String
::
MultiLineString
=
MultiLine
!
String
fromMultiLine
::
!
MultiLineString
->
String
class
docDescription
d
::
!
d
->
Maybe
Description
class
docParams
d
::
!
d
->
[
Description
]
class
docDescription
d
::
!
d
->
Maybe
Description
class
docVars
d
::
!
d
->
[
Description
]
class
docParams
d
::
!
d
->
[
Description
]
class
docResults
d
::
!
d
->
[
Description
]
class
docVars
d
::
!
d
->
[
Description
]
class
docType
d
::
!
d
->
Maybe
Type
class
docResults
d
::
!
d
->
[
Description
]
class
docThrows
d
::
!
d
->
[
Description
]
class
docType
d
::
!
d
->
Maybe
Type
class
docMembers
d
::
!
d
->
[
Maybe
ClassMemberDoc
]
class
docThrows
d
::
!
d
->
[
Description
]
class
docFields
d
::
!
d
->
Maybe
[
Maybe
Description
]
class
docMembers
d
::
!
d
->
[
Maybe
ClassMemberDoc
]
class
docConstructors
d
::
!
d
->
Maybe
[
Maybe
ConstructorDoc
]
class
docFields
d
::
!
d
->
Maybe
[
Maybe
Description
]
class
docRepresentation
d
::
!
d
->
Maybe
(
Maybe
Description
)
class
docConstructors
d
::
!
d
->
Maybe
[
Maybe
ConstructorDoc
]
class
docPropertyBootstrap
d
::
!
d
->
Maybe
String
class
docRepresentation
d
::
!
d
->
Maybe
(
Maybe
Description
)
class
docPropertyTestWith
d
::
!
d
->
[
PropertyVarInstantiation
]
class
docProperties
d
::
!
d
->
[
Property
]
/**
/**
* Documentation of a Clean module.
* Documentation of a Clean module.
...
@@ -37,9 +38,12 @@ class docRepresentation d :: !d -> Maybe (Maybe Description)
...
@@ -37,9 +38,12 @@ class docRepresentation d :: !d -> Maybe (Maybe Description)
::
ModuleDoc
=
::
ModuleDoc
=
{
description
::
Maybe
Description
{
description
::
Maybe
Description
,
property_bootstrap
::
Maybe
MultiLineString
//* For generating unit tests with clean-test
,
property_bootstrap
::
Maybe
MultiLineString
//* For generating unit tests with clean-test
,
property_test_with
::
[
PropertyVarInstantiation
]
//* With which types to test the properties
}
}
instance
docDescription
ModuleDoc
instance
docDescription
ModuleDoc
instance
docPropertyBootstrap
ModuleDoc
instance
docPropertyTestWith
ModuleDoc
derive
gDefault
ModuleDoc
derive
gDefault
ModuleDoc
/**
/**
...
@@ -62,6 +66,8 @@ instance docVars FunctionDoc
...
@@ -62,6 +66,8 @@ instance docVars FunctionDoc
instance
docResults
FunctionDoc
instance
docResults
FunctionDoc
instance
docType
FunctionDoc
instance
docType
FunctionDoc
instance
docThrows
FunctionDoc
instance
docThrows
FunctionDoc
instance
docPropertyTestWith
FunctionDoc
instance
docProperties
FunctionDoc
::
Property
::
Property
=
ForAll
String
[(
String
,
Type
)]
String
=
ForAll
String
[(
String
,
Type
)]
String
...
...
Doc.icl
View file @
6987d49d
...
@@ -33,14 +33,18 @@ gDefault{|Maybe|} _ = Nothing
...
@@ -33,14 +33,18 @@ gDefault{|Maybe|} _ = Nothing
fromMultiLine
::
!
MultiLineString
->
String
fromMultiLine
::
!
MultiLineString
->
String
fromMultiLine
(
MultiLine
s
)
=
s
fromMultiLine
(
MultiLine
s
)
=
s
instance
docDescription
ModuleDoc
where
docDescription
d
=
d
.
ModuleDoc
.
description
instance
docDescription
ModuleDoc
where
docDescription
d
=
d
.
ModuleDoc
.
description
instance
docPropertyBootstrap
ModuleDoc
where
docPropertyBootstrap
d
=
fromMultiLine
<$>
d
.
property_bootstrap
instance
docDescription
FunctionDoc
where
docDescription
d
=
d
.
FunctionDoc
.
description
instance
docPropertyTestWith
ModuleDoc
where
docPropertyTestWith
d
=
d
.
ModuleDoc
.
property_test_with
instance
docParams
FunctionDoc
where
docParams
d
=
d
.
FunctionDoc
.
params
instance
docVars
FunctionDoc
where
docVars
d
=
d
.
FunctionDoc
.
vars
instance
docDescription
FunctionDoc
where
docDescription
d
=
d
.
FunctionDoc
.
description
instance
docResults
FunctionDoc
where
docResults
d
=
d
.
FunctionDoc
.
results
instance
docParams
FunctionDoc
where
docParams
d
=
d
.
FunctionDoc
.
params
instance
docType
FunctionDoc
where
docType
d
=
d
.
FunctionDoc
.
type
instance
docVars
FunctionDoc
where
docVars
d
=
d
.
FunctionDoc
.
vars
instance
docThrows
FunctionDoc
where
docThrows
d
=
d
.
FunctionDoc
.
throws
instance
docResults
FunctionDoc
where
docResults
d
=
d
.
FunctionDoc
.
results
instance
docType
FunctionDoc
where
docType
d
=
d
.
FunctionDoc
.
type
instance
docThrows
FunctionDoc
where
docThrows
d
=
d
.
FunctionDoc
.
throws
instance
docProperties
FunctionDoc
where
docProperties
d
=
d
.
properties
instance
docPropertyTestWith
FunctionDoc
where
docPropertyTestWith
d
=
d
.
FunctionDoc
.
property_test_with
instance
docDescription
ClassMemberDoc
where
docDescription
d
=
d
.
ClassMemberDoc
.
description
instance
docDescription
ClassMemberDoc
where
docDescription
d
=
d
.
ClassMemberDoc
.
description
instance
docParams
ClassMemberDoc
where
docParams
d
=
d
.
ClassMemberDoc
.
params
instance
docParams
ClassMemberDoc
where
docParams
d
=
d
.
ClassMemberDoc
.
params
...
@@ -147,13 +151,14 @@ where
...
@@ -147,13 +151,14 @@ where
parser
::
Parser
Char
(
String
,
[(
String
,
Type
)])
parser
::
Parser
Char
(
String
,
[(
String
,
Type
)])
parser
=
skipSpaces
*>
parser
=
skipSpaces
*>
pMany
(
pSatisfy
\
c
->
c
<>
':'
&&
not
(
isSpace
c
))
>>=
\
name
->
pMany
(
pSatisfy
\
c
->
c
<>
':'
&&
not
(
isSpace
c
))
>>=
\
name
->
skipSpaces
*>
pToken
':'
*>
skipSpaces
*>
pToken
'A'
*>
pToken
'.'
*>
skipSpaces
*>
pToken
':'
*>
((
skipSpaces
*>
pToken
'A'
*>
pToken
'.'
*>
pMany
pMany
(
skipSpaces
*>
(
skipSpaces
*>
(
liftA2
tuple
(
liftA2
tuple
(
toString
<$>
pMany
(
pSatisfy
(
not
o
isSpace
)))
(
toString
<$>
pMany
(
pSatisfy
(
not
o
isSpace
)))
(
pList
[
skipSpaces
,
pToken
':'
,
pToken
':'
,
skipSpaces
]
*>
pTypeWithColonOrSemicolon
)
(
pList
[
skipSpaces
,
pToken
':'
,
pToken
':'
,
skipSpaces
]
*>
pTypeWithColonOrSemicolon
)
)
<*
skipSpaces
)
>>=
\
args
->
)
<*
skipSpaces
)
)
<|>
skipSpaces
*>
pure
[])
>>=
\
args
->
pure
(
toString
name
,
args
)
pure
(
toString
name
,
args
)
skipSpaces
=
pMany
(
pSatisfy
isSpace
)
*>
pYield
undef
skipSpaces
=
pMany
(
pSatisfy
isSpace
)
*>
pYield
undef
...
...
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