micro/runtime/syntax/dart.yaml
2017-03-21 14:55:22 -04:00

23 lines
1.1 KiB
YAML

filetype: dart
detect:
filename: "\\.dart$"
rules:
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
- statement: "\\b(break|case|catch|continue|default|else|finally)\\b"
- statement: "\\b(for|function|get|if|in|as|is|new|return|set|switch|final|await|async|sync)\\b"
- statement: "\\b(switch|this|throw|try|var|void|while|with|import|library|part|const|export)\\b"
- constant.bool: "\\b(true|false|null)\\b"
- type: "\\b(List|String)\\b"
- type: "\\b(int|num|double|bool)\\b"
- symbol.operator: "[-+/*=<>!~%?:&|]"
- constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
- constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
- comment: "(^|[[:space:]])//.*"
- comment: "/\\*.+\\*/"
- todo: "TODO:?"
- constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"