Skip to content

Commit 63ffc40

Browse files
Fix Ocaml syntax highlighting (zyedidia#3427)
* Fix (kinda) Ocaml syntax highlighting * Remove functions rule * Highlight character with escape sequence * Add suggested changes
1 parent a09c98a commit 63ffc40

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

runtime/syntax/ocaml.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,18 @@ rules:
1717
- statement: "\\b(if|then|else)\\b"
1818
#blocs
1919
- type: "\\b(begin|end|object|struct|sig|for|while|do|done|to|downto)\\b"
20+
- type: "'[0-9A-Za-z_]+"
2021
#constantes
2122
- constant.bool: "\\b(true|false)\\b"
2223
#modules/classes
2324
- special: "\\b(include|inherit|initializer)\\b"
2425
#expr modifiers
2526
- special: "\\b(new|ref|mutable|lazy|assert|raise)\\b"
26-
- constant.string:
27-
start: "'"
28-
end: "'"
29-
skip: "\\\\."
30-
rules:
31-
- constant.specialChar: "%."
32-
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
33-
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
27+
#character literal
28+
- constant.string: "'(\\\\[0-7]{3}|\\\\x[A-Fa-f0-9]{2}|\\\\u[A-Fa-f0-9]{4}|\\\\U[A-Fa-f0-9]{8}|\\\\[abfnrtv'\\\"\\\\]|.)'"
29+
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
30+
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
31+
#string literal
3432
- constant.string:
3533
start: "\""
3634
end: "\""

0 commit comments

Comments
 (0)