Verified Commit f2282f68 authored by Camil Staps's avatar Camil Staps 🙂

v0.1.15: Recognise strings in patterns (resolves #10)

parent b3e1091d
......@@ -215,6 +215,7 @@ var highlightRules = {
[/(\[\|)/, ['punctuation']], /* overloaded list */
[/([:\[\](),{}=])/, ['punctuation']],
[/(\|})/, ['punctuation']],
[/(")/, ['literal literal-string'], 'string'],
[/(\|)/, ['punctuation'], 'jump:guard'],
[/(#)/, ['punctuation']],
[/([A-Z][^:\[\](),{}=\s]+)/, ['constructor']],
......
{
"name": "clean-highlighter",
"version": "0.1.14",
"version": "0.1.15",
"description": "Clean language highlighter",
"keywords": ["clean","highlighter"],
"main": "clean.js",
......
-----
tMApp :: !(InhMkImg i) !ExprId !(Maybe TypeName) !ModuleName !VarName ![TExpr]
!TPriority !(Maybe VarPtr) !*TagSource
-> *(!SynMkImg, !*TagSource) | BlueprintLike i
tMApp inh _ _ "iTasks.Extensions.User" "@:" [lhsExpr : rhsExpr : _] _ _ tsrc
= tAssign inh lhsExpr rhsExpr tsrc
tMApp inh _ _ "iTasks.Core.Types" ">>|" [lhsExpr : rhsExpr : _] _ _ tsrc
= tBind inh lhsExpr Nothing rhsExpr tsrc
tMApp inh _ _ "iTasks.Core.Types" ">>=" [lhsExpr : TLam vars rhsExpr : _] _ _ tsrc
# var = case filterLamVars vars of
[var : _] = Just var
_ = Nothing
= tBind inh lhsExpr var rhsExpr tsrc
-----
funcname tMApp
whitespace
punctuation ::
whitespace
punctuation !(
type InhMkImg
whitespace
typevar i
punctuation )
whitespace
punctuation !
type ExprId
whitespace
punctuation !(
type Maybe
whitespace
type TypeName
punctuation )
whitespace
punctuation !
type ModuleName
whitespace
punctuation !
type VarName
whitespace
punctuation ![
type TExpr
punctuation ]
whitespace \n
punctuation !
type TPriority
whitespace
punctuation !(
type Maybe
whitespace
type VarPtr
punctuation )
whitespace
punctuation !*
type TagSource
whitespace \n
punctuation ->
whitespace
punctuation *(!
type SynMkImg
punctuation ,
whitespace
punctuation !*
type TagSource
punctuation )
whitespace
punctuation |
whitespace
classname BlueprintLike
whitespace
typevar i
whitespace \n
funcname tMApp
whitespace
argument inh
whitespace
argument _
whitespace
argument _
whitespace
literal literal-string "iTasks.Extensions.User"
whitespace
literal literal-string "@:"
whitespace
punctuation [
argument lhsExpr
whitespace
punctuation :
whitespace
argument rhsExpr
whitespace
punctuation :
whitespace
argument _
punctuation ]
whitespace
argument _
whitespace
argument _
whitespace
argument tsrc
whitespace \n
punctuation =
whitespace
funcname funcname-onlyused tAssign
whitespace
argumentinrhs inh
whitespace
argumentinrhs lhsExpr
whitespace
argumentinrhs rhsExpr
whitespace
argumentinrhs tsrc
whitespace \n
funcname tMApp
whitespace
argument inh
whitespace
argument _
whitespace
argument _
whitespace
literal literal-string "iTasks.Core.Types"
whitespace
literal literal-string ">>|"
whitespace
punctuation [
argument lhsExpr
whitespace
punctuation :
whitespace
argument rhsExpr
whitespace
punctuation :
whitespace
argument _
punctuation ]
whitespace
argument _
whitespace
argument _
whitespace
argument tsrc
whitespace \n
punctuation =
whitespace
funcname funcname-onlyused tBind
whitespace
argumentinrhs inh
whitespace
argumentinrhs lhsExpr
whitespace
constructor Nothing
whitespace
argumentinrhs rhsExpr
whitespace
argumentinrhs tsrc
whitespace \n
funcname tMApp
whitespace
argument inh
whitespace
argument _
whitespace
argument _
whitespace
literal literal-string "iTasks.Core.Types"
whitespace
literal literal-string ">>="
whitespace
punctuation [
argument lhsExpr
whitespace
punctuation :
whitespace
constructor TLam
whitespace
argument vars
whitespace
argument rhsExpr
whitespace
punctuation :
whitespace
argument _
punctuation ]
whitespace
argument _
whitespace
argument _
whitespace
argument tsrc
whitespace \n
punctuation #
whitespace
argument var
whitespace
punctuation =
whitespace
keyword case
whitespace
funcname funcname-onlyused filterLamVars
whitespace
argumentinrhs vars
whitespace
keyword of
whitespace \n
punctuation [
argument var
whitespace
punctuation :
whitespace
argument _
punctuation ]
whitespace
punctuation =
whitespace
constructor Just
whitespace
argumentinrhs var
whitespace \n
argument _
whitespace
punctuation =
whitespace
constructor Nothing
whitespace \n
punctuation =
whitespace
funcname funcname-onlyused tBind
whitespace
funcname funcname-onlyused inh
whitespace
funcname funcname-onlyused lhsExpr
whitespace
funcname funcname-onlyused var
whitespace
funcname funcname-onlyused rhsExpr
whitespace
funcname funcname-onlyused tsrc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment