Kaydet (Commit) 07002d25 authored tarafından Mark Dresselhaus's avatar Mark Dresselhaus Kaydeden (comit) Colomban Wendling

Add coffescript syntax highlighting

imported lexer from Scintilla and added coffeescript filetype
üst d0986dd3
......@@ -15,6 +15,7 @@ filetypes = \
filetypes.Clojure.conf \
filetypes.cmake \
filetypes.cobol \
filetypes.coffeescript \
filetypes.common \
filetypes.conf \
filetypes.cpp \
......
......@@ -16,6 +16,7 @@ CUDA=*.cu;*.cuh;*.h;
C#=*.cs;
CMake=CMakeLists.txt;*.cmake;*.ctest;
COBOL=*.cob;*.cpy;*.cbl;*.cobol;
CoffeeScript=*.coffee;Cakefile;*.Cakefile;*.coffee.erb;*.iced;*.iced.erb
Conf=*.conf;*.ini;config;*rc;*.cfg;*.desktop;*.properties;
CSS=*.css;
Cython=*.pyx;*.pxd;*.pxi;
......
# For complete documentation of this file, please see Geany's main documentation
[styling]
character=character
commentblock=comment
commentline=comment_line
default=default
globalclass=class
identifier=identifier_1
number=number_1
operator=operator
regex=regex
string=string_1
stringeol=string_eol
verbose_regex=regex
verbose_regex_comment=comment
word2=keyword_2
word=keyword_1
[settings]
extension=coffee
comment_single=#
comment_open=###
comment_close=###
comment_use_indent=true
context_action_cmd=
[keywords]
# all items must be in one line
primary=and break by case catch class const continue default delete do each else extends false finally for get if in Infinity instanceof is isnt let loop NaN new no not null of off on or return set switch then this throw true try typeof undefined unless until void when where while with yes yield
secondary=constructor decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt prototype require super
# types, classes
globalclass=Array Boolean Date Error EvalError Function Math Number Object RangeError ReferenceError RegExp String SyntaxError TypeError URIError
[indentation]
#width=4
# 0 is spaces, 1 is tabs, 2 is tab & spaces
#type=1
[build-menu]
FT_00_LB=Compile into _Javascript
FT_00_CM=coffee --compile "%f"
FT_01_LB=View compiled _Javascript
FT_01_CM=coffee -p "%f"
EX_00_LB=Run
EX_00_CM=coffee "%f"
......@@ -16,6 +16,7 @@ lexers/LexCPP.cxx \
lexers/LexCSS.cxx \
lexers/LexCaml.cxx \
lexers/LexCmake.cxx \
lexers/LexCoffeeScript.cxx \
lexers/LexD.cxx \
lexers/LexErlang.cxx \
lexers/LexForth.cxx \
......
This diff is collapsed.
......@@ -70,6 +70,7 @@ LexBash.o \
LexCOBOL.o \
LexCSS.o \
LexCPP.o \
LexCoffeeScript.o \
LexHTML.o \
LexOthers.o \
LexPascal.o \
......
......@@ -85,6 +85,7 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmCmake);
LINK_LEXER(lmCOBOL);
LINK_LEXER(lmCPP);
LINK_LEXER(lmCoffeeScript);
LINK_LEXER(lmCss);
LINK_LEXER(lmD);
LINK_LEXER(lmDiff);
......
......@@ -190,6 +190,7 @@ static void init_builtin_filetypes(void)
FT_INIT( BATCH, NONE, "Batch", NULL, SCRIPT, SCRIPT );
FT_INIT( POWERSHELL, NONE, "PowerShell", NULL, SOURCE_FILE, SCRIPT );
FT_INIT( RUST, RUST, "Rust", NULL, SOURCE_FILE, COMPILED );
FT_INIT( COFFEESCRIPT, NONE, "CoffeeScript", NULL, SOURCE_FILE, SCRIPT );
}
......
......@@ -100,6 +100,7 @@ typedef enum
GEANY_FILETYPES_BATCH,
GEANY_FILETYPES_POWERSHELL,
GEANY_FILETYPES_RUST,
GEANY_FILETYPES_COFFEESCRIPT,
/* ^ append items here */
GEANY_MAX_BUILT_IN_FILETYPES /* Don't use this, use filetypes_array->len instead */
}
......
......@@ -1001,6 +1001,7 @@ void highlighting_init_styles(guint filetype_idx, GKeyFile *config, GKeyFile *co
init_styleset_case(CAML);
init_styleset_case(CMAKE);
init_styleset_case(COBOL);
init_styleset_case(COFFEESCRIPT);
init_styleset_case(CONF);
init_styleset_case(CSS);
init_styleset_case(D);
......@@ -1084,6 +1085,7 @@ void highlighting_set_styles(ScintillaObject *sci, GeanyFiletype *ft)
styleset_case(CAML);
styleset_case(CMAKE);
styleset_case(COBOL);
styleset_case(COFFEESCRIPT);
styleset_case(CONF);
styleset_case(CSS);
styleset_case(D);
......
......@@ -333,6 +333,34 @@ static const HLKeyword highlighting_keywords_CMAKE[] =
};
#define highlighting_properties_CMAKE EMPTY_PROPERTIES
/* CoffeeScript */
#define highlighting_lexer_COFFEESCRIPT SCLEX_COFFEESCRIPT
static const HLStyle highlighting_styles_COFFEESCRIPT[] =
{
{ SCE_COFFEESCRIPT_DEFAULT, "default", FALSE },
{ SCE_COFFEESCRIPT_COMMENTLINE, "commentline", FALSE },
{ SCE_COFFEESCRIPT_NUMBER, "number", FALSE },
{ SCE_COFFEESCRIPT_WORD, "word", FALSE },
{ SCE_COFFEESCRIPT_STRING, "string", FALSE },
{ SCE_COFFEESCRIPT_CHARACTER, "character", FALSE },
{ SCE_COFFEESCRIPT_OPERATOR, "operator", FALSE },
{ SCE_COFFEESCRIPT_IDENTIFIER, "identifier", FALSE },
{ SCE_COFFEESCRIPT_STRINGEOL, "stringeol", FALSE },
{ SCE_COFFEESCRIPT_REGEX, "regex", FALSE },
{ SCE_COFFEESCRIPT_WORD2, "word2", FALSE },
{ SCE_COFFEESCRIPT_GLOBALCLASS, "globalclass", FALSE },
{ SCE_COFFEESCRIPT_COMMENTBLOCK, "commentblock", FALSE },
{ SCE_COFFEESCRIPT_VERBOSE_REGEX, "verbose_regex", FALSE },
{ SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT, "verbose_regex_comment",FALSE }
};
static const HLKeyword highlighting_keywords_COFFEESCRIPT[] =
{
{ 0, "primary", FALSE },
{ 1, "secondary", FALSE },
{ 3, "globalclass", FALSE }
};
#define highlighting_properties_COFFEESCRIPT EMPTY_PROPERTIES
/* CSS */
#define highlighting_lexer_CSS SCLEX_CSS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment