<commit_before>{
    "name": "fsharp",
    "scopeName": "source.fsharp",
    "fileTypes": [
        "fs"
    ],
    "foldingStartMarker": "",
    "foldingStopMarker": "",
    "patterns": [
        {
            "include": "#compiler_directives"
        },
        {
            "include": "#comments"
        },
        {
            "include": "#constants"
        },
        {
            "include": "#strings"
        },
        {
            "include": "#chars"
        },
        {
            "include": "#double_tick"
        },
        {
            "include": "#definition"
        },
        {
            "include": "#abstract_definition"
        },
        {
            "include": "#attributes"
        },
        {
            "include": "#modules"
        },
        {
            "include": "#anonymous_functions"
        },
        {
            "include": "#du_declaration"
        },
        {
            "include": "#record_declaration"
        },
        {
            "include": "#records"
        },
        {
            "include": "#strp_inlined"
        },
        {
            "include": "#keywords"
        },
        {
            "include": "#cexprs"
        },
        {
            "include": "#text"
        }
    ],
    "repository": {
        "strp_inlined_body": {
            "patterns": [
                {
                    "include": "#comments"
                },
                {
                    "include": "#anonymous_functions"
                },
                {
                    "match": "(\\^[[:alpha:]0-9'._]+)",
                    "captures": {
                        "1": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "name": "keyword.fsharp",
                    "match": "\\b(and|when|or)\\b"
                },
                {
                    "begin": "(\\()",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "end": "(\\))",
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#strp_inlined_body"
                        }
                    ]
                },
                {
                    "match": "(static member|member)\\s*([[:alpha:]0-9'`<>^._]+|``[[:alpha:]0-9' <>^._]+``)\\s*(:)",
                    "captures": {
                        "1": {
                            "name": "keyword.fsharp"
                        },
                        "2": {
                            "name": "variable.fsharp"
                        },
                        "3": {
                            "name": "keyword.symbol.fsharp"
                        }
                    }
                },
                {
                    "include": "#compiler_directives"
                },
                {
                    "include": "#constants"
                },
                {
                    "include": "#strings"
                },
                {
                    "include": "#chars"
                },
                {
                    "include": "#double_tick"
                },
                {
                    "include": "#keywords"
                },
                {
                    "include": "#text"
                },
                {
                    "include": "#definition"
                },
                {
                    "include": "#attributes"
                },
                {
                    "include": "#keywords"
                },
                {
                    "include": "#cexprs"
                },
                {
                    "include": "#text"
                }
            ]
        },
        "strp_inlined": {
            "patterns": [
                {
                    "begin": "(\\()",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "end": "(\\))",
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#strp_inlined_body"
                        }
                    ]
                }
            ]
        },
        "generic_declaration": {
            "patterns": [
                {
                    "comments": "SRTP syntax support",
                    "begin": "(:)\\s*(\\()\\s*(static member|member)",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "3": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "end": "(\\))",
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "begin": "(\\()",
                            "beginCaptures": {
                                "1": {
                                    "name": "keyword.symbol.fsharp"
                                }
                            },
                            "end": "(\\))",
                            "endCaptures": {
                                "1": {
                                    "name": "keyword.symbol.fsharp"
                                }
                            },
                            "patterns": [
                                {
                                    "include": "#member_declaration"
                                }
                            ]
                        },
                        {
                            "match": "(('|\\^)[[:alpha:]0-9'._]+)",
                            "captures": {
                                "1": {
                                    "name": "entity.name.type.fsharp"
                                }
                            }
                        },
                        {
                            "include": "#variables"
                        },
                        {
                            "include": "#keywords"
                        }
                    ]
                },
                {
                    "name": "keyword.fsharp",
                    "match": "\\b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|enum|member|try|finally|and|when|or|use|use\\!|struct|while|mutable|assert|base|done|downcast|downto|extern|fixed|global|lazy|upcast|not)(?!')\\b"
                },
                {
                    "name": "keyword.fsharp",
                    "match": ":"
                },
                {
                    "include": "#constants"
                },
                {
                    "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": "#generic_declaration"
                        }
                    ]
                },
                {
                    "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"
                        }
                    ]
                },
                {
                    "match": "(?!when|and|or\\b)\\b([\\w0-9'`^._]+)",
                    "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted",
                    "captures": {
                        "1": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "match": "(\\|)",
                    "comments": "Prevent captures of `|>` as a keyword when defining custom operator like `<|>`",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    }
                },
                {
                    "include": "#keywords"
                }
            ]
        },
        "anonymous_record_declaration": {
            "begin": "(\\{\\|)",
            "end": "(\\|\\})",
            "beginCaptures": {
                "1": {
                    "name": "keyword.symbol.fsharp"
                }
            },
            "endCaptures": {
                "1": {
                    "name": "keyword.symbol.fsharp"
                }
            },
            "patterns": [
                {
                    "match": "[[:alpha:]0-9'`^_ ]+(:)",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    }
                },
                {
                    "match": "([[:alpha:]0-9'`^_ ]+)",
                    "captures": {
                        "1": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "include": "#anonymous_record_declaration"
                },
                {
                    "include": "#keywords"
                }
            ]
        },
        "record_signature": {
            "patterns": [
                {
                    "match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "variable.parameter.fsharp"
                        }
                    }
                },
                {
                    "begin": "({)",
                    "end": "(})",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)",
                            "captures": {
                                "1": {
                                    "name": "keyword.symbol.fsharp"
                                },
                                "2": {
                                    "name": "variable.parameter.fsharp"
                                }
                            }
                        },
                        {
                            "include": "#record_signature"
                        }
                    ]
                },
                {
                    "include": "#keywords"
                }
            ]
        },
        "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": [
                {
                    "name": "function.anonymous",
                    "begin": "\\b(fun)\\b",
                    "end": "(->)",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#comments"
                        },
                        {
                            "begin": "(\\()",
                            "end": "\\s*(?=(->))",
                            "beginCaptures": {
                                "1": {
                                    "name": "keyword.symbol.fsharp"
                                }
                            },
                            "endCaptures": {
                                "1": {
                                    "name": "keyword.symbol.fsharp"
                                }
                            },
                            "patterns": [
                                {
                                    "include": "#member_declaration"
                                }
                            ]
                        },
                        {
                            "include": "#variables"
                        }
                    ]
                }
            ]
        },
        "attributes": {
            "patterns": [
                {
                    "name": "support.function.attribute.fsharp",
                    "begin": "\\[\\<",
                    "end": "\\>\\]|\\]",
                    "patterns": [
                        {
                            "include": "$self"
                        }
                    ]
                }
            ]
        },
        "comments": {
            "patterns": [
                {
                    "name": "comment.block.markdown.fsharp",
                    "begin": "^\\s*(\\(\\*\\*(?!\\)))(?!\\*\\))$",
                    "while": "^(?!\\s*\\*\\)$)",
                    "beginCaptures": {
                        "1": {
                            "name": "comment.block.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "comment.block.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "text.html.markdown"
                        }
                    ]
                },
                {
                    "name": "comment.block.markdown.fsharp.end",
                    "match": "^(\\s*\\*\\)$)",
                    "captures": {
                        "1": {
                            "name": "comment.block.fsharp"
                        }
                    }
                },
                {
                    "name": "comment.block.fsharp",
                    "begin": "(\\(\\*(?!\\)))",
                    "end": "(\\*\\))",
                    "beginCaptures": {
                        "1": {
                            "name": "comment.block.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "comment.block.fsharp"
                        }
                    }
                },
                {
                    "name": "comment.line.markdown.fsharp",
                    "begin": "///",
                    "while": "///",
                    "patterns": [
                        {
                            "include": "text.html.markdown"
                        }
                    ]
                },
                {
                    "name": "comment.line.double-slash.fsharp",
                    "match": "//.*$"
                }
            ]
        },
        "constants": {
            "patterns": [
                {
                    "name": "constant.language.unit.fsharp",
                    "match": "\\(\\)"
                },
                {
                    "name": "constant.numeric.floating-point.fsharp",
                    "match": "\\b-?[0-9][0-9_]*((\\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))"
                },
                {
                    "name": "constant.numeric.integer.nativeint.fsharp",
                    "match": "\\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))"
                },
                {
                    "name": "constant.others.fsharp",
                    "match": "\\b(true|false|null|unit|void)\\b"
                }
            ]
        },
        "abstract_definition": {
            "name": "abstract.definition.fsharp",
            "begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(:)",
            "end": "\\s*(with)\\b|=|$",
            "beginCaptures": {
                "1": {
                    "name": "keyword.fsharp"
                },
                "2": {
                    "name": "keyword.fsharp"
                },
                "3": {
                    "name": "support.function.attribute.fsharp"
                },
                "5": {
                    "name": "keyword.fsharp"
                }
            },
            "endCaptures": {
                "1": {
                    "name": "keyword.fsharp"
                }
            },
            "patterns": [
                {
                    "include": "#comments"
                },
                {
                    "include": "#common_declaration"
                },
                {
                    "match": "(\\?{0,1})([[:alpha:]0-9'`^._ ]+)\\s*(:)((?!with\\b)\\b([\\w0-9'`^._ ]+)){0,1}",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "variable.parameter.fsharp"
                        },
                        "3": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "4": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "match": "(?!with|get|set\\b)\\b([\\w0-9'`^._]+)",
                    "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted",
                    "captures": {
                        "1": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "include": "#keywords"
                }
            ]
        },
        "common_binding_definition": {
            "patterns": [
                {
                    "include": "#comments"
                },
                {
                    "include": "#attributes"
                },
                {
                    "comments": "SRTP syntax support",
                    "begin": "(:)\\s*(\\()\\s*(static member|member)",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "3": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "end": "(\\))\\s*((?=,)|(?=\\=))",
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "match": "(\\^[[:alpha:]0-9'._]+)",
                            "captures": {
                                "1": {
                                    "name": "entity.name.type.fsharp"
                                }
                            }
                        },
                        {
                            "include": "#variables"
                        },
                        {
                            "include": "#keywords"
                        }
                    ]
                },
                {
                    "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"
                        }
                    ]
                },
                {
                    "begin": "(:)\\s*(\\^[[:alpha:]0-9'._]+)\\s*(when)",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "entity.name.type.fsharp"
                        },
                        "3": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "end": "(?=:)",
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "name": "keyword.fsharp",
                            "match": "\\b(and|when|or)\\b"
                        },
                        {
                            "comment": "Because we first capture the keywords, we can capture what looks like a word and assume it's an entity definition",
                            "match": "([[:alpha:]0-9'^._]+)",
                            "captures": {
                                "1": {
                                    "name": "entity.name.type.fsharp"
                                }
                            }
                        },
                        {
                            "name": "keyword.symbol.fsharp",
                            "match": "(\\(|\\))"
                        }
                    ]
                },
                {
                    "match": "(:)\\s*([?[:alpha:]0-9'`^._ ]+)",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "match": "(->)\\s*(\\()?\\s*([?[:alpha:]0-9'`^._ ]+)*",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "3": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "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": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "begin": "(<+(?![[:space:]]*\\)))",
                    "beginComment": "The group (?![[:space:]]*\\) is for protection against overload operator. static member (<)",
                    "end": "((?<!:)>|\\))",
                    "endComment": "The group (?<!:) prevent us from stopping on :> when using SRTP synthax",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#generic_declaration"
                        }
                    ]
                },
                {
                    "include": "#anonymous_record_declaration"
                },
                {
                    "begin": "({)",
                    "end": "(})",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#record_signature"
                        }
                    ]
                },
                {
                    "include": "#definition"
                },
                {
                    "match": "(?<=>)\\s*(``([[:alpha:]0-9'^._ ]+)``|[[:alpha:]0-9'`^._]+)",
                    "captures": {
                        "1": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "include": "#variables"
                },
                {
                    "include": "#keywords"
                }
            ]
        },
        "definition": {
            "patterns": [
                {
                    "name": "binding.fsharp",
                    "begin": "\\b(let mutable|static let mutable|let inline|let|member val|static member inline|static member|default|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+=|(?<=\\=))",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        },
                        "2": {
                            "name": "keyword.fsharp"
                        },
                        "3": {
                            "name": "support.function.attribute.fsharp"
                        },
                        "4": {
                            "name": "keyword.fsharp"
                        },
                        "5": {
                            "name": "variable.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#common_binding_definition"
                        }
                    ]
                },
                {
                    "name": "binding.fsharp",
                    "begin": "\\b((get|set)\\s*(?=\\())(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?",
                    "end": "\\s*(=|\\n+=|(?<=\\=))",
                    "beginCaptures": {
                        "3": {
                            "name": "variable.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#common_binding_definition"
                        }
                    ]
                },
                {
                    "name": "binding.fsharp",
                    "begin": "\\b(static val mutable|val mutable|val)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?",
                    "end": "\\n$",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        },
                        "2": {
                            "name": "keyword.fsharp"
                        },
                        "3": {
                            "name": "support.function.attribute.fsharp"
                        },
                        "4": {
                            "name": "keyword.fsharp"
                        },
                        "5": {
                            "name": "variable.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#common_binding_definition"
                        }
                    ]
                },
                {
                    "name": "binding.fsharp",
                    "begin": "\\b(new)",
                    "end": "(=)",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#common_binding_definition"
                        }
                    ]
                }<commit_msg>Fix #135: Secure new capture with a word-break check (#136)<commit_after>{
    "name": "fsharp",
    "scopeName": "source.fsharp",
    "fileTypes": [
        "fs"
    ],
    "foldingStartMarker": "",
    "foldingStopMarker": "",
    "patterns": [
        {
            "include": "#compiler_directives"
        },
        {
            "include": "#comments"
        },
        {
            "include": "#constants"
        },
        {
            "include": "#strings"
        },
        {
            "include": "#chars"
        },
        {
            "include": "#double_tick"
        },
        {
            "include": "#definition"
        },
        {
            "include": "#abstract_definition"
        },
        {
            "include": "#attributes"
        },
        {
            "include": "#modules"
        },
        {
            "include": "#anonymous_functions"
        },
        {
            "include": "#du_declaration"
        },
        {
            "include": "#record_declaration"
        },
        {
            "include": "#records"
        },
        {
            "include": "#strp_inlined"
        },
        {
            "include": "#keywords"
        },
        {
            "include": "#cexprs"
        },
        {
            "include": "#text"
        }
    ],
    "repository": {
        "strp_inlined_body": {
            "patterns": [
                {
                    "include": "#comments"
                },
                {
                    "include": "#anonymous_functions"
                },
                {
                    "match": "(\\^[[:alpha:]0-9'._]+)",
                    "captures": {
                        "1": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "name": "keyword.fsharp",
                    "match": "\\b(and|when|or)\\b"
                },
                {
                    "begin": "(\\()",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "end": "(\\))",
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#strp_inlined_body"
                        }
                    ]
                },
                {
                    "match": "(static member|member)\\s*([[:alpha:]0-9'`<>^._]+|``[[:alpha:]0-9' <>^._]+``)\\s*(:)",
                    "captures": {
                        "1": {
                            "name": "keyword.fsharp"
                        },
                        "2": {
                            "name": "variable.fsharp"
                        },
                        "3": {
                            "name": "keyword.symbol.fsharp"
                        }
                    }
                },
                {
                    "include": "#compiler_directives"
                },
                {
                    "include": "#constants"
                },
                {
                    "include": "#strings"
                },
                {
                    "include": "#chars"
                },
                {
                    "include": "#double_tick"
                },
                {
                    "include": "#keywords"
                },
                {
                    "include": "#text"
                },
                {
                    "include": "#definition"
                },
                {
                    "include": "#attributes"
                },
                {
                    "include": "#keywords"
                },
                {
                    "include": "#cexprs"
                },
                {
                    "include": "#text"
                }
            ]
        },
        "strp_inlined": {
            "patterns": [
                {
                    "begin": "(\\()",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "end": "(\\))",
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#strp_inlined_body"
                        }
                    ]
                }
            ]
        },
        "generic_declaration": {
            "patterns": [
                {
                    "comments": "SRTP syntax support",
                    "begin": "(:)\\s*(\\()\\s*(static member|member)",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "3": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "end": "(\\))",
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "begin": "(\\()",
                            "beginCaptures": {
                                "1": {
                                    "name": "keyword.symbol.fsharp"
                                }
                            },
                            "end": "(\\))",
                            "endCaptures": {
                                "1": {
                                    "name": "keyword.symbol.fsharp"
                                }
                            },
                            "patterns": [
                                {
                                    "include": "#member_declaration"
                                }
                            ]
                        },
                        {
                            "match": "(('|\\^)[[:alpha:]0-9'._]+)",
                            "captures": {
                                "1": {
                                    "name": "entity.name.type.fsharp"
                                }
                            }
                        },
                        {
                            "include": "#variables"
                        },
                        {
                            "include": "#keywords"
                        }
                    ]
                },
                {
                    "name": "keyword.fsharp",
                    "match": "\\b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|enum|member|try|finally|and|when|or|use|use\\!|struct|while|mutable|assert|base|done|downcast|downto|extern|fixed|global|lazy|upcast|not)(?!')\\b"
                },
                {
                    "name": "keyword.fsharp",
                    "match": ":"
                },
                {
                    "include": "#constants"
                },
                {
                    "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": "#generic_declaration"
                        }
                    ]
                },
                {
                    "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"
                        }
                    ]
                },
                {
                    "match": "(?!when|and|or\\b)\\b([\\w0-9'`^._]+)",
                    "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted",
                    "captures": {
                        "1": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "match": "(\\|)",
                    "comments": "Prevent captures of `|>` as a keyword when defining custom operator like `<|>`",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    }
                },
                {
                    "include": "#keywords"
                }
            ]
        },
        "anonymous_record_declaration": {
            "begin": "(\\{\\|)",
            "end": "(\\|\\})",
            "beginCaptures": {
                "1": {
                    "name": "keyword.symbol.fsharp"
                }
            },
            "endCaptures": {
                "1": {
                    "name": "keyword.symbol.fsharp"
                }
            },
            "patterns": [
                {
                    "match": "[[:alpha:]0-9'`^_ ]+(:)",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    }
                },
                {
                    "match": "([[:alpha:]0-9'`^_ ]+)",
                    "captures": {
                        "1": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "include": "#anonymous_record_declaration"
                },
                {
                    "include": "#keywords"
                }
            ]
        },
        "record_signature": {
            "patterns": [
                {
                    "match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "variable.parameter.fsharp"
                        }
                    }
                },
                {
                    "begin": "({)",
                    "end": "(})",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)",
                            "captures": {
                                "1": {
                                    "name": "keyword.symbol.fsharp"
                                },
                                "2": {
                                    "name": "variable.parameter.fsharp"
                                }
                            }
                        },
                        {
                            "include": "#record_signature"
                        }
                    ]
                },
                {
                    "include": "#keywords"
                }
            ]
        },
        "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": [
                {
                    "name": "function.anonymous",
                    "begin": "\\b(fun)\\b",
                    "end": "(->)",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#comments"
                        },
                        {
                            "begin": "(\\()",
                            "end": "\\s*(?=(->))",
                            "beginCaptures": {
                                "1": {
                                    "name": "keyword.symbol.fsharp"
                                }
                            },
                            "endCaptures": {
                                "1": {
                                    "name": "keyword.symbol.fsharp"
                                }
                            },
                            "patterns": [
                                {
                                    "include": "#member_declaration"
                                }
                            ]
                        },
                        {
                            "include": "#variables"
                        }
                    ]
                }
            ]
        },
        "attributes": {
            "patterns": [
                {
                    "name": "support.function.attribute.fsharp",
                    "begin": "\\[\\<",
                    "end": "\\>\\]|\\]",
                    "patterns": [
                        {
                            "include": "$self"
                        }
                    ]
                }
            ]
        },
        "comments": {
            "patterns": [
                {
                    "name": "comment.block.markdown.fsharp",
                    "begin": "^\\s*(\\(\\*\\*(?!\\)))(?!\\*\\))$",
                    "while": "^(?!\\s*\\*\\)$)",
                    "beginCaptures": {
                        "1": {
                            "name": "comment.block.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "comment.block.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "text.html.markdown"
                        }
                    ]
                },
                {
                    "name": "comment.block.markdown.fsharp.end",
                    "match": "^(\\s*\\*\\)$)",
                    "captures": {
                        "1": {
                            "name": "comment.block.fsharp"
                        }
                    }
                },
                {
                    "name": "comment.block.fsharp",
                    "begin": "(\\(\\*(?!\\)))",
                    "end": "(\\*\\))",
                    "beginCaptures": {
                        "1": {
                            "name": "comment.block.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "comment.block.fsharp"
                        }
                    }
                },
                {
                    "name": "comment.line.markdown.fsharp",
                    "begin": "///",
                    "while": "///",
                    "patterns": [
                        {
                            "include": "text.html.markdown"
                        }
                    ]
                },
                {
                    "name": "comment.line.double-slash.fsharp",
                    "match": "//.*$"
                }
            ]
        },
        "constants": {
            "patterns": [
                {
                    "name": "constant.language.unit.fsharp",
                    "match": "\\(\\)"
                },
                {
                    "name": "constant.numeric.floating-point.fsharp",
                    "match": "\\b-?[0-9][0-9_]*((\\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))"
                },
                {
                    "name": "constant.numeric.integer.nativeint.fsharp",
                    "match": "\\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))"
                },
                {
                    "name": "constant.others.fsharp",
                    "match": "\\b(true|false|null|unit|void)\\b"
                }
            ]
        },
        "abstract_definition": {
            "name": "abstract.definition.fsharp",
            "begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(:)",
            "end": "\\s*(with)\\b|=|$",
            "beginCaptures": {
                "1": {
                    "name": "keyword.fsharp"
                },
                "2": {
                    "name": "keyword.fsharp"
                },
                "3": {
                    "name": "support.function.attribute.fsharp"
                },
                "5": {
                    "name": "keyword.fsharp"
                }
            },
            "endCaptures": {
                "1": {
                    "name": "keyword.fsharp"
                }
            },
            "patterns": [
                {
                    "include": "#comments"
                },
                {
                    "include": "#common_declaration"
                },
                {
                    "match": "(\\?{0,1})([[:alpha:]0-9'`^._ ]+)\\s*(:)((?!with\\b)\\b([\\w0-9'`^._ ]+)){0,1}",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "variable.parameter.fsharp"
                        },
                        "3": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "4": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "match": "(?!with|get|set\\b)\\b([\\w0-9'`^._]+)",
                    "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted",
                    "captures": {
                        "1": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "include": "#keywords"
                }
            ]
        },
        "common_binding_definition": {
            "patterns": [
                {
                    "include": "#comments"
                },
                {
                    "include": "#attributes"
                },
                {
                    "comments": "SRTP syntax support",
                    "begin": "(:)\\s*(\\()\\s*(static member|member)",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "3": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "end": "(\\))\\s*((?=,)|(?=\\=))",
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "match": "(\\^[[:alpha:]0-9'._]+)",
                            "captures": {
                                "1": {
                                    "name": "entity.name.type.fsharp"
                                }
                            }
                        },
                        {
                            "include": "#variables"
                        },
                        {
                            "include": "#keywords"
                        }
                    ]
                },
                {
                    "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"
                        }
                    ]
                },
                {
                    "begin": "(:)\\s*(\\^[[:alpha:]0-9'._]+)\\s*(when)",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "entity.name.type.fsharp"
                        },
                        "3": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "end": "(?=:)",
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "name": "keyword.fsharp",
                            "match": "\\b(and|when|or)\\b"
                        },
                        {
                            "comment": "Because we first capture the keywords, we can capture what looks like a word and assume it's an entity definition",
                            "match": "([[:alpha:]0-9'^._]+)",
                            "captures": {
                                "1": {
                                    "name": "entity.name.type.fsharp"
                                }
                            }
                        },
                        {
                            "name": "keyword.symbol.fsharp",
                            "match": "(\\(|\\))"
                        }
                    ]
                },
                {
                    "match": "(:)\\s*([?[:alpha:]0-9'`^._ ]+)",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "match": "(->)\\s*(\\()?\\s*([?[:alpha:]0-9'`^._ ]+)*",
                    "captures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "3": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "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": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        },
                        "2": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "begin": "(<+(?![[:space:]]*\\)))",
                    "beginComment": "The group (?![[:space:]]*\\) is for protection against overload operator. static member (<)",
                    "end": "((?<!:)>|\\))",
                    "endComment": "The group (?<!:) prevent us from stopping on :> when using SRTP synthax",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#generic_declaration"
                        }
                    ]
                },
                {
                    "include": "#anonymous_record_declaration"
                },
                {
                    "begin": "({)",
                    "end": "(})",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.symbol.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#record_signature"
                        }
                    ]
                },
                {
                    "include": "#definition"
                },
                {
                    "match": "(?<=>)\\s*(``([[:alpha:]0-9'^._ ]+)``|[[:alpha:]0-9'`^._]+)",
                    "captures": {
                        "1": {
                            "name": "entity.name.type.fsharp"
                        }
                    }
                },
                {
                    "include": "#variables"
                },
                {
                    "include": "#keywords"
                }
            ]
        },
        "definition": {
            "patterns": [
                {
                    "name": "binding.fsharp",
                    "begin": "\\b(let mutable|static let mutable|let inline|let|member val|static member inline|static member|default|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+=|(?<=\\=))",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        },
                        "2": {
                            "name": "keyword.fsharp"
                        },
                        "3": {
                            "name": "support.function.attribute.fsharp"
                        },
                        "4": {
                            "name": "keyword.fsharp"
                        },
                        "5": {
                            "name": "variable.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#common_binding_definition"
                        }
                    ]
                },
                {
                    "name": "binding.fsharp",
                    "begin": "\\b((get|set)\\s*(?=\\())(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?",
                    "end": "\\s*(=|\\n+=|(?<=\\=))",
                    "beginCaptures": {
                        "3": {
                            "name": "variable.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#common_binding_definition"
                        }
                    ]
                },
                {
                    "name": "binding.fsharp",
                    "begin": "\\b(static val mutable|val mutable|val)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?",
                    "end": "\\n$",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        },
                        "2": {
                            "name": "keyword.fsharp"
                        },
                        "3": {
                            "name": "support.function.attribute.fsharp"
                        },
                        "4": {
                            "name": "keyword.fsharp"
                        },
                        "5": {
                            "name": "variable.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#common_binding_definition"
                        }
                    ]
                },
                {
                    "name": "binding.fsharp",
                    "begin": "\\b(new)\\b",
                    "end": "(=)",
                    "beginCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "endCaptures": {
                        "1": {
                            "name": "keyword.fsharp"
                        }
                    },
                    "patterns": [
                        {
                            "include": "#common_binding_definition"
                        }
                    ]
                }
{'fraction_non_alphanumeric': 0.14598102845731403, 'fraction_numerical': 0.006162185293488339, 'mean_word_length': 0.5220912308126533, 'pattern_counts': {'":': 1036, '<': 39, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '190445', 'n_tokens_mistral': 17360, 'n_tokens_neox': 15397, 'n_words': 1761}