Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Slice (ZeroC's Specification Language for Ice) |
Bram Moolenaar | 9372a11 | 2005-12-06 19:59:18 +0000 | [diff] [blame] | 3 | " Maintainer: Morel Bodin <slice06@nym.hush.com> |
| 4 | " Last Change: 2005 Dec 03 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 6 | " quit when a syntax file was already loaded |
| 7 | if exists("b:current_syntax") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8 | finish |
| 9 | endif |
| 10 | |
| 11 | " The Slice keywords |
| 12 | |
| 13 | syn keyword sliceType bool byte double float int long short string void |
| 14 | syn keyword sliceQualifier const extends idempotent implements local nonmutating out throws |
Bram Moolenaar | 9372a11 | 2005-12-06 19:59:18 +0000 | [diff] [blame] | 15 | syn keyword sliceConstruct class enum exception dictionary interface module LocalObject Object sequence struct |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 16 | syn keyword sliceQualifier const extends idempotent implements local nonmutating out throws |
| 17 | syn keyword sliceBoolean false true |
| 18 | |
| 19 | " Include directives |
Bram Moolenaar | ac7bd63 | 2013-03-19 11:35:58 +0100 | [diff] [blame] | 20 | syn region sliceIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 21 | syn match sliceIncluded display contained "<[^>]*>" |
| 22 | syn match sliceInclude display "^\s*#\s*include\>\s*["<]" contains=sliceIncluded |
| 23 | |
| 24 | " Double-include guards |
| 25 | syn region sliceGuard start="^#\(define\|ifndef\|endif\)" end="$" |
| 26 | |
| 27 | " Strings and characters |
| 28 | syn region sliceString start=+"+ end=+"+ |
| 29 | |
| 30 | " Numbers (shamelessly ripped from c.vim, only slightly modified) |
| 31 | "integer number, or floating point number without a dot and with "f". |
| 32 | syn case ignore |
| 33 | syn match sliceNumbers display transparent "\<\d\|\.\d" contains=sliceNumber,sliceFloat,sliceOctal |
| 34 | syn match sliceNumber display contained "\d\+" |
| 35 | "hex number |
| 36 | syn match sliceNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" |
| 37 | " Flag the first zero of an octal number as something special |
| 38 | syn match sliceOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=sliceOctalZero |
| 39 | syn match sliceOctalZero display contained "\<0" |
| 40 | syn match sliceFloat display contained "\d\+f" |
| 41 | "floating point number, with dot, optional exponent |
| 42 | syn match sliceFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" |
| 43 | "floating point number, starting with a dot, optional exponent |
| 44 | syn match sliceFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" |
| 45 | "floating point number, without dot, with exponent |
| 46 | syn match sliceFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>" |
| 47 | " flag an octal number with wrong digits |
| 48 | syn case match |
| 49 | |
| 50 | |
| 51 | " Comments |
| 52 | syn region sliceComment start="/\*" end="\*/" |
| 53 | syn match sliceComment "//.*" |
| 54 | |
| 55 | syn sync ccomment sliceComment |
| 56 | |
| 57 | " Define the default highlighting. |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 58 | " Only when an item doesn't have highlighting yet |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 59 | |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 60 | hi def link sliceComment Comment |
| 61 | hi def link sliceConstruct Keyword |
| 62 | hi def link sliceType Type |
| 63 | hi def link sliceString String |
| 64 | hi def link sliceIncluded String |
| 65 | hi def link sliceQualifier Keyword |
| 66 | hi def link sliceInclude Include |
| 67 | hi def link sliceGuard PreProc |
| 68 | hi def link sliceBoolean Boolean |
| 69 | hi def link sliceFloat Number |
| 70 | hi def link sliceNumber Number |
| 71 | hi def link sliceOctal Number |
| 72 | hi def link sliceOctalZero Special |
| 73 | hi def link sliceNumberError Special |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 74 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 75 | |
| 76 | let b:current_syntax = "slice" |
| 77 | |
| 78 | " vim: ts=8 |