1 Then ' if block
+ '^^ keyword.control.flow.asp
+ ' ^^^^^^^^^^^^^^^ meta.between-if-and-then.asp
+ ' ^ keyword.operator.asp - punctuation.definition.tag.begin.html
+ ' ^^^ keyword.operator.logical.asp
+ ' ^ keyword.operator.asp - punctuation.definition.tag.end.html
+ ' ^^^^ keyword.control.flow.asp
+ ' ^ meta.if.block.asp
+ Exit Sub
+ '^^^^^^^^ keyword.control.flow.asp
+ ElseIf "abc>"<>"def= then " Then
+ '^^^^^^ keyword.control.flow.asp
+ ' ^^^^^^^^^^^^^^^^^^^^^^ meta.between-if-and-then.asp
+ ' ^ string.quoted.double.asp - keyword.operator.asp
+ ' ^^ keyword.operator.asp
+ ' ^ string.quoted.double.asp - keyword.operator
+ ' ^^^^ string.quoted.double.asp - keyword.control.flow.asp
+ ' ^^^^ keyword.control.flow.asp
+ ' ^ meta.if.block.asp
+ ElseIf new TestClass Then
+ ' ^^^ keyword.other.new.asp
+ ' ^^^^^^^^^ variable
+ Else
+ '^^^^ keyword.control.flow.asp
+ ' ^ meta.if.block.asp
+ example = example - 1
+ ' ^ keyword.operator.asp
+ example -= 1
+ ' ^^ invalid.illegal.unexpected-token.asp
+ example = example \ 5
+ ' ^ keyword.operator.asp
+ End If
+ '^^^^^^ keyword.control.flow.asp
+ ' ^ - meta.if.block.asp
+ End Sub
+ '^^^^^^^ storage.type.function.end.asp
+
+ If 1 _
+ = 2 Then Call DoSomething
+ ' ^^^^ keyword.control.flow.asp
+ ' ^^^^^^^^^^^^^^^^^ meta.if.line.asp - meta.if.block.asp
+ ' ^^^^ keyword.other.call.asp
+ ' ^^^^^^^^^^^ variable
+ ' ^ - meta.if.line.asp
+
+ Function IIf(expr, true_part, false_part) ' https://support.microsoft.com/en-us/kb/219271
+ ' ^^^^ variable.parameter.function.asp
+ ' ^^^^^^^^^ variable.parameter.function.asp
+ ' ^^^^^^^^^^ variable.parameter.function.asp
+ If expr Then IIf = true_part Else IIf = false_part
+ ' ^^^^^^^^^^^^^^^^^ meta.if.line.asp
+ ' ^^ - keyword.control.flow.asp
+ ' ^^^^^^^^^^^^^^^^^ meta.if.line.asp
+ ' ^ - meta.if.line.asp
+ End Function
+
+ If a is not nothing then a.b = a.b + 2
+ ' ^^^^^^ invalid.illegal.unexpected-token.asp
+ ' ^^^^^^^ storage.type.asp
+ ' ^^^^ keyword.control.flow.asp
+ ' ^^^^^^^^^^^^^^^^^^ meta.between-if-and-then.asp
+ ' ^^^^^^^^^^^^^^ meta.if.line.asp
+ ' ^ - meta.if.line.asp
+ If not a is nothing then a.b = a.b + 2
+ ' ^^^^^^^^^^^^^^^^^^ meta.between-if-and-then.asp
+ ' ^^^^^^^^^^^^^^ meta.if.line.asp
+ ' ^ variable.other.asp
+ ' ^ punctuation.accessor.dot.asp
+ ' ^ variable
+ ' ^ - meta.if.line.asp
+ ' ^^^^^^ - invalid
+ ' ^^ keyword.operator.logical.asp
+ ' ^^^^^^^ storage.type.asp
+
+ If a Then
+ ' ^ meta.if.block.asp - meta.if.line.asp
+ DoSomething ( invalid_token_inside_parens, 2, if )
+ ' ^^ invalid.illegal.unexpected-token.literal.asp
+ '^^^^^^^^^^^ variable
+ ' ^ punctuation.section.parens.begin.asp
+ ' ^ punctuation.section.parens.end.asp
+ ElseIf a = b Then AnotherSomething ' despite this being on the same line as the ElseIf, the End If is still required because the opening if statement was a block
+ ' ^ meta.if.block.asp - meta.if.line.asp
+ Else DoSomethingElse ' despite this being on the same line as the Else, the End If is still required because the opening if statement was a block
+ '^^^^ keyword.control.flow.asp
+ ' ^^^^^^^^^^^^^^^^ meta.if.block.asp
+ End If
+ ' ^ - meta.if.block.asp
+
+ If a Then Call
+
+ Dim str1_ REM example
+ '^^^ storage.modifier.asp
+ ' ^ - constant.numeric.asp
+ ' ^ - punctuation.separator.continuation.line.asp
+ ' ^^^ punctuation.definition.comment.asp
+ ' ^^^^^^^^^^^^ comment.line.rem.asp
+ str1 = "this is a ""hello-world""" & " " &"""" + "test" +_ 'continue on next line, comments not allowed here
+'<- - comment.line.rem.asp
+ ' ^^ string.quoted.double.asp constant.character.escape.apostrophe.asp
+ ' ^ string.quoted.double.asp - keyword.operator.asp
+ ' ^^ string.quoted.double.asp constant.character.escape.apostrophe.asp - punctuation.definition.string.end.asp
+ ' ^ string.quoted.double.asp punctuation.definition.string.end.asp
+ ' ^ keyword.operator.asp
+ ' ^^^ string.quoted.double.asp
+ ' ^ keyword.operator.asp
+ ' ^^^^ string.quoted.double.asp
+ ' ^^ constant.character.escape.apostrophe.asp - punctuation.definition.string.end.asp
+ ' ^ keyword.operator.asp
+ ' ^ punctuation.separator.continuation.line.asp
+ ' ^^^^^^^^^^^^^ invalid.illegal.expected-end-of-line.asp - comment
+ Chr(34) & vbCrLf _ +
+ ' ^^^ support.function.vb.asp
+ ' ^ punctuation.section.parens.begin.asp
+ ' ^ punctuation.section.parens.end.asp
+ ' ^^^^^^ support.type.vb.asp
+ ' ^ punctuation.separator.continuation.line.asp
+ ' ^ invalid.illegal.expected-end-of-line.asp
+
+ value = 1/2
+ ' ^ keyword.operator.asp
+ value = &HFF mod 3
+ ' ^^^^ constant.numeric.integer.hexadecimal.asp
+ ' ^^^ keyword.operator.asp
+ Select Case call value:Case 1
+ '^^^^^^^^^^^ keyword.control.flow.asp
+ ' ^^^^ meta.select.block.asp invalid.illegal.unexpected-token.literal.asp
+ ' ^ meta.select.block.asp punctuation.terminator.statement.asp
+ ' ^^^^ keyword.control.flow.asp
+ Case 2
+ '^^^^ keyword.control.flow.asp
+'<- meta.select.block.asp
+ Case
+ Case vbNullString
+ '^^^^ keyword.control.flow.asp
+ ' ^^^^^^^^^^^^ support.type.vb.asp
+ Case Else
+ '^^^^^^^^^ keyword.control.flow.asp
+ If value >= 4 and Value<=5 Then MsgBox("no end if required here")
+ ' ^^ keyword.operator.asp
+ ' ^^ keyword.operator.asp
+ ' ^^^^^^ support.function.vb.asp
+ If Not (value Is Nothing) then valueis = vbFalse
+ ' ^^^ keyword.operator.logical.asp
+ ' ^ punctuation.section.parens.begin.asp
+ ' ^^ keyword.operator.logical.asp
+ ' ^ punctuation.section.parens.end.asp
+ ' ^^ - keyword.operator
+ ' ^^^^^^^ support.type.vb.asp
+'<- meta.select.block.asp
+ End Select
+ '^^^^^^^^^^ keyword.control.flow.asp
+ ' ^ - meta.select.block.asp
+ 'the underscore in this comment should be ignored _ as should the colon :
+ ' ^ comment.line.apostrophe.asp - keyword - invalid - punctuation
+ ' ^ comment.line.apostrophe.asp - keyword - punctuation - invalid
+
+ Sub Test _
+ _ ' ^ punctuation.separator.continuation.line.asp
+ _ '^^^ storage.type.function.asp
+ _ ' ^^^^ entity.name.function.asp
+ _ '^^^^^^^^^ meta.method.asp meta.method.identifier.asp
+ (_
+ _ ' ^ meta.method.asp meta.method.identifier.asp punctuation.section.parens.begin.asp
+ _ ' ^ punctuation.separator.continuation.line.asp
+ abc, ByRef def _
+ _ '^^^ meta.method.asp meta.method.identifier.asp variable.parameter.function.asp
+ _ ' ^ meta.method.asp meta.method.identifier.asp punctuation.separator.parameter-declaration.asp
+ _ ' ^^^^^ meta.method.asp meta.method.identifier.asp storage.modifier.reference.asp
+ _ ' ^^^ meta.method.asp meta.method.identifier.asp variable.parameter.function.asp
+ _ ' ^ meta.method.asp meta.method.identifier.asp punctuation.separator.continuation.line.asp
+ )
+ '^ meta.method.asp meta.method.identifier.asp punctuation.section.parens.end.asp
+
+ Dim x _
+ ,y()
+ ' ^^ meta.array.definition.asp punctuation.section.array
+ a)
+ '^ invalid.illegal.stray-close-bracket.asp
+ a(
+ ReDim arr(2,b)
+ '^^^^^ storage.modifier.asp
+ ' ^^^ variable.other.asp
+ ' ^^^^^ meta.array.definition.asp
+ ' ^ constant.numeric
+ ' ^ punctuation.separator.array.asp
+ ' ^ variable.other.asp - invalid - constant.numeric
+ ' ^ punctuation.section.array.end.asp
+
+ ReDim arr(dim, other)
+ ' ^^^ invalid.illegal
+ ' ^ - invalid
+ ' ^^^^^^^^ - invalid
+ ReDim Dim(2,4)
+ ' ^^^ invalid.illegal.name.asp
+
+'<- - invalid
+
+ Dim a(0,&H5&)
+ ' ^^^^^^^ meta.array.definition.asp
+ ' ^ punctuation.section.array.begin.asp
+ ' ^ constant.numeric
+ ' ^ punctuation.separator.array.asp
+ ' ^^^^ constant.numeric.integer.hexadecimal.asp
+ ' ^^ punctuation.definition.numeric.hexadecimal.asp
+ ' ^ punctuation.definition.numeric.hexadecimal.asp
+ ' ^ punctuation.section.array.end.asp
+ b = a Is Empty : Dim loop,nope : Dim foobar
+ '^^^^^^^^^^^^^^^^^^^^^ - invalid.illegal.unexpected-token.asp - invalid.illegal.name.asp
+ ' ^^^^^^^^^^^^^ - invalid
+ ' ^ punctuation.terminator.statement.asp
+ ' ^^^ storage.modifier.asp
+ ' ^^^^ invalid.illegal.name.asp - variable.other.asp
+ ' ^ punctuation.terminator.statement.asp
+ ' ^^^ storage.modifier.asp
+ Dim hello_world, 2
+ ' ^ invalid.illegal.unexpected-token.asp - variable
+ ' ^ - invalid
+
+ ReDim Preserve arr ( &HA,c)
+ '^^^^^^^^^^^^^^ storage.modifier.asp
+ ' ^^^ variable.other.asp
+ ' ^^^^^^^^ meta.array.definition.asp
+ ' ^ punctuation.section.array.begin.asp
+ ' ^^^ constant.numeric.integer.hexadecimal.asp
+ ' ^ punctuation.separator.array.asp
+ ' ^ punctuation.section.array.end.asp
+ For x = LBound(a) to UBound(a) Step 2 'test
+ '^^^ keyword.control.flow.asp
+ ' ^ variable.other.asp
+ ' ^ keyword.operator.asp
+ ' ^^^^^^ support.function.vb.asp
+ ' ^ punctuation.section.parens.begin.asp
+ ' ^ variable.other.asp
+ ' ^ punctuation.section.parens.end.asp
+ ' ^ punctuation.section.parens.begin.asp
+ ' ^ variable.other.asp
+ ' ^ punctuation.section.parens.end.asp
+ ' ^^ keyword.control.flow.asp
+ ' ^^^^^^ support.function.vb.asp
+ ' ^^^^ keyword.control.flow.asp
+ ' ^ constant.numeric
+ ' ^ meta.for.block.asp
+ ' ^^^^^^ comment.line.apostrophe.asp
+ a(x) = x * 10
+ '^ variable.other.asp
+ ' ^ variable.other.asp
+ ' ^ punctuation.section.parens.begin.asp - variable.other.asp
+ ' ^ punctuation.section.parens.end.asp - variable.other.asp
+ ' ^ variable.other.asp
+ ' ^ keyword.operator.asp
+ Next
+ '^^^^ keyword.control.flow.asp
+ ' ^ - meta.for.block.asp
+ End Sub
+
+ Sub NoParens fg
+ ' ^^^^^^^^ meta.method.asp meta.method.identifier.asp entity.name.function.asp
+ ' ^^ invalid.illegal.unexpected-token.asp - meta.method.identifier.asp
+ End Sub
+
+ Function NoParams'()
+ '^^^^^^^^^^^^^^^^^ meta.method.asp meta.method.identifier.asp
+ ' ^^^^^^^^ entity.name.function.asp
+ ' ^^^ comment.line.apostrophe.asp - entity.name.function.asp - invalid.illegal.unexpected-token-after-method-declaration.asp - punctuation.section.parens
+ NoParams = InStr(1, "hello_'", "L", vbTextCompare)
+'<- meta.method.body.asp - invalid.illegal.unexpected-token-after-method-declaration.asp - meta.method.identifier.asp
+ '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - invalid.illegal.unexpected-token-after-method-declaration.asp - meta.method.asp meta.method.identifier.asp - invalid.illegal.expected-end-of-line.asp - comment.line.rem.asp
+ ' ^^^^^ support.function.vb.asp
+ ' ^ punctuation.section.parens.begin.asp
+ ' ^^^^^^^^^^^^^ support.type.vb.asp
+ ' ^ punctuation.section.parens.end.asp
+ Test = True Xor False
+ ' ^^^^ storage.type.asp
+ ' ^^^ keyword.operator.logical.asp
+ ' ^^^^^ storage.type.asp
+ End Function
+ Sub Test2
+ '^^^ meta.method.asp meta.method.identifier.asp storage.type.function.asp
+ ' ^^^^^ meta.method.asp meta.method.identifier.asp entity.name.function.asp
+ hello = world
+ '^ - entity.name.function.asp - meta.method.asp meta.method.identifier.asp
+ End Sub
+ Call Test
+ '^^^^ keyword.other.call.asp
+ Call NoParams
+
+ Sub Wow (test _ 'test
+ ,def _ '^^^^^^^^^^^^^^^^^^^^^^ meta.method.asp meta.method.identifier.asp
+ _ '^^^ storage.type.function.asp
+ ' ^^^ entity.name.function.asp
+ ' ^^^^^ invalid.illegal.expected-end-of-line.asp
+ ) ' this bracket doesn't form part of the method declaration - the line above is missing a _ and contains non-whitespace
+ '^ meta.method.body.asp - meta.method.identifier.asp - punctuation.section.parens.end.asp
+ MsgBox "hi", vbOkCancel or vbExclamation or vbDefaultButton1, "title"
+ ' ^^^^^^^^^^ support.type.vb.asp - variable.other.asp
+ ' ^^ keyword.operator.logical.asp
+ ' ^^^^^^^^^^^^^ support.type.vb.asp
+ ' ^^^^^^^^^^^^^^^^ support.type.vb.asp
+ End Sub
+
+ Dim [], [ažė+, (], [dim], [a(4)]
+ ' ^^ variable.other.asp
+ ' ^ punctuation.separator.variable-declaration.asp - meta.variable-definition.asp
+ ' ^^^^^^^^^ variable.other.asp - keyword - punctuation
+ ' ^^^^^ variable.other.asp
+ ' ^ punctuation.separator.variable-declaration.asp
+ ' ^^^^^^ variable.other.asp - meta.array.definition.asp - punctuation.section.array
+ [dim] = 5 ^ 2
+ '^^^^^ variable.other.asp
+ ' ^ keyword.operator.asp
+
+ Function [abcdef()hij] (blah)
+ '^^^^^^^^ storage.type.function.asp
+ ' ^^^^^^^^^^^^^ entity.name.function.asp
+ ' ^ - entity.name.function.asp
+ ' ^^^^ variable.parameter.function.asp
+ [abcdef()hij] = blah
+ '^^^^^^^^^^^^^ variable.other.asp
+ ' ^^^^ variable.other.asp
+ End Function
+ '^^^^^^^^^^^^ storage.type.function.end.asp
+ Response.Write [abcdef()hij]("hello")
+ ' ^^^^^^^^^^^^^ variable.other.asp
+ ' ^ punctuation.section.parens.begin.asp
+ ' ^ punctuation.section.parens.end.asp
+
+ End If ' nothing to end
+ '^^^ invalid.illegal.unexpected-token.asp
+' check that the incomplete if gets dropped off after the end of the line
+'<- - meta.between-if-and-then.asp invalid.illegal.unexpected-end-of-statement.asp
+
+ For Each cookie In Request.Cookies
+ '<- - meta.between-if-and-then.asp
+ '^^^^^^^^ keyword.control.flow.asp
+ ' ^^^^^^ variable.other.asp
+ ' ^^ keyword.control.flow.asp
+ ' ^ meta.for.block.asp
+ Response.Write(vbCrLf & cookie)
+ '^^^^^^^^ support.class.asp
+ ' ^ punctuation.accessor.dot.asp
+ ' ^^^^^^ support.type.vb.asp
+ ' ^ keyword.operator.asp
+ ' ^^^^^^ variable.other.asp
+ If x = y Then Exit For
+ '^^ keyword.control.flow.asp
+ ' ^ variable.other.asp
+ ' ^ variable.other.asp
+ ' ^^^^ keyword.control.flow.asp
+ ' ^^^^^^^^^ meta.if.line.asp
+ ' ^^^^^^^^ keyword.control.flow.asp
+ ' ^ - meta.if.line.asp
+ Response.Write("----" & vbCrLf)
+ '^^^^^^^^ support.class.asp
+ ' ^ punctuation.section.parens.begin.asp
+ ' ^ punctuation.section.parens.end.asp
+
+ abc = x >< y
+ ' ^^ invalid.illegal.unexpected-token.asp
+ abc = x <> y
+ ' ^^ keyword.operator.asp
+ Next
+ '^^^^ keyword.control.flow.asp
+ ' ^ - meta.for.block.asp
+
+ If
+ '^^ keyword.control.flow.asp
+ ' ^ meta.between-if-and-then.asp
+ ' the above if statement has no "Then"
+ '^ - meta.between-if-and-then.asp
+
+ Do
+ '^^ meta.do.block.asp keyword.control.flow.asp
+ Exit Do
+ '^^^^^^^ meta.do.block.asp keyword.control.flow.asp
+ Loop
+ '^^^^ keyword.control.flow.asp
+ ' ^ - meta.do.block.asp
+
+ Do
+ Exit Do
+ Loop Until x = y
+ '^^^^^^^^^^ keyword.control.flow.asp
+ ' ^ variable.other.asp
+ ' ^ keyword.operator.asp
+ ' ^ variable.other.asp
+ ' ^ - meta.do.block.asp
+
+ Do
+ Exit Do
+ Loop While x <> y
+ '^^^^^^^^^^ keyword.control.flow.asp
+ ' ^ variable.other.asp
+ ' ^ variable.other.asp
+ ' ^ - meta.do.block.asp - meta.while.block.asp
+
+ While True
+ '^^^^^ meta.while.block.asp keyword.control.flow.asp
+ ' ^^^^ storage.type.asp - variable.other.asp
+ Wend
+ '^^^^ keyword.control.flow.asp
+ ' ^ - meta.while.block.asp
+
+ Application.Lock
+ '^^^^^^^^^^^ support.class.asp - variable.other.asp
+ ' ^ punctuation.accessor.dot.asp
+ ' ^^^^ support.function.asp - variable.other.asp
+ Application("NumVisits") = Application("NumVisits") + 1
+ '^^^^^^^^^^^ support.class.asp
+ ' ^ punctuation.section.parens.begin.asp
+ ' ^ punctuation.section.parens.end.asp
+ ' ^ punctuation.section.parens.begin.asp
+ ' ^ punctuation.section.parens.end.asp
+ Application.Unlock
+ '^^^^^^^^^^^ support.class.asp
+ ' ^ punctuation.accessor.dot.asp
+ ' ^^^^^^ support.function.asp
+ %>
+ This application page has been visited
+ <%= Application("NumVisits") %> times!
+ <%
+
+ Sub Application_OnStart()
+ '^^^ storage.type.function.asp
+ ' ^^^^^^^^^^^^^^^^^^^ entity.name.function.asp support.function.magic.event.asp
+ Application("NumVisits") = 0
+ ' ^ punctuation.section.parens.begin.asp
+ ' ^ punctuation.section.parens.end.asp
+ End Sub
+ '^^^^^^^ storage.type.function.end.asp
+
+ Sub Application_OnStartup()
+ ' ^^^^^^^^^^^^^^^^^^^^^ entity.name.function.asp - support.function.magic.event.asp
+ End Sub
+
+ Sub Func_With_Explicit_Arrays(ByRef array_variable(), blah ())
+ ' ^ punctuation.section.array.begin.asp
+ ' ^ punctuation.section.array.end.asp
+ ' ^^^^^^^^^^^^ - invalid
+ ' ^ punctuation.separator.parameter-declaration.asp
+ ' ^^^^ variable.parameter.function.asp
+ ' ^ punctuation.section.array.begin.asp
+ ' ^ punctuation.section.array.end.asp
+ ' ^ punctuation.section.parens.end.asp
+ End Sub
+
+ Sub Another_Test()rem
+ '^^^ storage.type.function.asp
+ ' ^^^^^^^^^^^^ entity.name.function.asp
+ ' ^^ punctuation.section.parens
+ ' ^^^^ comment.line.rem.asp - meta.method.identifier.asp
+ Const ForAppending = 8
+ '^^^^^ meta.method.body.asp storage.modifier.asp
+
+ Set objFSO = CreateObject("Scripting.FileSystemObject")
+ ' ^^^^^^ variable.other.asp
+ Set objTextFile = objFSO.OpenTextFile("d:\logfile.c", ForAppending, True)
+ ' ^^^^^^^^^^^^ variable.other.asp
+
+ Dim Line
+ ' ^^^^ variable.other.asp
+ Line = 0
+ '^^^^ variable.other.asp
+ Do While Line < 2000
+ '^^^^^^^^ keyword.control.flow.asp
+ '^^^^^^^^^^^^^^^^^^^^^ meta.do.block.asp - meta.while.block.asp
+ ' ^^^^ variable.other.asp
+ ' ^ keyword.operator.asp
+ ' ^^^^ constant.numeric
+ objTextFile.WriteLine("long l" & Line & " = " & Line)
+ '^^^^^^^^^^^ variable.other.asp
+ ' ^^^^^^^^^ variable
+ Line = Line + 1
+ Dim WshShell 'http://stackoverflow.com/a/2237479/4473405
+ Set WshShell=Server.CreateObject("WScript.Shell")
+ WshShell.Run "waitfor /T " & numberOfSecond & "SignalThatWontHappen", , True
+
+ do until Line = Line
+ '^^^^^^^^ keyword.control.flow.asp
+ ' ^^^^ variable.other.asp
+ ' ^^^^ variable.other.asp
+ '^^^^^^^^^^^^^^^^^^^^^ meta.do.block.asp meta.do.block.asp - invalid
+ ' this code will never run
+ loop
+ '^^^^ keyword.control.flow.asp
+ Loop
+ '^^^^ keyword.control.flow.asp
+ ' ^ - meta.do.block.asp
+
+ objTextFile.Close
+
+ Set objTextFile = Nothing
+ Set objFSO = Nothing
+ End _
+ Sub
+ ' ^^^ storage.type.function.end.asp - meta.method.identifier.asp
+
+ a=3.4*.5*6.*0.25
+ ' ^^^ constant.numeric.float.decimal.asp
+ ' ^^ constant.numeric.float.decimal.asp
+ ' ^^ constant.numeric.float.decimal.asp
+ ' ^^^^ constant.numeric.float.decimal.asp
+ a=a+0.8
+ ' ^^^ constant.numeric.float.decimal.asp
+ ExampleSub 3.4,.5,6.,&HA,&H2,7*2.1e2,9,-3.402823E+38, 3.402823E38 ,1.401298E-45,Round(4.94065645841247E-324),a2,2a,123.456.789.321.654.321
+ ' ^^^ constant.numeric.float.decimal.asp
+ ' ^^ constant.numeric.float.decimal.asp
+ ' ^^ constant.numeric.float.decimal.asp
+ ' ^^^ constant.numeric.integer.hexadecimal.asp
+ ' ^^^ constant.numeric.integer.hexadecimal.asp
+ ' ^ constant.numeric
+ ' ^^^^^ constant.numeric.float.decimal.asp
+ ' ^ constant.numeric
+ ' ^^^^^^^^^^^^ constant.numeric.float.decimal.asp
+ ' ^^^^^^^^^^^ constant.numeric.float.decimal.asp
+ ' ^^^^^^^^^^^^ constant.numeric.float.decimal.asp
+ ' ^^^^^ support.function.vb.asp
+ ' ^^^^^^^^^^^^^^^^^^^^^ constant.numeric.float.decimal.asp
+ ' ^^ - constant.numeric
+ ' ^ - constant.numeric
+ ' ^^^^^^^^ - constant.numeric
+
+ response.write(test..b)
+ ' ^ punctuation.accessor.dot.asp
+ ' ^ invalid.illegal.unexpected-token.asp
+
+ [abc=123:def] = 4
+ '^^^^^^^^^^^^^ variable.other.asp - punctuation - keyword - constant
+
+ Randomize Timer
+ '^^^^^^^^^^^^^^^ storage.type.asp
+ a=Abs(-6)*Rnd()*2+Fix(2.75) + Int(3.14)/Sin(30)+Cos(20)+Tan(40)+Sqr(4)+Log(6)+Sgn(3)
+ ' ^^^ support.function.vb.asp
+ ' ^^^ support.function.vb.asp
+ ' ^^^ support.function.vb.asp
+ ' ^^^ support.function.vb.asp
+ ' ^^^ support.function.vb.asp
+ ' ^^^ support.function.vb.asp
+ ' ^^^ support.function.vb.asp
+ ' ^^^ support.function.vb.asp
+ ' ^^^ support.function.vb.asp
+ ' ^^^ support.function.vb.asp
+
+ b=Oct(12) & Hex(12)
+ ' ^^^ support.function.vb.asp
+ ' ^^^ support.function.vb.asp
+ c = CSng("123") + CDbl("123") + CInt("123")+CLng("123")
+ ' ^^^^ support.function.vb.asp
+ ' ^^^^ support.function.vb.asp
+ ' ^^^^ support.function.vb.asp
+ ' ^^^^ support.function.vb.asp
+ d = Time
+ ' ^^^^ support.function.vb.asp
+ e = Date()
+ ' ^^^^ support.function.vb.asp
+
+ submit = 2
+ '^^^^^^ variable.other.asp - storage.type.function.asp
+ function_hello = 2
+ '^^^^^^^^^^^^^^ variable.other.asp - storage.type.function.asp
+
+ %>
+ '^^ punctuation.section.embedded.end.asp
+ ' ^ - source.asp.embedded.html
+ This file was last modified on: <%response.write(modified)
+ '^ - source.asp.embedded.html
+ ' ^^ punctuation.section.embedded.begin.asp
+ ' ^ source.asp.embedded.html
+ ' ^^^^^^^^ support.class.asp
+ ' ^^^^^ support.function.asp
+ %>
+
+
+ '^^^ text.html.asp meta.tag.block.any.html - source.asp.embedded.html
+ <%='test %>
+ '^^^ punctuation.section.embedded.begin.asp - source.asp
+ ' ^^^^^^ comment.line.apostrophe.asp
+ ' ^^ punctuation.section.embedded.end.asp - comment
+ ' ^^^ - source.asp.embedded.html
+ <%= "this" + Chr(32) + "that" %>
+ '^^^ punctuation.section.embedded.begin.asp - source.asp.embedded.html
+ ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.asp.embedded.html
+ ' ^^^^^^ string.quoted.double.asp
+ ' ^ keyword.operator.asp
+ ' ^^^ support.function.vb.asp
+ ' ^^ punctuation.section.embedded.end.asp - source.asp
+<%
+
+Class ClassContainingMethodsWithReservedWords
+ Sub [Select]()
+ '^^^ storage.type.function.asp
+ ' ^^^^^^^^ entity.name.function.asp
+ ' ^ - entity.name.function.asp
+
+ End Sub
+
+ Sub [End]()
+ '^^^ storage.type.function.asp
+ ' ^^^^^ entity.name.function.asp
+ ' ^ - entity.name.function.asp
+
+ End Sub
+End Class
+Set ccmwrw = new ClassContainingMethodsWithReservedWords
+ccmwrw.Select()
+' ^ punctuation.accessor.dot.asp
+' ^^^^^^ variable.other.member.asp - invalid - keyword
+' ^^ - variable - invalid - keyword
+ccmwrw. Select() ' spaces are not allowed after the .
+' ^ punctuation.accessor.dot.asp
+' ^ - invalid
+' ^^^^^^ variable.other.member.asp - invalid - keyword
+' ^^ - variable - invalid - keyword
+ccmwrw.End
+' ^ punctuation.accessor.dot.asp
+' ^^^ variable.other.member.asp - invalid - keyword
+' ^ - invalid - variable
+ccmwrw .End
+' ^ invalid.illegal.unexpected-token.asp
+' ^ punctuation.accessor.dot.asp
+' ^^^ variable.other.member.asp - invalid - keyword
+' ^ - invalid
+ccmwrw.[End] ()
+' ^ punctuation.accessor.dot.asp
+' ^^^^^ variable.other.member.asp - invalid - keyword
+' ^^^ - variable - invalid - keyword
+ccmwrw. [End] ()
+' ^ punctuation.accessor.dot.asp
+' ^ - invalid - variable
+' ^^^^^ variable.other.member.asp - invalid - keyword
+' ^^^ - variable - invalid - keyword
+
+_
+ 'a line continuation char can be followed by just a comment on the next non blank line
+ ' ^ punctuation.definition.comment.asp
+ ' ^^^^^^ comment.line.apostrophe.asp
+
+t = [unclosed variable identifier
+' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variable.other.asp
+Dim test
+'<- storage.modifier.asp - variable
+ rem the syntax on the next line will cause an unterminated string constant error
+'^^^^^^ comment.line.rem.asp
+test = "hello%>
+' ^^^^^^ source.asp.embedded.html string.quoted.double.asp
+' ^^ punctuation.section.embedded.end.asp - string.quoted.double.asp
+' ^ - source.asp.embedded.html
+
+
+' ^^ punctuation.section.embedded.end.asp
+' ^^ text.html.asp meta.tag.inline.any.html entity.name.tag.inline.any.html
+<% Sub InventiveMethodNameHere(list) %>
+' ^^^ meta.method.identifier.asp storage.type.function.asp
+' ^ text.html.asp source.asp.embedded.html meta.method.asp meta.method.body.asp
+' ^^ text.html.asp punctuation.section.embedded.end.inside-block.asp
+
+<% End Sub %>
+' ^^^^^^^ text.html.asp source.asp.embedded.html meta.method.asp storage.type.function.end.asp
+' ^ - meta.method.asp
+
+'^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.tag.block.any.html
+' ^^^^^^^^^ meta.tag.block.any.html
+' ^^^^^ meta.attribute-with-value.class.html entity.other.attribute-name.class.html
+' ^^^ meta.attribute-with-value.class.html string.quoted.double.html
+' ^^^^^^^^^^ meta.attribute-with-value.class.html string.quoted.double.html
+' ^ - string
+' ^^^^^^^^^^^^^^^^ meta.class-name.html
+' ^^^^^^^^^^ meta.class-name.html
+' ^^ punctuation.section.embedded.begin.asp
+' ^^^^^^^^^^^^^ source.asp.embedded.html
+' ^^ keyword.control.flow.asp
+' ^^^^ meta.between-if-and-then.asp storage.type.asp
+' ^^^^ keyword.control.flow.asp
+' ^ meta.if.block.asp
+' ^ meta.if.block.asp
+' ^^ punctuation.section.embedded.end.inside-block.asp
+' ^^ punctuation.section.embedded.begin.inside-block.asp
+' ^^^^^^ keyword.control.flow.asp
+' ^^ punctuation.section.embedded.end.asp - meta.if.block.asp
+' ^ punctuation.definition.tag.end.html
+
+
+'^^^ meta.tag.block.any.html
+' ^^^^^^^^^^^^^^^^ meta.tag.block.any.html
+'^ punctuation.definition.tag.begin.html
+' ^ entity.name.tag.block.any.html
+' ^^^ punctuation.section.embedded.begin.asp
+' ^^^^^^^^^^^^^^^^ string.quoted.double.asp
+' ^^ punctuation.section.embedded.end.asp
+' ^^ meta.attribute-with-value.id.html entity.other.attribute-name.id.html
+' ^^^^^ meta.attribute-with-value.id.html string.quoted.double.html meta.toc-list.id.html
+' ^ punctuation.definition.tag.end.html
+' ^ - meta.tag.block.any.html
+<% If True Then
+ Do
+ %>
+
+ '^^^^^^ meta.tag.inline.any.html
+ '^ punctuation.definition.tag.begin.html
+ ' ^^^^ entity.name.tag.inline.any.html
+ ' ^^^ punctuation.section.embedded.begin.inside-block.asp
+ ' ^^^^^^^^^^^^^^^^ string.quoted.double.asp
+ ' ^^ punctuation.section.embedded.end.inside-block.asp
+ ' ^^^^^^^^^^^^ meta.tag
+ ' ^^ meta.attribute-with-value.id.html entity.other.attribute-name.id.html
+ ' ^^^^^ meta.attribute-with-value.id.html string.quoted.double.html meta.toc-list.id.html
+ ' ^ punctuation.definition.tag.end.html
+ ' ^^^^^^^ meta.tag.inline.any.html - meta.tag.after-embedded-asp.any.html
+ ' ^^ punctuation.definition.tag.begin.html
+ ' ^^^^ entity.name.tag.inline.any.html
+ ' ^ punctuation.definition.tag.end.html
+<% Loop
+ End If %>
+ '^^^^^^ keyword.control.flow.asp
+
+
+'^^^^^^^^^^^^^^^^^^^^^^^ meta.tag.inline.any.html
+' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.tag.inline.any.html
+'^ punctuation.definition.tag.begin.html
+' ^^^^ entity.name.tag.inline.any.html
+' ^^ punctuation.section.embedded.begin.asp
+' ^^ keyword.control.flow.asp
+' ^^^^^ meta.between-if-and-then.asp storage.type.asp
+' ^^^^ keyword.control.flow.asp
+' ^^ punctuation.section.embedded.end.inside-block.asp
+' ^^^^^^^^^^^^ meta.attribute-with-value.class.html
+' ^^^^^ entity.other.attribute-name.class.html
+' ^ punctuation.separator.key-value.html
+' ^ string.quoted.double.html punctuation.definition.string.begin.html
+' ^^^^ string.quoted.double.html meta.class-name.html
+' ^ string.quoted.double.html punctuation.definition.string.end.html
+' ^^ punctuation.section.embedded.begin.inside-block.asp
+' ^^^^^^ keyword.control.flow.asp
+' ^^ punctuation.section.embedded.end.asp
+' ^^ meta.attribute-with-value.id.html entity.other.attribute-name.id.html
+' ^^^^^ meta.attribute-with-value.id.html string.quoted.double.html meta.toc-list.id.html
+' ^ punctuation.definition.tag.end.html
+
+'^^^^^^^^^^^ meta.tag
+'^^ meta.attribute-with-value.id.html entity.other.attribute-name.id.html
+' ^^^^^ meta.attribute-with-value.id.html string.quoted.double.html meta.toc-list.id.html
+' ^ punctuation.definition.tag.end.html
+' ^^^^^^^ meta.tag.inline.any.html - meta.tag.after-embedded-asp.any.html
+' ^^ punctuation.definition.tag.begin.html
+' ^^^^ entity.name.tag.inline.any.html
+' ^ punctuation.definition.tag.end.html
+ <% If True Then %>
+'^^ punctuation.section.embedded.begin.asp
+' ^^ punctuation.section.embedded.end.inside-block.asp
+
+'^^^^^^^^^^^^^ meta.tag.inline.any.html
+' ^ string.quoted.double.html punctuation.definition.string.begin.html
+' ^^^ punctuation.section.embedded.begin.inside-block.asp
+' ^^ punctuation.section.embedded.end.inside-block.asp
+' ^^^^^^^^^^^^^ meta.tag
+' ^ string.quoted.double.html punctuation.definition.string.end.html
+' ^^ meta.attribute-with-value.id.html entity.other.attribute-name.id.html
+' ^^^^^ meta.attribute-with-value.id.html string.quoted.double.html meta.toc-list.id.html
+' ^ punctuation.definition.tag.end.html
+' ^^^^^^^ meta.tag.inline.any.html - meta.tag.after-embedded-asp.any.html
+' ^^ punctuation.definition.tag.begin.html
+' ^^^^ entity.name.tag.inline.any.html
+' ^ punctuation.definition.tag.end.html
+ <% End If %>
+'^^ punctuation.section.embedded.begin.inside-block.asp
+' ^^^^^^ keyword.control.flow.asp
+' ^^ punctuation.section.embedded.end.asp
+ <%
+ = hi = 2 ' will output a boolean expression - True or False %>
+' ^ punctuation.section.embedded.begin.asp
+' ^^^^^^^^^^ source.asp.embedded.html
+' ^^ variable.other.asp
+' ^ keyword.operator.asp
+' ^ constant.numeric
+' ^ comment
+
+'<- - comment - source.asp.embedded.html
+
+'^^^^^^^ meta.tag.structure.any.html
+
+
diff --git a/assets/syntaxes/Packages/ActionScript/ActionScript.sublime-build b/assets/syntaxes/Packages/ActionScript/ActionScript.sublime-build
new file mode 100644
index 000000000..4532cea65
--- /dev/null
+++ b/assets/syntaxes/Packages/ActionScript/ActionScript.sublime-build
@@ -0,0 +1,12 @@
+{
+ "selector": "source.actionscript",
+ "cmd": [
+ "mxmlc",
+ "${file}",
+ "-library-path+=${project_path}/libs",
+ "-output", "${project_path}/bin/${project_base_name}.swf",
+ "-debug=false",
+ "-static-link-runtime-shared-libraries=true"
+ ],
+ "file_regex": "^(.+?)\\(([0-9]+)\\): col: (([0-9]+))(.*)$"
+}
\ No newline at end of file
diff --git a/assets/syntaxes/Packages/ActionScript/ActionScript.sublime-syntax b/assets/syntaxes/Packages/ActionScript/ActionScript.sublime-syntax
new file mode 100644
index 000000000..a1f0ae038
--- /dev/null
+++ b/assets/syntaxes/Packages/ActionScript/ActionScript.sublime-syntax
@@ -0,0 +1,91 @@
+%YAML 1.2
+---
+# http://www.sublimetext.com/docs/3/syntax.html
+name: ActionScript
+file_extensions:
+ - as
+scope: source.actionscript.2
+contexts:
+ main:
+ - match: \b(R(ecordset|DBMSResolver|adioButton(Group)?)|X(ML(Socket|Node|Connector)?|UpdateResolverDataHolder)|M(M(Save|Execute)|icrophoneMicrophone|o(use|vieClip(Loader)?)|e(nu(Bar)?|dia(Controller|Display|Playback))|ath)|B(yName|inding|utton)|S(haredObject|ystem|crollPane|t(yleSheet|age|ream)|ound|e(ndEvent|rviceObject)|OAPCall|lide)|N(umericStepper|et(stream|S(tream|ervices)|Connection|Debug(Config)?))|C(heckBox|o(ntextMenu(Item)?|okie|lor|m(ponentMixins|boBox))|ustomActions|lient|amera)|T(ypedValue|ext(Snapshot|Input|F(ield|ormat)|Area)|ree|AB)|Object|D(ownload|elta(Item|Packet)?|at(e(Chooser|Field)?|a(G(lue|rid)|Set|Type)))|U(RL|TC|IScrollBar)|P(opUpManager|endingCall|r(intJob|o(duct|gressBar)))|E(ndPoint|rror)|Video|Key|F(RadioButton|GridColumn|MessageBox|BarChart|S(croll(Bar|Pane)|tyleFormat|plitView)|orm|C(heckbox|omboBox|alendar)|unction|T(icker|ooltip(Lite)?|ree(Node)?)|IconButton|D(ataGrid|raggablePane)|P(ieChart|ushButton|ro(gressBar|mptBox))|L(i(stBox|neChart)|oadingBox)|AdvancedMessageBox)|W(indow|SDLURL|ebService(Connector)?)|L(ist|o(calConnection|ad(er|Vars)|g)|a(unch|bel))|A(sBroadcaster|cc(ordion|essibility)|S(Set(Native|PropFlags)|N(ew|ative)|C(onstructor|lamp(2)?)|InstanceOf)|pplication|lert|rray))\b
+ scope: support.class.actionscript.2
+ - match: \b(s(h(ift|ow(GridLines|Menu|Border|Settings|Headers|ColumnHeaders|Today|Preferences)?|ad(ow|ePane))|c(hema|ale(X|Mode|Y|Content)|r(oll(Track|Drag)?|een(Resolution|Color|DPI)))|t(yleSheet|op(Drag|A(nimation|llSounds|gent))?|epSize|a(tus|rt(Drag|A(nimation|gent))?))|i(n|ze|lence(TimeOut|Level))|o(ngname|urce|rt(Items(By)?|On(HeaderRelease)?|able(Columns)?)?)|u(ppressInvalidCalls|bstr(ing)?)|p(li(ce|t)|aceCol(umnsEqually|lumnsEqually))|e(nd(DefaultPushButtonEvent|AndLoad)?|curity|t(R(GB|o(otNode|w(Height|Count))|esizable(Columns)?|a(nge|te))|G(ain|roupName)|X(AxisTitle)?|M(i(n(imum|utes)|lliseconds)|o(nth(Names)?|tionLevel|de)|ultilineMode|e(ssage|nu(ItemEnabled(At)?|EnabledAt)|dia)|a(sk|ximum))|B(u(tton(s|Width)|fferTime)|a(seTabIndex|ndwidthLimit|ckground))|S(howAsDisabled|croll(ing|Speed|Content|Target|P(osition|roperties)|barState|Location)|t(yle(Property)?|opOnFocus|at(us|e))|i(ze|lenceLevel)|ort(able(Columns)?|Function)|p(litterBarPosition|acing)|e(conds|lect(Multiple|ion(Required|Type)?|Style|Color|ed(Node(s)?|Cell|I(nd(ices|ex)|tem(s)?))?|able))|kin|m(oothness|allScroll))|H(ighlight(s|Color)|Scroll|o(urs|rizontal)|eader(Symbol|Height|Text|Property|Format|Width|Location)?|as(Shader|CloseBox))|Y(ear|AxisTitle)?|N(ode(Properties|ExpansionHandler)|ewTextFormat)|C(h(ildNodes|a(ngeHandler|rt(Title|EventHandler)))|o(ntent(Size)?|okie|lumns)|ell(Symbol|Data)|l(i(ckHandler|pboard)|oseHandler)|redentials)|T(ype(dVaule)?|i(tle(barHeight)?|p(Target|Offset)?|me(out(Handler)?)?)|oggle|extFormat|ransform)|I(s(Branch|Open)|n(terval|putProperty)|con(SymbolName)?|te(rator|m(ByKey|Symbol)))|Orientation|D(i(splay(Range|Graphics|Mode|Clip|Text|edMonth)|rection)|uration|e(pth(Below|To|Above)|fault(GatewayURL|Mappings|NodeIconSymbolName)|l(iveryMode|ay)|bug(ID)?)|a(yOfWeekNames|t(e(Filter)?|a(Mapping(s)?|Item(Text|Property|Format)|Provider|All(Height|Property|Format|Width))?))|ra(wConnectors|gContent))|U(se(Shadow|HandCursor|EchoSuppression|rInput|Fade)|TC(M(i(nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear))|P(osition|ercentComplete|an(e(M(inimumSize|aximumSize)|Size|Title))?|ro(pert(y(Data)?|iesAt)|gress))|E(nabled|dit(Handler|able)|xpand(NodeTrigger|erSymbolName))|V(Scroll|olume|alue(Source)?)|KeyFrameInterval|Quality|F(i(eld|rst(DayOfWeek|VisibleNode))|ocus|ullYear|ps|ade(InLength|OutLength)|rame(Color|Width))|Width|L(ine(Color|Weight)|o(opback|adTarget)|a(rgeScroll|bel(Source|Placement)?))|A(s(Boolean|String|Number)|n(yTypedValue|imation)|ctiv(e(State(Handler)?|Handler)|ateHandler)|utoH(ideScrollBar|eight)))?|paratorBefore|ek|lect(ion(Disabled|Unfocused)?|ed(Node(s)?|Child|I(nd(ices|ex)|tem(s)?)|Dat(e|a))?|able(Ranges)?)|rver(String)?)|kip|qrt|wapDepths|lice|aveToSharedObj|moothing)|h(scroll(Policy)?|tml(Text)?|i(t(Test(TextNearPos)?|Area)|de(BuiltInItems|Child)?|ghlight(2D|3D)?)|orizontal|e(ight|ader(Re(nderer|lease)|Height|Text))|P(osition|ageScrollSize)|a(s(childNodes|MP3|S(creen(Broadcast|Playback)|treaming(Video|Audio)|ort)|Next|OwnProperty|Pr(inting|evious)|EmbeddedVideo|VideoEncoder|A(ccesibility|udio(Encoder)?))|ndlerName)|LineScrollSize)|ye(sLabel|ar)|n(o(t|de(Name|Close|Type|Open|Value)|Label)|u(llValue|mChild(S(creens|lides)|ren|Forms))|e(w(Item|line|Value|LocationDialog)|xt(S(cene|ibling|lide)|TabIndex|Value|Frame)?)?|ame(s)?)|c(h(ildNodes|eck|a(nge(sPending)?|r(CodeAt|At))|r)|o(s|n(st(ant|ructor)|nect|c(urrency|at)|t(ent(Type|Path)?|ains|rol(Placement|lerPolicy))|denseWhite|version)|py|l(or|umn(Stretch|Name(s)?|Count))|m(p(onent|lete)|ment))|u(stomItems|ePoint(s)?|r(veTo|Value|rent(Slide|ChildSlide|Item|F(ocused(S(creen|lide)|Form)|ps))))|e(il|ll(Renderer|Press|Edit|Focus(In|Out)))|l(i(ck|ents)|o(se(Button|Pane)?|ne(Node)?)|ear(S(haredObjects|treams)|Timeout|Interval)?)|a(ncelLabel|tch|p(tion|abilities)|l(cFields|l(e(e|r))?))|reate(GatewayConnection|Menu|Se(rver|gment)|C(hild(AtDepth)?|l(ient|ass(ChildAtDepth|Object(AtDepth)?))|all)|Text(Node|Field)|Item|Object(AtDepth)?|PopUp|E(lement|mptyMovieClip)))|t(h(is|row)|ype(of|Name)?|i(tle(StyleDeclaration)?|me(out)?)|o(talTime|String|olTipText|p|UpperCase|ggle(HighQuality)?|Lo(caleString|werCase))|e(st|llTarget|xt(RightMargin|Bold|S(ize|elected)|Height|Color|I(ndent|talic)|Disabled|Underline|F(ield|ont)|Width|LeftMargin|Align)?)|a(n|rget(Path)?|b(Stops|Children|Index|Enabled|leName))|r(y|igger|ac(e|k(AsMenu)?)))|i(s(Running|Branch|NaN|Con(soleOpen|nected)|Toggled|Installed|Open|D(own|ebugger)|P(urchased|ro(totypeOf|pertyEnumerable))|Empty|F(inite|ullyPopulated)|Local|Active)|n(s(tall|ertBefore)|cludeDeltaPacketInfo|t|it(ialize|Component|Pod|A(pplication|gent))?|de(nt|terminate|x(InParent(Slide|Form)?|Of)?)|put|validate|finity|LocalInternetCache)?|con(F(ield|unction))?|t(e(ratorScrolled|m(s|RollO(ut|ver)|ClassName))|alic)|d3|p|fFrameLoaded|gnore(Case|White))|o(s|n(R(ollO(ut|ver)|e(s(ize|ult)|l(ease(Outside)?|aseOutside)))|XML|Mouse(Move|Down|Up|Wheel)|S(ync|croller|tatus|oundComplete|e(tFocus|lect(edItem)?))|N(oticeEvent|etworkChange)|C(hanged|onnect|l(ipEvent|ose))|ID3|D(isconnect|eactivate|ata|ragO(ut|ver))|Un(install|load)|P(aymentResult|ress)|EnterFrame|K(illFocus|ey(Down|Up))|Fault|Lo(ad|g)|A(ctiv(ity|ate)|ppSt(op|art)))?|pe(n|ration)|verLayChildren|kLabel|ldValue|r(d)?)|d(i(s(connect|play(Normal|ed(Month|Year)|Full)|able(Shader|d(Ranges|Days)|CloseBox|Events))|rection)|o(cTypeDecl|tall|Decoding|main|LazyDecoding)|u(plicateMovieClip|ration)|e(stroy(ChildAt|Object)|code|fault(PushButton(Enabled)?|KeydownHandler)?|l(ta(Packet(Changed)?)?|ete(PopUp|All)?)|blocking)|a(shBoardSave|yNames|ta(Provider)?|rkshadow)|r(opdown(Width)?|a(w|gO(ut|ver))))|u(se(Sort|HandCursor|Codepage|EchoSuppression)|n(shift|install|derline|escape|format|watch|lo(ck|ad(Movie(Num)?)?))|pdate(Results|Mode|I(nputProperties|tem(ByIndex)?)|P(acket|roperties)|View|AfterEvent)|rl)|join|p(ixelAspectRatio|o(sition|p|w)|u(sh|rge|blish)|ercen(tComplete|Loaded)|lay(head(Change|Time)|ing|Hidden|erType)?|a(ssword|use|r(se(XML|CSS|Int|Float)|ent(Node|Is(S(creen|lide)|Form))|ams))|r(int(Num|AsBitmap(Num)?)?|o(to(type)?|pert(y|ies)|gress)|e(ss|v(ious(S(ibling|lide)|Value)?|Scene|Frame)|ferred(Height|Width))))|e(scape|n(code(r)?|ter(Frame)?|dFill|able(Shader|d|CloseBox|Events))|dit(able|Field|LocationDialog)|v(ent|al(uate)?)|q|x(tended|p|ec(ute)?|actSettings)|m(phasized(StyleDeclaration)?|bedFonts))|v(i(sible|ewPod)|ScrollPolicy|o(id|lume)|ersion|P(osition|ageScrollSize)|a(l(idat(ionError|e(Property|ActivationKey)?)|ue(Of)?)|riable)|LineScrollSize)|k(ind|ey(Down|Up|Press|FrameInterval))|q(sort|uality)|f(scommand|i(n(d(Text|First|Last)?|ally)|eldInfo|lter(ed|Func)?|rst(Slide|Child|DayOfWeek|VisibleNode)?)|o(nt|cus(In|edCell|Out|Enabled)|r(egroundDisabled|mat(ter)?))|unctionName|ps|l(oor|ush)|ace|romCharCode)|w(i(th|dth)|ordWrap|atch|riteAccess)|l(t|i(st(Owner)?|ne(Style|To))|o(c(k|a(t(ion|eByld)|l(ToGlobal|FileReadDisable)))|opback|ad(Movie(Num)?|S(crollContent|ound)|ed|Variables(Num)?|Application)?|g(Changes)?)|e(ngth|ft(Margin)?|ading)?|a(st(Slide|Child|Index(Of)?)?|nguage|b(el(Placement|F(ield|unction))?|leField)))|a(s(scociate(Controller|Display)|in|pectRatio|function)|nd|c(ceptConnection|tiv(ityLevel|ePlayControl)|os)|t(t(ach(Movie|Sound|Video|Audio)|ributes)|an(2)?)|dd(header|RequestHeader|Menu(Item(At)?|At)?|Sort|Header|No(tice|de(At)?)|C(olumn(At)?|uePoint)|T(oLocalInternetCache|reeNode(At)?)|I(con|tem(s(At)?|At)?)|DeltaItem|P(od|age|roperty)|EventListener|View|FieldInfo|Listener|Animation)?|uto(Size|Play|KeyNav|Load)|pp(endChild|ly(Changes|Updates)?)|vHardwareDisable|fterLoaded|l(ternateRowColors|ign|l(ow(InsecureDomain|Domain)|Transitions(InDone|OutDone))|bum)|r(tist|row|g(uments|List))|gent|bs)|r(ight(Margin)?|o(ot(S(creen|lide)|Form)|und|w(Height|Count)|llO(ut|ver))|e(s(yncDepth|t(orePane|artAnimation|rict)|iz(e|able(Columns)?)|olveDelta|ult(s)?|ponse)|c(o(ncile(Results|Updates)|rd)|eive(Video|Audio))|draw|jectConnection|place(Sel|ItemAt|AllItems)?|ve(al(Child)?|rse)|quest(SizeChange|Payment)?|f(errer|resh(ScrollContent|Destinations|Pane|FromSources)?)|lease(Outside)?|ad(Only|Access)|gister(SkinElement|C(olor(Style|Name)|lass)|InheritingStyle|Proxy)|move(Range|M(ovieClip|enu(Item(At)?|At))|Background|Sort|No(tice|de(sAt|At)?)|C(olum(nAt|At)|uePoints)|T(extField|reeNode(At)?)|Item(At)?|Pod|EventListener|FromLocalInternetCache|Listener|All(C(olumns|uePoints)|Items)?))|a(ndom|te|dioDot))|g(t|oto(Slide|NextSlide|PreviousSlide|FirstSlide|LastSlide|And(Stop|Play))|e(nre|t(R(GB|o(otNode|wCount)|e(sizable|mote))|X(AxisTitle)?|M(i(n(imum(Size)?|utes)|lliseconds)|onth(Names)?|ultilineMode|e(ssage|nu(ItemAt|EnabledAt|At))|aximum(Size)?)|B(ytes(Total|Loaded)|ounds|utton(s|Width)|eginIndex|a(ndwidthLimit|ckground))|S(howAsDisabled|croll(ing|Speed|Content|Position|barState|Location)|t(yle(Names)?|opOnFocus|ate)|ize|o(urce|rtState)|p(litterBarPosition|acing)|e(conds|lect(Multiple|ion(Required|Type)|Style|ed(Node(s)?|Cell|Text|I(nd(ices|ex)|tem(s)?))?)|rvice)|moothness|WFVersion)|H(ighlight(s|Color)|ours|e(ight|ader(Height|Text|Property|Format|Width|Location)?)|as(Shader|CloseBox))|Y(ear|AxisTitle)?|N(o(tices|de(DisplayedAt|At))|um(Children|berAvailable)|e(wTextFormat|xtHighestDepth))|C(h(ild(S(creen|lide)|Nodes|Form|At)|artTitle)|o(n(tent|figInfo)|okie|de|unt|lumn(Names|Count|Index|At))|uePoint|ellIndex|loseHandler|a(ll|retIndex))|T(ypedValue|i(tle(barHeight)?|p(Target|Offset)?|me(stamp|zoneOffset|out(State|Handler)|r)?)|oggle|ext(Extent|Format)?|r(ee(NodeAt|Length)|ans(form|actionId)))|I(s(Branch|Open)|n(stanceAtDepth|d(icesByKey|exByKey))|con(SymbolName)?|te(rator|m(sByKey|By(Name|Key)|id|ID|At))|d)|O(utput(Parameter(s|ByName)?|Value(s)?)|peration|ri(entation|ginalCellData))|D(i(s(play(Range|Mode|Clip|Index|edMonth)|kUsage)|rection)|uration|e(pth|faultNodeIconSymbolName|l(taPacket|ay)|bug(Config|ID)?)|a(y(OfWeekNames)?|t(e|a(Mapping(s)?|Item(Text|Property|Format)|Label|All(Height|Property|Format|Width))?))|rawConnectors)|U(se(Shadow|HandCursor|rInput|Fade)|RL|TC(M(i(nutes|lliseconds)|onth)|Seconds|Hours|Da(y|te)|FullYear))|P(o(sition|ds)|ercentComplete|a(n(e(M(inimums|aximums)|Height|Title|Width))?|rentNode)|r(operty(Name|Data)?|efer(ences|red(Height|Width))))|E(n(dIndex|abled)|ditingData|x(panderSymbolName|andNodeTrigger))|V(iewed(Pods|Applications)|olume|ersion|alue(Source)?)|F(i(eld|rst(DayOfWeek|VisibleNode))|o(ntList|cus)|ullYear|ade(InLength|OutLength)|rame(Color|Width))|Width|L(ine(Color|Weight)|o(cal|adTarget)|ength|a(stTabIndex|bel(Source)?))|A(s(cii|Boolean|String|Number)|n(yTypedValue|imation)|ctiv(eState(Handler)?|ateHandler)|utoH(ideScrollBar|eight)|llItems|gent))?)?|lobal(StyleFormat|ToLocal)?|ain|roupName)|x(updatePackety|mlDecl)?|m(y(MethodName|Call)|in(imum)?|o(nthNames|tion(TimeOut|Level)|de(lChanged)?|use(Move|O(ut|ver)|Down(Somewhere|Outside)?|Up(Somewhere)?|WheelEnabled)|ve(To)?)|u(ted|lti(pleS(imultaneousAllowed|elections)|line))|e(ssage|nu(Show|Hide)?|th(od)?|diaType)|a(nufacturer|tch|x(scroll|hscroll|imum|HPosition|Chars|VPosition)?)|b(substring|chr|ord|length))|b(ytes(Total|Loaded)|indFormat(Strings|Function)|o(ttom(Scroll)?|ld|rder(Color)?)|u(tton(Height|Width)|iltInItems|ffer(Time|Length)|llet)|e(foreApplyUpdates|gin(GradientFill|Fill))|lockIndent|a(ndwidth|ckground(Style|Color|Disabled)?)|roadcastMessage)|onHTTPStatus)\b
+ scope: support.function.actionscript.2
+ - match: \b(__proto__|__resolve|_accProps|_alpha|_changed|_currentframe|_droptarget|_flash|_focusrect|_framesloaded|_global|_height|_highquality|_level|_listeners|_lockroot|_name|_parent|_quality|_root|_rotation|_soundbuftime|_target|_totalframes|_url|_visible|_width|_x|_xmouse|_xscale|_y|_ymouse|_yscale)\b
+ scope: support.constant.actionscript.2
+ - match: \b(dynamic|extends|import|implements|interface|public|private|new|static|super|var|for|in|break|continue|while|do|return|if|else|case|switch)\b
+ scope: keyword.control.actionscript.2
+ - match: \b(Boolean|Number|String|Void)\b
+ scope: storage.type.actionscript.2
+ - match: \b(null|undefined|true|false)\b
+ scope: constant.language.actionscript.2
+ - match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\b'
+ scope: constant.numeric.actionscript.2
+ - match: '"'
+ captures:
+ 0: punctuation.definition.string.begin.actionscript.2
+ push:
+ - meta_scope: string.quoted.double.actionscript.2
+ - match: '"'
+ captures:
+ 0: punctuation.definition.string.end.actionscript.2
+ pop: true
+ - match: \\.
+ scope: constant.character.escape.actionscript.2
+ - match: "'"
+ captures:
+ 0: punctuation.definition.string.begin.actionscript.2
+ push:
+ - meta_scope: string.quoted.single.actionscript.2
+ - match: "'"
+ captures:
+ 0: punctuation.definition.string.end.actionscript.2
+ pop: true
+ - match: \\.
+ scope: constant.character.escape.actionscript.2
+ - match: \b(BACKSPACE|CAPSLOCK|CONTROL|DELETEKEY|DOWN|END|ENTER|HOME|INSERT|LEFT|LN10|LN2|LOG10E|LOG2E|MAX_VALUE|MIN_VALUE|NEGATIVE_INFINITY|NaN|PGDN|PGUP|PI|POSITIVE_INFINITY|RIGHT|SPACE|SQRT1_2|SQRT2|UP)\b
+ scope: support.constant.actionscript.2
+ - match: /\*
+ captures:
+ 0: punctuation.definition.comment.actionscript.2
+ push:
+ - meta_scope: comment.block.actionscript.2
+ - match: \*/
+ captures:
+ 0: punctuation.definition.comment.actionscript.2
+ pop: true
+ - match: ^\s*(\*)(?!/)
+ captures:
+ 1: punctuation.definition.comment.actionscript.2
+ - match: (//).*$\n?
+ scope: comment.line.double-slash.actionscript.2
+ captures:
+ 1: punctuation.definition.comment.actionscript.2
+ - match: \b(instanceof)\b
+ scope: keyword.operator.actionscript.2
+ - match: "[-!%&*+=/?:]"
+ scope: keyword.operator.symbolic.actionscript.2
+ - match: '^[ \t]*(#)[a-zA-Z]+'
+ scope: meta.preprocessor.actionscript.2
+ captures:
+ 1: punctuation.definition.preprocessor.actionscript.2
+ - match: '\b(function)\s+([a-zA-Z_]\w*)\s*(\()'
+ captures:
+ 1: storage.type.function.actionscript.2
+ 2: entity.name.function.actionscript.2
+ 3: punctuation.definition.parameters.begin.actionscript.2
+ push:
+ - meta_scope: meta.function.actionscript.2
+ - match: \)
+ captures:
+ 0: punctuation.definition.parameters.end.actionscript.2
+ pop: true
+ - match: '[^,)\n]+'
+ scope: variable.parameter.function.actionscript.2
+ - match: '\b(class)\s+([a-zA-Z_](?:\w|\.)*)(?:\s+(extends)\s+([a-zA-Z_](?:\w|\.)*))?'
+ scope: meta.class.actionscript.2
+ captures:
+ 1: storage.type.class.actionscript.2
+ 2: entity.name.type.class.actionscript.2
+ 3: storage.modifier.extends.actionscript.2
+ 4: entity.other.inherited-class.actionscript.2
diff --git a/assets/syntaxes/Packages/ActionScript/syntax_test_as.as b/assets/syntaxes/Packages/ActionScript/syntax_test_as.as
new file mode 100644
index 000000000..97a9ade07
--- /dev/null
+++ b/assets/syntaxes/Packages/ActionScript/syntax_test_as.as
@@ -0,0 +1,5 @@
+/* SYNTAX TEST "Packages/ActionScript/ActionScript.sublime-syntax" */
+
+/**
+ *
+/* ^ comment.block.actionscript.2 punctuation.definition.comment.actionscript.2 */
\ No newline at end of file
diff --git a/assets/syntaxes/Packages/AppleScript/AppleScript.sublime-syntax b/assets/syntaxes/Packages/AppleScript/AppleScript.sublime-syntax
new file mode 100644
index 000000000..d39aa257b
--- /dev/null
+++ b/assets/syntaxes/Packages/AppleScript/AppleScript.sublime-syntax
@@ -0,0 +1,723 @@
+%YAML 1.2
+---
+# http://www.sublimetext.com/docs/3/syntax.html
+name: AppleScript
+file_extensions:
+ - applescript
+ - script editor
+first_line_match: ^#!.*(osascript)
+scope: source.applescript
+contexts:
+ main:
+ - include: blocks
+ - include: inline
+ attributes.considering-ignoring:
+ - match: ","
+ scope: punctuation.separator.array.attributes.applescript
+ - match: \b(and)\b
+ scope: keyword.control.attributes.and.applescript
+ - match: \b(?i:case|diacriticals|hyphens|numeric\s+strings|punctuation|white\s+space)\b
+ scope: constant.other.attributes.text.applescript
+ - match: \b(?i:application\s+responses)\b
+ scope: constant.other.attributes.application.applescript
+ blocks:
+ - match: ^\s*(script)\s+(\w+)
+ captures:
+ 1: keyword.control.script.applescript
+ 2: entity.name.type.script-object.applescript
+ push:
+ - meta_scope: meta.block.script.applescript
+ - match: ^\s*(end(?:\s+script)?)(?=\s*(--.*?)?$)
+ captures:
+ 1: keyword.control.script.applescript
+ pop: true
+ - include: main
+ - match: |-
+ ^(?x)
+ \s*(to|on)\s+ # "on" or "to"
+ (\w+) # function name
+ (\() # opening paren
+ ((?:[\s,:\{\}]*(?:\w+)?)*) # parameters
+ (\)) # closing paren
+ comment: |
+ This is not a very well-designed rule. For now,
+ we can leave it like this though, as it sorta works.
+ captures:
+ 1: keyword.control.function.applescript
+ 2: entity.name.function.handler.applescript
+ 3: punctuation.definition.parameters.applescript
+ 4: variable.parameter.handler.applescript
+ 5: punctuation.definition.parameters.applescript
+ push:
+ - meta_scope: meta.function.positional.applescript
+ - match: ^\s*(end)(?:\s+(\2))?(?=\s*(--.*?)?$)
+ captures:
+ 1: keyword.control.function.applescript
+ pop: true
+ - include: main
+ - match: |-
+ ^(?x)
+ \s*(to|on)\s+ # "on" or "to"
+ (\w+) # function name
+ (?:\s+
+ (of|in)\s+ # "of" or "in"
+ (\w+) # direct parameter
+ )?
+ (?=\s+(above|against|apart\s+from|around|aside\s+from|at|below|beneath|beside|between|by|for|from|instead\s+of|into|on|onto|out\s+of|over|thru|under)\b)
+ comment: "TODO: match `given` parameters"
+ captures:
+ 1: keyword.control.function.applescript
+ 2: entity.name.function.handler.applescript
+ 3: keyword.control.function.applescript
+ 4: variable.parameter.handler.direct.applescript
+ push:
+ - meta_scope: meta.function.prepositional.applescript
+ - match: ^\s*(end)(?:\s+(\2))?(?=\s*(--.*?)?$)
+ captures:
+ 1: keyword.control.function.applescript
+ pop: true
+ - match: \b(?i:above|against|apart\s+from|around|aside\s+from|at|below|beneath|beside|between|by|for|from|instead\s+of|into|on|onto|out\s+of|over|thru|under)\s+(\w+)\b
+ captures:
+ 1: keyword.control.preposition.applescript
+ 2: variable.parameter.handler.applescript
+ - include: main
+ - match: |-
+ ^(?x)
+ \s*(to|on)\s+ # "on" or "to"
+ (\w+) # function name
+ (?=\s*(--.*?)?$) # nothing else
+ captures:
+ 1: keyword.control.function.applescript
+ 2: entity.name.function.handler.applescript
+ push:
+ - meta_scope: meta.function.parameterless.applescript
+ - match: ^\s*(end)(?:\s+(\2))?(?=\s*(--.*?)?$)
+ captures:
+ 1: keyword.control.function.applescript
+ pop: true
+ - include: main
+ - include: blocks.tell
+ - include: blocks.repeat
+ - include: blocks.statement
+ - include: blocks.other
+ blocks.other:
+ - match: ^\s*(considering)\b
+ push:
+ - meta_scope: meta.block.considering.applescript
+ - match: ^\s*(end(?:\s+considering)?)(?=\s*(--.*?)?$)
+ pop: true
+ - match: (?<=considering)
+ push:
+ - meta_scope: meta.array.attributes.considering.applescript
+ - match: (?|<|≥|>=|≤|<=)
+ scope: keyword.operator.comparison.applescript
+ - match: |-
+ (?ix)\b
+ (and|or|div|mod|as|not
+ |(a\s+)?(ref(\s+to)?|reference\s+to)
+ |equal(s|\s+to)|contains?|comes\s+(after|before)|(start|begin|end)s?\s+with
+ )
+ \b
+ scope: keyword.operator.word.applescript
+ - match: |-
+ (?ix)\b
+ (is(n't|\s+not)?(\s+(equal(\s+to)?|(less|greater)\s+than(\s+or\s+equal(\s+to)?)?|in|contained\s+by))?
+ |does(n't|\s+not)\s+(equal|come\s+(before|after)|contain)
+ )
+ \b
+ comment: In double quotes so we can use a single quote in the keywords.
+ scope: keyword.operator.word.applescript
+ - match: \b(?i:some|every|whose|where|that|id|index|\d+(st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|last|front|back|middle|named|beginning|end|from|to|thr(u|ough)|before|(front|back|beginning|end)\s+of|after|behind|in\s+(front|back|beginning|end)\s+of)\b
+ scope: keyword.operator.reference.applescript
+ - match: \b(?i:continue|return|exit(\s+repeat)?)\b
+ scope: keyword.control.loop.applescript
+ - match: \b(?i:about|above|after|against|and|apart\s+from|around|as|aside\s+from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|contain|contains|contains|copy|div|does|eighth|else|end|equal|equals|error|every|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead\s+of|into|is|it|its|last|local|me|middle|mod|my|ninth|not|of|on|onto|or|out\s+of|over|prop|property|put|ref|reference|repeat|returning|script|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b
+ scope: keyword.other.applescript
+ built-in.punctuation:
+ - match: ¬
+ scope: punctuation.separator.continuation.line.applescript
+ - match: ":"
+ comment: "the : in property assignments"
+ scope: punctuation.separator.key-value.property.applescript
+ - match: "[()]"
+ comment: the parentheses in groups
+ scope: punctuation.section.group.applescript
+ built-in.support:
+ - match: \b(?i:POSIX\s+path|frontmost|id|name|running|version|days?|weekdays?|months?|years?|time|date\s+string|time\s+string|length|rest|reverse|items?|contents|quoted\s+form|characters?|paragraphs?|words?)\b
+ scope: support.function.built-in.property.applescript
+ - match: \b(?i:activate|log|clipboard\s+info|set\s+the\s+clipboard\s+to|the\s+clipboard|info\s+for|list\s+(disks|folder)|mount\s+volume|path\s+to(\s+resource)?|close\s+access|get\s+eof|open\s+for\s+access|read|set\s+eof|write|open\s+location|current\s+date|do\s+shell\s+script|get\s+volume\s+settings|random\s+number|round|set\s+volume|system\s+(attribute|info)|time\s+to\s+GMT|load\s+script|run\s+script|scripting\s+components|store\s+script|copy|count|get|launch|run|set|ASCII\s+(character|number)|localized\s+string|offset|summarize|beep|choose\s+(application|color|file(\s+name)?|folder|from\s+list|remote\s+application|URL)|delay|display\s+(alert|dialog)|say)\b
+ scope: support.function.built-in.command.applescript
+ - match: \b(?i:get|run)\b
+ scope: support.function.built-in.applescript
+ - match: \b(?i:anything|data|text|upper\s+case|propert(y|ies))\b
+ scope: support.class.built-in.applescript
+ - match: \b(?i:alias|class)(es)?\b
+ scope: support.class.built-in.applescript
+ - match: \b(?i:app(lication)?|boolean|character|constant|date|event|file(\s+specification)?|handler|integer|item|keystroke|linked\s+list|list|machine|number|picture|preposition|POSIX\s+file|real|record|reference(\s+form)?|RGB\s+color|script|sound|text\s+item|type\s+class|vector|writing\s+code(\s+info)?|zone|((international|styled(\s+(Clipboard|Unicode))?|Unicode)\s+)?text|((C|encoded|Pascal)\s+)?string)s?\b
+ scope: support.class.built-in.applescript
+ - match: |-
+ (?ix)\b
+ ( (cubic\s+(centi)?|square\s+(kilo)?|centi|kilo)met(er|re)s
+ | square\s+(yards|feet|miles)|cubic\s+(yards|feet|inches)|miles|inches
+ | lit(re|er)s|gallons|quarts
+ | (kilo)?grams|ounces|pounds
+ | degrees\s+(Celsius|Fahrenheit|Kelvin)
+ )
+ \b
+ scope: support.class.built-in.unit.applescript
+ - match: \b(?i:seconds|minutes|hours|days)\b
+ scope: support.class.built-in.time.applescript
+ comments:
+ - match: ^\s*(#!).*$\n?
+ scope: comment.line.number-sign.applescript
+ captures:
+ 1: punctuation.definition.comment.applescript
+ - match: (--).*$\n?
+ scope: comment.line.double-dash.applescript
+ captures:
+ 1: punctuation.definition.comment.applescript
+ - match: \(\*
+ captures:
+ 0: punctuation.definition.comment.applescript
+ push:
+ - meta_scope: comment.block.applescript
+ - match: \*\)
+ captures:
+ 0: punctuation.definition.comment.applescript
+ pop: true
+ - include: comments.nested
+ comments.nested:
+ - match: \(\*
+ captures:
+ 0: punctuation.definition.comment.applescript
+ push:
+ - meta_scope: comment.block.applescript
+ - match: \*\)
+ captures:
+ 0: punctuation.definition.comment.applescript
+ pop: true
+ - include: comments.nested
+ data-structures:
+ - match: '(\{)'
+ comment: We cannot necessarily distinguish "records" from "arrays", and so this could be either.
+ captures:
+ 1: punctuation.section.array.applescript
+ push:
+ - meta_scope: meta.array.applescript
+ - match: '(\})'
+ captures:
+ 1: punctuation.section.array.applescript
+ pop: true
+ - match: '(\w+|((\|)[^|\n]*(\|)))\s*(:)'
+ captures:
+ 1: constant.other.key.applescript
+ 2: meta.identifier.applescript
+ 3: punctuation.definition.identifier.applescript
+ 4: punctuation.definition.identifier.applescript
+ 5: punctuation.separator.key-value.applescript
+ - match: ":"
+ scope: punctuation.separator.key-value.applescript
+ - match: ","
+ scope: punctuation.separator.array.applescript
+ - include: inline
+ - match: (?:(?<=application )|(?<=app ))(")
+ captures:
+ 1: punctuation.definition.string.applescript
+ push:
+ - meta_scope: string.quoted.double.application-name.applescript
+ - match: (")
+ captures:
+ 1: punctuation.definition.string.applescript
+ pop: true
+ - match: \\.
+ scope: constant.character.escape.applescript
+ - match: (")
+ captures:
+ 1: punctuation.definition.string.applescript
+ push:
+ - meta_scope: string.quoted.double.applescript
+ - match: (")
+ captures:
+ 1: punctuation.definition.string.applescript
+ pop: true
+ - match: \\.
+ scope: constant.character.escape.applescript
+ - match: '(\|)[^|\n]*(\|)'
+ scope: meta.identifier.applescript
+ captures:
+ 1: punctuation.definition.identifier.applescript
+ 2: punctuation.definition.identifier.applescript
+ - match: '(«)(data) (utxt|utf8)([[:xdigit:]]*)(»)(?:\s+(as)\s+(?i:Unicode\s+text))?'
+ scope: constant.other.data.utxt.applescript
+ captures:
+ 1: punctuation.definition.data.applescript
+ 2: support.class.built-in.applescript
+ 3: storage.type.utxt.applescript
+ 4: string.unquoted.data.applescript
+ 5: punctuation.definition.data.applescript
+ 6: keyword.operator.applescript
+ 7: support.class.built-in.applescript
+ - match: («)(\w+)\b(?=\s)
+ captures:
+ 1: punctuation.definition.data.applescript
+ 2: support.class.built-in.applescript
+ push:
+ - meta_scope: constant.other.data.raw.applescript
+ - match: (»)
+ captures:
+ 1: punctuation.definition.data.applescript
+ pop: true
+ - match: "(«)[^»]*(»)"
+ scope: invalid.illegal.data.applescript
+ captures:
+ 1: punctuation.definition.data.applescript
+ 2: punctuation.definition.data.applescript
+ finder:
+ - match: \b(item|container|(computer|disk|trash)-object|disk|folder|((alias|application|document|internet location) )?file|clipping|package)s?\b
+ scope: support.class.finder.items.applescript
+ - match: \b((Finder|desktop|information|preferences|clipping) )windows?\b
+ scope: support.class.finder.window-classes.applescript
+ - match: \b(preferences|(icon|column|list) view options|(label|column|alias list)s?)\b
+ scope: support.class.finder.type-definitions.applescript
+ - match: \b(copy|find|sort|clean up|eject|empty( trash)|erase|reveal|update)\b
+ scope: support.function.finder.items.applescript
+ - match: \b(insertion location|product version|startup disk|desktop|trash|home|computer container|finder preferences)\b
+ scope: support.constant.finder.applescript
+ - match: \b(visible)\b
+ scope: support.variable.finder.applescript
+ inline:
+ - include: comments
+ - include: data-structures
+ - include: built-in
+ - include: standardadditions
+ itunes:
+ - match: \b(artwork|application|encoder|EQ preset|item|source|visual|(EQ |browser )?window|((audio CD|device|shared|URL|file) )?track|playlist window|((audio CD|device|radio tuner|library|folder|user) )?playlist)s?\b
+ scope: support.class.itunes.applescript
+ - match: \b(add|back track|convert|fast forward|(next|previous) track|pause|play(pause)?|refresh|resume|rewind|search|stop|update|eject|subscribe|update(Podcast|AllPodcasts)|download)\b
+ scope: support.function.itunes.applescript
+ - match: \b(current (playlist|stream (title|URL)|track)|player state)\b
+ scope: support.constant.itunes.applescript
+ - match: \b(current (encoder|EQ preset|visual)|EQ enabled|fixed indexing|full screen|mute|player position|sound volume|visuals enabled|visual size)\b
+ scope: support.variable.itunes.applescript
+ standard-suite:
+ - match: \b(colors?|documents?|items?|windows?)\b
+ scope: support.class.standard-suite.applescript
+ - match: \b(close|count|delete|duplicate|exists|make|move|open|print|quit|save|activate|select|data size)\b
+ scope: support.function.standard-suite.applescript
+ - match: \b(name|frontmost|version)\b
+ scope: support.constant.standard-suite.applescript
+ - match: \b(selection)\b
+ scope: support.variable.standard-suite.applescript
+ - match: \b(attachments?|attribute runs?|characters?|paragraphs?|texts?|words?)\b
+ scope: support.class.text-suite.applescript
+ standardadditions:
+ - match: \b((alert|dialog) reply)\b
+ scope: support.class.standardadditions.user-interaction.applescript
+ - match: \b(file information)\b
+ scope: support.class.standardadditions.file.applescript
+ - match: \b(POSIX files?|system information|volume settings)\b
+ scope: support.class.standardadditions.miscellaneous.applescript
+ - match: \b(URLs?|internet address(es)?|web pages?|FTP items?)\b
+ scope: support.class.standardadditions.internet.applescript
+ - match: \b(info for|list (disks|folder)|mount volume|path to( resource)?)\b
+ scope: support.function.standardadditions.file.applescript
+ - match: \b(beep|choose (application|color|file( name)?|folder|from list|remote application|URL)|delay|display (alert|dialog)|say)\b
+ scope: support.function.standardadditions.user-interaction.applescript
+ - match: \b(ASCII (character|number)|localized string|offset|summarize)\b
+ scope: support.function.standardadditions.string.applescript
+ - match: \b(set the clipboard to|the clipboard|clipboard info)\b
+ scope: support.function.standardadditions.clipboard.applescript
+ - match: \b(open for access|close access|read|write|get eof|set eof)\b
+ scope: support.function.standardadditions.file-i-o.applescript
+ - match: \b((load|store|run) script|scripting components)\b
+ scope: support.function.standardadditions.scripting.applescript
+ - match: \b(current date|do shell script|get volume settings|random number|round|set volume|system attribute|system info|time to GMT)\b
+ scope: support.function.standardadditions.miscellaneous.applescript
+ - match: \b(opening folder|(closing|moving) folder window for|adding folder items to|removing folder items from)\b
+ scope: support.function.standardadditions.folder-actions.applescript
+ - match: \b(open location|handle CGI request)\b
+ scope: support.function.standardadditions.internet.applescript
+ system-events:
+ - match: \b(audio (data|file))\b
+ scope: support.class.system-events.audio-file.applescript
+ - match: \b(alias(es)?|(Classic|local|network|system|user) domain objects?|disk( item)?s?|domains?|file( package)?s?|folders?|items?)\b
+ scope: support.class.system-events.disk-folder-file.applescript
+ - match: \b(delete|open|move)\b
+ scope: support.function.system-events.disk-folder-file.applescript
+ - match: \b(folder actions?|scripts?)\b
+ scope: support.class.system-events.folder-actions.applescript
+ - match: \b(attach action to|attached scripts|edit action of|remove action from)\b
+ scope: support.function.system-events.folder-actions.applescript
+ - match: \b(movie data|movie file)\b
+ scope: support.class.system-events.movie-file.applescript
+ - match: \b(log out|restart|shut down|sleep)\b
+ scope: support.function.system-events.power.applescript
+ - match: \b(((application |desk accessory )?process|(check|combo )?box)(es)?|(action|attribute|browser|(busy|progress|relevance) indicator|color well|column|drawer|group|grow area|image|incrementor|list|menu( bar)?( item)?|(menu |pop up |radio )?button|outline|(radio|tab|splitter) group|row|scroll (area|bar)|sheet|slider|splitter|static text|table|text (area|field)|tool bar|UI element|window)s?)\b
+ scope: support.class.system-events.processes.applescript
+ - match: \b(click|key code|keystroke|perform|select)\b
+ scope: support.function.system-events.processes.applescript
+ - match: \b(property list (file|item))\b
+ scope: support.class.system-events.property-list.applescript
+ - match: \b(annotation|QuickTime (data|file)|track)s?\b
+ scope: support.class.system-events.quicktime-file.applescript
+ - match: \b((abort|begin|end) transaction)\b
+ scope: support.function.system-events.system-events.applescript
+ - match: \b(XML (attribute|data|element|file)s?)\b
+ scope: support.class.system-events.xml.applescript
+ - match: \b(print settings|users?|login items?)\b
+ scope: support.class.system-events.other.applescript
+ textmate:
+ - match: \b(print settings)\b
+ scope: support.class.textmate.applescript
+ - match: \b(get url|insert|reload bundles)\b
+ scope: support.function.textmate.applescript
diff --git a/assets/syntaxes/Packages/AppleScript/Comments.tmPreferences b/assets/syntaxes/Packages/AppleScript/Comments.tmPreferences
new file mode 100644
index 000000000..2af4afb33
--- /dev/null
+++ b/assets/syntaxes/Packages/AppleScript/Comments.tmPreferences
@@ -0,0 +1,45 @@
+
+
diff --git a/assets/syntaxes/Packages/Batch File/Batch File.sublime-settings b/assets/syntaxes/Packages/Batch File/Batch File.sublime-settings
new file mode 100644
index 000000000..804ffcd95
--- /dev/null
+++ b/assets/syntaxes/Packages/Batch File/Batch File.sublime-settings
@@ -0,0 +1,6 @@
+{
+ // Determines what character(s) are used to terminate each line in new files.
+ // Valid values are 'system' (whatever the OS uses), 'windows' (CRLF) and
+ // 'unix' (LF only).
+ "default_line_ending": "windows"
+}
diff --git a/assets/syntaxes/Packages/Batch File/Batch File.sublime-syntax b/assets/syntaxes/Packages/Batch File/Batch File.sublime-syntax
new file mode 100644
index 000000000..315aab42d
--- /dev/null
+++ b/assets/syntaxes/Packages/Batch File/Batch File.sublime-syntax
@@ -0,0 +1,424 @@
+%YAML 1.2
+---
+# http://www.sublimetext.com/docs/3/syntax.html
+name: Batch File
+file_extensions:
+ - bat
+ - cmd
+scope: source.dosbatch
+variables:
+ colon_comment_start: '(?::[+=,;: ])'
+ command_terminators: (?=$\n|[&|><)])
+ set_arithmetic_operators_unquoted: (?:\+|-|\*|/|%%|~)
+ set_arithmetic_operators_quoted: (?:\||<<|>>|&|\^)
+
+contexts:
+ main:
+ - include: expressions
+
+ expressions:
+ - include: comments
+ - include: labels
+ - include: strings
+ - include: parens
+ - include: numbers
+ - include: constants
+ - include: operators
+ - include: escaped_characters
+ - include: variables
+ - include: commands
+ - match: \b(?i)exit\b
+ scope: keyword.control.statement.dosbatch
+ - match: \b(?i)(goto|call)\b(?:\s*(:)?(?:(eof)|(\w+)))?
+ captures:
+ 1: keyword.control.statement.dosbatch
+ 2: punctuation.separator.dosbatch
+ 3: keyword.control.flow.return.dosbatch
+ 4: meta.function-call.dosbatch variable.function.dosbatch
+ - match: \b(?i)(if)\s+(?:(not)\s+)?(exist|defined|errorlevel|cmdextversion)\b
+ captures:
+ 1: keyword.control.conditional.dosbatch
+ 2: keyword.operator.logical.dosbatch
+ 3: keyword.other.dosbatch
+ - match: \b(?i)(?:if|else)\b
+ scope: keyword.control.conditional.dosbatch
+ - match: \b(?i)for\b
+ scope: keyword.control.repeat.dosbatch
+
+ commands:
+ - match: \b(?i:echo)\b
+ scope: keyword.command.dosbatch
+ push:
+ - match: '{{command_terminators}}'
+ pop: true
+ - include: escaped_characters
+ - include: variables
+ - include: numbers
+ - include: strings
+ - include: command_set
+ - match: \b(?i:aciniupd|adprep|append|arp|assoc|at|atmadm|attrib|autofail|backup|basica|bcdedit|bootcfg|break|cacls|cd|cdburn|certreq|certutil|change logon|change port|change user|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|cleanmgr|clip|cls|cluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|control|convert|copy|cprofile|cscript|csvde|ctty|date|dcgpofix|debug|defrag|del|deltree|devcon|dfscmd|dhcploc|diantz|dir|diskcomp|diskcopy|diskpart|doskey|dpath|driverquery|dsadd|dsget|dsmod|dsmove|dsquery|dsrm|dvdburn|edit|edlin|endlocal|epal|erase|eventcreate|eventtriggers|evntcmd|exe2bin|expand|explorer|extract|fastopen|fc|fdisk|filever|find|findramd|findstr|finger|flattemp|forcedos|forfiles|format|freedisk|fsutil|ftp|ftype|getmac|gettype|gpresult|gpupdate|graftabl|gwbasic|help|helpctr|hostname|icacls|iexpress|ifconfig|iisreset|inuse|ipconfig|ipxroute|irftp|jt|keyb|label|ldifde|lfnfor|lh|loadhigh|lock|lodctr|logman|logoff|lpq|lpr|macfile|makecab|md|mem|mkdir|mklink|mmc|mode|more|mountvol|move|mrinfo|msd|msg|msiexec|msinfo32|mstsc|mtrace|nbtstat|net accounts|net computer|net config|net continue|net file|net group|net help|net helpmsg|net localgroup|net name|net pause|net print|net send|net session|net share|net start|net statistics|net stop|net time|net use|net user|net view|net|netdom|netsh|netstat|nlb|nlbmgr|nltest|notepad|nslookup|ntbackup|ntcmdprompt|ntdsutil|ntsd|ocsetup|odbcconf|openfiles|path|pathping|pause|pbadmin|pentnt|perfmon|ping|ping6|pkgmgr|popd|powercfg|print|prompt|pushd|qappsrv|qbasic|qchain|qfarm|qprocess|qserver|query process|query session|query termserver|query user|query|quser|qwinsta|rasdial|rasphone|rcp|rd|readline|recimg|recover|reg|regedit|regedt32|regini|register|regsvr32|relog|rem|ren|rename|replace|reset session|reset|restore|rexec|risetup|rmdir|robocopy|route|rsh|rsm|rss|runas|rundll|rundll32|sc|schtasks|secedit|set|setlocal|setx|sfc|shadow|shift|shutdown|sort|start|subinacl|subst|sysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|tftp|time|timeout|title|tracerpt|tracert|tracert6|tracerte|tree|truename|tscon|tsdiscon|tsecimp|tskill|tsprof|tsshutdn|type|typeperf|tzchange|unlock|unlodctr|ver|verify|vhdmount|vol|vssadmin|w32tm|waitfor|where|whoami|winmsd|winmsdp|winnt|winnt32|winpop|winsat|wlbs|wmic|wscript|wupdmgr|xcacls|xcopy)\b
+ scope: keyword.command.dosbatch
+
+ command_set:
+ - match: '(?i)\bSET\b'
+ scope: keyword.command.dosbatch
+ push: inside_command_set
+
+ inside_command_set:
+ - match: '{{command_terminators}}'
+ pop: true
+ - include: escaped_characters
+ - include: variables
+ - match: (")\s*([^ ][^=]*)(=)
+ captures:
+ 1: punctuation.definition.string.begin.dosbatch
+ 2: variable.other.readwrite.dosbatch
+ 3: keyword.operator.assignment.dosbatch
+ push:
+ - meta_scope: string.quoted.double.dosbatch
+ - match: '"(?=\s*(?:{{command_terminators}}))'
+ scope: punctuation.definition.string.end.dosbatch
+ pop: true
+ - include: escaped_characters
+ - include: variables
+ - include: numbers
+ - include: parens
+ - match: ([^ ][^=]*)(=)
+ captures:
+ 1: variable.other.readwrite.dosbatch
+ 2: keyword.operator.assignment.dosbatch
+ push:
+ - meta_content_scope: string.unquoted.dosbatch
+ - match: '{{command_terminators}}'
+ pop: true
+ - include: variables
+ - match: '"'
+ scope: punctuation.definition.string.begin.dosbatch
+ push:
+ - meta_scope: string.quoted.double.dosbatch
+ - clear_scopes: 1
+ - match: '"'
+ scope: punctuation.definition.string.end.dosbatch
+ pop: true
+ - include: escaped_characters
+ - include: variables
+ - include: numbers
+ - include: parens
+ - match: \b([^ ][^=\n]*)$
+ scope: variable.other.readwrite.dosbatch
+ - include: strings
+ - match: '\s+/[aA]\s+' # SET arithmetic
+ push:
+ - meta_content_scope: meta.expression.set.dosbatch
+ - include: set_arithmetic_unquoted
+ - match: '\s+/[pP]\s+' # SET from standard input
+ push:
+ - match: '{{command_terminators}}'
+ pop: true
+ - match: ([^ ][^=]*)(=)
+ captures:
+ 1: variable.other.readwrite.dosbatch
+ 2: keyword.operator.assignment.dosbatch
+ set:
+ - meta_scope: meta.prompt.set.dosbatch
+ - match: '{{command_terminators}}'
+ pop: true
+ - match: (?=")
+ push:
+ - include: strings
+ - match: '{{command_terminators}}'
+ pop: true
+ - match: .
+ scope: comment.line.ignored.dosbatch
+ - match: ''
+ push:
+ - meta_content_scope: string.unquoted.dosbatch
+ - match: '{{command_terminators}}'
+ pop: true
+ - include: variables
+
+ set_arithmetic_unquoted:
+ - match: '{{command_terminators}}'
+ pop: true
+ - include: set_arithmetic_operator_common
+ - match: \(
+ scope: punctuation.section.group.begin.dosbatch
+ push: command_set_group_unquoted
+ - match: '"'
+ scope: punctuation.definition.string.begin.dosbatch
+ push: set_arithmetic_quoted
+ - include: inside_command_set_arithmetic
+
+ command_set_group_unquoted:
+ - meta_scope: meta.group.dosbatch
+ - match: \)
+ scope: punctuation.section.group.end.dosbatch
+ pop: true
+ - match: '"'
+ scope: punctuation.definition.string.begin.dosbatch
+ set: command_set_group_newly_quoted
+ - include: set_arithmetic_unquoted
+
+ set_arithmetic_operator_common:
+ - match: ({{set_arithmetic_operators_unquoted}})=
+ scope: keyword.operator.assignment.augmented.dosbatch
+ - match: (\^)(\^=)
+ captures:
+ 1: constant.character.escape.dosbatch
+ 2: keyword.operator.assignment.augmented.dosbatch
+ - match: ({{set_arithmetic_operators_unquoted}})
+ scope: keyword.operator.arithmetic.dosbatch
+ - match: (\^)(\^)
+ captures:
+ 1: constant.character.escape.dosbatch
+ 2: keyword.operator.arithmetic.dosbatch
+ - match: =
+ scope: keyword.operator.assignment.dosbatch
+
+ set_arithmetic_operator_quoted:
+ - match: ({{set_arithmetic_operators_quoted}})=
+ scope: keyword.operator.assignment.augmented.dosbatch
+ - match: ({{set_arithmetic_operators_quoted}})
+ scope: keyword.operator.arithmetic.dosbatch
+ - include: set_arithmetic_operator_common
+
+ set_arithmetic_quoted:
+ - meta_scope: string.quoted.double.dosbatch
+ - match: $
+ pop: true
+ - match: '"'
+ scope: punctuation.definition.string.end.dosbatch
+ pop: true
+ - match: \(
+ scope: punctuation.section.group.begin.dosbatch
+ set:
+ - meta_scope: meta.group.dosbatch
+ - match: ''
+ set: command_set_group_newly_quoted
+ - include: set_arithmetic_operator_quoted
+ - include: inside_command_set_arithmetic
+
+ command_set_group_already_quoted:
+ - meta_scope: meta.group.dosbatch
+ - match: \)
+ scope: punctuation.section.group.end.dosbatch
+ pop: true
+ - match: '"'
+ scope: punctuation.definition.string.end.dosbatch
+ set:
+ - match: ''
+ set: command_set_group_unquoted
+ - include: set_arithmetic_quoted
+
+ command_set_group_newly_quoted:
+ - meta_scope: string.quoted.double.dosbatch meta.group.dosbatch
+ - match: \(
+ scope: punctuation.section.group.begin.dosbatch
+ push: command_set_group_already_quoted
+ - match: \)
+ scope: punctuation.section.group.end.dosbatch
+ set:
+ - match: ''
+ set: set_arithmetic_quoted
+ - include: command_set_group_already_quoted
+
+ inside_command_set_arithmetic:
+ - match: '!'
+ scope: keyword.operator.logical.dosbatch
+ - include: numbers
+ - include: comma_separator
+ - include: variables
+ - include: escaped_characters
+ - match: (?:(?!{{set_arithmetic_operators_unquoted}}|{{set_arithmetic_operators_quoted}}|[=")])\S)+
+ scope: variable.other.readwrite.dosbatch
+
+ variables:
+ # global parameters
+ - match: '(%)((~([fdpnxsatz]|\$PATH:)*)?\d|\*)'
+ scope: variable.parameter.dosbatch
+ captures:
+ 1: punctuation.definition.variable.dosbatch
+ - match: (?i)(%)errorlevel(%)
+ scope: variable.language.dosbatch
+ captures:
+ 1: punctuation.definition.variable.begin.dosbatch
+ 2: punctuation.definition.variable.end.dosbatch
+ - include: variable
+ - include: variable_delayed_expansion
+
+ variable:
+ # variable
+ - match: '%(?=[^%]+%)'
+ scope: punctuation.definition.variable.begin.dosbatch
+ push:
+ - meta_scope: variable.other.readwrite.dosbatch
+ - match: '(%)|\n'
+ captures:
+ 1: punctuation.definition.variable.end.dosbatch
+ pop: true
+ # substring expansion
+ - match: ':~'
+ scope: punctuation.separator.dosbatch
+ push:
+ - meta_content_scope: meta.variable.substring.dosbatch
+ - match: '(?=%|\n)'
+ pop: true
+ - include: inside_variable_substring
+ # string substitution
+ - match: ':'
+ scope: punctuation.separator.dosbatch
+ push:
+ - meta_content_scope: meta.variable.substitution.dosbatch
+ - match: '(?=%|\n)'
+ pop: true
+ - include: variable_substitution_replacee
+ - match: '='
+ scope: punctuation.separator.dosbatch
+ push:
+ - match: '(?=%|\n)'
+ pop: true
+ - include: variable_delayed_expansion
+ - match: '[^%]+'
+ scope: string.unquoted.dosbatch
+
+ variable_delayed_expansion:
+ # variable with delayed expansion
+ - match: '!(?=[^!]+!)'
+ scope: punctuation.definition.variable.begin.dosbatch
+ push:
+ - meta_scope: variable.other.readwrite.dosbatch
+ - match: '(!)|\n'
+ captures:
+ 1: punctuation.definition.variable.end.dosbatch
+ pop: true
+ # substring expansion
+ - match: ':~'
+ scope: punctuation.separator.dosbatch
+ push:
+ - meta_content_scope: meta.variable.substring.dosbatch
+ - match: '(?=!|\n)'
+ pop: true
+ - include: inside_variable_substring
+ # string substitution
+ - match: ':'
+ scope: punctuation.separator.dosbatch
+ push:
+ - meta_content_scope: meta.variable.substitution.dosbatch
+ - match: '(?=!|\n)'
+ pop: true
+ - include: variable
+ - include: variable_substitution_replacee
+ - match: '='
+ scope: punctuation.separator.dosbatch
+ push:
+ - match: '(?=!|\n)'
+ pop: true
+ - include: variable
+ - match: '[^!]+'
+ scope: string.unquoted.dosbatch
+
+ variable_substitution_replacee:
+ - match: '[^=]+'
+ scope: string.unquoted.dosbatch
+
+ inside_variable_substring:
+ - match: '[+-]?\d+'
+ scope: constant.numeric.dosbatch
+ - include: comma_separator
+
+ comma_separator:
+ - match: ','
+ scope: punctuation.separator.dosbatch
+
+ numbers:
+ - match: '\b(0[xX])\h*\b'
+ scope: constant.numeric.integer.hexadecimal.dosbatch
+ captures:
+ 1: punctuation.definition.numeric.hexadecimal.dosbatch
+ - match: '\b(0)[0-7]+\b'
+ scope: constant.numeric.integer.octal.dosbatch
+ captures:
+ 1: punctuation.definition.numeric.octal.dosbatch
+ - match: '\b(?:0|[1-9][0-9]*)\b'
+ scope: constant.numeric.integer.decimal.dosbatch
+
+ constants:
+ - match: \b(?i:NUL)\b
+ scope: constant.language.dosbatch
+
+ operators:
+ - match: '@(?=\S)'
+ scope: keyword.operator.at.dosbatch
+ - match: \b(?i:EQU|NEQ|LSS|LEQ|GTR|GEQ)\b|==
+ scope: keyword.operator.comparison.dosbatch
+ - match: \b(?i:NOT)\b
+ scope: keyword.operator.logical.dosbatch
+ - match: '&&?|\|\|'
+ scope: keyword.operator.conditional.dosbatch
+ - match: '\|'
+ scope: keyword.operator.pipe.dosbatch
+ - match: '<&?|>[&>]?'
+ scope: keyword.operator.redirection.dosbatch
+
+ labels:
+ - match: '^\s*(:)([^+=,;:\s].*)$'
+ captures:
+ 1: punctuation.separator.dosbatch
+ 2: entity.name.label.dosbatch
+
+ comments:
+ - match: '(?:^|(&))\s*(?=({{colon_comment_start}}))'
+ captures:
+ 1: keyword.operator.conditional.dosbatch
+ push:
+ - match: '\n'
+ scope: comment.line.rem.dosbatch
+ pop: true
+ - match: '({{colon_comment_start}})'
+ scope: punctuation.definition.comment.dosbatch
+ push:
+ - meta_scope: comment.line.colon.dosbatch
+ - match: '(?=\n)'
+ pop: true
+ # REM command
+ # https://technet.microsoft.com/en-us/library/bb490986.aspx
+ - match: \b(?i)rem\b
+ scope: keyword.command.rem.dosbatch
+ push:
+ # meta_content_scope is used since rem should not be
+ # highlighted as a comment, but a command
+ - meta_content_scope: comment.line.rem.dosbatch
+ - match: \n
+ scope: comment.line.rem.dosbatch
+ pop: true
+ - match: '[(|)]'
+ scope: invalid.illegal.unexpected-character.dosbatch
+
+ strings:
+ - match: '"'
+ scope: punctuation.definition.string.begin.dosbatch
+ push:
+ - meta_scope: string.quoted.double.dosbatch
+ - match: (")|(\n)
+ captures:
+ 1: punctuation.definition.string.end.dosbatch
+ 2: invalid.illegal.newline.dosbatch
+ pop: true
+ - include: escaped_characters
+ - include: variables
+
+ parens:
+ - match: \(
+ scope: punctuation.section.group.begin.dosbatch
+ push:
+ - meta_scope: meta.group.dosbatch
+ - match: \)
+ scope: punctuation.section.group.end.dosbatch
+ pop: true
+ - match: ',|;'
+ scope: punctuation.separator.dosbatch
+ - include: expressions
+
+ escaped_characters:
+ - match: '%%|\^\^!|\^.|\^\n'
+ scope: constant.character.escape.dosbatch
diff --git a/assets/syntaxes/Packages/Batch File/Comments.tmPreferences b/assets/syntaxes/Packages/Batch File/Comments.tmPreferences
new file mode 100644
index 000000000..697567334
--- /dev/null
+++ b/assets/syntaxes/Packages/Batch File/Comments.tmPreferences
@@ -0,0 +1,27 @@
+
+
diff --git a/assets/syntaxes/Packages/Batch File/Symbol List.tmPreferences b/assets/syntaxes/Packages/Batch File/Symbol List.tmPreferences
new file mode 100644
index 000000000..c9efab6d7
--- /dev/null
+++ b/assets/syntaxes/Packages/Batch File/Symbol List.tmPreferences
@@ -0,0 +1,16 @@
+
+
diff --git a/assets/syntaxes/Packages/Batch File/syntax_test_batch_file.bat b/assets/syntaxes/Packages/Batch File/syntax_test_batch_file.bat
new file mode 100644
index 000000000..0495bcb4e
--- /dev/null
+++ b/assets/syntaxes/Packages/Batch File/syntax_test_batch_file.bat
@@ -0,0 +1,770 @@
+:: SYNTAX TEST "Packages/Batch File/Batch File.sublime-syntax"
+
+ REM I'm a (com|ment)
+:: ^^^ keyword.command.rem.dosbatch
+:: ^^^^^^^^^^^^^^^^ comment.line.rem.dosbatch
+:: ^ invalid.illegal.unexpected-character.dosbatch
+:: ^ invalid.illegal.unexpected-character.dosbatch
+:: ^ invalid.illegal.unexpected-character.dosbatch
+
+REM
+ not a comment
+:: ^^^^^^^^^^^^^ - comment.line.rem.dosbatch
+
+REM This follows a REM command
+:: <- keyword.command - comment
+:: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line
+
+ :: Me too!
+:: ^^ punctuation.definition.comment.dosbatch
+:: ^^^^^^^^^^ comment.line.colon.dosbatch
+
+ :+ Me too!
+:: ^^ punctuation.definition.comment.dosbatch
+
+ := Me too!
+:: ^^ punctuation.definition.comment.dosbatch
+
+ :, Me too!
+:: ^^ punctuation.definition.comment.dosbatch
+
+ :; Me too!
+:: ^^ punctuation.definition.comment.dosbatch
+
+ : Me too!
+:: ^^ punctuation.definition.comment.dosbatch
+
+ECHO : Not a comment
+:: ^^^^^^^^^^^^^^^ - comment
+
+ECHO : Not a comment ^
+ do not break out of an echo with an escaped newline
+:: ^^^ - keyword.operator
+:: ^^^^^ - keyword.command
+
+ECHO &:: A comment
+:: ^ keyword.operator.conditional.dosbatch
+:: ^^ punctuation.definition.comment.dosbatch
+:: ^^^^^^^^^^^^ comment.line.colon.dosbatch
+
+ :: an indented comment
+::^^ punctuation.definition.comment.dosbatch
+::^^^^^^^^^^^^^^^^^^^^^^ comment.line.colon.dosbatch
+
+ ECHO "foo"
+:: ^ punctuation.definition.string.begin.dosbatch
+:: ^^^^^ string.quoted.double.dosbatch
+:: ^ punctuation.definition.string.end.dosbatch
+
+ECHO "
+:: ^ invalid.illegal.newline.dosbatch
+
+ @ECHO OFF
+:: ^ keyword.operator.at.dosbatch
+
+ @
+:: ^ - keyword.operator.at.dosbatch
+
+ GOTO:EOF
+:: ^^^^ keyword.control.statement.dosbatch
+:: ^ punctuation.separator.dosbatch
+:: ^^^ keyword.control.flow.return.dosbatch
+
+ GOTO :End
+:: ^^^^ keyword.control.statement.dosbatch
+:: ^ punctuation.separator.dosbatch
+:: ^^^ meta.function-call.dosbatch variable.function.dosbatch
+
+ GOTO:End
+:: ^^^^ keyword.control.statement.dosbatch
+:: ^ punctuation.separator.dosbatch
+:: ^^^ meta.function-call.dosbatch variable.function.dosbatch
+
+:: Redirection
+ ECHO Hello World! > hello.txt
+:: ^^^^ keyword.command.dosbatch
+:: ^ keyword.operator.redirection.dosbatch
+
+ ECHO >> NUL
+:: ^^ keyword.operator.redirection.dosbatch
+:: ^^^ constant.language
+
+ dir > f.txt 2>&1
+:: ^ keyword.operator.redirection.dosbatch
+:: ^^ keyword.operator.redirection.dosbatch
+
+ ECHO || ECHO && ECHO &
+:: ^^ keyword.operator.conditional.dosbatch
+:: ^^ keyword.operator.conditional.dosbatch
+:: ^ keyword.operator.conditional.dosbatch
+
+:: Conditionals
+ IF foo EQU bar
+:: ^^ keyword.control.conditional.dosbatch
+:: ^^^ keyword.operator.comparison.dosbatch
+
+ IF NOT foo EQU bar
+:: ^^ keyword.control.conditional.dosbatch
+:: ^^^ keyword.operator.logical.dosbatch
+:: ^^^ keyword.operator.comparison.dosbatch
+
+
+ IF %ERRORLEVEL% NEQ 0 EXIT /B 1
+:: ^^ keyword.control.conditional.dosbatch
+:: ^^^^^^^^^^^^ variable.language.dosbatch
+:: ^ punctuation.definition.variable.begin.dosbatch
+:: ^ variable.language.dosbatch punctuation.definition.variable.end.dosbatch
+
+ IF foo == bar
+:: ^^ keyword.control.conditional.dosbatch
+:: ^^ keyword.operator.comparison.dosbatch
+
+ FOR %%G IN (0,9) DO (md %%G)
+:: ^^^ keyword.control.repeat.dosbatch
+:: ^ constant.numeric.integer.decimal.dosbatch
+
+ FIND "a" |
+:: ^ keyword.operator.pipe.dosbatch
+
+ :This is a #%@$虎 strange label
+::^ punctuation.separator.dosbatch
+:: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entity.name.label.dosbatch
+
+ :End
+::^ punctuation.separator.dosbatch
+:: ^^^ entity.name.label.dosbatch
+
+ ECHO %1 %* %~dpf$PATH:5 %~1
+:: ^ punctuation.definition.variable.dosbatch
+:: ^^ variable.parameter.dosbatch
+:: ^ punctuation.definition.variable.dosbatch
+:: ^^ variable.parameter.dosbatch
+:: ^ punctuation.definition.variable.dosbatch
+:: ^^^^^^^^^^^ variable.parameter.dosbatch
+:: ^ punctuation.definition.variable.dosbatch
+:: ^^^ variable.parameter.dosbatch
+
+ ECHO %variable% !variable!
+:: ^ punctuation.definition.variable.begin.dosbatch
+:: ^^^^^^^^^^ variable.other.readwrite.dosbatch
+:: ^ punctuation.definition.variable.end.dosbatch
+:: ^ punctuation.definition.variable.begin.dosbatch
+:: ^^^^^^^^^^ variable.other.readwrite.dosbatch
+:: ^ punctuation.definition.variable.end.dosbatch
+
+ECHO %sub:str1=str2% !sub:str1=str2!
+:: ^^^^^^^^^^^^^^^ variable.other.readwrite.dosbatch
+:: ^ punctuation.definition.variable.begin.dosbatch
+:: ^ punctuation.separator.dosbatch
+:: ^^^^^^^^^ meta.variable.substitution.dosbatch
+:: ^^^^ string.unquoted.dosbatch
+:: ^ punctuation.separator.dosbatch
+:: ^^^^ string.unquoted.dosbatch
+:: ^ punctuation.definition.variable.end.dosbatch
+:: ^^^^^^^^^^^^^^^ variable.other.readwrite.dosbatch
+:: ^ punctuation.definition.variable.begin.dosbatch
+:: ^ punctuation.separator.dosbatch
+:: ^^^^^^^^^ meta.variable.substitution.dosbatch
+:: ^^^^ string.unquoted.dosbatch
+:: ^ punctuation.separator.dosbatch
+:: ^^^^ string.unquoted.dosbatch
+:: ^ punctuation.definition.variable.end.dosbatch
+
+
+ECHO %substr:~0,-2% !substr:~0,-2!
+:: ^^^^^^^^^^^^^^ variable.other.readwrite.dosbatch
+:: ^ punctuation.definition.variable.begin.dosbatch
+:: ^^ punctuation.separator.dosbatch
+:: ^^^^ meta.variable.substring.dosbatch
+:: ^ constant.numeric.dosbatch
+:: ^ punctuation.separator.dosbatch
+:: ^^ constant.numeric.dosbatch
+:: ^ punctuation.definition.variable.end.dosbatch
+:: ^^^^^^^^^^^^^^ variable.other.readwrite.dosbatch
+:: ^ punctuation.definition.variable.begin.dosbatch
+:: ^^ punctuation.separator.dosbatch
+:: ^^^^ meta.variable.substring.dosbatch
+:: ^ constant.numeric.dosbatch
+:: ^ punctuation.separator.dosbatch
+:: ^^ constant.numeric.dosbatch
+:: ^ punctuation.definition.variable.end.dosbatch
+
+ECHO %b:~-5% !b:~+5!
+:: ^^^^^^^ variable.other.readwrite.dosbatch
+:: ^ punctuation.definition.variable.begin.dosbatch
+:: ^^ punctuation.separator.dosbatch
+:: ^^ meta.variable.substring.dosbatch
+:: ^^ constant.numeric.dosbatch
+:: ^ punctuation.definition.variable.end.dosbatch
+:: ^^^^^^^ variable.other.readwrite.dosbatch
+:: ^ punctuation.definition.variable.begin.dosbatch
+:: ^^ punctuation.separator.dosbatch
+:: ^^ meta.variable.substring.dosbatch
+:: ^^ constant.numeric.dosbatch
+:: ^ punctuation.definition.variable.end.dosbatch
+
+ECHO !t:%foo%=%bar:~0,-4%!
+:: ^^^^^^^^^^^^^^^^^^^^^ variable.other.readwrite.dosbatch
+:: ^ punctuation.definition.variable.begin.dosbatch
+:: ^^^^^ meta.variable.substitution.dosbatch variable.other.readwrite.dosbatch
+:: ^ meta.variable.substitution.dosbatch punctuation.definition.variable.begin.dosbatch
+:: ^ meta.variable.substitution.dosbatch punctuation.definition.variable.end.dosbatch
+:: ^ meta.variable.substitution.dosbatch punctuation.definition.variable.begin.dosbatch
+:: ^^^^^^^^^^^ meta.variable.substitution.dosbatch variable.other.readwrite.dosbatch
+:: ^^^^ meta.variable.substitution.dosbatch meta.variable.substring.dosbatch
+:: ^ meta.variable.substitution.dosbatch punctuation.definition.variable.end.dosbatch
+:: ^^ meta.variable.substitution.dosbatch constant.numeric.dosbatch
+:: ^ punctuation.definition.variable.end.dosbatch
+
+ECHO %t:foo=!bar:~0,-4!%
+:: ^^^^^^^^^^^^^^^^^^^ variable.other.readwrite.dosbatch
+:: ^ punctuation.definition.variable.begin.dosbatch
+:: ^ meta.variable.substitution.dosbatch punctuation.definition.variable.begin.dosbatch
+:: ^^^^^^^^^^^ meta.variable.substitution.dosbatch variable.other.readwrite.dosbatch
+:: ^^^^ meta.variable.substitution.dosbatch meta.variable.substring.dosbatch
+:: ^ meta.variable.substitution.dosbatch punctuation.definition.variable.end.dosbatch
+:: ^^ meta.variable.substitution.dosbatch constant.numeric.dosbatch
+:: ^ punctuation.definition.variable.end.dosbatch
+
+ECHO Not% a variable
+:: ^^^^^^^^^^^^ - variable.other.readwrite.dosbatch
+:: ^^^ - keyword.operator.logical.dosbatch
+
+ECHO Not! a variable
+:: ^^^^^^^^^^^^ - variable.other.readwrite.dosbatch
+:: ^^^ - keyword.operator.logical.dosbatch
+
+:: Numerics
+SET /A r = 010 + 0x20 - 24
+:: ^^^ constant.numeric.integer.octal.dosbatch
+:: ^ punctuation.definition.numeric.octal.dosbatch
+:: ^^^^ constant.numeric.integer.hexadecimal.dosbatch
+:: ^^ punctuation.definition.numeric.hexadecimal.dosbatch
+:: ^^ constant.numeric.integer.decimal.dosbatch
+
+:: Escape Characters
+ECHO %% ^^! ^&
+:: ^^ constant.character.escape.dosbatch
+:: ^^^ constant.character.escape.dosbatch
+:: ^^ constant.character.escape.dosbatch
+
+:: command SET /A specific operators
+ set /a "num%%=5"
+:: ^^^^^^^^^ meta.expression.set.dosbatch
+:: ^^^ keyword.operator.assignment.augmented.dosbatch
+
+ set /a "num&=3"
+:: ^^ keyword.operator.assignment.augmented.dosbatch
+
+ set /a "num*=5"
+:: ^^ keyword.operator.assignment.augmented.dosbatch
+
+ set /a "num+=5"
+:: ^^ keyword.operator.assignment.augmented.dosbatch
+
+ set /a "num-=5"
+:: ^^ keyword.operator.assignment.augmented.dosbatch
+
+ set /a "num/=5"
+:: ^^ keyword.operator.assignment.augmented.dosbatch
+
+ set /a "num<<=2"
+:: ^^^ keyword.operator.assignment.augmented.dosbatch
+
+ set /a "num=!5"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.logical.dosbatch
+
+ set /a "num=(2+3)*5"
+:: ^^^^^ meta.group.dosbatch
+:: ^ punctuation.section.group.begin.dosbatch
+:: ^ punctuation.section.group.end.dosbatch
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num=2,result=num*5"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ punctuation.separator.dosbatch
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num=2<<3"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num=2>>3"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num=5%%2"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num=5&3"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num=5^3"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num=5|3"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num^=3"
+:: ^^ keyword.operator.assignment.augmented.dosbatch
+
+ set /a "num=num*5"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num=num+5"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num=num-5"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num=num/5"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num=~5"
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+
+ set /a "num>>=2"
+:: ^^^ keyword.operator.assignment.augmented.dosbatch
+
+ set /a "num|=3"
+:: ^^ keyword.operator.assignment.augmented.dosbatch
+
+ set /a century=year/100, next=century+1
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+:: ^ punctuation.separator.dosbatch
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ keyword.operator.arithmetic.dosbatch
+
+ SET T=%TIME: =0%
+::^^^ keyword.command
+:: ^ variable.other.readwrite
+:: ^ keyword.operator.assignment
+:: ^^^^^^^^^^ variable.other.readwrite
+
+IF "%FOO%" == "BAR" ( SET BAZ=42 )
+:: ^ punctuation.section.group.begin
+:: ^^^^^^^^^^^^^^ meta.group
+:: ^ punctuation.section.group.end
+:: ^^ string.unquoted
+
+:: See http://ss64.com/nt/syntax-brackets.html
+IF EXIST MyFile.txt (ECHO Some(more)Potatoes)
+:: <- keyword.control
+:: ^ keyword.other
+:: ^^^^^^^^^^^^^^^^ meta.group
+:: ^ keyword.command
+:: ^ - meta.group
+
+IF EXIST MyFile.txt (ECHO Some[more]Potatoes)
+:: <- keyword.control
+:: ^ keyword.other
+:: ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group
+:: ^ keyword.command
+
+set "hello"="world"
+:: <- keyword.command
+:: ^ - variable.other.readwrite
+:: ^^^^^^ variable.other.readwrite
+:: ^ keyword.operator.assignment
+:: ^ - punctuation
+:: ^ punctuation.definition.string.end
+:: ^ - string
+
+set foo=bar
+:: <- keyword.command
+:: ^^^ variable.other.readwrite
+:: ^ keyword.operator.assignment
+:: ^^^ string.unquoted
+
+set foo = bar
+:: <- keyword.command
+:: ^ - variable.other.readwrite
+:: ^^^^ variable.other.readwrite
+:: ^ keyword.operator.assignment
+:: ^^^ string.unquoted
+
+set hello world = bar
+:: <- keyword.command
+:: ^ - variable.other.readwrite
+:: ^^^^^^^^^^^^ variable.other.readwrite
+:: ^ keyword.operator.assignment
+:: ^^^ string.unquoted
+
+set abc /a = 1+2
+:: <- keyword.command
+:: ^^^^^^^ variable.other.readwrite
+:: ^ keyword.operator.assignment - meta.expression.set
+:: ^^^ string.unquoted
+
+set "foobar=test"
+:: <- keyword.command
+:: ^ - variable.other.readwrite
+:: ^^^^^^ variable.other.readwrite
+:: ^ keyword.operator.assignment
+:: ^ punctuation.definition.string.end
+
+set " foo = bar"
+:: <- keyword.command
+:: ^^ - variable.other.readwrite
+:: ^^^^ variable.other.readwrite
+:: ^ keyword.operator.assignment
+:: ^ punctuation.definition.string.end
+
+set test rem = hi
+:: <- keyword.command
+:: ^^^^^^^^^ - comment
+:: ^^^^^^^^^ variable.other.readwrite
+:: ^ keyword.operator.assignment
+:: ^^ - variable.other
+
+set hello_world
+:: <- keyword.command
+:: ^^^^^^^^^^^ variable.other.readwrite.dosbatch
+
+set /A hello_world
+:: <- keyword.command
+:: ^^^^^^^^^^^ meta.expression.set
+:: ^ - meta.expression.set
+
+powershell get-date -uformat "%%Y%%m%%d" > today.txt
+:: ^^^^^^^^^^^ string.quoted.double.dosbatch
+:: ^^ constant.character.escape.dosbatch
+:: ^ - constant.character.escape.dosbatch
+:: ^^ constant.character.escape.dosbatch
+:: ^ - constant.character.escape.dosbatch
+:: ^^ constant.character.escape.dosbatch
+:: ^ - constant.character.escape.dosbatch
+
+:: the following example was inspired by http://stackoverflow.com/a/14634551/4473405
+set /p today=
"
+:: ^ punctuation.definition.string.begin
+:: ^ - punctuation
+:: ^^^^^^^ variable.other.readwrite
+:: ^ - punctuation
+:: ^ - punctuation
+:: ^^^^^^^ variable.other.readwrite
+:: ^ - punctuation
+:: ^ punctuation.definition.string.end
+
+set folder=%TEMP%\subfolder\
+:: ^^^^^^ variable.other.readwrite.dosbatch
+:: ^^^^^^ variable.other.readwrite.dosbatch
+:: ^^^^^^^^^^^ string.unquoted - variable.other
+
+set test="c:\program files (x86)\%example%_%%test"abc
+:: ^^^^ variable.other.readwrite.dosbatch
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ punctuation.definition.string.begin.dosbatch
+:: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.dosbatch
+:: ^^^^^^^^^ variable.other.readwrite.dosbatch
+:: ^^ constant.character.escape.dosbatch
+:: ^ punctuation.definition.string.end.dosbatch
+:: ^^^ string.unquoted.dosbatch
+
+SETLOCAL EnableDelayedExpansion
+::^^^^^^ keyword.command.dosbatch
+ SET /P example="what is the answer? ;) " & echo you have answered: !example!
+:: ^^^^ - variable.other.readwrite.dosbatch
+:: ^^^^^^^ variable.other.readwrite.dosbatch
+:: ^ keyword.operator.assignment.dosbatch
+:: ^ punctuation.definition.string.begin.dosbatch
+:: ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.prompt.set.dosbatch string.quoted
+:: ^ punctuation.definition.string.end.dosbatch
+:: ^ keyword.operator.conditional.dosbatch - meta.prompt.set.dosbatch - string
+:: ^^^^ keyword.command.dosbatch
+:: ^^^^^^^^^ variable.other.readwrite.dosbatch
+ENDLOCAL
+::^^^^^^ keyword.command.dosbatch
+
+set "X="
+:: ^^^^ string.quoted.double
+:: ^ punctuation.definition.string.begin
+:: ^ variable.other.readwrite
+:: ^ keyword.operator.assignment
+:: ^ punctuation.definition.string.end
+:: ^ - string
+
+set /p OUTPUT="( ... )|&... "
+:: ^^^^^^^^^^^^^^^ meta.prompt.set string.quoted.double - string.unquoted
+set /p OUTPUT=hi|echo
+:: ^^ meta.prompt.set string.unquoted
+:: ^ keyword.operator.pipe - meta.prompt
+:: ^^^^ keyword.command
+set /p OUTPUT="( ... )|&... "ignored & echo
+:: ^^^^^^^^^^^^^^^ meta.prompt.set string.quoted.double - string.unquoted
+:: ^^^^^^^ meta.prompt.set comment.line.ignored
+:: ^ keyword.operator.conditional - comment
+:: ^^^^ keyword.command
+set /p today="enter a date: " REM :: this is a comment & echo !today!
+:: ^^^^ - variable.other.readwrite.dosbatch
+:: ^^^^^ variable.other.readwrite.dosbatch
+:: ^ keyword.operator.assignment.dosbatch - variable.other.readwrite.dosbatch
+:: ^^^^^^^^^^^^^^^^ meta.prompt.set.dosbatch string.quoted - variable.other.readwrite.dosbatch - comment
+:: ^^^^^^^^^^^^^^^^^^^^^^^^ comment
+:: ^ keyword.operator.conditional - comment - meta.prompt
+:: ^^^^ keyword.command
+:: ^^^^^^^ variable.other.readwrite
+
+set hello=4
+set wow=2
+set /A hello*=wow*=2
+:: ^^^^^ variable.other.readwrite
+:: ^^ keyword.operator.assignment.augmented
+:: ^^^ variable.other.readwrite
+:: ^^ keyword.operator.assignment.augmented
+:: ^ constant.numeric.integer.decimal
+
+set /A "hello*=wow"
+:: ^^^^^^^^^^^^ meta.expression.set string.quoted.double
+:: ^ punctuation.definition.string.begin
+:: ^^^^^ variable.other.readwrite
+:: ^^ keyword.operator.assignment.augmented
+:: ^ punctuation.definition.string.end
+
+set /A "%hello%+%wow%"
+:: ^^^^^^^^^^^^^^^ meta.expression.set string.quoted.double
+:: ^ punctuation.definition.string.begin
+:: ^^^^^^^ variable.other.readwrite
+:: ^ punctuation.definition.variable.begin
+:: ^ punctuation.definition.variable.end
+:: ^ keyword.operator.arithmetic
+:: ^^^^^ variable.other.readwrite
+:: ^ punctuation.definition.variable.begin
+:: ^^^ variable.other.readwrite
+:: ^ punctuation.definition.variable.end
+:: ^ punctuation.definition.string.end
+set /A "%hello%+wow"
+:: ^^^^^^^^^^^^^ meta.expression.set string.quoted.double
+:: ^^^^^^^ variable.other.readwrite
+:: ^ punctuation.definition.variable.begin
+:: ^ punctuation.definition.variable.end
+:: ^ keyword.operator.arithmetic
+
+set /A 1+"%hello%"
+:: ^ constant.numeric.integer.decimal
+:: ^ keyword.operator.arithmetic
+:: ^^^^^^^^^ string.quoted.double
+:: ^ punctuation.definition.string.begin
+:: ^ punctuation.definition.variable.begin
+:: ^^^^^ variable.other.readwrite
+:: ^ punctuation.definition.variable.end
+:: ^ punctuation.definition.string.end
+
+set a12b=21
+REM the line below is actually invalid, as % is not expected to be used in variables before an augmented operator
+set /a %a12b%*=2
+:: ^^^^ variable.other.readwrite
+:: ^^ keyword.operator.assignment.augmented
+:: ^ constant.numeric.integer.decimal
+
+set /a a12b*=2
+:: ^^^^ variable.other.readwrite
+:: ^^ keyword.operator.assignment.augmented
+:: ^ constant.numeric.integer.decimal
+set /a a12b *= 2
+:: ^ - variable
+:: ^^^^ variable.other.readwrite
+:: ^ - variable
+:: ^^ meta.expression.set keyword.operator.assignment.augmented
+:: ^ constant.numeric.integer.decimal
+
+set /a ! a12b
+:: ^ keyword.operator.logical
+:: ^^^^ variable.other.readwrite
+set /a !a12b
+:: ^ keyword.operator.logical
+:: ^^^^ variable.other.readwrite
+set /a "! a12b"
+:: ^^^^^^^^ meta.expression.set string.quoted.double
+:: ^ punctuation.definition.string.begin
+:: ^ keyword.operator.logical
+:: ^^^^ variable.other.readwrite
+:: ^ punctuation.definition.string.end
+set /a "! %a12b%"
+:: ^^^^^^^^^^ meta.expression.set string.quoted.double
+:: ^ punctuation.definition.string.begin
+:: ^ keyword.operator.logical
+:: ^^^^^^ variable.other.readwrite
+:: ^ punctuation.definition.variable.begin
+:: ^ punctuation.definition.variable.end
+:: ^ punctuation.definition.string.end
+set /a ! "a12b"
+:: ^ keyword.operator.logical
+:: ^ punctuation.definition.string.begin
+:: ^^^^ variable.other.readwrite
+:: ^ punctuation.definition.string.end
+set /a !"%a12b%"
+:: ^ keyword.operator.logical
+:: ^ punctuation.definition.string.begin
+:: ^^^^^^ variable.other.readwrite
+:: ^ punctuation.definition.string.end
+
+set /a a&=a12b
+:: ^ keyword.operator.conditional - meta.expression.set
+set /a " world"=12
+:: ^^^^^^^^ string.quoted.double
+:: ^^^^^ variable.other.readwrite
+:: ^ punctuation.definition.string.end
+:: ^ keyword.operator.assignment
+:: ^^ constant.numeric.integer.decimal
+
+set /a "wow"+="2"
+:: ^^^^^ string.quoted.double
+:: ^^^ variable.other.readwrite
+:: ^^ keyword.operator.assignment.augmented - string
+:: ^^^ string.quoted.double
+:: ^ constant.numeric.integer.decimal
+set /a wow"+="2
+:: ^^^ variable.other.readwrite
+:: ^^^^ string.quoted.double
+:: ^^ keyword.operator.assignment.augmented
+:: ^ constant.numeric.integer.decimal - string
+set /a 4*"2+-wow+(3"-2)
+:: ^^^^^^^^^^^^^^^^ meta.expression.set - string string - meta.group meta.group
+:: ^ constant.numeric.integer.decimal
+:: ^ keyword.operator.arithmetic
+:: ^^^^^^^^^^^ string.quoted.double
+:: ^ punctuation.definition.string.begin
+:: ^ constant.numeric.integer.decimal
+:: ^^ keyword.operator.arithmetic
+:: ^^^ variable.other.readwrite
+:: ^ keyword.operator.arithmetic
+:: ^^^^^^ meta.group
+:: ^ punctuation.section.group.begin
+:: ^ constant.numeric.integer.decimal
+:: ^ punctuation.definition.string.end
+:: ^ keyword.operator.arithmetic
+:: ^ constant.numeric.integer.decimal
+:: ^ punctuation.section.group.end
+:: ^^^ - string
+:: ^^^ string.quoted.double meta.group
+
+set /a (8"2")
+:: ^^^^^^ meta.group
+:: ^ punctuation.section.group.begin
+:: ^ constant.numeric.integer.decimal
+:: ^ punctuation.definition.string.begin
+:: ^^^ string.quoted.double
+:: ^ constant.numeric.integer.decimal
+:: ^ punctuation.definition.string.end
+:: ^ punctuation.section.group.end
+
+set /a 4*"2+1"1
+:: ^ constant.numeric.integer.decimal
+:: ^ keyword.operator.arithmetic
+:: ^^^^^ string.quoted.double
+:: ^ constant.numeric.integer.decimal
+:: ^ keyword.operator.arithmetic
+:: ^ constant.numeric.integer.decimal
+:: ^ constant.numeric.integer.decimal
+set /a 4*"2++1"
+:: ^ constant.numeric.integer.decimal
+:: ^ keyword.operator.arithmetic
+:: ^^^^^^ string.quoted.double
+:: ^ constant.numeric.integer.decimal
+:: ^^ keyword.operator.arithmetic
+:: ^ constant.numeric.integer.decimal
+set /a 4*"2++w"ow
+:: ^^^^^^ string.quoted.double
+:: ^ constant.numeric.integer.decimal
+:: ^^ keyword.operator.arithmetic
+:: ^ variable.other.readwrite
+:: ^^ variable.other.readwrite
+set /a (8"2")^^1
+:: ^ constant.character.escape
+:: ^ keyword.operator.arithmetic
+set /a (8"2")^
++1
+:: <- keyword.operator.arithmetic
+set /a (abc*(def-(2))/4)"+((1))"
+:: ^^^^^^^^^^^^^^^^^ meta.group
+:: ^ - meta.group
+:: ^^^^^^^^^ meta.group meta.group
+:: ^^^ meta.group meta.group meta.group
+:: ^ punctuation.section.group.begin
+:: ^^^ variable.other.readwrite
+:: ^ keyword.operator.arithmetic
+:: ^ punctuation.section.group.begin
+:: ^^^ variable.other.readwrite
+:: ^ keyword.operator.arithmetic
+:: ^ punctuation.section.group.begin
+:: ^ constant.numeric.integer.decimal
+:: ^ punctuation.section.group.end
+:: ^ punctuation.section.group.end
+:: ^ keyword.operator.arithmetic
+:: ^ constant.numeric.integer.decimal
+:: ^ punctuation.section.group.end
+:: ^^^^^^^^ string.quoted.double
+:: ^ punctuation.definition.string.begin
+:: ^ keyword.operator.arithmetic
+:: ^ meta.group punctuation.section.group.begin
+:: ^ meta.group meta.group punctuation.section.group.begin
+:: ^ meta.group meta.group constant.numeric.integer.decimal
+:: ^ meta.group meta.group punctuation.section.group.end
+:: ^ meta.group punctuation.section.group.end
+:: ^ punctuation.definition.string.end - meta.group
+set /a ("a"+b&"c+d")
+:: ^^^^^^ meta.expression.set meta.group
+:: ^^^ string.quoted.double
+:: ^ variable.other.readwrite
+:: ^ keyword.operator.arithmetic
+:: ^ variable.other.readwrite
+:: ^ keyword.operator.conditional
+:: ^^^^^ string.quoted.double - keyword - variable
+set /a (a+"b)*2"-1
+:: ^^^^^^ meta.group
+:: ^ punctuation.section.group.begin
+:: ^ variable.other.readwrite
+:: ^ keyword.operator.arithmetic
+:: ^ punctuation.definition.string.begin
+:: ^^^^^^ string.quoted.double
+:: ^ variable.other.readwrite
+:: ^ punctuation.section.group.end
+:: ^ keyword.operator.arithmetic - meta.group
+:: ^ constant.numeric.integer.decimal
+:: ^ punctuation.definition.string.end
+:: ^ keyword.operator.arithmetic - meta.group
+:: ^ constant.numeric.integer.decimal
diff --git a/assets/syntaxes/Packages/C#/Build.sublime-syntax b/assets/syntaxes/Packages/C#/Build.sublime-syntax
new file mode 100644
index 000000000..f7b0e7ef6
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Build.sublime-syntax
@@ -0,0 +1,56 @@
+%YAML 1.2
+---
+# http://www.sublimetext.com/docs/3/syntax.html
+name: NAnt Build File
+file_extensions:
+ - build
+scope: source.nant-build
+contexts:
+ main:
+ - match: "
+ captures:
+ 0: punctuation.definition.comment.nant
+ pop: true
+ - match: "(?)([-_a-zA-Z0-9:]+)"
+ captures:
+ 1: punctuation.definition.tag.nant
+ 2: entity.name.tag.nant
+ push:
+ - meta_scope: meta.tag.nant
+ - match: (/?>)
+ captures:
+ 1: punctuation.definition.tag.nant
+ 2: entity.name.tag.nant
+ pop: true
+ - match: " ([a-zA-Z-]+)"
+ scope: entity.other.attribute-name.nant
+ - match: '"'
+ captures:
+ 0: punctuation.definition.string.begin.nant
+ push:
+ - meta_scope: string.quoted.double.nant
+ - match: '"'
+ captures:
+ 0: punctuation.definition.string.end.nant
+ pop: true
+ - match: "'"
+ captures:
+ 0: punctuation.definition.string.begin.nant
+ push:
+ - meta_scope: string.quoted.single.nant
+ - match: "'"
+ captures:
+ 0: punctuation.definition.string.end.nant
+ pop: true
+ - match: "(&)([a-zA-Z]+|#[0-9]+|#x[0-9a-fA-F]+)(;)"
+ scope: constant.character.entity.nant
+ captures:
+ 1: punctuation.definition.constant.nant
+ 3: punctuation.definition.constant.nant
+ - match: "&"
+ scope: invalid.illegal.bad-ampersand.nant
diff --git a/assets/syntaxes/Packages/C#/C#.sublime-syntax b/assets/syntaxes/Packages/C#/C#.sublime-syntax
new file mode 100644
index 000000000..ed494f8b2
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/C#.sublime-syntax
@@ -0,0 +1,2119 @@
+%YAML 1.2
+---
+# http://www.sublimetext.com/docs/3/syntax.html
+# Copyright (c) 2016 Sublime Text HQ Pty, @gwenzek,
+# Matthew Winter @wintermi, Adam Lickel @lickel
+# MIT license: https://opensource.org/licenses/mit-license.php
+
+name: C#
+file_extensions:
+ - cs
+ - csx
+scope: source.cs
+
+variables:
+
+ bin_op: '(?:\+|->|-|\*|/|%|\|\||&&|\||&|\^|<<|>>|=>|<=|<|>=|>|==|!=|\?\?)'
+ unary_op: '(?:\+\+|--|-|~|!|&|\*)'
+
+ # numbers
+ dec_digits: (?:[\d_]*\d)
+ dec_exponent: (?:[eE][-+]??{{dec_digits}})
+ float_suffix: '[fFdDmM]'
+ integer_suffix: '[uU][lL]?|[lL][uU]?'
+
+ # 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})'
+
+ 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)\b)
+ type_suffix: (?:\s*(?:\[,*\]|\*|\?)*)
+ generic_declaration: \s*(<[^(={};<]*>)?\s*
+
+ brackets_capture: '((\[)(,*)(\]))'
+ type_suffix_capture: '(\?)?{{brackets_capture}}?(?:\s*(\*))?'
+
+ reserved: '(?:abstract|as|base|break|case|catch|checked|class|const|continue|default|delegate|do|else|enum|event|explicit|extern|finally|fixed|for|foreach|goto|if|implicit|in|interface|internal|is|lock|nameof|namespace|new|null|operator|out|override|params|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|string|struct|switch|this|throw|try|typeof|unchecked|unsafe|using|virtual|volatile|while)'
+ name: '(?:@{{reserved}}|@{{base_type}}|@var|@?{{name_normal}})'
+ namespaced_name: (?:(?:{{name}}{{generic_declaration}}\s*\.\s*)*{{name}}{{generic_declaration}})
+
+ start_char: '(?:{{unicode_char}}|[_\p{L}])'
+ other_char: '(?:{{unicode_char}}|[_0-9\p{L}])'
+ name_normal: '{{start_char}}{{other_char}}*\b'
+ cap_name: '(\p{Lu}{{other_char}})'
+
+contexts:
+ prototype:
+ - include: comments
+ - match: '^\s*((#)\s*)'
+ captures:
+ 1: keyword.other.preprocessor.cs
+ 2: punctuation.definition.preprocessor.cs
+ push: preprocessor_option
+
+ # comments
+ comments:
+ - match: '^\s*(///)'
+ captures:
+ 1: comment.block.documentation.cs punctuation.definition.comment.documentation.cs
+ push: documentation
+ - match: '//'
+ scope: punctuation.definition.comment.cs
+ push:
+ - meta_scope: comment.line.double-slash.cs
+ - match: $\n?
+ pop: true
+ - include: comments_in
+ - match: '/\*'
+ scope: punctuation.definition.comment.begin.cs
+ push:
+ - meta_scope: comment.block.cs
+ - match: '\*/'
+ scope: punctuation.definition.comment.end.cs
+ pop: true
+ - match: ^\s*(\*)(?!/)
+ captures:
+ 1: punctuation.definition.comment.cs
+ - include: comments_in
+
+ comments_in:
+ - match: \b(?i:todo|hack|xxx)\b
+ scope: comment.line.todo.cs
+ - match: '/!\\'
+ scope: comment.line.todo.cs
+ - match: \b(https?://\S*)\b
+ scope: markup.underline.link.cs
+
+ preprocessor_option:
+ - meta_scope: meta.preprocessor.cs
+ - match: '\b(define|undef)\s+({{name}})\b'
+ captures:
+ 1: keyword.control.preprocessor.cs
+ 2: entity.name.constant.cs
+ - match: '\b(el)?if\b'
+ scope: keyword.control.preprocessor.cs
+ push:
+ - match: '\(|\)'
+ scope: punctuation.section.parens.cs
+ - match: '&&|\|\||!'
+ scope: keyword.operator.logical.cs
+ - match: '\b(true|false)\b'
+ scope: constant.language.cs
+ - match: '{{name}}'
+ scope: constant.other.flag.cs
+ - include: option_done
+ - match: '\b(else|endif)\b'
+ scope: keyword.control.preprocessor.cs
+ push: option_done
+ # error, warning, region and endregion may be followed by any text.
+ # Comments doesn't apply in this case, see ECMA C# specification.
+ - match: '\b(error|warning)\b\s*(.*)'
+ captures:
+ 1: keyword.other.preprocessor.cs
+ 2: string.unquoted.cs
+ - match: '\b(region)\b\s*(.*)'
+ captures:
+ 1: keyword.other.preprocessor.cs
+ 2: entity.name.section.cs
+ - match: '\b(endregion)\b\s*(.*)'
+ captures:
+ 1: keyword.other.preprocessor.cs
+ 2: variable.other.section.cs
+
+ - match: '\b(line)\s+(default|hidden)\b'
+ captures:
+ 1: keyword.other.preprocessor.cs
+ 2: keyword.other.preprocessor.cs
+ push: option_done
+ - match: '\b(line)\s+(\d*)\s+((").*("))?'
+ captures:
+ 1: keyword.other.preprocessor.cs
+ 2: constant.numeric.integer.decimal.cs
+ 3: string.quoted.double.cs
+ 4: punctuation.definition.string.begin.cs
+ 5: punctuation.definition.string.end.cs
+ push: option_done
+ - match: '\b(pragma)\s+(checksum)\s+'
+ captures:
+ 1: keyword.other.preprocessor.cs
+ 2: keyword.other.preprocessor.cs
+ push:
+ - match: '"{'
+ scope: punctuation.definition.string.begin.cs
+ push:
+ - meta_scope: string.quoted.double.hash.cs
+ - match: '[-\h]+'
+ scope: constant.numeric.integer.hexadecimal.cs
+ - match: '}"'
+ scope: punctuation.definition.string.end.cs
+ pop: true
+ - match: \.
+ scope: invalid.illegal.cs
+ pop: true
+ - match: '"'
+ scope: punctuation.definition.string.begin.cs
+ push: string
+ - include: option_done
+
+ - match: '(pragma)\s+(warning)\b'
+ captures:
+ 1: keyword.other.preprocessor.cs
+ 2: keyword.other.preprocessor.cs
+ push:
+ - match: \b(disable|restore)\b(?:\s+([\p{L}_-]+))?
+ captures:
+ 1: keyword.other.preprocessor.cs
+ 2: string.unquoted.warning.cs
+ - include: comments
+ - match: $
+ pop: true
+ - match: .*
+ scope: invalid.illegal.cs
+ - match: $
+ pop: true
+
+ # Pops out at the end of the line and handles comments.
+ # Marks the rest of the line as invalid.
+ option_done:
+ - include: comments
+ - match: $
+ pop: true
+ - match: \S
+ scope: invalid.illegal.cs
+
+ main:
+ - include: stray_close_bracket
+ - match: '\{'
+ scope: punctuation.section.block.begin.cs
+ push:
+ - meta_scope: meta.block.cs
+ - match: '\}'
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: main
+ - include: attribute
+ - include: using
+ - include: class_declaration
+ - include: interface_declaration
+ - include: namespace_declaration
+ - include: delegate_declaration
+ # allows coloration of code outside a class
+ - match: (?=\S)
+ push:
+ - match: (?={{visibility}}|\b(?:class|delegate|interface|namespace|readonly)\b)
+ pop: true
+ - include: line_of_code
+
+ stray_close_bracket:
+ - match: '[})\]]'
+ scope: invalid.illegal.stray.brace.cs
+
+ using:
+ - match: '\b(using)\s+(?={{name}}\s*=\s*)'
+ captures:
+ 1: keyword.control.import.cs
+ 2: meta.path.cs
+ 3: keyword.operator.assignment.cs
+ push: using_namespace
+ - match: '\b(using)(?!\s*\()(?:\s+(static))?\b'
+ captures:
+ 1: keyword.control.import.cs
+ 2: keyword.control.import.cs
+ 3: meta.path.cs
+ push: using_namespace
+
+ namespace_alias:
+ - match: '(?:(global)|({{name}}))\s*(::)'
+ captures:
+ 1: support.namespace.cs
+ 2: variable.other.namespace.cs
+ 3: punctuation.accessor.double-colon.namespace.cs
+
+ using_namespace:
+ - include: namespace_alias
+ - match: '{{name}}'
+ scope: meta.path.cs
+ - match: '='
+ scope: keyword.operator.assignment.cs
+ - match: \.
+ scope: punctuation.separator.namespace.cs
+ - match: '<'
+ scope: meta.generic.cs punctuation.definition.generic.begin.cs
+ push: type_argument
+ - match: ';'
+ scope: punctuation.terminator.cs
+ pop: true
+ - match: '[^\s;]+'
+ scope: invalid.illegal.expected-namespace.cs
+ - match: '$'
+ pop: true
+
+ namespace_declaration:
+ # package declaration
+ - match: '\b(namespace)\b'
+ scope: storage.type.namespace.cs
+ push:
+ - meta_scope: meta.namespace.cs
+ - match: '(?={{name}})'
+ push:
+ - meta_content_scope: entity.name.namespace.cs
+ - match: '{{name}}'
+ - match: \.
+ scope: punctuation.separator.namespace.cs
+ - match: ''
+ pop: true
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.namespace.cs meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: main
+ - match: (?=\S)
+ pop: true
+
+ class_declaration:
+ - match: '\b(static|unsafe|abstract|partial|sealed)\b'
+ scope: storage.modifier.cs
+ - match: '{{visibility}}'
+ scope: storage.modifier.access.cs
+ - match: '\b(class)\s+({{name}})'
+ captures:
+ 1: storage.type.class.cs
+ 2: entity.name.class.cs
+ push: [class_signature, data_type_signature]
+ - match: '(?:\b(readonly)\s+)?(?:\b(ref)\s+)?\b(struct)\s+({{name}})'
+ captures:
+ 1: storage.modifier.cs
+ 2: storage.modifier.cs
+ 3: storage.type.struct.cs
+ 4: entity.name.struct.cs
+ push: [struct_signature, data_type_signature]
+ - match: '\b(enum)\s+({{name}})\s*(?:(:)\s*(byte|sbyte|short|ushort|int|uint|long|ulong))?'
+ scope: meta.enum.cs
+ captures:
+ 1: storage.type.enum.cs
+ 2: entity.name.enum.cs
+ 3: punctuation.separator.key-value.type.cs
+ 4: storage.type.cs
+ push:
+ - meta_content_scope: meta.enum.cs
+ - match: (?=\{)
+ set:
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.enum.body.cs meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ set:
+ - match: ';'
+ scope: punctuation.terminator.statement.cs
+ pop: true
+ - match: '(?=\S)'
+ pop: true
+ - include: attribute
+ - match: '{{name}}'
+ scope: constant.other.enum.cs
+ - match: '='
+ scope: keyword.operator.assignment.cs
+ push: line_of_code_in
+ - match: ','
+ scope: punctuation.separator.enum.cs
+
+ interface_declaration:
+ - match: '(interface)\s+({{name}})'
+ captures:
+ 1: storage.type.interface.cs
+ 2: entity.name.interface.cs
+ push: [interface_signature, data_type_signature]
+
+ delegate_declaration:
+ - match: \b(delegate)\b\s+
+ captures:
+ 1: storage.type.delegate.cs
+ push: delegate_type
+
+ delegate_type:
+ - meta_scope: meta.delegate.cs
+ - match: \s
+ set: delegate_name
+ - include: type
+
+ delegate_name:
+ - match: '\s+'
+ scope: meta.delegate.cs
+ - match: '({{name}})(\s*)(<)'
+ captures:
+ 1: meta.delegate.cs variable.other.member.delegate.cs
+ 2: meta.delegate.cs
+ 3: meta.delegate.cs meta.generic.cs punctuation.definition.generic.begin.cs
+ set:
+ - meta_content_scope: meta.delegate.cs meta.generic.cs
+ - match: '>'
+ scope: meta.delegate.cs meta.generic.cs punctuation.definition.generic.end.cs
+ set:
+ - match: '\s+'
+ scope: meta.delegate.cs
+ - match: \(
+ scope: meta.delegate.parameters.cs punctuation.section.parameters.begin.cs
+ set: delegate_params
+ - include: type_parameter
+ - match: '({{name}})(\s*)(\()'
+ captures:
+ 1: meta.delegate.cs variable.other.member.delegate.cs
+ 2: meta.delegate.cs
+ 3: meta.delegate.parameters.cs punctuation.section.parameters.begin.cs
+ set: delegate_params
+ - match: '(?=\S)'
+ pop: true
+
+ delegate_params:
+ - meta_content_scope: meta.delegate.parameters.cs
+ - match: \)
+ scope: punctuation.section.parameters.end.cs
+ set: delegate_end
+ - match: (?=\S)
+ push: [method_param, method_param_type]
+
+ delegate_end:
+ - match: ';'
+ scope: punctuation.terminator.cs
+ pop: true
+ - match: (\s+(?=\S)|\S)
+ scope: invalid.illegal.expected.colon
+ pop: true
+
+ struct_signature:
+ - meta_scope: meta.struct.cs
+ - match: ''
+ set: [struct_body, data_type_body]
+
+ class_signature:
+ - meta_scope: meta.class.cs
+ - match: ''
+ set: [class_body, data_type_body]
+
+ interface_signature:
+ - meta_scope: meta.interface.cs
+ - match: ''
+ set: [interface_body, data_type_body]
+
+ struct_body:
+ - meta_content_scope: meta.struct.body.cs
+ - match: ''
+ pop: true
+
+ class_body:
+ - meta_content_scope: meta.class.body.cs
+ - match: ''
+ pop: true
+
+ interface_body:
+ - meta_content_scope: meta.interface.body.cs
+ - match: ''
+ pop: true
+
+ data_type_body:
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ push:
+ - meta_scope: meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: attribute
+ - include: class_declaration
+ - include: interface_declaration
+ - include: delegate_declaration
+ - include: method_declaration
+ - include: stray_close_bracket
+ - match: \S*
+ scope: invalid.illegal
+ pop: true
+
+ data_type_signature:
+ - match: '<'
+ scope: meta.generic.cs punctuation.definition.generic.begin.cs
+ push:
+ - meta_content_scope: meta.generic.cs
+ - include: type_parameter
+ - match: ':'
+ scope: punctuation.separator.type.cs
+ set: type_constraint
+ - match: (?=where\b)
+ set: type_constraint
+ - match: (?=\{)
+ pop: true
+
+ type_constraint:
+ - include: type_constraint_common
+ - match: '{{name}}'
+ scope: entity.other.inherited-class.cs
+ - include: type
+
+ type_constraint_common:
+ - match: (?=\{)
+ pop: true
+ - match: '\b(where)\s+(?:({{base_type}})|({{name}}))\s*(:)'
+ captures:
+ 1: storage.modifier.cs
+ 2: storage.type.cs
+ 3: support.type.cs
+ 4: punctuation.separator.type.cs
+ - match: '(?:(global)|({{name}}))\s*(::)'
+ captures:
+ 1: support.namespace.cs
+ 2: meta.path.cs
+ 3: punctuation.accessor.double-colon.namespace.cs
+ - match: '(class|struct|interface)'
+ scope: storage.type.cs
+ - match: 'new\s*\(\s*\)'
+ scope: keyword.operator.new.cs
+ - match: '{{base_type}}'
+ scope: storage.type.cs
+ - match: '({{name}})?(\.)'
+ captures:
+ 1: meta.path.cs
+ 2: punctuation.accessor.dot.namespace.cs
+ - match: ','
+ scope: punctuation.separator.inherited-class.cs
+
+ event_handler_declaration:
+ - match: '({{name}})(\.)'
+ captures:
+ 1: entity.other.inherited-class.cs
+ 2: punctuation.accessor.dot.cs
+ - match: '{{name}}'
+ scope: variable.other.member.cs
+ set:
+ - match: ';'
+ scope: punctuation.terminator.statement.cs
+ pop: true
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - match: \b(add)\b
+ scope: storage.type.function.accessor.add.cs
+ push: method_body
+ - match: \b(remove)\b
+ scope: storage.type.function.accessor.remove.cs
+ push: method_body
+ - match: (?=\S)
+ pop: true
+ - match: (?=\S)
+ pop: true
+
+ method_declaration:
+ - match: '\b(abstract|async|const|extern|new|override|readonly|ref|sealed|static|unsafe|virtual|volatile)\b'
+ scope: storage.modifier.cs
+ - match: \b(event)\b\s*
+ captures:
+ 1: storage.modifier.cs
+ push: [event_handler_declaration, type_no_space]
+ - match: \bdelegate\b
+ scope: storage.type.delegate.cs
+ - match: '\b(implicit|explicit)\b'
+ scope: storage.modifier.cs
+ - match: '{{visibility}}'
+ scope: storage.modifier.access.cs
+ - match: '({{name}})\s*(<)'
+ captures:
+ 1: support.type.cs
+ 2: meta.generic.cs punctuation.definition.generic.begin.cs
+ push: [method_name, type_argument]
+ - match: '(~{{name}})(\s*)(\()'
+ captures:
+ 1: meta.method.cs entity.name.function.destructor.cs
+ 2: meta.method.cs
+ 3: meta.method.parameters.cs punctuation.section.parameters.begin.cs
+ push: [constructor_prebody, method_params]
+ - match: '({{name}})\s*(\()'
+ captures:
+ 1: entity.name.function.constructor.cs
+ 2: meta.method.parameters.cs punctuation.section.parameters.begin.cs
+ push: [constructor_prebody, method_params]
+ - match: '({{name}})\s*(\.)'
+ captures:
+ 1: entity.other.inherited-class.cs
+ 2: punctuation.accessor.dot.cs
+ - match: \b(?:({{base_type}})|({{name}}))
+ captures:
+ 1: storage.type.cs
+ 2: support.type.cs
+ push:
+ - match: '{{type_suffix_capture}}'
+ captures:
+ 1: storage.type.nullable.cs
+ 2: meta.brackets.cs
+ 3: punctuation.section.brackets.begin.cs
+ 4: punctuation.separator.cs
+ 5: punctuation.section.brackets.end.cs
+ 6: keyword.operator.pointer.cs
+ - match: ''
+ set: method_name
+ - match: '\b(operator)\b'
+ scope: storage.modifier.cs
+ push: method_name
+ - match: (?=\()
+ push: [method_name, type_tuple]
+
+ method_name: # also matches member variables
+ - match: '\.'
+ scope: punctuation.accessor.dot.cs
+ - match: '(operator)\s*({{unary_op}}|{{bin_op}})\s*(\()'
+ captures:
+ 1: storage.modifier.other.cs
+ 2: meta.method.cs entity.name.function.cs
+ 3: meta.method.parameters.cs punctuation.section.parameters.begin.cs
+ set: [method_body_transition, method_params]
+ - match: '({{name}}\s*)?((=>)\s*)'
+ captures:
+ 1: variable.other.member.cs
+ 2: meta.method.cs
+ 3: storage.type.function.accessor.get.cs
+ set:
+ - meta_scope: meta.property.cs
+ - meta_content_scope: meta.method.cs
+ - include: line_of_code_in
+ - match: '({{name}})\s*(?==[^>])'
+ captures:
+ 1: variable.other.member.cs
+ set: member_variables_declaration
+ - match: '({{name}})?\s*(\()'
+ # here the name is optionnal since it may already have been match by
+ # '{{name}}\s*(<)' (see rule below)
+ captures:
+ 1: meta.method.cs entity.name.function.cs
+ 2: meta.method.parameters.cs punctuation.section.parameters.begin.cs
+ set: [method_body_transition, method_params]
+ - match: '({{name}})\s*(;)'
+ captures:
+ 1: variable.other.member.cs
+ 2: punctuation.terminator.statement.cs
+ pop: true
+ - match: '({{name}})\s*(<)(?=[^(]*>\.)'
+ scope: meta.method.cs
+ captures:
+ 1: entity.other.inherited-class.cs
+ 2: meta.generic.cs punctuation.section.generic.begin.cs
+ push:
+ - meta_content_scope: meta.method.cs meta.generic.cs
+ - match: '(>)\s*(\.)'
+ scope: meta.method.cs meta.generic.cs
+ captures:
+ 1: punctuation.definition.generic.end.cs
+ 2: punctuation.accessor.dot.cs
+ pop: true
+ - match: ','
+ scope: punctuation.separator.parameter.type.cs
+ - include: type
+ - match: '({{name}})\s*(<)'
+ captures:
+ 1: entity.name.function.cs
+ 2: meta.generic.cs punctuation.definition.generic.begin.cs
+ push:
+ - meta_scope: meta.method.cs
+ - meta_content_scope: meta.generic.cs
+ - include: type_parameter
+ - match: '(this)\s*(\[)'
+ captures:
+ 1: variable.language.cs
+ 2: meta.brackets.cs punctuation.section.brackets.begin.cs
+ set: [method_accessor, method_params_bracket]
+ - match: '({{name}})\s*(\.)'
+ scope: meta.method.cs
+ captures:
+ 1: entity.other.inherited-class.cs
+ 2: punctuation.accessor.dot.cs
+ - match: '{{name}}'
+ scope: meta.property.cs variable.other.member.cs
+ push:
+ - match: \s*(,)
+ captures:
+ 1: punctuation.separator.variables.cs
+ pop: true
+ - match: ''
+ pop: true
+ - match: '(?=\s*\{)'
+ set: method_accessor
+
+ method_body_transition:
+ - match: ''
+ set: method_body
+
+ method_params:
+ - meta_content_scope: meta.method.parameters.cs
+ - match: \)
+ scope: meta.method.parameters.cs punctuation.section.parameters.end.cs
+ pop: true
+ - match: (?=\S)
+ push: [method_param, method_param_type]
+
+ method_params_bracket:
+ - meta_content_scope: meta.brackets.cs
+ - match: \]
+ scope: meta.brackets.cs punctuation.section.brackets.end.cs
+ pop: true
+ - match: (?=\S)
+ push: [method_param, method_param_type]
+
+ method_param:
+ - match: '{{name}}'
+ scope: variable.parameter.cs
+ - match: '='
+ scope: keyword.operator.assignment.default-value.cs
+ push: line_of_code_in
+ - match: ','
+ scope: punctuation.separator.parameter.function.cs
+ pop: true
+ - match: (?=\}|\)|>|\]|;)
+ pop: true
+
+ method_param_type:
+ - include: attribute
+ - match: (?=[^\s\[])
+ set:
+ - match: '\s*\b(out|ref|this|params|in)\s+'
+ captures:
+ 1: storage.modifier.parameter.cs
+ - match: \s
+ pop: true
+ - include: type
+ - match: (?=\}|\)|>|\]|;)
+ pop: true
+
+ constructor_prebody:
+ - meta_scope: meta.method.constructor.cs
+ - match: ':'
+ scope: meta.method.constructor.prebody.cs punctuation.separator.function.cs
+ set:
+ - match: \s+
+ scope: meta.method.constructor.prebody.cs
+ - match: (this|base)\s*(\()
+ captures:
+ 1: variable.language.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ set: [constructor_initializer, arguments]
+ - match: '(?=\{)'
+ set: method_body
+ - match: '(?=\{|=>)'
+ set: method_body
+
+ constructor_initializer:
+ - meta_scope: meta.method.constructor.prebody.cs
+ - meta_content_scope: meta.group.cs
+ - match: '\)'
+ scope: punctuation.section.group.end.cs
+ - match: ''
+ set: constructor_initializer_after
+
+ constructor_initializer_after:
+ - meta_content_scope: meta.method.constructor.prebody.cs
+ - match: '(?=\{)'
+ set: method_body
+ - match: '(?=\S)'
+ pop: true
+
+ method_body:
+ - meta_scope: meta.method.cs
+ - match: (?=where\b)
+ scope: storage.modifier.other.cs
+ push: type_constraint
+ - match: (=>)
+ scope: storage.type.function.cs
+ set:
+ - meta_content_scope: meta.method.cs
+ - include: line_of_code_in
+ - match: '(?=\{)'
+ set:
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.method.body.cs meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: stray_close_bracket
+ - include: code_block_in
+ - match: ;
+ scope: punctuation.terminator.cs
+ pop: true
+ - match: \S+
+ scope: invalid.illegal.cs
+ pop: true
+
+ method_accessor:
+ - meta_scope: meta.property.cs
+ - match: \{
+ scope: meta.block.cs punctuation.section.block.begin.cs
+ set:
+ - meta_content_scope: meta.property.cs meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ set:
+ - meta_content_scope: meta.property.cs
+ - match: =
+ scope: keyword.operator.assignment.cs
+ set:
+ - meta_content_scope: meta.property.cs
+ - include: line_of_code_in
+ - match: (?=\S)
+ pop: true
+ - match: \b(get)\b
+ scope: storage.type.function.accessor.get.cs
+ push: method_body
+ - match: \b(set)\b
+ scope: storage.type.function.accessor.set.cs
+ push: method_body
+ - match: '{{visibility}}'
+ scope: storage.modifier.access.cs
+ - include: attribute
+ - match: '=>'
+ scope: storage.type.function.cs
+ set:
+ - meta_content_scope: meta.method.cs
+ - include: line_of_code_in
+ - match: \S
+ scope: invalid.illegal.cs
+ pop: true
+
+ attribute:
+ - match: (\[)\s*(assembly|module|field|event|method|param|property|return|type)\s*(:)
+ captures:
+ 1: punctuation.definition.annotation.begin.cs
+ 2: storage.modifier.target.cs
+ 3: punctuation.separator.key-value.cs
+ push: attribute_in
+ - match: \[
+ scope: punctuation.definition.annotation.begin.cs
+ push: attribute_in
+
+ attribute_in:
+ - meta_scope: meta.annotation.cs
+ - match: '({{name}})(\()'
+ captures:
+ 1: variable.annotation.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ set: [attribute_arguments, arguments]
+ - match: '({{name}})\s*(\.)'
+ captures:
+ 1: variable.other.namespace.cs
+ 2: punctuation.accessor.dot.namespace.cs
+ - match: '(?:(global)|({{name}}))\s*(::)'
+ captures:
+ 1: support.namespace.cs
+ 2: support.namespace.cs
+ 3: punctuation.accessor.double-colon.namespace.cs
+ - match: '{{name}}'
+ scope: variable.annotation.cs
+ - match: ','
+ scope: punctuation.separator.annotation.cs
+ - match: \]
+ scope: punctuation.definition.annotation.end.cs
+ pop: true
+
+ code_block_in:
+ - match: (?=\S)
+ push: line_of_code
+
+ line_of_code:
+ # language keywords
+ - match: \b(if)\b
+ captures:
+ 1: keyword.control.conditional.if.cs
+ set: [else_block, if_block, if_condition]
+ - match: \b(switch)\b
+ captures:
+ 1: keyword.control.flow.switch.cs
+ set: [switch_block, if_condition]
+ - match: \b(for)\s*(\()(?=(?:{{name}}|var)\s(?!=))
+ captures:
+ 1: keyword.control.loop.for.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ set: [for_block, line_of_code_in, line_of_code_in, for_var_assignment, var_declaration]
+ - match: \b(for)\s*(\()
+ captures:
+ 1: keyword.control.loop.for.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ set: [for_block, line_of_code_in, line_of_code_in, line_of_code_in_no_semicolon]
+ - match: \b(foreach)\s*(\()
+ captures:
+ 1: keyword.control.loop.foreach.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ set: [for_block, foreach_var_assignment, var_declaration]
+ - match: \b(try)\b
+ scope: keyword.control.trycatch.try.cs
+ set: [finally_block, catch_expr, try_block]
+ - match: \b(using)\s*(\()
+ captures:
+ 1: keyword.control.using.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ set: [using_block, line_of_code]
+ - match: \b(fixed)\s*(\()
+ captures:
+ 1: keyword.control.other.fixed.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ set: [expression_block, line_of_code]
+ - match: \b(lock)\s*(\()
+ captures:
+ 1: keyword.control.other.lock.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ set: [expression_block, line_of_code]
+ - match: \bdo\b
+ scope: keyword.control.loop.do.cs
+ set: [do_condition, while_block]
+ - match: \bwhile\b
+ scope: keyword.control.loop.while.cs
+ set: [while_block, while_condition]
+ - match: \b(else|case|catch|finally)\b
+ scope: keyword.control.cs invalid.illegal.unexpected.keyword.cs
+ - match: \b(return|yield\s+return)\b
+ scope: keyword.control.flow.return.cs
+ set: line_of_code_in
+ - match: \b(continue|break|yield\s+break)\b\s*(;)?
+ captures:
+ 1: keyword.control.flow.break.cs
+ 2: punctuation.terminator.statement.cs
+ pop: true
+ - match: \b(throw)\b
+ scope: keyword.control.trycatch.throw.cs
+ set: line_of_code_in
+ - match: \b(goto)\s+(case)\b
+ captures:
+ 1: keyword.control.flow.goto.cs
+ 2: keyword.control.switch.case.cs
+ set: line_of_code_in
+ - match: '\b(goto)\s+({{name}})\s*(;)'
+ captures:
+ 1: keyword.control.flow.goto.cs
+ 2: constant.other.label.cs
+ 3: punctuation.terminator.statement.cs
+ pop: true
+ - include: keywords
+ # C#7, nested method
+ - match: '(?=(?:\b(?:async|ref)\s+)?{{name}}(?:{{generic_declaration}})?{{type_suffix}}\s+{{name}}{{generic_declaration}}\()'
+ push:
+ - include: method_declaration
+ - match: ''
+ pop: true
+ - match: '({{name}})\s*(<)(?=([^(={};]*>){{type_suffix}}\s+{{name}}{{generic_declaration}}\()'
+ captures:
+ 1: support.type.cs
+ 2: meta.generic.cs punctuation.definition.generic.begin.cs
+ push: [method_name, type_argument]
+ - match: '({{name}})\s*(<)(?=[^(={};]*>\()'
+ scope: meta.function-call.cs
+ captures:
+ 1: variable.function.cs
+ 2: meta.generic.cs punctuation.definition.generic.begin.cs
+ push:
+ - meta_content_scope: meta.generic.cs
+ - match: ','
+ scope: punctuation.separator.type.cs
+ - match: '>'
+ scope: meta.generic.cs punctuation.definition.generic.end.cs
+ pop: true
+ - include: type
+ - match: '({{name}})(<)'
+ captures:
+ 1: support.type.cs
+ 2: meta.generic.cs punctuation.definition.generic.begin.cs
+ set:
+ - meta_content_scope: meta.generic.cs
+ - match: '>'
+ scope: meta.generic.cs punctuation.definition.generic.end.cs
+ set:
+ - match: \.
+ set: line_of_code
+ scope: punctuation.accessor.dot.namespace.cs
+ - match: \s+
+ set: variables_declaration
+ - match: (?=\S)
+ set: line_of_code
+ - include: type_argument
+ - match: \bconst\b
+ scope: storage.modifier.cs
+ - match: '(var|dynamic)\s+({{reserved}}|{{base_type}})\s*(=)'
+ captures:
+ 1: storage.type.variable.cs
+ 2: invalid.illegal.cs
+ 3: keyword.operator.assignment.variable.cs
+ - match: '(var|dynamic)\s+({{name}})\s*(=)'
+ captures:
+ 1: storage.type.variable.cs
+ 2: variable.other.cs
+ 3: keyword.operator.assignment.variable.cs
+ set: line_of_code_in
+ - match: (?=var\s*\()
+ push: var_declaration
+ - include: lambdas
+ - match: (?:\b(ref)\s+)?\b(?={{namespaced_name}}{{type_suffix}}\s+{{name}}(?!\s*(?:[(:])))
+ captures:
+ 1: storage.modifier.cs
+ set: [variables_declaration, type_no_space]
+ - match: '(?:\b(ref)\s+)?\b(?:({{base_type}})|({{name}}))(?={{type_suffix}}\s+{{name}}(?!\s*:))' # avoid picking up `test ? something : something_else` as a variable declaration of `something` with nullable type `test`.
+ captures:
+ 1: storage.modifier.cs
+ 2: storage.type.cs
+ 3: support.type.cs
+ set: [variables_declaration, type_no_space]
+ - match: '({{name}})\s*(:)(?!:)'
+ captures:
+ 1: entity.name.label.cs
+ 2: punctuation.separator.cs
+ pop: true
+ - include: namespace_alias
+ - match: '({{name}})\s+({{name}})'
+ captures:
+ 1: support.type.cs
+ 2: variable.other.cs
+ set: variables_declaration
+ - match: \.
+ scope: punctuation.accessor.dot.cs
+ - match: '(?=\S)'
+ set: line_of_code_in
+
+ lambdas:
+ - match: ({{name}})\s+(=>)\s*
+ captures:
+ 1: variable.parameter.cs
+ 2: storage.type.function.lambda.cs
+ push:
+ - meta_scope: meta.function.anonymous.cs
+ - match: '(?=;)'
+ pop: true
+ - include: line_of_code_in
+ - match: \((?=[^()]*\)\s+=>)
+ scope: meta.function.anonymous.cs meta.group.cs punctuation.section.group.begin.cs
+ push:
+ - meta_content_scope: meta.function.anonymous.cs meta.group.cs
+ - match: '{{name}}(?=\s*[\),/])'
+ scope: variable.parameter.cs
+ - match: ','
+ scope: punctuation.separator.parameter.function.cs
+ - match: (\))\s*(=>)
+ captures:
+ 1: meta.group.cs punctuation.section.group.end.cs
+ 2: storage.type.function.lambda.cs
+ set:
+ - meta_content_scope: meta.function.anonymous.cs
+ - match: '(?=;)'
+ pop: true
+ - include: line_of_code_in
+
+ member_variables_declaration:
+ - match: '='
+ scope: keyword.operator.assignment.variable.cs
+ push:
+ - match: (?=;|,)
+ pop: true
+ - include: line_of_code_in
+ - match: '(?=\{)'
+ push: method_accessor
+ - match: '{{name}}'
+ scope: variable.other.member.cs
+ - match: ','
+ scope: punctuation.separator.variables.cs
+ - match: ';'
+ scope: punctuation.terminator.statement.cs
+ pop: true
+ - match: (?=\}|\)|>|\])
+ pop: true
+
+ variables_declaration:
+ - match: '='
+ scope: keyword.operator.assignment.variable.cs
+ push:
+ - match: (?=;|,)
+ pop: true
+ - match: (?=\{)
+ push:
+ - match: (?=[^,\s{}])
+ pop: true
+ - include: initializer_constructor
+ - include: line_of_code_in
+ - match: '{{name}}'
+ scope: variable.other.cs
+ - match: ','
+ scope: punctuation.separator.variables.cs
+ - match: ';'
+ scope: punctuation.terminator.statement.cs
+ pop: true
+ - match: (?=\{|\}|\)|>|\])
+ pop: true
+
+ keywords:
+ - match: '\b(this|base)\s*(\[)'
+ captures:
+ 1: variable.language.cs
+ 2: meta.brackets.cs punctuation.section.brackets.begin.cs
+ push: accessor_arguments
+ - match: \b(this|base)\b
+ scope: variable.language.cs
+ - match: \b(await)\b
+ scope: keyword.control.other.cs
+ - match: \b(nameof)(\()
+ captures:
+ 1: keyword.other.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ push:
+ - meta_content_scope: meta.group.cs
+ - match: \)
+ scope: meta.group.cs punctuation.section.group.end.cs
+ pop: true
+ - match: '({{base_type}})\b'
+ scope: storage.type.cs
+ # We don't if these are types of variables, so we guess that
+ # uppercase names are types, and others are variables
+ - match: '(?=\p{Ll}){{name}}(?=\s*\))'
+ scope: variable.other.cs
+ - include: type
+ - match: \b(typeof|default)(\()
+ captures:
+ 1: keyword.operator.reflection.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ push:
+ - meta_content_scope: meta.group.cs
+ - match: \)
+ scope: meta.group.cs punctuation.section.group.end.cs
+ pop: true
+ - include: type
+ - match: '\b(as|is)\s+'
+ captures:
+ 1: keyword.operator.reflection.cs
+ push: type_no_space
+ - match: \b(checked|unchecked)\b
+ scope: keyword.other.cs
+ push:
+ - match: \(
+ scope: punctuation.section.group.begin.cs
+ set:
+ - meta_scope: meta.group.cs
+ - match: \)
+ scope: punctuation.section.group.end.cs
+ pop: true
+ - include: line_of_code_in
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: code_block_in
+ - match: \S
+ scope: invalid.illegal.expected.block.cs
+ - match: \b(unsafe)\b
+ scope: keyword.other.cs
+ push:
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: code_block_in
+ - match: \S
+ scope: invalid.illegal.expected.block.cs
+ - match: \b(new)\b
+ scope: meta.instance.cs keyword.operator.new.cs
+ push: maybe_an_anonymous_class
+ - match: '{{visibility}}'
+ scope: storage.modifier.access.cs
+
+ maybe_an_anonymous_class:
+ - meta_content_scope: meta.instance.cs
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ # Found an anounymous class
+ set:
+ - meta_scope: meta.instance.cs meta.class.body.anonymous.cs meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - match: ','
+ scope: punctuation.separator.class.cs
+ - match: '({{name}})\s*(=)'
+ captures:
+ 1: variable.other.member.cs
+ 2: keyword.operator.assignment.cs
+ push: line_of_code_in
+ - match: (?=\S)
+ push: line_of_code_in
+ - match: (?=[^{\s])
+ # This is not an anounymous class
+ set:
+ - meta_content_scope: meta.instance.cs
+ - match: '{{brackets_capture}}'
+ captures:
+ 1: meta.brackets.cs
+ 2: punctuation.section.brackets.begin.cs
+ 3: punctuation.separator.cs
+ 4: punctuation.section.brackets.end.cs
+ - match: \[
+ scope: punctuation.section.brackets.begin.cs
+ push:
+ - meta_scope: meta.brackets.cs
+ - match: ','
+ scope: punctuation.separator.argument.cs
+ push: line_of_code_in
+ - match: \]
+ scope: punctuation.section.brackets.end.cs
+ pop: true
+ - match: '(?=\S)'
+ push: line_of_code_in
+ - match: (?:\s*((\()\s*(\)))\s*)?(\{)
+ scope: meta.instance.cs
+ captures:
+ 1: meta.group.cs
+ 2: punctuation.section.group.begin.cs
+ 3: punctuation.section.group.end.cs
+ 4: meta.braces.cs punctuation.section.braces.begin.cs
+ set: initializer_constructor
+ - match: \(
+ scope: meta.group.cs punctuation.section.group.begin.cs
+ set: [constructor_arguments, arguments]
+ - include: type
+
+ line_of_code_in:
+ - include: line_of_code_in_no_semicolon
+ - match: ';'
+ scope: punctuation.terminator.statement.cs
+ pop: true
+
+ line_of_code_in_no_semicolon:
+ - match: \b(value)\b
+ scope: variable.language.cs
+ - include: keywords
+ # Cannot neg-ahead "(" because clauses can follow several of the sql words
+ - match: \b(let|select|equals|from|in|where|join|orderby|group|by|on|into|into|ascending|descending)\b(?!\s*[.,;+=&\|\[\]\)])
+ scope: keyword.other.sql.cs
+ - match: \?\.
+ scope: punctuation.accessor.null-coalescing.cs
+ - match: \.
+ scope: punctuation.accessor.dot.cs
+ # Match this before {{bin_op}} to scope specially in the generic context
+ - match: '->'
+ scope: punctuation.accessor.arrow.cs
+ - match: '{{bin_op}}='
+ scope: keyword.operator.cs
+ - match: '{{bin_op}}|{{unary_op}}'
+ scope: keyword.operator.cs
+ - match: '='
+ scope: keyword.operator.assignment.cs
+ - include: literals
+ # interpolated strings
+ - match: '\$"'
+ scope: punctuation.definition.string.begin.cs
+ push: format_string
+ # multi-line strings
+ - match: '@"'
+ scope: punctuation.definition.string.begin.cs
+ push: long_string
+ # interpolated multi-line strings
+ - match: '(@\$|\$@)"'
+ scope: punctuation.definition.string.begin.cs
+ push: long_format_string
+ - match: '({{name}})(<)(?=[^(]*>\s*\()'
+ captures:
+ 1: variable.function.cs
+ 2: meta.generic.cs punctuation.definition.generic.begin.cs
+ push:
+ - meta_scope: meta.function-call.cs
+ - meta_content_scope: meta.generic.cs
+ - match: ','
+ scope: punctuation.separator.type.cs
+ - match: '(>)\s*(\()'
+ scope: meta.function-call.cs
+ captures:
+ 1: meta.generic.cs punctuation.definition.generic.end.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ set: [function_call_arguments, arguments]
+ - include: type
+ - match: ({{name}})(<)(?={{namespaced_name}}>\s*\.)
+ captures:
+ 1: support.type.cs
+ 2: meta.generic.cs punctuation.definition.generic.begin.cs
+ push:
+ - meta_content_scope: meta.generic.cs
+ - match: ','
+ scope: punctuation.separator.type.cs
+ - match: '>'
+ scope: meta.generic.cs punctuation.definition.generic.end.cs
+ pop: true
+ - include: type
+ - match: '((?!{{reserved}}\b){{name}})\s*(\()'
+ scope: meta.function-call.cs
+ captures:
+ 1: variable.function.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ push: [function_call_arguments, arguments]
+ - match: '({{name}})\s*(\??\[)'
+ captures:
+ 1: variable.other.cs
+ 2: meta.brackets.cs punctuation.section.brackets.begin.cs
+ push: accessor_arguments
+ - include: lambdas
+ - match: '\s*(\??\[)'
+ captures:
+ 1: meta.brackets.cs punctuation.section.brackets.begin.cs
+ push: accessor_arguments
+ - match: '({{base_type}})\b'
+ scope: storage.type.cs
+ - match: '({{reserved}})\b'
+ scope: keyword.other.cs
+ - match: '(?:(global)|({{name}}))\s*(::)'
+ captures:
+ 1: support.namespace.cs
+ 2: support.namespace.cs
+ 3: punctuation.accessor.double-colon.namespace.cs
+ - match: '{{name}}'
+ scope: variable.other.cs
+ - match: '@'
+ scope: invalid.illegal.reserved-char.cs
+ - match: \?
+ scope: keyword.operator.ternary.cs
+ push:
+ - match: ':'
+ scope: keyword.operator.ternary.cs
+ pop: true
+ - include: line_of_code_in
+ - match: '(\()\s*(\*)\s*({{name}})\s*(\))'
+ captures:
+ 1: punctuation.section.group.begin.cs
+ 2: keyword.operator.pointer.cs
+ 3: variable.other.cs
+ 4: punctuation.section.group.end.cs
+ - match: '(\()(?={{namespaced_name}}\s*\))'
+ captures:
+ 1: punctuation.section.group.begin.cs
+ push:
+ - meta_scope: meta.cast.cs
+ - match: \)
+ scope: punctuation.section.group.end.cs
+ pop: true
+ - match: '{{base_type}}'
+ scope: storage.type.cs
+ - match: '{{name}}'
+ scope: support.type.cs
+ - match: '\.'
+ scope: punctuation.separator.namespace.cs
+ - match: '{{type_suffix_capture}}'
+ captures:
+ 1: punctuation.section.brackets.begin.cs
+ 2: punctuation.separator.cs
+ 3: punctuation.section.brackets.end.cs
+ 4: keyword.operator.pointer.cs
+ - match: \((?=(?:[^,)(]*|\([^\)]*\))*,)
+ scope: punctuation.section.group.begin.cs
+ push:
+ - meta_scope: meta.group.tuple.cs
+ - match: \)
+ scope: punctuation.section.group.end.cs
+ pop: true
+ - match: ','
+ scope: punctuation.separator.tuple.cs
+ - match: ':'
+ scope: keyword.operator.assignment.cs
+ - match: _\b
+ scope: variable.language.deconstruction.discard.cs
+ - match: (?!{{reserved}})(?={{namespaced_name}}{{type_suffix}}\s+{{name}}\s*[:,])
+ push: var_declaration_explicit
+ - match: '({{name}})(<)'
+ captures:
+ 1: support.type.cs
+ 2: meta.generic.cs punctuation.definition.generic.begin.cs
+ push:
+ - meta_content_scope: meta.generic.cs
+ - match: ','
+ scope: punctuation.separator.type.cs
+ - match: '>'
+ scope: meta.generic.cs punctuation.definition.generic.end.cs
+ pop: true
+ - include: type
+ - include: line_of_code_in_no_semicolon
+ - match: \(
+ scope: punctuation.section.group.begin.cs
+ push:
+ - meta_scope: meta.group.cs
+ - match: \)
+ scope: punctuation.section.group.end.cs
+ pop: true
+ - include: lambdas
+ - include: line_of_code_in_no_semicolon
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: code_block_in
+ - match: (?=\}|\)|>|\]|,|{{reserved}})
+ pop: true
+
+ attribute_arguments:
+ - meta_content_scope: meta.annotation.cs meta.group.cs
+ - match: ''
+ set: attribute_in
+
+ constructor_arguments:
+ - meta_content_scope: meta.instance.cs meta.group.cs
+ - match: '(?=[^\s{])'
+ pop: true
+ - match: '\{'
+ scope: punctuation.section.braces.begin.cs
+ set: initializer_constructor
+
+ function_call_arguments:
+ - meta_content_scope: meta.function-call.cs meta.group.cs
+ - match: ''
+ pop: true
+
+ arguments:
+ - match: (out)\s
+ captures:
+ 1: storage.modifier.argument.cs
+ push:
+ - match: (ref)\s
+ captures:
+ 1: storage.modifier.argument.cs
+ - match: (?!{{namespaced_name}}{{type_suffix}}\s+{{name}})
+ pop: true
+ - include: var_declaration
+ - match: (ref)\s
+ captures:
+ 1: storage.modifier.argument.cs
+ - match: '({{name}})\s*(=)(?=[^>=])'
+ captures:
+ 1: variable.parameter.cs
+ 2: keyword.operator.assignment.cs
+ push: line_of_code_in
+ - match: '({{name}})\s*(:)'
+ captures:
+ 1: variable.parameter.cs
+ 2: punctuation.separator.argument.value.cs
+ push: line_of_code_in
+ - match: ','
+ scope: punctuation.separator.argument.cs
+ - match: \)
+ scope: punctuation.section.group.end.cs
+ pop: true
+ - match: ;
+ scope: invalid.illegal.expected-close-paren.cs
+ pop: true
+ - include: stray_close_bracket
+ - match: '(?=\S)'
+ push:
+ - include: line_of_code_in_no_semicolon
+ - match: (?=;)
+ pop: true
+
+ accessor_arguments:
+ - meta_content_scope: meta.brackets.cs
+ - match: '({{name}})\s*(:)'
+ captures:
+ 1: variable.other.parameter.cs
+ 2: punctuation.separator.key-value.parameter.cs
+ - match: ','
+ scope: punctuation.separator.accessor.cs
+ - match: \]
+ scope: meta.brackets.cs punctuation.section.brackets.end.cs
+ pop: true
+ - include: line_of_code_in
+
+ type:
+ - include: type_common
+ - match: (?=\()
+ push: type_tuple
+
+ type_tuple:
+ - match: \(
+ scope: punctuation.section.group.begin.cs
+ set:
+ - meta_scope: meta.group.tuple.cs
+ - match: (\))
+ captures:
+ 1: punctuation.section.group.end.cs
+ pop: true
+ - match: ','
+ scope: punctuation.separator.tuple.cs
+ - match: (?=\S)
+ push: var_declaration_explicit
+
+ type_common:
+ - include: namespace_alias
+ - match: '(class|struct|enum)'
+ scope: storage.type.other.cs
+ - match: 'new\s*\(\s*\)'
+ scope: keyword.operator.new.cs
+ - match: '{{base_type}}'
+ scope: storage.type.cs
+ - match: '{{brackets_capture}}'
+ captures:
+ 1: meta.brackets.cs
+ 2: punctuation.section.brackets.begin.cs
+ 3: punctuation.separator.cs
+ 4: punctuation.section.brackets.end.cs
+ - match: \s*(\.)\s*
+ captures:
+ 1: punctuation.accessor.dot.namespace.cs
+ - match: '\*'
+ scope: keyword.operator.pointer.cs
+ - match: \s*(\?)
+ captures:
+ 1: storage.type.nullable.cs
+ - match: \s*(<)
+ captures:
+ 1: meta.generic.cs punctuation.definition.generic.begin.cs
+ push: type_argument
+ - match: '{{name}}'
+ scope: support.type.cs
+ - match: '[{:]'
+ scope: invalid.illegal
+ pop: true
+ - match: (?=\}|\)|>|\]|,|;|>|=>)
+ pop: true
+
+ type_arg_param_common:
+ - match: ','
+ scope: punctuation.separator.type.cs
+ - match: '(>){{type_suffix_capture}}'
+ captures:
+ 1: meta.generic.cs punctuation.definition.generic.end.cs
+ 2: storage.type.nullable.cs
+ 3: meta.brackets.cs
+ 4: punctuation.section.brackets.begin.cs
+ 5: punctuation.separator.cs
+ 6: punctuation.section.brackets.end.cs
+ 7: keyword.operator.pointer.cs
+ pop: true
+ - include: type
+
+ type_argument:
+ - meta_content_scope: meta.generic.cs
+ - include: type_arg_param_common
+
+ type_parameter:
+ - match: '(in|out)\b'
+ scope: storage.modifier.cs
+ - include: type_arg_param_common
+ - match: '{{name}}'
+ scope: support.type.cs
+
+ type_no_space:
+ - include: type
+ - match: \s
+ pop: true
+
+ # bools, numbers, chars, simple strings
+ literals:
+ # language constants
+ - match: \b(true|false|null)\b
+ scope: constant.language.cs
+ # characters
+ - match: '''\'''
+ scope: invalid.illegal.lone-escape.cs
+ - match: (')({{escaped_char}})(')
+ scope: constant.character.cs
+ captures:
+ 2: constant.character.escape.cs
+ - match: (').(')
+ scope: constant.character.cs
+ - match: (')[^']+(')
+ scope: invalid.illegal.not_a_char.cs
+ # numbers
+ - match: (0[xX])[\h_]*\h
+ scope: constant.numeric.integer.hexadecimal.cs
+ captures:
+ 1: punctuation.definition.numeric.base.cs
+ - match: (0[bB])[01_]*[01]
+ scope: constant.numeric.integer.binary.cs
+ captures:
+ 1: punctuation.definition.numeric.base.cs
+ - match: '{{dec_digits}}(?:(?:(?:(\.){{dec_digits}}){{dec_exponent}}?|{{dec_exponent}})({{float_suffix}})?|({{float_suffix}}))'
+ scope: constant.numeric.float.decimal.cs
+ captures:
+ 1: punctuation.separator.decimal.cs
+ 2: storage.type.numeric.cs
+ 3: storage.type.numeric.cs
+ - match: (?:0|[1-9]{{dec_digits}}?)({{integer_suffix}})?
+ scope: constant.numeric.integer.decimal.cs
+ captures:
+ 1: storage.type.numeric.cs
+ # strings
+ - match: '"'
+ scope: punctuation.definition.string.begin.cs
+ push: string
+
+ string:
+ - meta_include_prototype: false
+ - meta_scope: string.quoted.double.cs
+ - include: string_escaped
+ - match: '"'
+ scope: punctuation.definition.string.end.cs
+ pop: true
+ - include: string_placeholders
+ - match: '(\{)(\d+)'
+ captures:
+ 1: punctuation.definition.placeholder.begin.cs
+ 2: constant.numeric.integer.decimal.cs
+ push: string_placeholder
+ - match: $\n?
+ scope: invalid.illegal.unclosed-string.cs
+ pop: true
+
+ format_string:
+ - meta_include_prototype: false
+ - meta_scope: meta.string.interpolated.cs string.quoted.double.cs
+ - match: '"'
+ scope: punctuation.definition.string.end.cs
+ pop: true
+ - include: string_escaped
+ - include: string_placeholder_escape
+ - match: \{
+ scope: punctuation.section.interpolation.begin.cs
+ push:
+ - meta_scope: meta.string.interpolated.cs
+ - meta_content_scope: source.cs
+ - clear_scopes: 2
+ - match: $
+ pop: true
+ - include: string_placeholder_format
+ - include: string_interpolation
+ - match: $\n?
+ scope: invalid.illegal.unclosed-string.cs
+ pop: true
+
+ long_format_string:
+ - meta_include_prototype: false
+ - meta_scope: meta.string.interpolated.cs string.quoted.double.raw.cs
+ - include: long_string_escaped
+ - match: '"'
+ scope: punctuation.definition.string.end.cs
+ pop: true
+ - include: string_placeholder_escape
+ - match: \{
+ scope: punctuation.section.interpolation.begin.cs
+ push:
+ - meta_scope: meta.string.interpolated.cs
+ - meta_content_scope: source.cs
+ - clear_scopes: 2
+ - include: long_string_placeholder_format
+ - include: string_interpolation
+
+ string_placeholder_escape:
+ - match: '\{\{|\}\}'
+ scope: constant.character.escape.cs
+
+ string_placeholders:
+ - include: string_placeholder_escape
+ - match: \{\h{8}-(?:\h{4}-){3}\h{12}\}
+ scope: constant.other.guid.cs
+ - match: '(\{)(\d+)(?=")'
+ scope: constant.other.placeholder.cs
+ captures:
+ 1: punctuation.definition.placeholder.begin.cs
+ 2: constant.numeric.integer.decimal.cs invalid.illegal.unclosed-string-placeholder.cs
+
+ inside_string_placeholder:
+ - match: '(\})(\}(?!\}))?'
+ captures:
+ 1: punctuation.definition.placeholder.end.cs
+ 2: invalid.illegal.unescaped-placeholder.cs
+ pop: true
+ - match: (?=[}"])
+ pop: true
+
+ string_placeholder:
+ - meta_scope: constant.other.placeholder.cs
+ - include: inside_string_placeholder
+ - include: string_placeholder_format
+ - match: '[^"}]+'
+ scope: invalid.illegal.unexpected-character-in-placeholder.cs
+
+ long_string_placeholder:
+ - meta_scope: constant.other.placeholder.cs
+ - include: inside_string_placeholder
+ - include: long_string_placeholder_format
+ - match: '[^"}]+'
+ scope: invalid.illegal.unexpected-character-in-placeholder.cs
+
+ string_placeholder_format:
+ - match: '\s*(?:(,)\s*(-?\d+)\s*)?'
+ captures:
+ 1: punctuation.separator.arguments.cs
+ 2: constant.numeric.integer.decimal.formatting.cs
+ - match: ':(?=")'
+ scope: invalid.illegal.unclosed-string-placeholder.cs
+ pop: true
+ - match: ':'
+ scope: punctuation.separator.cs
+ push:
+ - meta_scope: constant.other.format-spec.cs
+ - include: string_placeholder_escape
+ - include: string_escaped
+ - match: '(?=\})'
+ pop: true
+ - match: '([^}"\\]+(\\.)*)+(?=")'
+ scope: invalid.illegal.unclosed-string-placeholder.cs
+ pop: true
+ - match: '\{'
+ scope: invalid.illegal.unescaped-placeholder.cs
+
+ long_string_placeholder_format:
+ - match: '\s*(?:(,)\s*(-?\d+)\s*)?'
+ captures:
+ 1: punctuation.separator.arguments.cs
+ 2: constant.numeric.integer.decimal.formatting.cs
+ - match: ':(?="(?!"))'
+ scope: invalid.illegal.unclosed-string-placeholder.cs
+ pop: true
+ - match: ':'
+ scope: punctuation.separator.cs
+ push:
+ - meta_scope: constant.other.format-spec.cs
+ - include: string_placeholder_escape
+ - include: long_string_escaped
+ - match: (?=\})
+ pop: true
+ - match: \\(?:""|[^"])
+ scope: constant.character.escape.cs
+ - match: (?:[^}"]+|"")+(?="(?!"))
+ scope: invalid.illegal.unclosed-string-placeholder.cs
+ pop: true
+ - match: \{
+ scope: invalid.illegal.unescaped-placeholder.cs
+
+ string_interpolation:
+ - match: '\}'
+ scope: punctuation.section.interpolation.end.cs
+ pop: true
+ - include: line_of_code_in
+
+ long_string:
+ - meta_include_prototype: false
+ - meta_scope: string.quoted.double.raw.cs
+ - include: long_string_escaped
+ - include: string_placeholders
+ - match: '(\{)(\d+)'
+ captures:
+ 1: punctuation.definition.placeholder.begin.cs
+ 2: constant.numeric.integer.decimal.cs
+ push: long_string_placeholder
+ - match: '"'
+ scope: punctuation.definition.string.end.cs
+ pop: true
+
+ escaped:
+ - match: '{{escaped_char}}'
+ scope: constant.character.escape.cs
+
+ string_escaped:
+ - include: escaped
+ - match: \\
+ scope: invalid.illegal.lone-escape.cs
+
+ long_string_escaped:
+ - match: '""'
+ scope: constant.character.escape.cs
+
+ initializer_constructor:
+ - meta_content_scope: meta.instance.cs meta.braces.cs
+ - match: \}
+ scope: meta.instance.cs meta.braces.cs punctuation.section.braces.end.cs
+ pop: true
+ - match: \{
+ scope: punctuation.section.braces.begin.cs
+ push: initializer_constructor
+ - match: ','
+ scope: punctuation.separator.array-element.cs
+ - match: (?=[^,\s{}])
+ push: line_of_code_in
+
+ try_block:
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: main
+ - match: (?=\S)
+ set:
+ - match: \s*$
+ pop: true
+ - include: main
+
+ catch_expr:
+ - match: '(catch)\s*(\()'
+ captures:
+ 1: keyword.control.trycatch.catch.cs
+ 2: meta.group.cs punctuation.section.group.begin.cs
+ push: [catch_block, var_declaration_explicit]
+ - match: 'catch'
+ scope: keyword.control.trycatch.catch.cs
+ push: trycatch_block
+ - match: (?=\S)
+ pop: true
+
+ catch_block:
+ - meta_content_scope: meta.group.cs
+ - match: \)
+ scope: meta.group.cs punctuation.section.group.end.cs
+ set: catch_when
+
+ catch_when:
+ - match: \bwhen\b
+ scope: keyword.control.trycatch.when.cs
+ set:
+ - match: \(
+ scope: punctuation.section.group.begin.cs
+ set:
+ - meta_scope: meta.group.cs
+ - match: \)
+ scope: punctuation.section.group.end.cs
+ set: trycatch_block
+ - include: line_of_code_in
+ - match: (?=\S)
+ set: trycatch_block
+ - match: '(?=\S)'
+ set: trycatch_block
+
+ finally_block:
+ - meta_scope: meta.block.trycatch.cs
+ - match: finally\b
+ scope: keyword.control.trycatch.finally.cs
+ set: trycatch_block
+ - match: (?=\S)
+ pop: true
+
+ trycatch_block:
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: code_block_in
+ - match: (?=\S)
+ pop: true
+
+ using_block:
+ - meta_content_scope: meta.group.cs
+ - match: \)
+ scope: meta.group.cs punctuation.section.group.end.cs
+ set:
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: code_block_in
+ - match: (?=\S)
+ pop: true
+ - match: (?=\S)
+ pop: true
+
+ expression_block:
+ - meta_content_scope: meta.group.cs
+ - match: \)
+ scope: meta.group.cs punctuation.section.group.end.cs
+ set:
+ - match: \{
+ scope: meta.block.cs punctuation.section.block.begin.cs
+ set:
+ - meta_content_scope: meta.block.cs
+ - match: \}
+ scope: meta.block.cs punctuation.section.block.end.cs
+ pop: true
+ - include: code_block_in
+ - match: (?=\S)
+ set: line_of_code
+
+ if_condition:
+ - match: '\s*(\()'
+ captures:
+ 1: meta.group.cs punctuation.section.group.begin.cs
+ set:
+ - meta_content_scope: meta.group.cs
+ - match: '\s*(\))'
+ captures:
+ 1: meta.group.cs punctuation.section.group.end.cs
+ pop: true
+ - include: line_of_code_in
+ - match: (?=[^(])
+ pop: true
+
+ if_block:
+ - match: \{
+ scope: meta.block.cs punctuation.section.block.begin.cs
+ set:
+ - meta_content_scope: meta.block.cs
+ - match: \}
+ scope: meta.block.cs punctuation.section.block.end.cs
+ pop: true
+ - include: main
+ - match: (?=\S)
+ set:
+ - match: (?=else\b)
+ pop: true
+ - include: line_of_code
+
+ else_block:
+ - match: (else\s+if)\b\s*
+ captures:
+ 1: keyword.control.conditional.elseif.cs
+ push: [if_block, if_condition]
+ - match: (else)\s*
+ scope: keyword.control.conditional.else.cs
+ set:
+ - match: \s*(\{)
+ captures:
+ 1: meta.block.cs punctuation.section.block.begin.cs
+ set:
+ - meta_content_scope: meta.block.cs
+ - match: \}
+ scope: meta.block.cs punctuation.section.block.end.cs
+ pop: true
+ - include: main
+ - match: (?=\S)
+ set:
+ - include: line_of_code
+ - match: (?=\S)
+ pop: true
+
+ switch_condition:
+ - match: '\('
+ scope: punctuation.section.group.begin.cs
+ set:
+ - meta_scope: meta.group.cs
+ - match: '\)'
+ scope: punctuation.section.group.end.cs
+ pop: true
+ - include: line_of_code_in
+ - match: (?=\S)
+ pop: true
+
+ switch_block:
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - match: '\b(default)\s*(:)'
+ captures:
+ 1: keyword.control.switch.case.cs
+ 2: punctuation.separator.case-statement.cs
+ - match: '\b(case)\b'
+ scope: keyword.control.switch.case.cs
+ push:
+ - match: '{{name}}(?=\s*:)'
+ scope: constant.other.cs
+ - match: '\bwhen\b'
+ scope: keyword.control.switch.case.when.cs
+ - match: '(?={{namespaced_name}}{{type_suffix}}\s+{{name}}\s+when\b)'
+ push: var_declaration_explicit
+ - match: ':'
+ scope: punctuation.separator.case-statement.cs
+ pop: true
+ - include: line_of_code_in
+ - match: $
+ pop: true
+ - include: code_block_in
+ - match: '(?=\S)'
+ pop: true
+
+ for_var_assignment:
+ - match: '='
+ scope: keyword.operator.assignment.variable.loop.cs
+ set: line_of_code_in
+ - match: (?=;|\)|\})
+ pop: true
+
+ foreach_var_assignment:
+ - match: '\b(in)\b'
+ scope: keyword.control.flow.cs
+ set: line_of_code_in
+ - match: (?=\)|\})
+ pop: true
+
+ var_declaration:
+ - match: (var)\s*(\()
+ captures:
+ 1: storage.type.variable.cs
+ 2: meta.group.tuple.cs punctuation.definition.group.begin.cs
+ set:
+ - meta_content_scope: meta.group.tuple.cs
+ - match: \)
+ scope: meta.group.tuple.cs punctuation.definition.group.end.cs
+ pop: true
+ - match: _\b
+ scope: variable.language.deconstruction.discard.cs
+ - match: '{{name}}'
+ scope: variable.other.cs
+ - match: ','
+ scope: punctuation.separator.tuple.cs
+ - match: '(var)\s+({{name}})\s*'
+ captures:
+ 1: storage.type.variable.cs
+ 2: variable.other.cs
+ pop: true
+ - include: var_declaration_explicit
+
+ var_declaration_explicit:
+ - match: '({{name}})\s*(\.)'
+ captures:
+ 1: support.type.cs
+ 2: punctuation.accessor.dot.namespace.cs
+ - match: '({{name}})\s*(<)'
+ captures:
+ 1: support.type.cs
+ 2: meta.generic.cs punctuation.definition.generic.begin.cs
+ set:
+ - meta_content_scope: meta.generic.cs
+ - match: '>'
+ scope: meta.generic.cs punctuation.definition.generic.end.cs
+ set:
+ - match: '({{name}})\s*'
+ captures:
+ 1: variable.other.cs
+ pop: true
+ - match: (?=[,);}])
+ pop: true
+ - include: type_argument
+ - match: '({{base_type}}){{type_suffix_capture}}'
+ captures:
+ 1: storage.type.cs
+ 2: storage.type.nullable.cs
+ 3: meta.brackets.cs
+ 4: punctuation.section.brackets.begin.cs
+ 5: punctuation.separator.cs
+ 6: punctuation.section.brackets.end.cs
+ 7: keyword.operator.pointer.cs
+ set:
+ - match: '({{name}})\s*'
+ captures:
+ 1: variable.other.cs
+ pop: true
+ - match: (?=[,);}])
+ pop: true
+ - match: '(?:({{name}}){{type_suffix_capture}})(?:\s+({{name}}))?\s*'
+ captures:
+ 1: support.type.cs
+ 2: storage.type.nullable.cs
+ 3: meta.brackets.cs
+ 4: punctuation.section.brackets.begin.cs
+ 5: punctuation.separator.cs
+ 6: punctuation.section.brackets.end.cs
+ 7: keyword.operator.pointer.cs
+ 8: variable.other.cs
+ pop: true
+ - match: (?=\))
+ pop: true
+
+ using_var_assignment:
+ - match: '='
+ scope: keyword.operator.assignment.variable.using.cs
+ push: line_of_code_in
+ - match: (?=;|\)|\})
+ pop: true
+ - match: ','
+ scope: punctuation.separator.expression.cs
+ push: line_of_code_in
+
+ for_block:
+ - meta_content_scope: meta.group.cs
+ - match: \)
+ scope: punctuation.section.group.end.cs
+ set:
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: code_block_in
+ - match: (?=\S)
+ set:
+ - include: line_of_code
+
+ while_block:
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.block.cs
+ - match: '\}'
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: code_block_in
+ - match: (?=\S)
+ set:
+ - include: line_of_code
+
+ do_condition:
+ - match: \b(while)\b
+ scope: keyword.control.loop.while.cs
+ set: while_condition
+ - match: (?=\S)
+ pop: true
+
+ while_condition:
+ - match: \(
+ scope: punctuation.section.group.begin.cs
+ set:
+ - meta_scope: meta.group.cs
+ - match: '\)'
+ scope: punctuation.section.group.end.cs
+ pop: true
+ - include: line_of_code_in
+ - match: (?=\S)
+ pop: true
+
+ documentation:
+ - meta_include_prototype: false
+ - meta_content_scope: comment.block.documentation.cs
+ - match: '(<)({{name}})'
+ captures:
+ 1: punctuation.definition.tag.begin.cs
+ 2: entity.name.tag.begin.cs
+ push:
+ - meta_include_prototype: false
+ - match: '({{name}})\s*(=)'
+ captures:
+ 1: entity.other.attribute-name.cs
+ 2: punctuation.separator.argument.value.cs
+ - match: '/?>'
+ scope: punctuation.definition.tag.end.cs
+ pop: true
+ - match: '"[^"]*"'
+ scope: string.quoted.double.cs
+ - match: $
+ pop: true
+ - match: '()({{name}})(>)'
+ captures:
+ 1: punctuation.definition.tag.begin.cs
+ 2: entity.name.tag.end.cs
+ 3: punctuation.definition.tag.end.cs
+ - match: '^\s*(///)'
+ captures:
+ 1: punctuation.definition.comment.documentation.cs
+ - match: '^\s*(?!///)'
+ pop: true
+ - include: comments_in
+ - match: '[\w\s]+|.'
+ scope: text.documentation.cs
diff --git a/assets/syntaxes/Packages/C#/Comments.tmPreferences b/assets/syntaxes/Packages/C#/Comments.tmPreferences
new file mode 100644
index 000000000..295dc7048
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Comments.tmPreferences
@@ -0,0 +1,39 @@
+
+
diff --git a/assets/syntaxes/Packages/C#/Indentation.tmPreferences b/assets/syntaxes/Packages/C#/Indentation.tmPreferences
new file mode 100644
index 000000000..d55a1fa75
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Indentation.tmPreferences
@@ -0,0 +1,45 @@
+
+
diff --git a/assets/syntaxes/Packages/C#/Symbol List Classes.tmPreferences b/assets/syntaxes/Packages/C#/Symbol List Classes.tmPreferences
new file mode 100644
index 000000000..b7320d3ec
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Symbol List Classes.tmPreferences
@@ -0,0 +1,16 @@
+
+
diff --git a/assets/syntaxes/Packages/C#/Symbol List Constructors.tmPreferences b/assets/syntaxes/Packages/C#/Symbol List Constructors.tmPreferences
new file mode 100644
index 000000000..298f7715c
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Symbol List Constructors.tmPreferences
@@ -0,0 +1,21 @@
+
+
diff --git a/assets/syntaxes/Packages/C#/Symbol List Enums.tmPreferences b/assets/syntaxes/Packages/C#/Symbol List Enums.tmPreferences
new file mode 100644
index 000000000..78d3c43fe
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Symbol List Enums.tmPreferences
@@ -0,0 +1,16 @@
+
+
diff --git a/assets/syntaxes/Packages/C#/Symbol List Index Constructors.tmPreferences b/assets/syntaxes/Packages/C#/Symbol List Index Constructors.tmPreferences
new file mode 100644
index 000000000..42aa25d51
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Symbol List Index Constructors.tmPreferences
@@ -0,0 +1,14 @@
+
+
diff --git a/assets/syntaxes/Packages/C#/Symbol List Inner Function.tmPreferences b/assets/syntaxes/Packages/C#/Symbol List Inner Function.tmPreferences
new file mode 100644
index 000000000..3c38f7f6d
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Symbol List Inner Function.tmPreferences
@@ -0,0 +1,21 @@
+
+
diff --git a/assets/syntaxes/Packages/C#/Symbol List Interfaces.tmPreferences b/assets/syntaxes/Packages/C#/Symbol List Interfaces.tmPreferences
new file mode 100644
index 000000000..95b950da6
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Symbol List Interfaces.tmPreferences
@@ -0,0 +1,16 @@
+
+
diff --git a/assets/syntaxes/Packages/C#/Symbol List Namespace.tmPreferences b/assets/syntaxes/Packages/C#/Symbol List Namespace.tmPreferences
new file mode 100644
index 000000000..54128ce21
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Symbol List Namespace.tmPreferences
@@ -0,0 +1,14 @@
+
+
diff --git a/assets/syntaxes/Packages/C#/Symbol List Region.tmPreferences b/assets/syntaxes/Packages/C#/Symbol List Region.tmPreferences
new file mode 100644
index 000000000..a917fe895
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Symbol List Region.tmPreferences
@@ -0,0 +1,19 @@
+
+
diff --git a/assets/syntaxes/Packages/C#/Symbol List Structs.tmPreferences b/assets/syntaxes/Packages/C#/Symbol List Structs.tmPreferences
new file mode 100644
index 000000000..80ce2026a
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/Symbol List Structs.tmPreferences
@@ -0,0 +1,16 @@
+
+
diff --git a/assets/syntaxes/Packages/C#/doc_params.sublime-snippet b/assets/syntaxes/Packages/C#/doc_params.sublime-snippet
new file mode 100644
index 000000000..7a6edaa35
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/doc_params.sublime-snippet
@@ -0,0 +1,9 @@
+
diff --git a/assets/syntaxes/Packages/C#/doc_see.sublime-snippet b/assets/syntaxes/Packages/C#/doc_see.sublime-snippet
new file mode 100644
index 000000000..1ae68ad5e
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/doc_see.sublime-snippet
@@ -0,0 +1,9 @@
+
diff --git a/assets/syntaxes/Packages/C#/doc_summary.sublime-snippet b/assets/syntaxes/Packages/C#/doc_summary.sublime-snippet
new file mode 100644
index 000000000..128d851cf
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/doc_summary.sublime-snippet
@@ -0,0 +1,9 @@
+
diff --git a/assets/syntaxes/Packages/C#/tests/syntax_test_C#7.cs b/assets/syntaxes/Packages/C#/tests/syntax_test_C#7.cs
new file mode 100644
index 000000000..e125f0989
--- /dev/null
+++ b/assets/syntaxes/Packages/C#/tests/syntax_test_C#7.cs
@@ -0,0 +1,772 @@
+/// SYNTAX TEST "Packages/C#/C#.sublime-syntax"
+
+class Foo {
+/// <- meta.class storage.type.class
+ /// <- meta.class
+ /// <- meta.class
+///^^^^^^^^ meta.class
+/// ^ meta.class.body
+
+ void Main(string[] args) {
+/// ^^^^ storage.type
+/// ^^^^^^^^^^^^^^^^^^^^^ meta.method
+/// ^^^^^^^^^^^^^^^^^^^^^ - meta.method meta.method
+/// ^^^^ entity.name.function
+/// ^^^^^^^^^^^^^^^ meta.method.parameters
+/// ^ punctuation.section.parameters.begin
+/// ^^^^^^ storage.type
+/// ^^ meta.brackets
+/// ^ punctuation.section.brackets.begin
+/// ^ punctuation.section.brackets.end
+/// ^^^^ variable.parameter
+/// ^ punctuation.section.parameters.end
+/// ^ punctuation.section.block.begin
+
+ int x = 37;
+/// ^^^ storage.type
+/// ^ - entity.name
+/// ^ keyword.operator.assignment
+/// ^^ constant.numeric.integer.decimal
+/// ^ punctuation.terminator
+
+ // simple nested function
+ int[] add(int y) {return x + y;}
+/// ^^^ storage.type
+/// ^^ meta.brackets
+/// ^ punctuation.section.brackets.begin
+/// ^ punctuation.section.brackets.end
+/// ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.method.body meta.method
+/// ^^^ entity.name.function
+/// ^^^^^^^ meta.method.parameters
+/// ^ punctuation.section.parameters.begin
+/// ^^^ storage.type
+/// ^ variable.parameter
+/// ^ punctuation.section.parameters.end
+/// ^^^^^^^^^^^^^^^ meta.method.body meta.method.body
+/// ^ punctuation.section.block.begin
+/// ^^^^^^ keyword.control
+/// ^ keyword.operator
+/// ^ punctuation.terminator
+/// ^ punctuation.section.block.end
+
+ T add(int y) {return x + y;};
+/// ^ support.type
+/// ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.method
+/// ^^^ entity.name.function
+/// ^^^^^^^ meta.method.parameters
+/// ^ punctuation.section.parameters.begin
+/// ^^^ storage.type
+/// ^ variable.parameter
+/// ^ punctuation.section.parameters.end
+/// ^^^^^^^^^^^^^^^ meta.method.body
+/// ^^^^^^ keyword.control
+/// ^ keyword.operator
+/// ^ punctuation.terminator
+/// ^ punctuation.section.block.end
+/// ^ punctuation.terminator
+
+ List