%YAML 1.2 --- # http://www.sublimetext.com/docs/3/syntax.html name: "F#" file_extensions: - fs - fsi - fsx scope: source.fsharp contexts: main: - include: comments - include: constants - include: structure - include: attributes - include: strings - include: definition - include: method_calls - include: modules - include: anonymous_functions - include: keywords anonymous_functions: - match: \b(fun)\b captures: 1: keyword.other.function-definition.fsharp push: - meta_scope: meta.function.anonymous - match: (->) captures: 1: keyword.other.fsharp pop: true - include: variables attributes: - match: '\[\<' push: - meta_scope: support.function.attribute.fsharp - match: '\>\]' pop: true - include: main characters: - match: (') captures: 1: punctuation.definition.string.begin.fsharp push: - meta_scope: string.quoted.single.fsharp - match: (') captures: 1: punctuation.definition.string.end.fsharp pop: true - match: '\\$[ \t]*' scope: punctuation.separator.string.ignore-eol.fsharp - match: '\\([\\""ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})' scope: constant.character.string.escape.fsharp - match: '\\(?![\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8}).' scope: invalid.illeagal.character.string.fsharp comments: - match: \(\*\*?(\*)\) scope: comment.block.fsharp captures: 1: comment.block.empty.fsharp - match: '\(\*[^\)]' push: - meta_scope: comment.block.fsharp - match: \*\) pop: true - include: comments - match: //.*$ scope: comment.line.double-slash.fsharp constants: - match: \(\) scope: constant.language.unit.fsharp - match: '\b-?[0-9][0-9_]*((\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))' scope: constant.numeric.floating-point.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_]*)))' scope: constant.numeric.integer.nativeint.fsharp definition: - match: '\b(val|val|let|and|member|override|use)\s?(rec|inline|mutable)?(\s+\(?([a-zA-Z.\|_][a-zA-Z0-9.|_]*)\)?\w*)\b' captures: 1: keyword.other.binding.fsharp 2: keyword.other.function-recursive.fsharp 3: variable.other.binding.fsharp push: - meta_scope: meta.binding.fsharp - match: "=|$" captures: 1: punctuation.separator.function.type-constraint.fsharp pop: true - include: variables - match: \b(let)\s+((\(\))|(_))\s+= scope: meta.expression.fsharp captures: 1: keyword.other.binding.fsharp 2: keyword.other.function-recursive.fsharp 4: constant.language.unit.fsharp 5: constant.language.ignored.fsharp keywords: - match: ^\s*#\s*(light|if|else|endif|r|I|load|time|help|quit)\b push: - meta_scope: meta.preprocessor.fsharp - match: (\s|$) pop: true - match: \b(new|in|as|if|then|else|elif|for|begin|end|match|with|type|inherit|true|false|null|do)\b scope: keyword.other.fsharp - match: '(\|>|\|?>|\->|\<\-|:>|:|\[|\]|\;|\||_)' scope: entity.name method_calls: - match: '(?