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

Unified Diff: tools/utils/textmate/Dart.tmbundle/Syntaxes/Dart.textmate

Issue 8321007: Create minimal TextMate mode for Dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added a readme for Textmate mode. Created 9 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: tools/utils/textmate/Dart.tmbundle/Syntaxes/Dart.textmate
diff --git a/tools/utils/textmate/Dart.tmbundle/Syntaxes/Dart.textmate b/tools/utils/textmate/Dart.tmbundle/Syntaxes/Dart.textmate
new file mode 100644
index 0000000000000000000000000000000000000000..44d04d6def25203722c936a96fd635bd9a38b765
--- /dev/null
+++ b/tools/utils/textmate/Dart.tmbundle/Syntaxes/Dart.textmate
@@ -0,0 +1,178 @@
+{ scopeName = 'source.dart';
+ fileTypes = ( 'dart' );
+ foldingStartMarker = '\{\s*$';
+ foldingStopMarker = '^\s*\}';
+ patterns = (
+ { name = 'meta.preprocessor.script.dart';
+ match = '^(#!.*)$';
+ },
+ { name = 'meta.declaration.dart';
+ begin = '#\b(library|import|source|resource)\b';
+ end = ';';
+ beginCaptures = { 0 = { name = 'keyword.other.import.dart'; }; };
+ endCaptures = { 0 = { name = 'punctuation.terminator.dart'; }; };
+ patterns = (
+ { include = '#strings'; },
+ { match = '\b(prefix)\s*:';
+ captures = { 1 = { name = 'keyword.other.import.dart'; }; };
+ },
+ );
+ },
+ { include = '#comments'; },
+ { include = '#constants-and-special-vars'; },
+ { include = '#keywords'; },
+ { include = '#strings'; },
+ );
+ repository = {
+ comments = {
+ patterns = (
+ { name = 'comment.block.empty.dart';
+ match = '/\*\*/';
+ captures = { 0 = { name = 'punctuation.definition.comment.dart'; }; };
+ },
+ { include = 'text.html.javadoc'; },
+ { include = '#comments-inline'; },
+ );
+ };
+ comments-inline = {
+ patterns = (
+ { name = 'comment.block.dart';
+ begin = '/\*';
+ end = '\*/';
+ },
+ { match = '((//).*)$';
+ captures = { 1 = { name = 'comment.line.double-slash.dart'; }; };
+ },
+ );
+ };
+ constants-and-special-vars = {
+ patterns = (
+ { name = 'constant.language.dart';
+ match = '\b(true|false|null)\b';
+ },
+ { name = 'variable.language.dart';
+ match = '\b(this|super)\b';
+ },
+ { name = 'constant.numeric.dart';
+ match = '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b';
+ },
+ );
+ };
+ keywords = {
+ patterns = (
+ { name = 'keyword.control.catch-exception.dart';
+ match = '\b(try|catch|finally|throw)\b';
+ },
+ { name = 'keyword.control.ternary.dart';
+ match = '\?|:';
+ },
+ { name = 'keyword.control.dart';
+ match = '\b(break|case|continue|default|do|else|for|if|in|return|switch|while)\b';
+ },
+ { name = 'keyword.control.new.dart';
+ match = '\b(new)\b';
+ },
+ { name = 'keyword.operator.dart';
+ match = '\b(is\!?)\b';
+ },
+ { name = 'keyword.operator.bitwise.dart';
+ match = '(<<|>>>?|~|\^|\||&)';
+ },
+ { name = 'keyword.operator.assignment.bitwise.dart';
+ match = '((&|\^|\||<<|>>>?)=)';
+ },
+ { name = 'keyword.operator.comparison.dart';
+ match = '(===?|!==?|<=?|>=?)';
+ },
+ { name = 'keyword.operator.assignment.arithmetic.dart';
+ match = '(([+*/%-]|\~)=)';
+ },
+ { name = 'keyword.operator.assignment.dart';
+ match = '(=)';
+ },
+ { name = 'keyword.operator.increment-decrement.dart';
+ match = '(\-\-|\+\+)';
+ },
+ { name = 'keyword.operator.arithmetic.dart';
+ match = '(\-|\+|\*|\/|\~\/|%)';
+ },
+ { name = 'keyword.operator.logical.dart';
+ match = '(!|&&|\|\|)';
+ },
+ { name = 'punctuation.terminator.dart';
+ match = ';';
+ },
+ { name = 'storage.modifier.dart';
+ match = '\b(static|final|native|abstract|const|class|interface)\b';
+ },
+ { name = 'storage.type.primitive.dart';
+ match = '\b(?:void|bool|num|int|double|Dynamic|var)\b';
+ },
+ );
+ };
+ string-interp = {
+ patterns = (
+ { match = '\$((\w+)|\{(\w+)\})';
+ captures = {
+ 2 = { name = 'variable.parameter.dart'; };
+ 3 = { name = 'variable.parameter.dart'; };
+ };
+ },
+ { name = 'constant.character.escape.dart';
+ match = '\\.';
+ },
+ );
+ };
+ strings = {
+ patterns = (
+ { name = 'string.interpolated.triple.dart';
+ begin = '(?<!@)"""';
+ end = '"""(?!")';
+ patterns = ( { include = '#string-interp'; } );
+ },
+ { name = 'string.quoted.triple.dart';
+ begin = '@"""';
+ end = '"""(?!")';
+ },
+ { name = 'string.interpolated.double.dart';
+ begin = '(?<!\\|@)"';
+ end = '"';
+ patterns = (
+ { name = 'invalid.string.newline';
+ match = '\n';
+ },
+ { include = '#string-interp'; },
+ );
+ },
+ { name = 'string.quoted.double.dart';
+ begin = '@"';
+ end = '"';
+ patterns = (
+ { name = 'invalid.string.newline';
+ match = '\n';
+ },
+ );
+ },
+ { name = 'string.interpolated.single.dart';
+ begin = "(?<!\|@)'";
+ end = "'";
+ patterns = (
+ { name = 'invalid.string.newline';
+ match = '\n';
+ },
+ { include = '#string-interp'; },
+ );
+ },
+ { name = 'string.quoted.single.dart';
+ begin = "@'";
+ end = "'";
+ patterns = (
+ { name = 'invalid.string.newline';
+ match = '\n';
+ },
+ );
+ },
+ );
+ };
+ };
+}

Powered by Google App Engine
This is Rietveld 408576698