Skip to content

Commit f1abf5a

Browse files
committed
[f#] update grammar
1 parent 7efdde8 commit f1abf5a

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

extensions/fsharp/syntaxes/fsharp.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
{
1717
"include": "#structure"
1818
},
19-
{
20-
"include": "#attributes"
21-
},
2219
{
2320
"include": "#strings"
2421
},
@@ -31,6 +28,9 @@
3128
{
3229
"include": "#definition"
3330
},
31+
{
32+
"include": "#attributes"
33+
},
3434
{
3535
"include": "#method_calls"
3636
},
@@ -59,7 +59,7 @@
5959
{
6060
"name": "function.anonymous",
6161
"begin": "\\b(fun)\\b",
62-
"end": "[(->)\\n]",
62+
"end": "(->)",
6363
"beginCaptures": {
6464
"1": {
6565
"name": "keyword.other.function-definition.fsharp"
@@ -139,7 +139,7 @@
139139
"patterns": [
140140
{
141141
"name": "binding.fsharp",
142-
"begin": "\\b(val mutable|val|let mutable|let inline|let|member|static member|override|let!)(\\s+rec|mutable)?(\\s+private|internal|public)?\\s+(\\([^\\s-]*\\)|[_[:alpha:]]([_[:alpha:]0-9,\\.]|(?<=,)\\s)*)",
142+
"begin": "\\b(val mutable|val|let mutable|let inline|let|member|static member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\([^\\s-]*\\)|[_[:alpha:]]([_[:alpha:]0-9,\\._]|(?<=,)\\s)*)",
143143
"end": "((``.*``)|(with)|=|$)",
144144
"beginCaptures": {
145145
"1": {
@@ -149,9 +149,12 @@
149149
"name": "keyword.other.function-recursive.fsharp"
150150
},
151151
"3": {
152-
"name": "keyword.other.access.fsharp"
152+
"name": "support.function.attribute.fsharp"
153153
},
154154
"4": {
155+
"name": "keyword.other.access.fsharp"
156+
},
157+
"5": {
155158
"name": "variable.other.binding.fsharp"
156159
}
157160
},
@@ -178,7 +181,7 @@
178181
"patterns": [
179182
{
180183
"name": "keyword.other.fsharp",
181-
"match": "\\b(function|yield!|yield|class|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|member|try|finally|and|when|use|use\\!|struct|while)\\b"
184+
"match": "\\b(function|yield!|yield|class|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|member|try|finally|and|when|use|use\\!|struct|while|mutable)\\b"
182185
},
183186
{
184187
"name": "meta.preprocessor.fsharp",
@@ -195,7 +198,7 @@
195198
"patterns": [
196199
{
197200
"name": "entity.name.section.fsharp",
198-
"begin": "\\b(namespace|module)(\\s+public|internal|private)?\\s+([[:alpha:]][[:alpha:]0-9'_. ]*)",
201+
"begin": "\\b(namespace|module)\\s*(public|internal|private)?\\s+([[:alpha:]][[:alpha:]0-9'_. ]*)",
199202
"end": "(\\s|$)",
200203
"beginCaptures": {
201204
"1": {
@@ -389,7 +392,7 @@
389392
"patterns": [
390393
{
391394
"name": "record.fsharp",
392-
"match": "(type)[\\s]+(private|internal|public)?[\\s]*([[:alpha:]0-9'<>^:,. ]+)[\\s]*(\\([[:alpha:]0-9'<>^:,. ]+\\))?[\\s]*((with)|(as [[:alpha:]0-9']+)|(=)|(\\(\\)))",
395+
"match": "(type)[\\s]+(private|internal|public)?[\\s]*([[:alpha:]0-9'<>^:,._ ]+)[\\s]*(\\([[:alpha:]0-9'<>^:,._ ]+\\))?[\\s]*((with)|(as [[:alpha:]0-9']+)|(=)|(\\(\\)))",
393396
"captures": {
394397
"1": {
395398
"name": "keyword.other.fsharp"
@@ -454,5 +457,5 @@
454457
]
455458
}
456459
},
457-
"version": "https://github.com/ionide/ionide-fsgrammar/commit/edb05603ec3f2eb3c633f92df1649e82fe870545"
460+
"version": "https://github.com/ionide/ionide-fsgrammar/commit/f2e3c30f0ebfcc89fb78ad908701159f20516812"
458461
}

0 commit comments

Comments
 (0)