Skip to content

Commit

Permalink
Fix syntax highlighting of lazy bindings (#287)
Browse files Browse the repository at this point in the history
* fix syntax highlighting of lazy bindings

* update change log
  • Loading branch information
mnxn committed Jul 14, 2020
1 parent b4ff9b8 commit 1bdaeae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Highlight unprefixed opam files (#284)
- Fix syntax highlighting of `module type of` (#285)
- Fix syntax highlighting of module constraints (#286)
- Fix syntax highlighting of lazy bindings (#287)

## 0.8.0

Expand Down
4 changes: 2 additions & 2 deletions syntaxes/ocaml.interface.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
}
},
{
"comment": "and declaration for let bindings, type declarations, class bindings, or class type definitions",
"match": "\\b(and)\\s+(?!(?:module|type)\\b)((?:virtual|lazy)\\s+)?(_\\s+|'[A-Za-z][A-Za-z0-9_']*\\s+|\\(.*\\)\\s+)?([a-z_][A-Za-z0-9_']*)\\s+(?!,|::)",
"comment": "and declaration for let bindings, type declarations, class bindings, class type definitions, or module constraints",
"match": "\\b(and)\\s+(?!(?:module|type|lazy)\\b)(virtual\\s+)?(_\\s+|'[A-Za-z][A-Za-z0-9_']*\\s+|\\(.*\\)\\s+)?([a-z_][A-Za-z0-9_']*)\\s+(?!,|::)",
"captures": {
"1": { "name": "keyword.ocaml" },
"2": { "name": "keyword.ocaml" },
Expand Down
7 changes: 3 additions & 4 deletions syntaxes/ocaml.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,16 @@
},
{
"comment": "let expression",
"match": "\\b(let)\\s+(rec\\s+)?(lazy\\s+)?([a-z_][A-Za-z0-9_']*)\\s+(?!,|::)",
"match": "\\b(let)\\s+(?!lazy\\b)(rec\\s+)?([a-z_][A-Za-z0-9_']*)\\s+(?!,|::)",
"captures": {
"1": { "name": "keyword.ocaml" },
"2": { "name": "keyword.ocaml" },
"3": { "name": "keyword.ocaml" },
"4": { "name": "entity.name.function.binding.ocaml" }
"3": { "name": "entity.name.function.binding.ocaml" }
}
},
{
"comment": "using binding operators",
"match": "\\b(let|and)([$&*+\\-/=>@^|<][!?$&*+\\-/=>@^|%:]*)\\s*(lazy\\s+)?([a-z_][A-Za-z0-9_']*)\\s+(?!,|::)",
"match": "\\b(let|and)([$&*+\\-/=>@^|<][!?$&*+\\-/=>@^|%:]*)\\s*(?!lazy\\b)([a-z_][A-Za-z0-9_']*)\\s+(?!,|::)",
"captures": {
"1": { "name": "keyword.ocaml" },
"2": { "name": "keyword.ocaml" },
Expand Down

0 comments on commit 1bdaeae

Please sign in to comment.