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
C
clean-highlighter
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
clean-highlighter
Commits
b3e1091d
Verified
Commit
b3e1091d
authored
Sep 27, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v0.1.14: Add support for types in dynamic pattern matches
parent
08e3fbaa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
1 deletion
+76
-1
clean.js
clean.js
+3
-0
package.json
package.json
+1
-1
tests/dynamic-pattern-match
tests/dynamic-pattern-match
+72
-0
No files found.
clean.js
View file @
b3e1091d
...
...
@@ -209,6 +209,7 @@ var highlightRules = {
[
/
([^\s
;
]
+
)
/
,
[
'
modulename
'
],
'
pop
'
]
],
funcargs
:
[
[
/
(
::
)
/
,
[
'
punctuation
'
],
'
type
'
],
[
/
(
=:
)
/
,
[
'
punctuation
'
]],
[
/
((?:
:=
)?
=
)
/
,
[
'
punctuation
'
],
'
jump:rhs
'
],
[
/
(\[\|)
/
,
[
'
punctuation
'
]],
/* overloaded list */
...
...
@@ -253,6 +254,8 @@ var highlightRules = {
[
/
(\(\))
/
,
[
'
type
'
]],
[
/
(\()(
->
)(\))
/
,
[
'
punctuation
'
,
'
type
'
,
'
punctuation
'
]],
[
/
(\|)
/
,
[
'
punctuation
'
],
'
context
'
],
[
/
(\()
/
,
[
'
punctuation
'
],
'
type
'
],
[
/
(\))
/
,
[
'
punctuation
'
],
'
pop
'
],
[
/
([^\s\w])
/
,
[
'
punctuation
'
]]
],
typeOfPattern
:
[
...
...
package.json
View file @
b3e1091d
{
"name"
:
"clean-highlighter"
,
"version"
:
"0.1.1
3
"
,
"version"
:
"0.1.1
4
"
,
"description"
:
"Clean language highlighter"
,
"keywords"
:
[
"clean"
,
"highlighter"
],
"main"
:
"clean.js"
,
...
...
tests/dynamic-pattern-match
0 → 100644
View file @
b3e1091d
-----
unpack :: Dynamic -> Maybe a
unpack (x :: a^) = Just x
unpack (f :: A.a: Int -> Maybe a) = Just (f 37)
unpack _ = Nothing
-----
funcname unpack
whitespace
punctuation ::
whitespace
type Dynamic
whitespace
punctuation ->
whitespace
type Maybe
whitespace
typevar a
whitespace \n
funcname unpack
whitespace
punctuation (
argument x
whitespace
punctuation ::
whitespace
typevar a
punctuation ^)
whitespace
punctuation =
whitespace
constructor Just
whitespace
argumentinrhs x
whitespace \n
funcname unpack
whitespace
punctuation (
argument f
whitespace
punctuation ::
whitespace
existential A
punctuation .
typevar a
punctuation :
whitespace
type Int
whitespace
punctuation ->
whitespace
type Maybe
whitespace
typevar a
punctuation )
whitespace
punctuation =
whitespace
constructor Just
whitespace
punctuation (
argumentinrhs f
whitespace
literal literal-int literal-int-dec 37
punctuation )
whitespace \n
funcname unpack
whitespace
argument _
whitespace
punctuation =
whitespace
constructor 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