Benno Schulenberg | c4b344f | 2014-02-23 16:07:44 +0000 | [diff] [blame] | 1 | ## Syntax highlighting for OCaml. |
| 2 | |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 3 | syntax "ocaml" "\.mli?$" |
Mike Scalora | 6a2032f | 2016-05-25 22:13:50 +0200 | [diff] [blame] | 4 | comment "(*|*)" |
Benno Schulenberg | fe9da94 | 2014-05-16 20:21:34 +0000 | [diff] [blame] | 5 | |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 6 | # Uid: |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 7 | color red "\<[A-Z][0-9a-z_]{2,}\>" |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 8 | # Declarations: |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 9 | color green "\<(let|val|method|in|and|rec|private|virtual|constraint)\>" |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 10 | # Structure items: |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 11 | color red "\<(type|open|class|module|exception|external)\>" |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 12 | # Patterns: |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 13 | color blue "\<(fun|function|functor|match|try|with)\>" |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 14 | # Pattern modifiers: |
Benno Schulenberg | fe9da94 | 2014-05-16 20:21:34 +0000 | [diff] [blame] | 15 | color yellow "\<(as|when|of)\>" |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 16 | # Conditions: |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 17 | color cyan "\<(if|then|else)\>" |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 18 | # Blocks: |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 19 | color magenta "\<(begin|end|object|struct|sig|for|while|do|done|to|downto)\>" |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 20 | # Constants: |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 21 | color green "\<(true|false)\>" |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 22 | # Modules/classes: |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 23 | color green "\<(include|inherit|initializer)\>" |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 24 | # Expression modifiers: |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 25 | color yellow "\<(new|ref|mutable|lazy|assert|raise)\>" |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 26 | # Comments: |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 27 | color white start="\(\*" end="\*\)" |
Benno Schulenberg | 26bc037 | 2015-12-30 20:57:31 +0000 | [diff] [blame] | 28 | # Strings: (no multiline handling yet) |
Chris Allegretta | 215eb36 | 2008-10-01 00:49:19 +0000 | [diff] [blame] | 29 | color brightblack ""[^\"]*"" |