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
88ff4d98
Verified
Commit
88ff4d98
authored
Jul 07, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for qualified imports
parent
1861ae1e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
145 additions
and
4 deletions
+145
-4
clean.css
clean.css
+6
-1
clean.js
clean.js
+6
-3
tests/qualified-in-list
tests/qualified-in-list
+113
-0
tests/qualified-type
tests/qualified-type
+20
-0
No files found.
clean.css
View file @
88ff4d98
...
...
@@ -12,7 +12,7 @@
font-weight
:
bold
;
}
.funcname.funcname-onlyused
,
.
modulename.modulename-onlyused
,
.
argument
{
.funcname.funcname-onlyused
,
.argument
{
color
:
#6e94ad
;
font-weight
:
normal
;
}
...
...
@@ -43,6 +43,11 @@
color
:
#444
;
}
.qualified
{
color
:
#444
;
font-weight
:
normal
;
}
.field
{
color
:
#41b1b5
;
}
...
...
clean.js
View file @
88ff4d98
...
...
@@ -144,6 +144,7 @@ function highlightClean(func, callback, start) {
_prepend
:
[
[
/
(\s
*
)(\/\/
.*
)
/
,
[
'
whitespace
'
,
'
comment
'
]],
[
/
(\s
*
)(\/\*)
/
,
[
'
whitespace
'
,
'
comment
'
],
'
comment
'
],
[
/
(
'
)([\w
`
]
+
)(
'
\.)
/
,
[
'
punctuation
'
,
'
qualified
'
,
'
punctuation
'
]],
],
_append
:
[
[
/
(\n[^\n\S]
*
)
/
,
function
(
matches
,
states
)
{
...
...
@@ -344,7 +345,8 @@ function highlightClean(func, callback, start) {
[
/
\b(
True|False
)\b
/
,
[
'
literal literal-bool
'
]],
[
/
(
"
)
/
,
[
'
literal literal-string
'
],
'
string
'
],
[
/
(\[)(\s
*
)(
'
)
/
,
[
'
punctuation
'
,
'
whitespace
'
,
'
literal literal-char
'
],
'
charlist
'
],
[
/
(\[)(\s
*
)(
'
)(?=
.*'
\])
/
,
[
'
punctuation
'
,
'
whitespace
'
,
'
literal literal-char
'
],
'
charlist
'
],
[
/
([
A-Z
][\w
`
]
*
)
/
,[
'
constructor
'
]],
[
/
\b(
_
)\b
/
,
[
'
argument argument-wildcard
'
]],
[
/
([\w
`
]
+
)
/
,
[
'
funcname funcname-onlyused
'
]],
...
...
@@ -371,7 +373,8 @@ function highlightClean(func, callback, start) {
[
/
\b(
True|False
)\b
/
,
[
'
literal literal-bool
'
]],
[
/
(
"
)
/
,
[
'
literal literal-string
'
],
'
string
'
],
[
/
(\[)(\s
*
)(
'
)
/
,
[
'
punctuation
'
,
'
whitespace
'
,
'
literal literal-char
'
],
'
charlist
'
],
[
/
(\[)(\s
*
)(
'
)(?=
.*'
\])
/
,
[
'
punctuation
'
,
'
whitespace
'
,
'
literal literal-char
'
],
'
charlist
'
],
[
/
(\(
.+
\)\s
+infix.*
)
/
,
[
'
__type__
'
]],
[
/
([\w
`
]
+
\s
*::.*
)
/
,
...
...
@@ -558,7 +561,7 @@ function highlightClean(func, callback, start) {
],
importAs
:
[
[
/
(
,
)
/
,
[
'
punctuation
'
],
'
pop
'
],
[
/
([^
,
\s]
+
)
/
,
[
'
modulename
modulename-onlyus
ed
'
]]
[
/
([^
,
\s]
+
)
/
,
[
'
modulename
qualifi
ed
'
]]
],
importFrom
:
[
[
/
([^
,
\s]
+
)(\s
+
)(
import
)
/
,
[
'
modulename
'
,
'
whitespace
'
,
'
keyword
'
],
'
importSelections
'
]
...
...
tests/qualified-in-list
0 → 100644
View file @
88ff4d98
-----
instance 'T'.toTypeContext ['syntax'.TypeContext]
where
toTypeContext context
= ['T'.Instance gds.glob_object.ds_ident.id_name (map 'T'.toType tc_types)
\\ {tc_class=(TCClass gds),tc_types} <- context] ++
['T'.Derivation gtc_generic.glob_object.ds_ident.id_name ('T'.toType t)
\\ {tc_class=(TCGeneric {gtc_generic}),tc_types=[t]} <- context]
-----
keyword instance
whitespace
punctuation '
qualified T
punctuation '.
classname toTypeContext
whitespace
punctuation ['
qualified syntax
punctuation '.
type TypeContext
punctuation ]
whitespace \n
keyword where
whitespace \n
funcname toTypeContext
whitespace
argument context
whitespace \n
punctuation =
whitespace
punctuation ['
qualified T
punctuation '.
constructor Instance
whitespace
funcname funcname-onlyused gds
punctuation .
funcname funcname-onlyused glob_object
punctuation .
funcname funcname-onlyused ds_ident
punctuation .
funcname funcname-onlyused id_name
whitespace
punctuation (
funcname funcname-onlyused map
whitespace
punctuation '
qualified T
punctuation '.
funcname funcname-onlyused toType
whitespace
funcname funcname-onlyused tc_types
punctuation )
whitespace \n
punctuation \\
whitespace
punctuation {
funcname funcname-onlyused tc_class
punctuation =(
constructor TCClass
whitespace
funcname funcname-onlyused gds
punctuation ),
funcname funcname-onlyused tc_types
punctuation }
whitespace
punctuation <-
whitespace
argumentinrhs context
punctuation ]
whitespace
punctuation ++
whitespace \n
punctuation ['
qualified T
punctuation '.
constructor Derivation
whitespace
funcname funcname-onlyused gtc_generic
punctuation .
funcname funcname-onlyused glob_object
punctuation .
funcname funcname-onlyused ds_ident
punctuation .
funcname funcname-onlyused id_name
whitespace
punctuation ('
qualified T
punctuation '.
funcname funcname-onlyused toType
whitespace
funcname funcname-onlyused t
punctuation )
whitespace \n
punctuation \\
whitespace
punctuation {
funcname funcname-onlyused tc_class
punctuation =(
constructor TCGeneric
whitespace
punctuation {
funcname funcname-onlyused gtc_generic
punctuation }),
funcname funcname-onlyused tc_types
punctuation =[
funcname funcname-onlyused t
punctuation ]}
whitespace
punctuation <-
whitespace
argumentinrhs context
punctuation ]
tests/qualified-type
0 → 100644
View file @
88ff4d98
-----
pdType :: !'syntax'.ParsedDefinition -> Maybe 'T'.Type
-----
funcname pdType
whitespace
punctuation ::
whitespace
punctuation !'
qualified syntax
punctuation '.
type ParsedDefinition
whitespace
punctuation ->
whitespace
type Maybe
whitespace
punctuation '
qualified T
punctuation '.
type 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