Bram Moolenaar | 96f45c0 | 2019-10-26 19:53:45 +0200 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " |
| 3 | " Language: Dart |
| 4 | " Maintainer: Eugene 'pr3d4t0r' Ciurana <dart.syntax AT cime.net > |
| 5 | " Source: https://github.com/pr3d4t0r/dart-vim-syntax |
| 6 | " Last Update: 2019 Oct 19 |
| 7 | " |
| 8 | " License: Vim is Charityware. dart.vim syntax is Charityware. |
| 9 | " (c) Copyright 2019 by Eugene Ciurana / pr3d4t0r. Licensed |
| 10 | " under the standard VIM LICENSE - Vim command :help uganda.txt |
| 11 | " for details. |
| 12 | " |
| 13 | " Questions, comments: <dart.syntax AT cime.net> |
| 14 | " https://ciurana.eu/pgp, https://keybase.io/pr3d4t0r |
| 15 | " |
| 16 | " vim: set fileencoding=utf-8: |
| 17 | |
| 18 | |
| 19 | " Quit when a (custom) syntax file was already loaded |
| 20 | if exists("b:current_syntax") |
| 21 | finish |
| 22 | endif |
| 23 | |
| 24 | let s:cpo_save = &cpo |
| 25 | set cpo&vim |
| 26 | |
| 27 | |
| 28 | syn keyword dartCommentTodo contained TODO FIXME XXX TBD |
| 29 | syn match dartLineComment "//.*" contains=dartTodo,@Spell |
| 30 | syn match dartCommentSkip "^[ \t]*\*\($\|[ \t]\+\)" |
| 31 | syn region dartComment start="/\*" end="\*/" contains=@Spell,dartTodo |
| 32 | syn keyword dartReserved assert async await class const export extends external final hide import implements interface library mixin on show super sync yield |
| 33 | syn match dartNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" |
| 34 | |
| 35 | |
| 36 | syn keyword dartBoolean false true |
| 37 | syn keyword dartBranch break continue |
| 38 | syn keyword dartConditional if else switch |
| 39 | syn keyword dartException catch finally rethrow throw try |
| 40 | syn keyword dartIdentifier abstract covariant deferred dynamic factory Function operator part static this typedef var |
| 41 | syn keyword dartLabel case default |
| 42 | syn keyword dartNull null |
| 43 | syn keyword dartOperator is new |
| 44 | syn keyword dartRepeat for do in while |
| 45 | syn keyword dartStatement return with |
| 46 | syn keyword dartType bool double enum int String StringBuffer void |
| 47 | syn keyword dartTodo contained TODO FIXME XXX |
| 48 | |
| 49 | |
| 50 | syn match dartEscape contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)" |
| 51 | syn match dartSpecialError contained "\\." |
| 52 | syn match dartStrInterpol contained "\${[\x, _]*\}" |
| 53 | |
| 54 | syn region dartDQString start=+"+ end=+"+ end=+$+ contains=dartEscape,dartStrInterpol,dartSpecialError,@Spell |
| 55 | syn region dartSQString start=+'+ end=+'+ end=+$+ contains=dartEscape,dartStrInterpol,dartSpecialError,@Spell |
| 56 | |
| 57 | syn match dartBraces "[{}\[\]]" |
| 58 | syn match dartParens "[()]" |
| 59 | |
| 60 | |
| 61 | syn sync fromstart |
| 62 | syn sync maxlines=100 |
| 63 | |
| 64 | |
| 65 | hi def link dartBoolean Boolean |
| 66 | hi def link dartBranch Conditional |
| 67 | hi def link dartComment Comment |
| 68 | hi def link dartConditional Conditional |
| 69 | hi def link dartDQString String |
| 70 | hi def link dartEscape SpecialChar |
| 71 | hi def link dartException Exception |
| 72 | hi def link dartIdentifier Identifier |
| 73 | hi def link dartLabel Label |
| 74 | hi def link dartLineComment Comment |
| 75 | hi def link dartNull Keyword |
| 76 | hi def link dartOperator Operator |
| 77 | hi def link dartRepeat Repeat |
| 78 | hi def link dartReserved Keyword |
| 79 | hi def link dartSQString String |
| 80 | hi def link dartSpecialError Error |
| 81 | hi def link dartStatement Statement |
| 82 | hi def link dartStrInterpol Special |
| 83 | hi def link dartTodo Todo |
| 84 | hi def link dartType Type |
| 85 | |
| 86 | |
| 87 | let b:current_syntax = "dart" |
| 88 | let &cpo = s:cpo_save |
| 89 | unlet s:cpo_save |
| 90 | |