Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion THIRD-PARTY-LICENSES.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -120,9 +120,23 @@ The project uses the following third-party libraries or assets
- **License**: MIT License
- **License Link**: https://github.com/shentao/vue-multiselect/blob/master/LICENSE

### OCamllex

- **Source**: https://github.com/textmate/ocaml.tmbundle/blob/master/Syntaxes/OCamllex.tmLanguage
- **Commit**: 1eff26848b39368414cb4214183a2cba22f12d0e
- **License**: Permission to copy, use, modify, sell and distribute this software is granted. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.
- **License Link**: https://github.com/textmate/ocaml.tmbundle/tree/master#license

### OCamlyacc

- **Source**: https://github.com/textmate/ocaml.tmbundle/blob/master/Syntaxes/OCamlyacc.tmLanguage
- **Commit**: 08a892aef6a4b285b1902d9ed1427653fce53e31
- **License**: Permission to copy, use, modify, sell and distribute this software is granted. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.
- **License Link**: https://github.com/textmate/ocaml.tmbundle/tree/master#license

### Erlang

- **Source**: https://github.com/shentao/vue-multiselect/blob/master/docs/shiki/languages/erlang.tmLanguage.json
- **Commit**: 8092917041f0ae02cbe4c6982deddc931c6adecd
- **License**: MIT License
- **License Link**: https://github.com/shentao/vue-multiselect/blob/master/LICENSE
- **License Link**: https://github.com/shentao/vue-multiselect/blob/master/LICENSE
2 changes: 2 additions & 0 deletions src/Models/TextMateHelper.cs
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,6 +29,8 @@ public static class GrammarUtility
new ExtraGrammar("source.vue", [".vue"], "vue.json"),
new ExtraGrammar("source.erlang", [".erl", ".escript", ".hrl"], "erlang.json"),
new ExtraGrammar("source.ocaml", [".ml", ".mli"], "ocaml.json"),
new ExtraGrammar("source.ocamllex", [".mll"], "ocamllex.json"),
new ExtraGrammar("source.ocamlyacc", [".mly"], "ocamlyacc.json"),
];

private static readonly Dictionary<string, IRawGrammar> s_cachedRawGrammars = new();
Expand Down
6 changes: 3 additions & 3 deletions src/Resources/Grammars/ocaml.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -729,7 +729,7 @@
"commentBlock": {
"begin": "\\(\\*(?!\\*[^\\)])",
"end": "\\*\\)",
"name": "comment constant.regexp meta.separator.markdown",
"name": "comment",
"contentName": "emphasis",
"patterns": [
{
Expand All@@ -743,7 +743,7 @@
"commentDoc": {
"begin": "\\(\\*\\*",
"end": "\\*\\)",
"name": "comment constant.regexp meta.separator.markdown",
"name": "comment",
"patterns": [
{
"match": "\\*"
Expand DownExpand Up@@ -2958,4 +2958,4 @@
}
}
}
}
}
302 changes: 302 additions & 0 deletions src/Resources/Grammars/ocamllex.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
{
"name": "ocamllex",
"scopeName": "source.ocamllex",
"fileTypes": [ "mll" ],
"foldingStartMarker": "{",
"foldingStopMarker": "}",
"keyEquivalent": "^~O",
"patterns": [
{
"begin": "^\\s*({)",
"beginCaptures": {
"1": {
"name": "punctuation.section.embedded.ocaml.begin.ocamllex"
}
},
"end": "^\\s*(})",
"endCaptures": {
"1": {
"name": "punctuation.section.embedded.ocaml.end.ocamllex"
}
},
"name": "meta.embedded.ocaml",
"patterns": [
{
"include": "source.ocaml"
}
]
},
{
"begin": "\\b(let)\\s+([a-z][a-zA-Z0-9'_]*)\\s+=",
"beginCaptures": {
"1": {
"name": "keyword.other.pattern-definition.ocamllex"
},
"2": {
"name": "entity.name.type.pattern.stupid-goddamn-hack.ocamllex"
}
},
"end": "^(?:\\s*let)|(?:\\s*(rule|$))",
"name": "meta.pattern-definition.ocaml",
"patterns": [
{
"include": "#match-patterns"
}
]
},
{
"begin": "(rule|and)\\s+([a-z][a-zA-Z0-9_]*)\\s+(=)\\s+(parse)(?=\\s*$)|((?<!\\|)(\\|)(?!\\|))",
"beginCaptures": {
"1": {
"name": "keyword.other.ocamllex"
},
"2": {
"name": "entity.name.function.entrypoint.ocamllex"
},
"3": {
"name": "keyword.operator.ocamllex"
},
"4": {
"name": "keyword.other.ocamllex"
},
"5": {
"name": "punctuation.separator.match-pattern.ocamllex"
}
},
"end": "(?:^\\s*((and)\\b|(?=\\|)|$))",
"endCaptures": {
"3": {
"name": "keyword.other.entry-definition.ocamllex"
}
},
"name": "meta.pattern-match.ocaml",
"patterns": [
{
"include": "#match-patterns"
},
{
"include": "#actions"
}
]
},
{
"include": "#strings"
},
{
"include": "#comments"
},
{
"match": "=",
"name": "keyword.operator.symbol.ocamllex"
},
{
"begin": "\\(",
"end": "\\)",
"name": "meta.paren-group.ocamllex",
"patterns": [
{
"include": "$self"
}
]
},
{
"match": "(’|‘|“|”)",
"name": "invalid.illegal.unrecognized-character.ocamllex"
}
],
"repository": {
"actions": {
"patterns": [
{
"begin": "[^\\']({)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.action.begin.ocamllex"
}
},
"end": "(})",
"endCaptures": {
"1": {
"name": "punctuation.definition.action.end.ocamllex"
}
},
"name": "meta.action.ocamllex",
"patterns": [
{
"include": "source.ocaml"
}
]
}
]
},
"chars": {
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.char.begin.ocamllex"
},
"4": {
"name": "punctuation.definition.char.end.ocamllex"
}
},
"match": "(')([^\\\\]|\\\\(x[a-fA-F0-9][a-fA-F0-9]|[0-2]\\d\\d|[bnrt'\"\\\\]))(')",
"name": "constant.character.ocamllex"
}
]
},
"comments": {
"patterns": [
{
"begin": "\\(\\*",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.begin.ocaml"
}
},
"end": "\\*\\)",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.ocaml"
}
},
"name": "comment.block.ocaml",
"patterns": [
{
"include": "#comments"
}
]
},
{
"begin": "(?=[^\\\\])(\")",
"end": "\"",
"name": "comment.block.string.quoted.double.ocaml",
"patterns": [
{
"match": "\\\\(x[a-fA-F0-9][a-fA-F0-9]|[0-2]\\d\\d|[bnrt'\"\\\\])",
"name": "comment.block.string.constant.character.escape.ocaml"
}
]
}
]
},
"match-patterns": {
"patterns": [
{
"begin": "(\\()",
"beginCaptures": {
"1": {
"name": "punctuation.definition.sub-pattern.begin.ocamllex"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.definition.sub-pattern.end.ocamllex"
}
},
"name": "meta.pattern.sub-pattern.ocamllex",
"patterns": [
{
"include": "#match-patterns"
}
]
},
{
"match": "[a-z][a-zA-Z0-9'_]",
"name": "entity.name.type.pattern.reference.stupid-goddamn-hack.ocamllex"
},
{
"match": "\\bas\\b",
"name": "keyword.other.pattern.ocamllex"
},
{
"match": "eof",
"name": "constant.language.eof.ocamllex"
},
{
"match": "_",
"name": "constant.language.universal-match.ocamllex"
},
{
"begin": "(\\[)(\\^?)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.character-class.begin.ocamllex"
},
"2": {
"name": "punctuation.definition.character-class.negation.ocamllex"
}
},
"end": "(])(?!\\')",
"endCaptures": {
"1": {
"name": "punctuation.definition.character-class.end.ocamllex"
}
},
"name": "meta.pattern.character-class.ocamllex",
"patterns": [
{
"match": "-",
"name": "punctuation.separator.character-class.range.ocamllex"
},
{
"include": "#chars"
}
]
},
{
"match": "\\*|\\+|\\?",
"name": "keyword.operator.pattern.modifier.ocamllex"
},
{
"match": "\\|",
"name": "keyword.operator.pattern.alternation.ocamllex"
},
{
"include": "#chars"
},
{
"include": "#strings"
}
]
},
"strings": {
"patterns": [
{
"begin": "(?=[^\\\\])(\")",
"beginCaptures": {
"1": {
"name": "punctuation.definition.string.begin.ocaml"
}
},
"end": "(\")",
"endCaptures": {
"1": {
"name": "punctuation.definition.string.end.ocaml"
}
},
"name": "string.quoted.double.ocamllex",
"patterns": [
{
"match": "\\\\$[ \\t]*",
"name": "punctuation.separator.string.ignore-eol.ocaml"
},
{
"match": "\\\\(x[a-fA-F0-9][a-fA-F0-9]|[0-2]\\d\\d|[bnrt'\"\\\\])",
"name": "constant.character.string.escape.ocaml"
},
{
"match": "\\\\[\\|\\(\\)1-9$^.*+?\\[\\]]",
"name": "constant.character.regexp.escape.ocaml"
},
{
"match": "\\\\(?!(x[a-fA-F0-9][a-fA-F0-9]|[0-2]\\d\\d|[bnrt'\"\\\\]|[\\|\\(\\)1-9$^.*+?\\[\\]]|$[ \\t]*))(?:.)",
"name": "invalid.illegal.character.string.escape"
}
]
}
]
}
}
}
Loading