OLD | NEW |
(Empty) | |
| 1 { scopeName = 'source.dart'; |
| 2 fileTypes = ( 'dart' ); |
| 3 foldingStartMarker = '\{\s*$'; |
| 4 foldingStopMarker = '^\s*\}'; |
| 5 patterns = ( |
| 6 { name = 'meta.preprocessor.script.dart'; |
| 7 match = '^(#!.*)$'; |
| 8 }, |
| 9 { name = 'meta.declaration.dart'; |
| 10 begin = '#\b(library|import|source|resource)\b'; |
| 11 end = ';'; |
| 12 beginCaptures = { 0 = { name = 'keyword.other.import.dar
t'; }; }; |
| 13 endCaptures = { 0 = { name = 'punctuation.terminator.dar
t'; }; }; |
| 14 patterns = ( |
| 15 { include = '#strings'; }, |
| 16 { match = '\b(prefix)\s*:'; |
| 17 captures = { 1 = { name = 'keyword.other
.import.dart'; }; }; |
| 18 }, |
| 19 ); |
| 20 }, |
| 21 { include = '#comments'; }, |
| 22 { include = '#constants-and-special-vars'; }, |
| 23 { include = '#keywords'; }, |
| 24 { include = '#strings'; }, |
| 25 ); |
| 26 repository = { |
| 27 comments = { |
| 28 patterns = ( |
| 29 { name = 'comment.block.empty.dart'; |
| 30 match = '/\*\*/'; |
| 31 captures = { 0 = { name = 'punctuation.d
efinition.comment.dart'; }; }; |
| 32 }, |
| 33 { include = 'text.html.javadoc'; }, |
| 34 { include = '#comments-inline'; }, |
| 35 ); |
| 36 }; |
| 37 comments-inline = { |
| 38 patterns = ( |
| 39 { name = 'comment.block.dart'; |
| 40 begin = '/\*'; |
| 41 end = '\*/'; |
| 42 }, |
| 43 { match = '((//).*)$'; |
| 44 captures = { 1 = { name = 'comment.line.
double-slash.dart'; }; }; |
| 45 }, |
| 46 ); |
| 47 }; |
| 48 constants-and-special-vars = { |
| 49 patterns = ( |
| 50 { name = 'constant.language.dart'; |
| 51 match = '\b(true|false|null)\b'; |
| 52 }, |
| 53 { name = 'variable.language.dart'; |
| 54 match = '\b(this|super)\b'; |
| 55 }, |
| 56 { name = 'constant.numeric.dart'; |
| 57 match = '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]
+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b'; |
| 58 }, |
| 59 ); |
| 60 }; |
| 61 keywords = { |
| 62 patterns = ( |
| 63 { name = 'keyword.control.catch-exception.
dart'; |
| 64 match = '\b(try|catch|finally|throw)\b'; |
| 65 }, |
| 66 { name = 'keyword.control.ternary.dart'; |
| 67 match = '\?|:'; |
| 68 }, |
| 69 { name = 'keyword.control.dart'; |
| 70 match = '\b(break|case|continue|default|
do|else|for|if|in|return|switch|while)\b'; |
| 71 }, |
| 72 { name = 'keyword.control.new.dart'; |
| 73 match = '\b(new)\b'; |
| 74 }, |
| 75 { name = 'keyword.operator.dart'; |
| 76 match = '\b(is\!?)\b'; |
| 77 }, |
| 78 { name = 'keyword.operator.bitwise.dart'; |
| 79 match = '(<<|>>>?|~|\^|\||&)'; |
| 80 }, |
| 81 { name = 'keyword.operator.assignment.bitw
ise.dart'; |
| 82 match = '((&|\^|\||<<|>>>?)=)'; |
| 83 }, |
| 84 { name = 'keyword.operator.comparison.dart
'; |
| 85 match = '(===?|!==?|<=?|>=?)'; |
| 86 }, |
| 87 { name = 'keyword.operator.assignment.arit
hmetic.dart'; |
| 88 match = '(([+*/%-]|\~)=)'; |
| 89 }, |
| 90 { name = 'keyword.operator.assignment.dart
'; |
| 91 match = '(=)'; |
| 92 }, |
| 93 { name = 'keyword.operator.increment-decre
ment.dart'; |
| 94 match = '(\-\-|\+\+)'; |
| 95 }, |
| 96 { name = 'keyword.operator.arithmetic.dart
'; |
| 97 match = '(\-|\+|\*|\/|\~\/|%)'; |
| 98 }, |
| 99 { name = 'keyword.operator.logical.dart'; |
| 100 match = '(!|&&|\|\|)'; |
| 101 }, |
| 102 { name = 'punctuation.terminator.dart'; |
| 103 match = ';'; |
| 104 }, |
| 105 { name = 'storage.modifier.dart'; |
| 106 match = '\b(static|final|native|abstract
|const|class|interface)\b'; |
| 107 }, |
| 108 { name = 'storage.type.primitive.dart'; |
| 109 match = '\b(?:void|bool|num|int|double|D
ynamic|var)\b'; |
| 110 }, |
| 111 ); |
| 112 }; |
| 113 string-interp = { |
| 114 patterns = ( |
| 115 { match = '\$((\w+)|\{(\w+)\})'; |
| 116 captures = { |
| 117 2 = { name = 'variable.parameter
.dart'; }; |
| 118 3 = { name = 'variable.parameter
.dart'; }; |
| 119 }; |
| 120 }, |
| 121 { name = 'constant.character.escape.dart'; |
| 122 match = '\\.'; |
| 123 }, |
| 124 ); |
| 125 }; |
| 126 strings = { |
| 127 patterns = ( |
| 128 { name = 'string.interpolated.triple.dart'
; |
| 129 begin = '(?<!@)"""'; |
| 130 end = '"""(?!")'; |
| 131 patterns = ( { include = '#string-interp
'; } ); |
| 132 }, |
| 133 { name = 'string.quoted.triple.dart'; |
| 134 begin = '@"""'; |
| 135 end = '"""(?!")'; |
| 136 }, |
| 137 { name = 'string.interpolated.double.dart'
; |
| 138 begin = '(?<!\\|@)"'; |
| 139 end = '"'; |
| 140 patterns = ( |
| 141 { name = 'invalid.string.n
ewline'; |
| 142 match = '\n'; |
| 143 }, |
| 144 { include = '#string-inter
p'; }, |
| 145 ); |
| 146 }, |
| 147 { name = 'string.quoted.double.dart'; |
| 148 begin = '@"'; |
| 149 end = '"'; |
| 150 patterns = ( |
| 151 { name = 'invalid.string.n
ewline'; |
| 152 match = '\n'; |
| 153 }, |
| 154 ); |
| 155 }, |
| 156 { name = 'string.interpolated.single.dart'
; |
| 157 begin = "(?<!\|@)'"; |
| 158 end = "'"; |
| 159 patterns = ( |
| 160 { name = 'invalid.string.n
ewline'; |
| 161 match = '\n'; |
| 162 }, |
| 163 { include = '#string-inter
p'; }, |
| 164 ); |
| 165 }, |
| 166 { name = 'string.quoted.single.dart'; |
| 167 begin = "@'"; |
| 168 end = "'"; |
| 169 patterns = ( |
| 170 { name = 'invalid.string.n
ewline'; |
| 171 match = '\n'; |
| 172 }, |
| 173 ); |
| 174 }, |
| 175 ); |
| 176 }; |
| 177 }; |
| 178 } |
OLD | NEW |