Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: utils/vim/syntax/dart.vim

Issue 8437100: Tweaks to string escapes. Added raw string literals. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/tools/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 " Vim syntax file " Language: Dart 1 " Vim syntax file " Language: Dart
2 " Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 " Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 " for details. All rights reserved. Use of this source code is governed by a 3 " for details. All rights reserved. Use of this source code is governed by a
4 " BSD-style license that can be found in the LICENSE file. 4 " BSD-style license that can be found in the LICENSE file.
5 5
6 " Quit when a syntax file was already loaded 6 " Quit when a syntax file was already loaded
7 if !exists("main_syntax") 7 if !exists("main_syntax")
8 if version < 600 8 if version < 600
9 syntax clear 9 syntax clear
10 elseif exists("b:current_syntax") 10 elseif exists("b:current_syntax")
11 finish 11 finish
12 endif 12 endif
13 " we define it here so that included files can test for it 13 " we define it here so that included files can test for it
14 let main_syntax='dart' 14 let main_syntax='dart'
15 syn region dartFold start="{" end="}" transparent fold 15 syn region dartFold start="{" end="}" transparent fold
16 endif 16 endif
17 17
18 " keyword definitions 18 " keyword definitions
19 syn keyword dartConditional if else switch 19 syn keyword dartConditional if else switch
20 syn keyword dartRepeat while for 20 syn keyword dartRepeat while for
21 syn keyword dartBoolean true false 21 syn keyword dartBoolean true false
22 syn keyword dartConstant null 22 syn keyword dartConstant null
23 syn keyword dartTypedef this super class typedef 23 syn keyword dartTypedef this super class typedef
24 syn keyword dartOperator new is in factory 24 syn keyword dartOperator new is in factory
25 syn match dartOperator "+\|-\|*\|[~]\=/\|%\|||\|&&\|\(!\|=\)=[=]\=\|=>\| =" 25 syn match dartOperator "+\|-\|*\|[~]\=/\|%\|||\|&&\|\(!\|=\)=[=]\=\|=>\| [<>]=\|=\|!"
26 syn keyword dartType void var const bool int double num 26 syn keyword dartType void var const bool int double num
27 syn keyword dartStatement return 27 syn keyword dartStatement return
28 syn keyword dartStorageClass static final abstract 28 syn keyword dartStorageClass static final abstract
29 syn keyword dartExceptions throw try catch finally 29 syn keyword dartExceptions throw try catch finally
30 syn keyword dartAssert assert 30 syn keyword dartAssert assert
31 syn keyword dartClassDecl extends implements interface 31 syn keyword dartClassDecl extends implements interface
32 " TODO(antonm): check if labels on break and continue are supported. 32 " TODO(antonm): check if labels on break and continue are supported.
33 syn keyword dartBranch break continue nextgroup=dartUserLabelRef skipwhi te 33 syn keyword dartBranch break continue nextgroup=dartUserLabelRef skipwhi te
34 syn keyword dartKeyword function get set 34 syn keyword dartKeyword function get set
35 syn match dartUserLabelRef "\k\+" contained 35 syn match dartUserLabelRef "\k\+" contained
36 syn match dartVarArg "\.\.\." 36 syn match dartVarArg "\.\.\."
37 37
38 " TODO(antonm): consider conditional highlighting of corelib classes. 38 " TODO(antonm): consider conditional highlighting of corelib classes.
39 39
40 syn region dartLabelRegion transparent matchgroup=dartLabel start="\<case\>" matchgroup=NONE end=":" 40 syn region dartLabelRegion transparent matchgroup=dartLabel start="\<case\>" matchgroup=NONE end=":"
41 syn keyword dartLabel default 41 syn keyword dartLabel default
42 42
43 " Comments 43 " Comments
44 syn keyword dartTodo contained TODO FIXME XXX 44 syn keyword dartTodo contained TODO FIXME XXX
45 syn region dartComment start="/\*" end="\*/" contains=dartTodo,dartDocLi nk,@Spell 45 syn region dartComment start="/\*" end="\*/" contains=dartTodo,dartDocLi nk,@Spell
46 syn match dartLineComment "//.*" contains=dartTodo,@Spell 46 syn match dartLineComment "//.*" contains=dartTodo,@Spell
47 syn region dartDocLink contained start=+\[+ end=+\]+ 47 syn region dartDocLink contained start=+\[+ end=+\]+
48 48
49 " Strings 49 " Strings
50 syn region dartString start=+"+ end=+"+ contains=@Spell,dartInterpolation ,dartSpecialChar 50 syn region dartString start=+\z(["']\)+hs=s+1 end=+\z1+he=e-1 contains=@ Spell,dartInterpolation,dartSpecialChar
51 syn region dartString start=+'+ end=+'+ contains=@Spell,dartInterpolation ,dartSpecialChar 51 syn region dartRawString start=+@\z(["']\)+hs=s+2 end=+\z1+he=e-1 contains= @Spell
52 syn match dartInterpolation contained "\$\(\w\+\|{[^\}]\+}\)" 52 syn match dartInterpolation contained "\$\(\w\+\|{[^}]\+}\)"
53 syn match dartSpecialChar contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf ]\|u\x\{4\}\)" 53 syn match dartSpecialChar contained "\\\(u\x\{4\}\|u{\x\+}\|x\x\x\|x{\x\+}\| .\)"
54 54
55 " Numbers 55 " Numbers
56 syn match dartNumber "\<\d\+\(\.\d\+\)\=\>" 56 syn match dartNumber "\<\d\+\(\.\d\+\)\=\>"
57 57
58 " The default highlighting. 58 " The default highlighting.
59 command! -nargs=+ HiLink hi def link <args> 59 command! -nargs=+ HiLink hi def link <args>
60 HiLink dartVarArg Function 60 HiLink dartVarArg Function
61 HiLink dartBranch Conditional 61 HiLink dartBranch Conditional
62 HiLink dartUserLabelRef dartUserLabel 62 HiLink dartUserLabelRef dartUserLabel
63 HiLink dartLabel Label 63 HiLink dartLabel Label
64 HiLink dartUserLabel Label 64 HiLink dartUserLabel Label
65 HiLink dartConditional Conditional 65 HiLink dartConditional Conditional
66 HiLink dartRepeat Repeat 66 HiLink dartRepeat Repeat
67 HiLink dartExceptions Exception 67 HiLink dartExceptions Exception
68 HiLink dartAssert Statement 68 HiLink dartAssert Statement
69 HiLink dartStorageClass StorageClass 69 HiLink dartStorageClass StorageClass
70 HiLink dartClassDecl dartStorageClass 70 HiLink dartClassDecl dartStorageClass
71 HiLink dartBoolean Boolean 71 HiLink dartBoolean Boolean
72 HiLink dartString String 72 HiLink dartString String
73 HiLink dartRawString String
73 HiLink dartNumber Number 74 HiLink dartNumber Number
74 HiLink dartStatement Statement 75 HiLink dartStatement Statement
75 HiLink dartOperator Operator 76 HiLink dartOperator Operator
76 HiLink dartComment Comment 77 HiLink dartComment Comment
77 HiLink dartLineComment Comment 78 HiLink dartLineComment Comment
78 HiLink dartConstant Constant 79 HiLink dartConstant Constant
79 HiLink dartTypedef Typedef 80 HiLink dartTypedef Typedef
80 HiLink dartTodo Todo 81 HiLink dartTodo Todo
81 HiLink dartKeyword Keyword 82 HiLink dartKeyword Keyword
82 HiLink dartType Type 83 HiLink dartType Type
83 HiLink dartInterpolation PreProc 84 HiLink dartInterpolation PreProc
84 HiLink dartDocLink SpecialComment 85 HiLink dartDocLink SpecialComment
85 HiLink dartSpecialChar SpecialChar 86 HiLink dartSpecialChar SpecialChar
86 delcommand HiLink 87 delcommand HiLink
87 88
88 let b:current_syntax = "dart" 89 let b:current_syntax = "dart"
89 90
90 if main_syntax == 'dart' 91 if main_syntax == 'dart'
91 unlet main_syntax 92 unlet main_syntax
92 endif 93 endif
93 94
94 let b:spell_options="contained" 95 let b:spell_options="contained"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698