filetype: csharp
detect:
- filename: "\\.cs"
+ filename: "\\.cs$"
rules:
# Class
# Annotation
- identifier.var: "@[A-Za-z]+"
- - identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]"
+ - identifier: "([A-Za-z0-9_]*[[:space:]]*[()])"
- type: "\\b(bool|byte|sbyte|char|decimal|double|float|IntPtr|int|uint|long|ulong|object|short|ushort|string|base|this|var|void)\\b"
- statement: "\\b(alias|as|case|catch|checked|default|do|dynamic|else|finally|fixed|for|foreach|goto|if|is|lock|new|null|return|switch|throw|try|unchecked|while)\\b"
- statement: "\\b(abstract|async|class|const|delegate|enum|event|explicit|extern|get|implicit|in|internal|interface|namespace|operator|out|override|params|partial|private|protected|public|readonly|ref|sealed|set|sizeof|stackalloc|static|struct|typeof|unsafe|using|value|virtual|volatile|yield)\\b"
- constant.string:
start: "\""
- end: "(?<!\\\\)\""
+ end: "\""
+ skip: "\\\\."
rules:
- constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
- constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"
- constant.string:
start: "'"
- end: "(?<!\\\\)'"
+ end: "'"
+ skip: "\\\\."
rules:
- constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
- constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"