From a0fcc7d09ff1076637f520799f64a5485459780f Mon Sep 17 00:00:00 2001 From: David Sowsy Date: Wed, 28 Sep 2011 11:12:27 -0400 Subject: [PATCH] Adding initial support for CoffeeScript file syntax highlighting. I started off with the .js code and removed a lot of the JS basic function definitions, took away the function keyword. Added single and multiline commenting. Added keywords class and extends. --- Other/SyntaxDefinitions.plist | 32 ++++++---- Syntax Definitions/coffeescript.plist | 84 +++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 12 deletions(-) mode change 100644 => 100755 Other/SyntaxDefinitions.plist create mode 100644 Syntax Definitions/coffeescript.plist diff --git a/Other/SyntaxDefinitions.plist b/Other/SyntaxDefinitions.plist old mode 100644 new mode 100755 index 98655fd..7727bc5 --- a/Other/SyntaxDefinitions.plist +++ b/Other/SyntaxDefinitions.plist @@ -1,5 +1,5 @@ - + @@ -43,7 +43,7 @@ run mod dat - name + name Apache file apache @@ -154,6 +154,14 @@ extensions cobol + + name + CoffeeScript + file + coffeescript + extensions + coffee + name ColdFusion @@ -203,13 +211,13 @@ e - name - Erlang - file - erl - extensions - erl hrl - + name + Erlang + file + erl + extensions + erl hrl + name eZ Publish @@ -241,7 +249,7 @@ gedcom extensions ged - + name GNU Assembler @@ -530,7 +538,7 @@ extensions rb - + name Scala file @@ -643,4 +651,4 @@ xml dtd xsd xsl - \ No newline at end of file + diff --git a/Syntax Definitions/coffeescript.plist b/Syntax Definitions/coffeescript.plist new file mode 100644 index 0000000..282dd59 --- /dev/null +++ b/Syntax Definitions/coffeescript.plist @@ -0,0 +1,84 @@ + + + + + functionDefinition + ^\s*function\s+.*\n?\s*\{ + beginVariable + + endInstruction + + firstString + " + firstSingleLineComment + # + keywordsCaseSensitive + + secondSingleLineComment + + secondString + ' + endCommand + + beginCommand + + keywords + + if + else + for + in + while + do + continue + break + with + try + catch + switch + case + new + var + return + delete + true + false + void + throw + typeof + const + default + escape + Number + window + this + call + caller + class + => + @ + -> + extends + + endSecondMultiLineComment + + endVariable + + removeFromFunction + function + beginSecondMultiLineComment + + beginFirstMultiLineComment + ### + beginInstruction + + endFirstMultiLineComment + ### + recolourKeywordIfAlreadyColoured + + autocompleteWords + + class + class + +