Skip to content

Commit

Permalink
update grammars
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed Oct 4, 2018
1 parent 84f1d0d commit 10a1d2a
Show file tree
Hide file tree
Showing 17 changed files with 1,489 additions and 403 deletions.
182 changes: 112 additions & 70 deletions extensions/fsharp/syntaxes/fsharp.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/ionide/ionide-fsgrammar/commit/67c9f45ebbbd5a12d89ffad1661caf8452f1d552",
"version": "https://github.com/ionide/ionide-fsgrammar/commit/eb210da2bfea65a7dff46d22c97a0e9e410a9469",
"name": "fsharp",
"scopeName": "source.fsharp",
"patterns": [
Expand Down Expand Up @@ -64,7 +64,7 @@
"generic_declaration": {
"patterns": [
{
"match": "([^<>,])",
"match": "([^<>,*()-])",
"captures": {
"1": {
"name": "entity.name.type.fsharp"
Expand All @@ -86,13 +86,16 @@
},
"patterns": [
{
"match": "([^<>,])",
"match": "([^<>,*()-])",
"captures": {
"1": {
"name": "entity.name.type.fsharp"
}
}
},
{
"include": "#tuple_signature"
},
{
"include": "#generic_declaration"
}
Expand Down Expand Up @@ -151,6 +154,48 @@
}
]
},
"tuple_signature": {
"patterns": [
{
"match": "(([?[:alpha:]0-9'`^._ ]+))+",
"captures": {
"1": {
"name": "entity.name.type.fsharp"
}
}
},
{
"begin": "(\\()",
"end": "(\\))",
"beginCaptures": {
"1": {
"name": "keyword.symbol.fsharp"
}
},
"endCaptures": {
"1": {
"name": "keyword.symbol.fsharp"
}
},
"patterns": [
{
"match": "(([?[:alpha:]0-9'`^._ ]+))+",
"captures": {
"1": {
"name": "entity.name.type.fsharp"
}
}
},
{
"include": "#tuple_signature"
}
]
},
{
"include": "#keywords"
}
]
},
"anonymous_functions": {
"patterns": [
{
Expand Down Expand Up @@ -351,7 +396,7 @@
{
"name": "binding.fsharp",
"begin": "\\b(val mutable|val|let mutable|let inline|let|member val|member|static member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?",
"end": "\\s*(with\\b|=|\\n+=)",
"end": "\\s*(with\\b|=|\\n+=|(?<=\\=))",
"beginCaptures": {
"1": {
"name": "keyword.fsharp"
Expand Down Expand Up @@ -379,21 +424,35 @@
"include": "#comments"
},
{
"match": "(:)\\s*(\\()?\\s*(([?[:alpha:]0-9'`^._ ]+))*",
"captures": {
"include": "#attributes"
},
{
"begin": "(:)\\s*(\\()",
"beginCaptures": {
"1": {
"name": "keyword.symbol.fsharp"
},
"2": {
"name": "keyword.symbol.fsharp"
}
},
"end": "(\\)\\s*(([?[:alpha:]0-9'`^._ ]+))+)",
"endCaptures": {
"1": {
"name": "keyword.symbol.fsharp"
},
"3": {
"2": {
"name": "entity.name.type.fsharp"
}
}
},
"patterns": [
{
"include": "#tuple_signature"
}
]
},
{
"match": "(\\*\\s*\\()\\s*(([?[:alpha:]0-9'`^._ ]+))*",
"match": "(:)\\s*([?[:alpha:]0-9'`^._ ]+)*",
"captures": {
"1": {
"name": "keyword.symbol.fsharp"
Expand All @@ -417,6 +476,31 @@
}
}
},
{
"begin": "(\\*)\\s*(\\()",
"beginCaptures": {
"1": {
"name": "keyword.symbol.fsharp"
},
"2": {
"name": "keyword.symbol.fsharp"
}
},
"end": "(\\)\\s*(([?[:alpha:]0-9'`^._ ]+))+)",
"endCaptures": {
"1": {
"name": "keyword.symbol.fsharp"
},
"2": {
"name": "entity.name.type.fsharp"
}
},
"patterns": [
{
"include": "#tuple_signature"
}
]
},
{
"match": "(\\*)(\\s*([?[:alpha:]0-9'`^._ ]+))*",
"captures": {
Expand All @@ -429,7 +513,7 @@
}
},
{
"begin": "(<)",
"begin": "(<(?![[:space:]]*\\)))",
"end": "(>)",
"beginCaptures": {
"1": {
Expand Down Expand Up @@ -717,7 +801,7 @@
"patterns": [
{
"name": "entity.name.type.format.specifier.fsharp",
"match": "(%0?-?(\\d+)?((a|t)|(\\.\\d+)?(f|F|e|E|g|G|M)|(b|c|s|d|i|x|X|o)|(s|b|O)|(\\+?A)))",
"match": "(%0?-?(\\d+)?((a|t)|(\\.\\d+)?(f|F|e|E|g|G|M)|(b|c|s|d|i|x|X|o|u)|(s|b|O)|(\\+?A)))",
"captures": {
"1": {
"name": "keyword.format.specifier.fsharp"
Expand All @@ -734,7 +818,7 @@
},
{
"name": "variable.parameter.fsharp",
"match": "[[:alpha:]0-9'`<>^._ ]\\w*"
"match": "``[[:alpha:]0-9'`^:,._ ]+``|[[:alpha:]0-9'`<>^._ ]\\w*"
}
]
},
Expand Down Expand Up @@ -774,7 +858,7 @@
]
},
{
"match": "\\s*(->)\\s*([[:alpha:]0-9'`^._ ]+)",
"match": "\\s*(->)\\s*(?!with|get|set\\b)\\b([\\w0-9'`^._]+)",
"captures": {
"1": {
"name": "keyword.symbol.fsharp"
Expand Down Expand Up @@ -888,7 +972,7 @@
"patterns": [
{
"name": "record.fsharp",
"begin": "\\b(type)[\\s]+(private|internal|public)?(\\s*\\[\\<.*\\>\\])?[\\s]*([[:alpha:]0-9'`^:,._]+|``[[:alpha:]0-9'`^:,._ ]+``)(<)",
"begin": "\\b(type)[\\s]+(private|internal|public)?\\s*",
"end": "\\s*((with)|((as)\\s*([[:alpha:]0-9']+))|(=)|[\\n=]|(\\(\\)))",
"beginCaptures": {
"1": {
Expand All @@ -899,12 +983,6 @@
},
"3": {
"name": "support.function.attribute.fsharp"
},
"4": {
"name": "entity.name.type.fsharp"
},
"5": {
"name": "keyword.symbol.fsharp"
}
},
"endCaptures": {
Expand All @@ -931,6 +1009,20 @@
{
"include": "#comments"
},
{
"include": "#attributes"
},
{
"match": "([[:alpha:]0-9'`^:,._]+|``[[:alpha:]0-9'`^:,._ ]+``)(<)",
"captures": {
"1": {
"name": "entity.name.type.fsharp"
},
"2": {
"name": "keyword.symbol.fsharp"
}
}
},
{
"match": "\\s*(>)\\s*(private|internal|public)?",
"captures": {
Expand All @@ -957,56 +1049,6 @@
"include": "#keywords"
}
]
},
{
"name": "record.fsharp",
"begin": "\\b(type)[\\s]+(private|internal|public)?(\\s*\\[\\<.*\\>\\])?[\\s]*([[:alpha:]0-9'`^:,._]+<(.*)>|[[:alpha:]0-9'^:,._]+|``[[:alpha:]0-9'`^:,._ ]+``)[\\s]?(private|internal|public)?[\\s]*",
"end": "\\s*((with)|((as)\\s*([[:alpha:]0-9']+))|(=)|[\\n=]|(\\(\\)))",
"beginCaptures": {
"1": {
"name": "keyword.fsharp"
},
"2": {
"name": "keyword.fsharp"
},
"3": {
"name": "support.function.attribute.fsharp"
},
"4": {
"name": "entity.name.type.fsharp"
},
"6": {
"name": "keyword.fsharp"
}
},
"endCaptures": {
"2": {
"name": "keyword.fsharp"
},
"3": {
"name": "keyword.fsharp"
},
"4": {
"name": "keyword.fsharp"
},
"5": {
"name": "variable.parameter.fsharp"
},
"6": {
"name": "keyword.symbol.fsharp"
},
"7": {
"name": "constant.language.unit.fsharp"
}
},
"patterns": [
{
"include": "#comments"
},
{
"include": "#member_declaration"
}
]
}
]
},
Expand Down
Loading

0 comments on commit 10a1d2a

Please sign in to comment.