2018-09-05 08:53:18 +02:00
|
|
|
%YAML 1.2
|
|
|
|
---
|
2021-12-06 08:40:43 +01:00
|
|
|
# http://www.sublimetext.com/docs/syntax.html
|
2018-09-05 08:53:18 +02:00
|
|
|
name: Dart
|
|
|
|
file_extensions:
|
|
|
|
- dart
|
|
|
|
scope: source.dart
|
|
|
|
contexts:
|
|
|
|
main:
|
|
|
|
- match: ^(#!.*)$
|
|
|
|
scope: meta.preprocessor.script.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: ^\w*\b(library|import|part of|part|export)\b
|
2018-09-05 08:53:18 +02:00
|
|
|
captures:
|
|
|
|
0: keyword.other.import.dart
|
|
|
|
push:
|
|
|
|
- meta_scope: meta.declaration.dart
|
|
|
|
- match: ;
|
|
|
|
captures:
|
|
|
|
0: punctuation.terminator.dart
|
|
|
|
pop: true
|
|
|
|
- include: strings
|
2021-12-06 08:40:43 +01:00
|
|
|
- include: comments
|
|
|
|
- match: \b(as|show|hide)\b
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: keyword.other.import.dart
|
|
|
|
- include: comments
|
2021-12-06 08:40:43 +01:00
|
|
|
- include: punctuation
|
2018-09-05 08:53:18 +02:00
|
|
|
- include: annotations
|
|
|
|
- include: keywords
|
2021-12-06 08:40:43 +01:00
|
|
|
- include: constants-and-special-vars
|
2018-09-05 08:53:18 +02:00
|
|
|
- include: strings
|
|
|
|
annotations:
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: '@[a-zA-Z]+'
|
|
|
|
scope: storage.type.annotation.dart
|
2018-09-05 08:53:18 +02:00
|
|
|
comments:
|
|
|
|
- match: /\*\*/
|
|
|
|
scope: comment.block.empty.dart
|
|
|
|
captures:
|
|
|
|
0: punctuation.definition.comment.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- include: comments-doc-oldschool
|
|
|
|
- include: comments-doc
|
2018-09-05 08:53:18 +02:00
|
|
|
- include: comments-inline
|
2021-12-06 08:40:43 +01:00
|
|
|
comments-block:
|
2018-09-05 08:53:18 +02:00
|
|
|
- match: /\*
|
|
|
|
push:
|
|
|
|
- meta_scope: comment.block.dart
|
|
|
|
- match: \*/
|
|
|
|
pop: true
|
2021-12-06 08:40:43 +01:00
|
|
|
- include: comments-block
|
|
|
|
comments-doc:
|
|
|
|
- match: ///
|
2018-09-05 08:53:18 +02:00
|
|
|
push:
|
2021-12-06 08:40:43 +01:00
|
|
|
- meta_scope: comment.block.documentation.dart
|
|
|
|
- match: .*
|
2018-09-05 08:53:18 +02:00
|
|
|
pop: true
|
2021-12-06 08:40:43 +01:00
|
|
|
- include: dartdoc
|
|
|
|
comments-doc-oldschool:
|
|
|
|
- match: /\*\*
|
2018-09-05 08:53:18 +02:00
|
|
|
push:
|
2021-12-06 08:40:43 +01:00
|
|
|
- meta_scope: comment.block.documentation.dart
|
|
|
|
- match: \*/
|
2018-09-05 08:53:18 +02:00
|
|
|
pop: true
|
2021-12-06 08:40:43 +01:00
|
|
|
- include: comments-doc-oldschool
|
|
|
|
- include: comments-block
|
|
|
|
- include: dartdoc
|
|
|
|
comments-inline:
|
|
|
|
- include: comments-block
|
|
|
|
- match: ((//).*)$
|
|
|
|
captures:
|
|
|
|
1: comment.line.double-slash.dart
|
2018-09-05 08:53:18 +02:00
|
|
|
constants-and-special-vars:
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (?<!\$)\b(true|false|null)\b(?!\$)
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: constant.language.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (?<!\$)\b(this|super)\b(?!\$)
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: variable.language.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: '(?<!\$)\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b(?!\$)'
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: constant.numeric.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: '(?<![a-zA-Z0-9_$])([_$]*[A-Z][a-zA-Z0-9_$]*|bool\b|num\b|int\b|double\b|dynamic\b)'
|
|
|
|
scope: support.class.dart
|
|
|
|
- match: '([_$]*[a-z][a-zA-Z0-9_$]*)(<|\(|\s+=>)'
|
2018-09-05 08:53:18 +02:00
|
|
|
captures:
|
2021-12-06 08:40:43 +01:00
|
|
|
1: entity.name.function.dart
|
|
|
|
dartdoc:
|
|
|
|
- match: '(\[.*?\])'
|
2018-09-05 08:53:18 +02:00
|
|
|
captures:
|
2021-12-06 08:40:43 +01:00
|
|
|
0: variable.name.source.dart
|
|
|
|
- match: '^ {4,}(?![ \*]).*'
|
2018-09-05 08:53:18 +02:00
|
|
|
captures:
|
2021-12-06 08:40:43 +01:00
|
|
|
0: variable.name.source.dart
|
|
|
|
- match: '```.*?$'
|
2018-09-05 08:53:18 +02:00
|
|
|
push:
|
2021-12-06 08:40:43 +01:00
|
|
|
- meta_content_scope: variable.other.source.dart
|
|
|
|
- match: '```'
|
2018-09-05 08:53:18 +02:00
|
|
|
pop: true
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (`.*?`)
|
2018-09-05 08:53:18 +02:00
|
|
|
captures:
|
2021-12-06 08:40:43 +01:00
|
|
|
0: variable.other.source.dart
|
|
|
|
- match: (`.*?`)
|
2018-09-05 08:53:18 +02:00
|
|
|
captures:
|
2021-12-06 08:40:43 +01:00
|
|
|
0: variable.other.source.dart
|
|
|
|
- match: (\* (( ).*))$
|
2018-09-05 08:53:18 +02:00
|
|
|
captures:
|
2021-12-06 08:40:43 +01:00
|
|
|
2: variable.other.source.dart
|
|
|
|
- match: (\* .*)$
|
2018-09-05 08:53:18 +02:00
|
|
|
keywords:
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (?<!\$)\bas\b(?!\$)
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: keyword.cast.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (?<!\$)\b(try|on|catch|finally|throw|rethrow)\b(?!\$)
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: keyword.control.catch-exception.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (?<!\$)\b(break|case|continue|default|do|else|for|if|in|return|switch|while)\b(?!\$)
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: keyword.control.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (?<!\$)\b(sync(\*)?|async(\*)?|await|yield(\*)?)\b(?!\$)
|
|
|
|
scope: keyword.control.dart
|
|
|
|
- match: (?<!\$)\bassert\b(?!\$)
|
|
|
|
scope: keyword.control.dart
|
|
|
|
- match: (?<!\$)\b(new)\b(?!\$)
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: keyword.control.new.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (?<!\$)\b(abstract|class|enum|extends|external|factory|implements|get|mixin|native|operator|set|typedef|with|covariant)\b(?!\$)
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: keyword.declaration.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (?<!\$)\b(is\!?)\b(?!\$)
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: keyword.operator.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: '\?|:'
|
|
|
|
scope: keyword.operator.ternary.dart
|
2018-09-05 08:53:18 +02:00
|
|
|
- match: (<<|>>>?|~|\^|\||&)
|
|
|
|
scope: keyword.operator.bitwise.dart
|
|
|
|
- match: ((&|\^|\||<<|>>>?)=)
|
|
|
|
scope: keyword.operator.assignment.bitwise.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (=>)
|
|
|
|
scope: keyword.operator.closure.dart
|
|
|
|
- match: (==|!=|<=?|>=?)
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: keyword.operator.comparison.dart
|
|
|
|
- match: '(([+*/%-]|\~)=)'
|
|
|
|
scope: keyword.operator.assignment.arithmetic.dart
|
|
|
|
- match: (=)
|
|
|
|
scope: keyword.operator.assignment.dart
|
|
|
|
- match: (\-\-|\+\+)
|
|
|
|
scope: keyword.operator.increment-decrement.dart
|
|
|
|
- match: (\-|\+|\*|\/|\~\/|%)
|
|
|
|
scope: keyword.operator.arithmetic.dart
|
|
|
|
- match: (!|&&|\|\|)
|
|
|
|
scope: keyword.operator.logical.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (?<!\$)\b(static|final|const)\b(?!\$)
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: storage.modifier.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (?<!\$)\b(?:void|var)\b(?!\$)
|
2018-09-05 08:53:18 +02:00
|
|
|
scope: storage.type.primitive.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
punctuation:
|
|
|
|
- match: ','
|
|
|
|
scope: punctuation.comma.dart
|
|
|
|
- match: ;
|
|
|
|
scope: punctuation.terminator.dart
|
2018-09-05 08:53:18 +02:00
|
|
|
- match: \.
|
2021-12-06 08:40:43 +01:00
|
|
|
scope: punctuation.dot.dart
|
2018-09-05 08:53:18 +02:00
|
|
|
string-interp:
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: '\$((\w+)|\{([^{}]+)\})'
|
2018-09-05 08:53:18 +02:00
|
|
|
captures:
|
|
|
|
2: variable.parameter.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
3: variable.parameter.dart
|
2018-09-05 08:53:18 +02:00
|
|
|
- match: \\.
|
|
|
|
scope: constant.character.escape.dart
|
|
|
|
strings:
|
|
|
|
- match: (?<!r)"""
|
|
|
|
push:
|
|
|
|
- meta_scope: string.interpolated.triple.double.dart
|
|
|
|
- match: '"""(?!")'
|
|
|
|
pop: true
|
|
|
|
- include: string-interp
|
|
|
|
- match: (?<!r)'''
|
|
|
|
push:
|
|
|
|
- meta_scope: string.interpolated.triple.single.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: '''''''(?!'')'
|
2018-09-05 08:53:18 +02:00
|
|
|
pop: true
|
|
|
|
- include: string-interp
|
|
|
|
- match: r"""
|
|
|
|
push:
|
|
|
|
- meta_scope: string.quoted.triple.double.dart
|
|
|
|
- match: '"""(?!")'
|
|
|
|
pop: true
|
|
|
|
- match: r'''
|
|
|
|
push:
|
|
|
|
- meta_scope: string.quoted.triple.single.dart
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: '''''''(?!'')'
|
2018-09-05 08:53:18 +02:00
|
|
|
pop: true
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: (?<!\|r)"
|
2018-09-05 08:53:18 +02:00
|
|
|
push:
|
|
|
|
- meta_scope: string.interpolated.double.dart
|
|
|
|
- match: '"'
|
|
|
|
pop: true
|
|
|
|
- match: \n
|
|
|
|
scope: invalid.string.newline
|
|
|
|
- include: string-interp
|
|
|
|
- match: r"
|
|
|
|
push:
|
|
|
|
- meta_scope: string.quoted.double.dart
|
|
|
|
- match: '"'
|
|
|
|
pop: true
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: \n
|
|
|
|
scope: invalid.string.newline
|
2018-09-05 08:53:18 +02:00
|
|
|
- match: (?<!\|r)'
|
|
|
|
push:
|
|
|
|
- meta_scope: string.interpolated.single.dart
|
|
|
|
- match: "'"
|
|
|
|
pop: true
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: \n
|
|
|
|
scope: invalid.string.newline
|
2018-09-05 08:53:18 +02:00
|
|
|
- include: string-interp
|
|
|
|
- match: r'
|
|
|
|
push:
|
|
|
|
- meta_scope: string.quoted.single.dart
|
|
|
|
- match: "'"
|
|
|
|
pop: true
|
2021-12-06 08:40:43 +01:00
|
|
|
- match: \n
|
|
|
|
scope: invalid.string.newline
|