15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sudo: false
language: c
branches:
except:
- /^v[0-9]{4}$/
install:
- wget --content-disposition https://download.sublimetext.com/latest/dev/linux/x64/syntax_tests
- tar xf "$(ls st3_syntax_tests_build_*_x64.tar.bz2)"
- mv st3_syntax_tests/syntax_tests ./
- rm -R st3_syntax_tests*
before_script:
- mkdir -p Data/Packages/
- find . -maxdepth 1 -mindepth 1 -type d -not -name 'Data' -exec mv '{}' Data/Packages/ \;
script:
- ./syntax_tests
13 changes: 7 additions & 6 deletions C#/C#.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ variables:

# characters
unicode_char: '(?:\\u\h{4}|\\U\h{8})'
escaped_char: '(?:\\[abfnrtv"''\\]|{{unicode_char}}|\\x[0-9a-fA-F]{1,4}||\\[0-9]{1,3})'
escaped_char: '(?:\\[abfnrtv"''\\]|{{unicode_char}}|\\x[0-9a-fA-F]{1,4}|\\[0-9]{1,3})'

visibility: \b(?:public|private|protected|internal|protected\s+internal)\b
base_type: (?:bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|short|ushort|object|string|void)
Expand Down Expand Up @@ -202,7 +202,11 @@ contexts:
- include: namespace_declaration
- include: delegate_declaration
# allows coloration of code outside a class
- include: code_block_in
- match: (?=\S)
push:
- match: (?={{visibility}}|\b(?:class|delegate|interface|namespace)\b)
pop: true
- include: line_of_code

stray_close_bracket:
- match: '[})\]]'
Expand Down Expand Up @@ -803,10 +807,7 @@ contexts:

code_block_in:
- match: (?=\S)
push:
- match: (?={{reserved}})
pop: true
- include: line_of_code
push: line_of_code

line_of_code:
# language keywords
Expand Down
4 changes: 3 additions & 1 deletion CSS/CSS.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ contexts:
# @namespace
# https://www.w3.org/TR/css3-namespace/
at-namespace:
- match: '\s*((@)namespace)\s+({{ident}})?'
- match: '\s*((@)namespace)\s+({{ident}}(?!{{nmchar}}|\())?'
captures:
1: keyword.control.at-rule.namespace.css
2: punctuation.definition.keyword.css
Expand All @@ -351,6 +351,8 @@ contexts:
- meta_scope: meta.at-rule.namespace.css
- include: at-rule-punctuation
- include: literal-string
- include: url-function
- include: comment-block

# @page
# https://www.w3.org/TR/CSS2/page.html
Expand Down
8 changes: 8 additions & 0 deletions CSS/syntax_test_css.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
/* ^^^^^^^^^ keyword.control.at-rule.namespace.css */
/* ^^^ entity.other.namespace-prefix.css */

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.at-rule.namespace.css */
/* ^^^ support.function.url.css */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.css */
/* ^ meta.group.css punctuation.definition.group.begin.css */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.css string.quoted.double.css */
/* ^ meta.group.css punctuation.definition.group.end.css */

@page :left {}
/* ^^^^^^^^^^^^^^ meta.at-rule.page.css */
/* ^ punctuation.definition.keyword.css */
Expand Down
35 changes: 12 additions & 23 deletions D/D.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ scope: source.d
contexts:
main:
- match: /\*\*/
scope: comment.block.empty.d
captures:
0: punctuation.definition.comment.d
scope: comment.block.empty.d punctuation.definition.comment.d
- include: scope:text.html.javadoc
- match: |-
(?x)^\s*
Expand Down Expand Up @@ -157,7 +155,7 @@ contexts:
scope: keyword.control.conditional.d
- match: \b(goto|break|continue)\b
scope: keyword.control.branch.d
- match: \b(while|for|do|foreach(_reverse)?)\b
- match: \b(while|for|foreach(_reverse)?)\b
scope: keyword.control.repeat.d
- match: \b(version|return|with|invariant|body|scope|in|out|inout|asm|mixin|function|delegate)\b
scope: keyword.control.statement.d
Expand Down Expand Up @@ -224,22 +222,18 @@ contexts:
- include: storage-type-d
comments:
- match: /\*
captures:
0: punctuation.definition.comment.d
scope: punctuation.definition.comment.d
push:
- meta_scope: comment.block.d
- match: \*/
captures:
0: punctuation.definition.comment.d
scope: punctuation.definition.comment.d
pop: true
- match: /\+
captures:
0: punctuation.definition.comment.d
scope: punctuation.definition.comment.d
push:
- meta_scope: comment.block.nested.d
- match: \+/
captures:
0: punctuation.definition.comment.d
scope: punctuation.definition.comment.d
pop: true
- match: (//).*$\n?
scope: comment.line.double-slash.d
Expand All @@ -261,7 +255,7 @@ contexts:
- include: $top_level_main
- match: (in|out)
scope: keyword.control.statement.d
- match: (?=body)
- match: (?=body|do)
pop: true
- match: '(?<=\})'
pop: true
Expand Down Expand Up @@ -294,13 +288,11 @@ contexts:
scope: invalid.illegal.unknown-escape.d
strings:
- match: '"'
captures:
0: punctuation.definition.string.begin.d
scope: punctuation.definition.string.begin.d
push:
- meta_scope: string.quoted.double.d
- match: '"'
captures:
0: punctuation.definition.string.end.d
scope: punctuation.definition.string.end.d
pop: true
- include: string_escaped_char
- match: (r)(")
Expand All @@ -316,8 +308,7 @@ contexts:
pop: true
- include: regular_expressions
- match: "`"
captures:
0: punctuation.definition.string.begin.d
scope: punctuation.definition.string.begin.d
push:
- meta_scope: string.quoted.double.raw.backtick.d
- match: ((?<=`)(`)|`)
Expand All @@ -326,13 +317,11 @@ contexts:
2: meta.empty-string.double.d
pop: true
- match: "'"
captures:
0: punctuation.definition.string.begin.d
scope: punctuation.definition.string.begin.d
push:
- meta_scope: string.quoted.single.d
- match: "'"
captures:
0: punctuation.definition.string.end.d
scope: punctuation.definition.string.end.d
pop: true
- include: string_escaped_char
support-type-built-ins-classes-d:
Expand Down
27 changes: 17 additions & 10 deletions D/syntax_test_d.d
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ int c = 0x0;
// ^ constant.numeric
int d = 0x0_00;
// ^ constant.numeric
int e = .0_0;
// ^ constant.numeric
float e = .0_0;
// ^ constant.numeric

template testTemplate(X)
{
Expand Down Expand Up @@ -79,7 +79,7 @@ void main(char[][] args)
auto cl = new CmdLin(argc, argv);
// ^ keyword.other
// ^ meta.block - keyword.type
writefln(cl.argnum, cl.suffix, " arg: %s", cl.argv);
writefln("%s%s arg: %s", cl.argnum, cl.suffix, cl.argv);
delete cl;
// ^ keyword.other
}
Expand Down Expand Up @@ -110,8 +110,8 @@ void main(char[][] args)
return *s;
}

char[] argcmsg = "argc = %d";
char[] allocmsg = "allocated = %d";
char[] argcmsg = "argc = %d".dup;
char[] allocmsg = "allocated = %d".dup;
writefln(argcmsg ~ ", " ~ allocmsg,
argspecs(args).count,argspecs(args).allocated);
}
Expand Down Expand Up @@ -160,16 +160,16 @@ class CmdLin
switch(_argc)
{
case 1:
suffix = "st";
suffix = "st"w.dup;
break;
case 2:
suffix = "nd";
suffix = "nd"w.dup;
break;
case 3:
suffix = "rd";
suffix = "rd"w.dup;
break;
default:
suffix = "th";
suffix = "th"w.dup;
}
return suffix;
}
Expand Down Expand Up @@ -197,6 +197,13 @@ class MyClass {
// <- storage.type
}


string sA = r"$";
// ^ punctuation.definition.string.end

void func()
in {
assert(true);
}
do {
// <- meta.function keyword.control
}
Loading