Skip to content

Commit

Permalink
Merge pull request #348 from mnxn/ocaml-syntax-characters
Browse files Browse the repository at this point in the history
Fix interaction between character literals and comments/escaped quotes in OCaml files
  • Loading branch information
mnxn committed Sep 2, 2020
2 parents 140d7f4 + b456554 commit dd2ee74
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## Unreleased

- Fix interaction between character literals and comments/escaped quotes in
OCaml files (#348)

## 1.1.0

- Highlight method keyword in ocaml interface (#340)
Expand Down
14 changes: 9 additions & 5 deletions syntaxes/ocaml.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@

"strings-in-comments": {
"patterns": [
{
"comment": "char literal",
"match": "'(\\\\)?.'"
},
{
"comment": "string literal",
"begin": "\"",
Expand Down Expand Up @@ -234,11 +238,6 @@

"characters": {
"patterns": [
{
"comment": "character literal",
"name": "string.quoted.other.ocaml constant.character.ocaml",
"match": "'.'"
},
{
"comment": "character literal from escaped backslash",
"name": "string.quoted.other.ocaml constant.character.ocaml",
Expand Down Expand Up @@ -276,6 +275,11 @@
"captures": {
"1": { "name": "invalid.illegal.unknown-escape.ocaml" }
}
},
{
"comment": "character literal",
"name": "string.quoted.other.ocaml constant.character.ocaml",
"match": "'.'"
}
]
},
Expand Down

0 comments on commit dd2ee74

Please sign in to comment.