Added new filetypes Diff and Ferite.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@765 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2006-08-27 17:39:34 +00:00
parent a8a33cd9ef
commit 010d6581e5
11 changed files with 348 additions and 23 deletions

View File

@ -1,3 +1,11 @@
2006-08-27 Enrico Tröger <enrico.troeger@uvena.de>
* tagmanager/parsers.h, tagmanager/c.c, data/filetype_extensions.conf,
data/filetypes.diff, data/filetypes.ferite, src/highlighting.c,
src/filetypes.c, src/msgwindow.c:
Added new filetypes Diff and Ferite.
2006-08-26 Enrico Tröger <enrico.troeger@uvena.de>
* src/geany.h, src/main.c, src/utils.c:

View File

@ -9,6 +9,7 @@ Java=*.java;
Pascal=*.pas;*.pp;*.inc;*.dpr;*.dpk;
ASM=*.asm;
Fortran=*.f;*.f77;*.f90;*.f95;*.for;*.ftn;
Ferite=*.fe;
CAML=*.ml;*.mli;
Perl=*.pl;*.perl;*.pm;
PHP=*.php;*.php3;*.php4;*.php5;*.html;*.htm;
@ -24,4 +25,5 @@ SQL=*.sql;
LaTeX=*.tex;*.sty;*.idx;
O-Matrix=*.oms;
Conf=*.conf;*.ini;config;*rc;*.cfg;
Diff=*.diff;*.patch;
None=*;

20
data/filetypes.diff Normal file
View File

@ -0,0 +1,20 @@
# For complete documentation of this file, please see Geany's main documentation
[styling]
# foreground;background;bold;italic
default=0x000000;0xffffff;false;false
comment=0x808080;0xffffff;false;false
command=0x7f7f00;0xffffff;false;false
header=0x7f0000;0xffffff;false;false
position=0x00007f;0xffffff;false;false
deleted=0xff2727;0xffffff;false;false
added=0x34b034;0xffffff;false;false
[settings]
# the following characters are these which a "word" can contains, see documentation
wordchars=_#&abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
# only the text before the first --- is a comment
comment_open=
comment_close=

54
data/filetypes.ferite Normal file
View File

@ -0,0 +1,54 @@
# For complete documentation of this file, please see Geany's main documentation
[styling]
# foreground;background;bold;italic
default=0x000000;0xffffff;false;false
comment=0xff0000;0xffffff;false;false
commentline=0xff0000;0xffffff;false;false
commentdoc=0xff0000;0xffffff;false;false
number=0x007f00;0xffffff;false;false
word=0x00007f;0xffffff;true;false
word2=0x991111;0xffffff;true;false
string=0xff901e;0xffffff;false;false
character=0xff901e;0xffffff;false;false
uuid=0x404080;0xffffff;false;false
preprocessor=0x007F7F;0xffffff;false;false
operator=0x301010;0xffffff;false;false
identifier=0x000000;0xffffff;false;false
stringeol=0x000000;0xe0c0e0;false;false
verbatim=0x101030;0xffffff;false;false
regex=0x105090;0xffffff;false;false
commentlinedoc=0xff0000;0xffffff;true;false
commentdockeyword=0xff0000;0xffffff;true;true
globalclass=0x1111bb;0xffffff;true;false
[keywords]
# all items must be in one line
primary=false null self super true abstract alias arguments attribute_missing break case class closure conformsToProtocol constructor default deliver destructor diliver do else extends final fix for function if iferr implements include instanceof method_missing modifies namespace new private protected protocol public recipient rename return static switch uses using while
types=string number array object void
docComment=@brief @class @declaration @description @end @example @extends @function @group @implements @modifies @module @namespace @param @protocol @return @return @static @type @variable @warning
[settings]
# the following characters are these which a "word" can contains, see documentation
wordchars=_#&abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
# if only single comment char is supported like # in this file, leave comment_close blank
comment_open=//
comment_close=
# this is an alternative way, so multiline comments are used
#comment_open=/*
#comment_close=*/
# set to false if a comment character/string should start at column 0 of a line, true uses any
# indention of the line, e.g. setting to true causes the following on pressing CTRL+d
#command_example();
# setting to false would generate this
# command_example();
# This setting works only for single line comments
comment_use_indent=true
[build_settings]
# %f will be replaced by the complete filename
# %e will be replaced by the filename without extension
# (use only one of it at one time)
compiler=ferite -c "%f"
run_cmd=ferite "%f"

View File

@ -58,8 +58,10 @@ enum
FILETYPE_UID_TCL, // 19
FILETYPE_UID_ALL, // 20
FILETYPE_UID_D, // 21
FILETYPE_UID_FORTRAN // 22
//FILETYPE_UID_HTML, // 23
FILETYPE_UID_FORTRAN, // 22
FILETYPE_UID_DIFF, // 23
FILETYPE_UID_FERITE // 24
//FILETYPE_UID_HTML, // 25
};
@ -98,6 +100,8 @@ filetype *filetypes_get_from_uid(gint uid)
case FILETYPE_UID_ALL: return filetypes[GEANY_FILETYPES_ALL];
case FILETYPE_UID_D: return filetypes[GEANY_FILETYPES_D];
case FILETYPE_UID_FORTRAN: return filetypes[GEANY_FILETYPES_FORTRAN];
case FILETYPE_UID_DIFF: return filetypes[GEANY_FILETYPES_DIFF];
case FILETYPE_UID_FERITE: return filetypes[GEANY_FILETYPES_FERITE];
//case FILETYPE_UID_HTML: return filetypes[GEANY_FILETYPES_HTML];
default: return NULL;
}
@ -397,6 +401,25 @@ void filetypes_init_types(void)
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_TCL]);
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_TCL]->title, filetypes[GEANY_FILETYPES_TCL]);
#define FERITE
filetypes[GEANY_FILETYPES_FERITE] = g_new0(filetype, 1);
filetypes[GEANY_FILETYPES_FERITE]->id = GEANY_FILETYPES_FERITE;
filetypes[GEANY_FILETYPES_FERITE]->uid = FILETYPE_UID_FERITE;
filetypes[GEANY_FILETYPES_FERITE]->item = NULL;
filetypes[GEANY_FILETYPES_FERITE]->lang = 19;
filetypes[GEANY_FILETYPES_FERITE]->name = g_strdup("Ferite");
filetypes[GEANY_FILETYPES_FERITE]->has_tags = TRUE;
filetypes[GEANY_FILETYPES_FERITE]->title = g_strdup(_("Ferite source file"));
filetypes[GEANY_FILETYPES_FERITE]->extension = g_strdup("fe");
filetypes[GEANY_FILETYPES_FERITE]->pattern = g_new0(gchar*, 2);
filetypes[GEANY_FILETYPES_FERITE]->pattern[0] = g_strdup("*.fe");
filetypes[GEANY_FILETYPES_FERITE]->pattern[1] = NULL;
filetypes[GEANY_FILETYPES_FERITE]->style_func_ptr = styleset_ferite;
filetypes[GEANY_FILETYPES_FERITE]->comment_open = g_strdup("/*");
filetypes[GEANY_FILETYPES_FERITE]->comment_close = g_strdup("*/");
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_FERITE]);
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_FERITE]->title, filetypes[GEANY_FILETYPES_FERITE]);
#define SH
filetypes[GEANY_FILETYPES_SH] = g_new0(filetype, 1);
filetypes[GEANY_FILETYPES_SH]->id = GEANY_FILETYPES_SH;
@ -559,6 +582,26 @@ void filetypes_init_types(void)
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_OMS]);
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_OMS]->title, filetypes[GEANY_FILETYPES_OMS]);
#define DIFF
filetypes[GEANY_FILETYPES_DIFF] = g_new0(filetype, 1);
filetypes[GEANY_FILETYPES_DIFF]->id = GEANY_FILETYPES_DIFF;
filetypes[GEANY_FILETYPES_DIFF]->uid = FILETYPE_UID_DIFF;
filetypes[GEANY_FILETYPES_DIFF]->item = NULL;
filetypes[GEANY_FILETYPES_DIFF]->lang = -2;
filetypes[GEANY_FILETYPES_DIFF]->name = g_strdup("Diff");
filetypes[GEANY_FILETYPES_DIFF]->has_tags = FALSE;
filetypes[GEANY_FILETYPES_DIFF]->title = g_strdup(_("Diff file"));
filetypes[GEANY_FILETYPES_DIFF]->extension = g_strdup("diff");
filetypes[GEANY_FILETYPES_DIFF]->pattern = g_new0(gchar*, 3);
filetypes[GEANY_FILETYPES_DIFF]->pattern[0] = g_strdup("*.diff");
filetypes[GEANY_FILETYPES_DIFF]->pattern[1] = g_strdup("*.patch");
filetypes[GEANY_FILETYPES_DIFF]->pattern[2] = NULL;
filetypes[GEANY_FILETYPES_DIFF]->style_func_ptr = styleset_diff;
filetypes[GEANY_FILETYPES_DIFF]->comment_open = g_strdup("#");
filetypes[GEANY_FILETYPES_DIFF]->comment_close = NULL;
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_DIFF]);
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_DIFF]->title, filetypes[GEANY_FILETYPES_DIFF]);
#define CONF
filetypes[GEANY_FILETYPES_CONF] = g_new0(filetype, 1);
filetypes[GEANY_FILETYPES_CONF]->id = GEANY_FILETYPES_CONF;

View File

@ -47,6 +47,7 @@ enum
GEANY_FILETYPES_PYTHON,
GEANY_FILETYPES_RUBY,
GEANY_FILETYPES_TCL,
GEANY_FILETYPES_FERITE,
GEANY_FILETYPES_SH,
GEANY_FILETYPES_MAKE,
GEANY_FILETYPES_XML,
@ -58,6 +59,7 @@ enum
GEANY_FILETYPES_SQL,
GEANY_FILETYPES_LATEX,
GEANY_FILETYPES_OMS,
GEANY_FILETYPES_DIFF,
GEANY_FILETYPES_CONF,
GEANY_FILETYPES_ALL,
GEANY_MAX_FILE_TYPES

View File

@ -738,6 +738,58 @@ void styleset_makefile(ScintillaObject *sci)
}
static void styleset_diff_init(void)
{
GKeyFile *config = g_key_file_new();
GKeyFile *config_home = g_key_file_new();
gchar *f0 = g_strconcat(app->datadir, G_DIR_SEPARATOR_S "filetypes.diff", NULL);
gchar *f = g_strconcat(app->configdir, G_DIR_SEPARATOR_S GEANY_FILEDEFS_SUBDIR G_DIR_SEPARATOR_S "filetypes.diff", NULL);
styleset_load_file(config, f0, G_KEY_FILE_KEEP_COMMENTS, NULL);
g_key_file_load_from_file(config_home, f, G_KEY_FILE_KEEP_COMMENTS, NULL);
types[GEANY_FILETYPES_DIFF] = g_new(style_set, 1);
styleset_get_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", types[GEANY_FILETYPES_DIFF]->styling[0]);
styleset_get_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", types[GEANY_FILETYPES_DIFF]->styling[1]);
styleset_get_hex(config, config_home, "styling", "command", "0x7f7f00", "0xffffff", "false", types[GEANY_FILETYPES_DIFF]->styling[2]);
styleset_get_hex(config, config_home, "styling", "header", "0x7f0000", "0xffffff", "false", types[GEANY_FILETYPES_DIFF]->styling[3]);
styleset_get_hex(config, config_home, "styling", "position", "0x00007f", "0xffffff", "false", types[GEANY_FILETYPES_DIFF]->styling[4]);
styleset_get_hex(config, config_home, "styling", "deleted", "0xff2727", "0xffffff", "false", types[GEANY_FILETYPES_DIFF]->styling[5]);
styleset_get_hex(config, config_home, "styling", "added", "0x34b034", "0xffffff", "false", types[GEANY_FILETYPES_DIFF]->styling[6]);
types[GEANY_FILETYPES_DIFF]->keywords = NULL;
styleset_get_wordchars(config, config_home, GEANY_FILETYPES_DIFF, GEANY_WORDCHARS);
filetypes_get_config(config, config_home, GEANY_FILETYPES_DIFF);
g_key_file_free(config);
g_key_file_free(config_home);
g_free(f0);
g_free(f);
}
void styleset_diff(ScintillaObject *sci)
{
if (types[GEANY_FILETYPES_DIFF] == NULL) styleset_diff_init();
styleset_common(sci, 5);
SSM (sci, SCI_SETLEXER, SCLEX_DIFF, 0);
SSM(sci, SCI_SETWORDCHARS, 0, (sptr_t) types[GEANY_FILETYPES_DIFF]->wordchars);
styleset_set_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_DIFF, 0);
styleset_set_style(sci, SCE_DIFF_DEFAULT, GEANY_FILETYPES_DIFF, 0);
styleset_set_style(sci, SCE_DIFF_COMMENT, GEANY_FILETYPES_DIFF, 1);
styleset_set_style(sci, SCE_DIFF_COMMAND, GEANY_FILETYPES_DIFF, 2);
styleset_set_style(sci, SCE_DIFF_HEADER, GEANY_FILETYPES_DIFF, 3);
styleset_set_style(sci, SCE_DIFF_POSITION, GEANY_FILETYPES_DIFF, 4);
styleset_set_style(sci, SCE_DIFF_DELETED, GEANY_FILETYPES_DIFF, 5);
styleset_set_style(sci, SCE_DIFF_ADDED, GEANY_FILETYPES_DIFF, 6);
}
static void styleset_latex_init(void)
{
GKeyFile *config = g_key_file_new();
@ -788,7 +840,7 @@ void styleset_latex(ScintillaObject *sci)
SSM (sci, SCI_SETLEXER, SCLEX_LATEX, 0);
SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) types[GEANY_FILETYPES_LATEX]->keywords[0]);
SSM (sci, SCI_SETWORDCHARS, 0, (sptr_t) types[GEANY_FILETYPES_LATEX]->wordchars);
SSM(sci, SCI_SETWORDCHARS, 0, (sptr_t) types[GEANY_FILETYPES_LATEX]->wordchars);
styleset_set_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_LATEX, 0);
styleset_set_style(sci, SCE_L_DEFAULT, GEANY_FILETYPES_LATEX, 0);
@ -846,8 +898,8 @@ void styleset_php(ScintillaObject *sci)
styleset_common(sci, 7);
SSM (sci, SCI_SETPROPERTY, (sptr_t) "phpscript.mode", (sptr_t) "1");
SSM (sci, SCI_SETLEXER, SCLEX_HTML, 0);
SSM(sci, SCI_SETPROPERTY, (sptr_t) "phpscript.mode", (sptr_t) "1");
SSM(sci, SCI_SETLEXER, SCLEX_HTML, 0);
SSM(sci, SCI_AUTOCSETMAXHEIGHT, app->autocompletion_max_height, 0);
@ -2529,3 +2581,97 @@ void styleset_d(ScintillaObject *sci)
styleset_set_style(sci, SCE_C_GLOBALCLASS, GEANY_FILETYPES_D, 18);
}
static void styleset_ferite_init(void)
{
GKeyFile *config = g_key_file_new();
GKeyFile *config_home = g_key_file_new();
gchar *f0 = g_strconcat(app->datadir, G_DIR_SEPARATOR_S "filetypes.ferite", NULL);
gchar *f = g_strconcat(app->configdir, G_DIR_SEPARATOR_S GEANY_FILEDEFS_SUBDIR G_DIR_SEPARATOR_S "filetypes.ferite", NULL);
styleset_load_file(config, f0, G_KEY_FILE_KEEP_COMMENTS, NULL);
g_key_file_load_from_file(config_home, f, G_KEY_FILE_KEEP_COMMENTS, NULL);
types[GEANY_FILETYPES_FERITE] = g_new(style_set, 1);
styleset_get_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[0]);
styleset_get_hex(config, config_home, "styling", "comment", "0xff0000", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[1]);
styleset_get_hex(config, config_home, "styling", "commentline", "0xff0000", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[2]);
styleset_get_hex(config, config_home, "styling", "commentdoc", "0xff0000", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[3]);
styleset_get_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[4]);
styleset_get_hex(config, config_home, "styling", "word", "0x00007f", "0xffffff", "true", types[GEANY_FILETYPES_FERITE]->styling[5]);
styleset_get_hex(config, config_home, "styling", "word2", "0x991111", "0xffffff", "true", types[GEANY_FILETYPES_FERITE]->styling[6]);
styleset_get_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[7]);
styleset_get_hex(config, config_home, "styling", "character", "0xff901e", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[8]);
styleset_get_hex(config, config_home, "styling", "uuid", "0x404080", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[9]);
styleset_get_hex(config, config_home, "styling", "preprocessor", "0x007f7f", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[10]);
styleset_get_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[11]);
styleset_get_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[12]);
styleset_get_hex(config, config_home, "styling", "stringeol", "0x000000", "0xe0c0e0", "false", types[GEANY_FILETYPES_FERITE]->styling[13]);
styleset_get_hex(config, config_home, "styling", "verbatim", "0x101030", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[14]);
styleset_get_hex(config, config_home, "styling", "regex", "0x105090", "0xffffff", "false", types[GEANY_FILETYPES_FERITE]->styling[15]);
styleset_get_hex(config, config_home, "styling", "commentlinedoc", "0xff0000", "0xffffff", "true", types[GEANY_FILETYPES_FERITE]->styling[16]);
styleset_get_hex(config, config_home, "styling", "commentdockeyword", "0xff0000", "0xffffff", "true", types[GEANY_FILETYPES_FERITE]->styling[17]);
styleset_get_hex(config, config_home, "styling", "globalclass", "0x1111bb", "0xffffff", "true", types[GEANY_FILETYPES_FERITE]->styling[18]);
styleset_get_int(config, config_home, "styling", "styling_within_preprocessor", 1, 0, types[GEANY_FILETYPES_FERITE]->styling[19]);
types[GEANY_FILETYPES_FERITE]->keywords = g_new(gchar*, 4);
styleset_get_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_FERITE, 0, "false null self super true abstract alias arguments attribute_missing break case class closure conformsToProtocol constructor default deliver destructor diliver do else extends final fix for function if iferr implements include instanceof method_missing modifies namespace new private protected protocol public recipient rename return static switch uses using while");
styleset_get_keywords(config, config_home, "keywords", "types", GEANY_FILETYPES_FERITE, 1, "number string array object void");
styleset_get_keywords(config, config_home, "keywords", "docComment", GEANY_FILETYPES_FERITE, 2, "@brief @class @declaration @description @end @example @extends @function @group @implements @modifies @module @namespace @param @protocol @return @return @static @type @variable @warning");
types[GEANY_FILETYPES_FERITE]->keywords[3] = NULL;
styleset_get_wordchars(config, config_home, GEANY_FILETYPES_FERITE, GEANY_WORDCHARS);
filetypes_get_config(config, config_home, GEANY_FILETYPES_FERITE);
g_key_file_free(config);
g_key_file_free(config_home);
g_free(f0);
g_free(f);
}
void styleset_ferite(ScintillaObject *sci)
{
if (types[GEANY_FILETYPES_FERITE] == NULL) styleset_ferite_init();
styleset_common(sci, 5);
SSM(sci, SCI_SETWORDCHARS, 0, (sptr_t) types[GEANY_FILETYPES_FERITE]->wordchars);
SSM(sci, SCI_AUTOCSETMAXHEIGHT, app->autocompletion_max_height, 0);
SSM(sci, SCI_SETLEXER, SCLEX_CPP, 0);
//SSM(sci, SCI_SETCONTROLCHARSYMBOL, 32, 0);
SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) types[GEANY_FILETYPES_FERITE]->keywords[0]);
SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) types[GEANY_FILETYPES_FERITE]->keywords[1]);
SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) types[GEANY_FILETYPES_FERITE]->keywords[2]);
styleset_set_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_FERITE, 0);
styleset_set_style(sci, SCE_C_DEFAULT, GEANY_FILETYPES_FERITE, 0);
styleset_set_style(sci, SCE_C_COMMENT, GEANY_FILETYPES_FERITE, 1);
styleset_set_style(sci, SCE_C_COMMENTLINE, GEANY_FILETYPES_FERITE, 2);
styleset_set_style(sci, SCE_C_COMMENTDOC, GEANY_FILETYPES_FERITE, 3);
styleset_set_style(sci, SCE_C_NUMBER, GEANY_FILETYPES_FERITE, 4);
styleset_set_style(sci, SCE_C_WORD, GEANY_FILETYPES_FERITE, 5);
styleset_set_style(sci, SCE_C_WORD2, GEANY_FILETYPES_FERITE, 6);
styleset_set_style(sci, SCE_C_STRING, GEANY_FILETYPES_FERITE, 7);
styleset_set_style(sci, SCE_C_CHARACTER, GEANY_FILETYPES_FERITE, 8);
styleset_set_style(sci, SCE_C_UUID, GEANY_FILETYPES_FERITE, 9);
styleset_set_style(sci, SCE_C_PREPROCESSOR, GEANY_FILETYPES_FERITE, 10);
styleset_set_style(sci, SCE_C_OPERATOR, GEANY_FILETYPES_FERITE, 11);
styleset_set_style(sci, SCE_C_IDENTIFIER, GEANY_FILETYPES_FERITE, 12);
styleset_set_style(sci, SCE_C_STRINGEOL, GEANY_FILETYPES_FERITE, 13);
styleset_set_style(sci, SCE_C_VERBATIM, GEANY_FILETYPES_FERITE, 14);
styleset_set_style(sci, SCE_C_REGEX, GEANY_FILETYPES_FERITE, 15);
styleset_set_style(sci, SCE_C_COMMENTLINEDOC, GEANY_FILETYPES_FERITE, 16);
styleset_set_style(sci, SCE_C_COMMENTDOCKEYWORD, GEANY_FILETYPES_FERITE, 17);
SSM(sci, SCI_STYLESETFORE, SCE_C_COMMENTDOCKEYWORDERROR, invert(0x0000ff));
SSM(sci, SCI_STYLESETBACK, SCE_C_COMMENTDOCKEYWORDERROR, invert(0xffffff));
SSM(sci, SCI_STYLESETITALIC, SCE_C_COMMENTDOCKEYWORDERROR, TRUE);
// is used for local structs and typedefs
styleset_set_style(sci, SCE_C_GLOBALCLASS, GEANY_FILETYPES_FERITE, 18);
}

View File

@ -92,4 +92,8 @@ void styleset_d(ScintillaObject *sci);
void styleset_fortran(ScintillaObject *sci);
void styleset_diff(ScintillaObject *sci);
void styleset_ferite(ScintillaObject *sci);
#endif

View File

@ -415,6 +415,16 @@ void msgwin_parse_compiler_error_line(const gchar *string, gchar **filename, gin
field_idx_file = 2;
break;
}
case GEANY_FILETYPES_FERITE:
{
// Error: Parse Error: on line 5 in "/misc/tmp/testfiles_geany/hello.fe"
pattern = " \"";
field_min_len = 10;
field_idx_line = 5;
field_idx_file = 8;
break;
}
default: return;
}
@ -441,8 +451,11 @@ void msgwin_parse_compiler_error_line(const gchar *string, gchar **filename, gin
if (strncmp(fields[field_idx_file], "./", 2) == 0) skip_dot_slash = 2;
// get the build directory to get the path to look for other files
*filename = g_strconcat(build_info.dir, G_DIR_SEPARATOR_S,
fields[field_idx_file] + skip_dot_slash, NULL);
if (! utils_is_absolute_path(fields[field_idx_file]))
*filename = g_strconcat(build_info.dir, G_DIR_SEPARATOR_S,
fields[field_idx_file] + skip_dot_slash, NULL);
else
*filename = g_strdup(fields[field_idx_file]);
g_strfreev(fields);
}

View File

@ -76,7 +76,7 @@ typedef enum eKeywordId {
KEYWORD_SYNCHRONIZED,
KEYWORD_TEMPLATE, KEYWORD_THROW, KEYWORD_THROWS, KEYWORD_TRANSIENT,
KEYWORD_TRY, KEYWORD_TYPEDEF, KEYWORD_TYPENAME,
KEYWORD_UNION, KEYWORD_UNSIGNED, KEYWORD_USING,
KEYWORD_UNION, KEYWORD_UNSIGNED, KEYWORD_USES, KEYWORD_USING,
KEYWORD_VIRTUAL, KEYWORD_VOID, KEYWORD_VOLATILE,
KEYWORD_WCHAR_T
} keywordId;
@ -234,6 +234,7 @@ static langType Lang_c;
static langType Lang_cpp;
static langType Lang_java;
static langType Lang_d;
static langType Lang_ferite;
/* Used to index into the CKinds table. */
typedef enum {
@ -326,6 +327,7 @@ static const keywordDesc KeywordTable [] = {
{ "typename", KEYWORD_TYPENAME, { 0, 1, 0 } },
{ "union", KEYWORD_UNION, { 1, 1, 0 } },
{ "unsigned", KEYWORD_UNSIGNED, { 1, 1, 0 } },
{ "uses", KEYWORD_USES, { 0, 1, 0 } },
{ "using", KEYWORD_USING, { 0, 1, 0 } },
{ "virtual", KEYWORD_VIRTUAL, { 0, 1, 0 } },
{ "void", KEYWORD_VOID, { 1, 1, 1 } },
@ -709,7 +711,7 @@ static void reinitStatement (statementInfo *const st, const boolean partial)
*/
if (! partial)
st->member.access = st->member.accessDefault;
/* Init first token */
if (!partial)
initToken(st->firstToken);
@ -820,7 +822,9 @@ static tagType declToTagType (const declType declaration)
static const char* accessField (const statementInfo *const st)
{
const char* result = NULL;
if ((isLanguage (Lang_cpp) || isLanguage (Lang_d)) && st->scope == SCOPE_FRIEND)
if ((isLanguage (Lang_cpp) || isLanguage (Lang_d) || isLanguage (Lang_ferite)) &&
st->scope == SCOPE_FRIEND)
result = "friend";
else if (st->member.access != ACCESS_UNDEFINED)
result = accessString (st->member.access);
@ -867,7 +871,8 @@ static void addOtherFields (tagEntryInfo* const tag, const tagType type,
vStringValue (st->parentClasses);
}
if (st->implementation != IMP_DEFAULT &&
(isLanguage (Lang_cpp) || isLanguage (Lang_java) || isLanguage (Lang_d)))
(isLanguage (Lang_cpp) || isLanguage (Lang_java) ||
isLanguage (Lang_d) || isLanguage (Lang_ferite)))
{
tag->extensionFields.implementation =
implementationString (st->implementation);
@ -878,7 +883,7 @@ static void addOtherFields (tagEntryInfo* const tag, const tagType type,
}
if ((TRUE == st->gotArgs) && (TRUE == Option.extensionFields.argList) &&
((TAG_FUNCTION == type) || (TAG_METHOD == type) || (TAG_PROTOTYPE == type))) {
if (1) {
tag->extensionFields.arglist = getArglistFromPos(
tag->filePosition, tag->name);
@ -886,7 +891,7 @@ static void addOtherFields (tagEntryInfo* const tag, const tagType type,
}
break;
}
if ((TAG_FIELD == tag->type) || (TAG_MEMBER == tag->type) ||
(TAG_EXTERN_VAR == tag->type) || (TAG_TYPEDEF == tag->type) ||
(TAG_VARIABLE == tag->type) || (TAG_METHOD == tag->type) ||
@ -901,7 +906,8 @@ static void addOtherFields (tagEntryInfo* const tag, const tagType type,
static void addContextSeparator (vString *const scope)
{
if (isLanguage (Lang_c) || isLanguage (Lang_cpp) || isLanguage (Lang_d))
if (isLanguage (Lang_c) || isLanguage (Lang_cpp) ||
isLanguage (Lang_d) || isLanguage (Lang_ferite))
vStringCatS (scope, "::");
else if (isLanguage (Lang_java))
vStringCatS (scope, ".");
@ -1004,9 +1010,17 @@ static void makeTag (const tokenInfo *const token,
if (isType (token, TOKEN_NAME) && vStringLength (token->name) > 0 /* &&
includeTag (type, isFileScope) */)
{
vString *scope = vStringNew ();
vString *scope;
tagEntryInfo e;
// take only functions which are introduced by "function ..."
if (type == TAG_FUNCTION && isLanguage (Lang_ferite) &&
strncmp("function", st->firstToken->name->buffer, 8) != 0)
{
return;
}
scope = vStringNew ();
initTagEntry (&e, vStringValue (token->name));
e.lineNumber = token->lineNumber;
@ -1427,7 +1441,7 @@ static void setAccess (statementInfo *const st, const accessType access)
{
if (isMember (st))
{
if (isLanguage (Lang_cpp) || isLanguage (Lang_d))
if (isLanguage (Lang_cpp) || isLanguage (Lang_d) || isLanguage (Lang_ferite))
{
int c = skipToNonWhite ();
@ -1982,7 +1996,8 @@ static void addContext (statementInfo *const st, const tokenInfo* const token)
{
if (vStringLength (st->context->name) > 0)
{
if (isLanguage (Lang_c) || isLanguage (Lang_cpp) || isLanguage (Lang_d))
if (isLanguage (Lang_c) || isLanguage (Lang_cpp) ||
isLanguage (Lang_d) || isLanguage (Lang_ferite))
vStringCatS (st->context->name, "::");
else if (isLanguage (Lang_java))
vStringCatS (st->context->name, ".");
@ -2005,7 +2020,7 @@ static void processColon (statementInfo *const st)
else
{
cppUngetc (c);
if ((isLanguage (Lang_cpp) || isLanguage (Lang_d)) && (
if ((isLanguage (Lang_cpp) || isLanguage (Lang_d) || isLanguage (Lang_ferite)) && (
st->declaration == DECL_CLASS || st->declaration == DECL_STRUCT))
{
readParents (st, ':');
@ -2132,7 +2147,7 @@ static void nextToken (statementInfo *const st)
default: parseGeneralToken (st, c); break;
}
} while (isType (token, TOKEN_NONE));
/* We want to know about non-keyword variable types */
if (TOKEN_NONE == st->firstToken->type)
{
@ -2407,7 +2422,13 @@ static void initializeJavaParser (const langType language)
static void initializeDParser (const langType language)
{
Lang_d = language;
buildKeywordHash (language, 17);
buildKeywordHash (language, 1);
}
static void initializeFeriteParser (const langType language)
{
Lang_ferite = language;
buildKeywordHash (language, 1);
}
extern parserDefinition* CParser (void)
@ -2425,8 +2446,7 @@ extern parserDefinition* CParser (void)
extern parserDefinition* CppParser (void)
{
static const char *const extensions [] = {
"c++", "cc", "cp", "cpp", "cxx", "h", "h++", "hh", "hp", "hpp", "hxx",
"i",
"c++", "cc", "cp", "cpp", "cxx", "h", "h++", "hh", "hp", "hpp", "hxx", "i",
#ifndef CASE_INSENSITIVE_FILENAMES
"C", "H",
#endif
@ -2465,5 +2485,16 @@ extern parserDefinition* DParser (void)
return def;
}
extern parserDefinition* FeriteParser (void)
{
static const char *const extensions [] = { "fe", NULL };
parserDefinition* def = parserNew ("Ferite");
def->kinds = CKinds;
def->kindCount = KIND_COUNT (CKinds);
def->extensions = extensions;
def->parser2 = findCTags;
def->initialize = initializeFeriteParser;
return def;
}
/* vi:set tabstop=8 shiftwidth=4: */

View File

@ -33,7 +33,8 @@
TclParser, \
ShParser, \
DParser, \
FortranParser
FortranParser, \
FeriteParser
/*
langType of each parser
@ -56,6 +57,7 @@ langType of each parser
16 ShParser
17 DParser
18 FortranParser
19 FeriteParser
*/
#endif /* _PARSERS_H */