Hello list, I am attempting to add filetype and highlighting support for COBOL but I am running into an error:
../scintilla/libscintilla.a(KeyWords.o): In function `Scintilla_LinkLexers()': ../scintilla/KeyWords.cxx:177: undefined reference to `lmCOBOL' collect2: ld returned 1 exit status Copying most of the SQL lexer, because it is the closest in type to COBOL, I did a grep for "lmSQL" and got: scintilla/LexSQL.cxx:LexerModule lmSQL(SCLEX_SQL, ColouriseSQLDoc, "sql", FoldSQLDoc, sqlWordListDesc); scintilla/KeyWords.cxx: LINK_LEXER(lmSQL); Also, my grep of lmCOBOL: scintilla/LexCOBOL.cxx:LexerModule lmCOBOL(SCLEX_COBOL, ColouriseCOBOLDoc, "cobol", FoldCOBOLDoc, cobolWordListDesc); scintilla/KeyWords.cxx: LINK_LEXER(lmCOBOL); Provided in the attachment is the svn diff. Can someone maybe point me in the right direction with this code, please? I would like to see this in before 0.19 is released. Thank you for your time, Seth Keiper
Index: scintilla/makefile.win32 =================================================================== --- scintilla/makefile.win32 (revision 4171) +++ scintilla/makefile.win32 (working copy) @@ -60,7 +60,7 @@ #++Autogenerated -- run src/LexGen.py to regenerate #**LEXOBJS=\\\n\(\*.o \) LEXOBJS=\ -LexAda.o LexBash.o LexAsm.o LexCSS.o LexCPP.o LexCrontab.o LexHTML.o LexOthers.o LexPascal.o \ +LexAda.o LexBash.o LexAsm.o LexCSS.o LexCPP.o LexCOBOL.o LexCrontab.o LexHTML.o LexOthers.o LexPascal.o \ LexPerl.o LexPython.o LexSQL.o LexCaml.o LexTCL.o LexRuby.o LexFortran.o LexVHDL.o \ LexMarkdown.o LexMatlab.o \ LexD.o LexLua.o LexHaskell.o LexBasic.o LexR.o LexYAML.o LexCmake.o LexNsis.o Index: scintilla/include/SciLexer.h =================================================================== --- scintilla/include/SciLexer.h (revision 4171) +++ scintilla/include/SciLexer.h (working copy) @@ -945,6 +945,25 @@ #define SCE_CAML_COMMENT1 13 #define SCE_CAML_COMMENT2 14 #define SCE_CAML_COMMENT3 15 +#define SCE_COBOL_DEFAULT 0 +#define SCE_COBOL_COMMENT 1 +#define SCE_COBOL_COMMENTLINE 2 +#define SCE_COBOL_COMMENTDOC 3 +#define SCE_COBOL_NUMBER 4 +#define SCE_COBOL_WORD 5 +#define SCE_COBOL_STRING 6 +#define SCE_COBOL_CHARACTER 7 +#define SCE_COBOL_OPERATOR 10 +#define SCE_COBOL_IDENTIFIER 11 +#define SCE_COBOL_COMMENTLINEDOC 15 +#define SCE_COBOL_WORD2 16 +#define SCE_COBOL_COMMENTDOCKEYWORD 17 +#define SCE_COBOL_COMMENTDOCKEYWORDERROR 18 +#define SCE_COBOL_USER1 19 +#define SCE_COBOL_USER2 20 +#define SCE_COBOL_USER3 21 +#define SCE_COBOL_USER4 22 +#define SCE_COBOL_QUOTEDIDENTIFIER 23 #define SCE_HA_DEFAULT 0 #define SCE_HA_IDENTIFIER 1 #define SCE_HA_KEYWORD 2 Index: scintilla/include/Scintilla.iface =================================================================== --- scintilla/include/Scintilla.iface (revision 4171) +++ scintilla/include/Scintilla.iface (working copy) @@ -3097,6 +3097,27 @@ val SCE_CAML_COMMENT1=13 val SCE_CAML_COMMENT2=14 val SCE_CAML_COMMENT3=15 +# Lexical states for SCLEX_COBOL +lex COBOL=SCLEX_COBOL SCE_COBOL_ +val SCE_COBOL_DEFAULT=0 +val SCE_COBOL_COMMENT=1 +val SCE_COBOL_COMMENTLINE=2 +val SCE_COBOL_COMMENTDOC=3 +val SCE_COBOL_NUMBER=4 +val SCE_COBOL_WORD=5 +val SCE_COBOL_STRING=6 +val SCE_COBOL_CHARACTER=7 +val SCE_COBOL_OPERATOR=10 +val SCE_COBOL_IDENTIFIER=11 +val SCE_COBOL_COMMENTLINEDOC=15 +val SCE_COBOL_WORD2=16 +val SCE_COBOL_COMMENTDOCKEYWORD=17 +val SCE_COBOL_COMMENTDOCKEYWORDERROR=18 +val SCE_COBOL_USER1=19 +val SCE_COBOL_USER2=20 +val SCE_COBOL_USER3=21 +val SCE_COBOL_USER4=22 +val SCE_COBOL_QUOTEDIDENTIFIER=23 # Lexical states for SCLEX_HASKELL lex Haskell=SCLEX_HASKELL SCE_HA_ val SCE_HA_DEFAULT=0 Index: scintilla/LexCOBOL.cxx =================================================================== --- scintilla/LexCOBOL.cxx (revision 0) +++ scintilla/LexCOBOL.cxx (revision 0) @@ -0,0 +1,329 @@ +// Scintilla source code edit control +/** @file LexCOBOL.cxx + ** Lexer for COBOL. + **/ +// Copyright 1998-2005 by Neil Hodgson <[email protected]> +// The License.txt file describes the conditions under which this software may be distributed. + +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <stdio.h> +#include <stdarg.h> + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +#ifdef SCI_NAMESPACE +using namespace Scintilla; +#endif + +static inline bool IsAWordChar(int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_'); +} + +static inline bool IsAWordStart(int ch) { + return (ch < 0x80) && (isalpha(ch) || ch == '_'); +} + +static inline bool IsADoxygenChar(int ch) { + return (islower(ch) || ch == '$' || ch == '@' || + ch == '\\' || ch == '&' || ch == '<' || + ch == '>' || ch == '#' || ch == '{' || + ch == '}' || ch == '[' || ch == ']'); +} + +static inline bool IsANumberChar(int ch) { + // Not exactly following number definition (several dots are seen as OK, etc.) + // but probably enough in most cases. + return (ch < 0x80) && + (isdigit(ch) || toupper(ch) == 'E' || + ch == '.' || ch == '-' || ch == '+'); +} + +static void ColouriseCOBOLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + + WordList &keywords1 = *keywordlists[0]; + WordList &keywords2 = *keywordlists[1]; + WordList &kw_pldoc = *keywordlists[2]; + WordList &kw_user1 = *keywordlists[4]; + WordList &kw_user2 = *keywordlists[5]; + WordList &kw_user3 = *keywordlists[6]; + WordList &kw_user4 = *keywordlists[7]; + + StyleContext sc(startPos, length, initStyle, styler); + + // property cobol.backslash.escapes + // Enables backslash as an escape character in COBOL. + bool cobolBackslashEscapes = styler.GetPropertyInt("cobol.backslash.escapes", 0) != 0; + + bool cobolBackticksIdentifier = styler.GetPropertyInt("lexer.cobol.backticks.identifier", 0) != 0; + int styleBeforeDCKeyword = SCE_COBOL_DEFAULT; + for (; sc.More(); sc.Forward()) { + // Determine if the current state should terminate. + switch (sc.state) { + case SCE_COBOL_OPERATOR: + sc.SetState(SCE_COBOL_DEFAULT); + break; + case SCE_COBOL_NUMBER: + // We stop the number definition on non-numerical non-dot non-eE non-sign char + if (!IsANumberChar(sc.ch)) { + sc.SetState(SCE_COBOL_DEFAULT); + } + break; + case SCE_COBOL_IDENTIFIER: + if (!IsAWordChar(sc.ch)) { + int nextState = SCE_COBOL_DEFAULT; + char s[1000]; + sc.GetCurrentLowered(s, sizeof(s)); + if (keywords1.InList(s)) { + sc.ChangeState(SCE_COBOL_WORD); + } else if (keywords2.InList(s)) { + sc.ChangeState(SCE_COBOL_WORD2); + } else if (kw_user1.InList(s)) { + sc.ChangeState(SCE_COBOL_USER1); + } else if (kw_user2.InList(s)) { + sc.ChangeState(SCE_COBOL_USER2); + } else if (kw_user3.InList(s)) { + sc.ChangeState(SCE_COBOL_USER3); + } else if (kw_user4.InList(s)) { + sc.ChangeState(SCE_COBOL_USER4); + } + sc.SetState(nextState); + } + break; + case SCE_COBOL_QUOTEDIDENTIFIER: + if (sc.ch == 0x60) { + if (sc.chNext == 0x60) { + sc.Forward(); // Ignore it + } else { + sc.ForwardSetState(SCE_COBOL_DEFAULT); + } + } + break; + case SCE_COBOL_COMMENT: + if (sc.Match('*>')) { + sc.Forward(); + sc.ForwardSetState(SCE_COBOL_DEFAULT); + } + break; + case SCE_COBOL_COMMENTDOC: + if (sc.Match('*', '/')) { + sc.Forward(); + sc.ForwardSetState(SCE_COBOL_DEFAULT); + } else if (sc.ch == '@' || sc.ch == '\\') { // Doxygen support + // Verify that we have the conditions to mark a comment-doc-keyword + if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) { + styleBeforeDCKeyword = SCE_COBOL_COMMENTDOC; + sc.SetState(SCE_COBOL_COMMENTDOCKEYWORD); + } + } + break; + case SCE_COBOL_COMMENTLINE: + case SCE_COBOL_COMMENTLINEDOC: + case SCE_COBOL_COMMENTDOCKEYWORD: + if ((styleBeforeDCKeyword == SCE_COBOL_COMMENTDOC) && sc.Match('*', '/')) { + sc.ChangeState(SCE_COBOL_COMMENTDOCKEYWORDERROR); + sc.Forward(); + sc.ForwardSetState(SCE_COBOL_DEFAULT); + } else if (!IsADoxygenChar(sc.ch)) { + char s[100]; + sc.GetCurrentLowered(s, sizeof(s)); + if (!isspace(sc.ch) || !kw_pldoc.InList(s + 1)) { + sc.ChangeState(SCE_COBOL_COMMENTDOCKEYWORDERROR); + } + sc.SetState(styleBeforeDCKeyword); + } + break; + case SCE_COBOL_CHARACTER: + if (cobolBackslashEscapes && sc.ch == '\\') { + sc.Forward(); + } else if (sc.ch == '\'') { + if (sc.chNext == '\"') { + sc.Forward(); + } else { + sc.ForwardSetState(SCE_COBOL_DEFAULT); + } + } + break; + case SCE_COBOL_STRING: + if (sc.ch == '\\') { + // Escape sequence + sc.Forward(); + } else if (sc.ch == '\"') { + if (sc.chNext == '\"') { + sc.Forward(); + } else { + sc.ForwardSetState(SCE_COBOL_DEFAULT); + } + } + break; + } + + // Determine if a new state should be entered. + if (sc.state == SCE_COBOL_DEFAULT) { + if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { + sc.SetState(SCE_COBOL_NUMBER); + } else if (IsAWordStart(sc.ch)) { + sc.SetState(SCE_COBOL_IDENTIFIER); + } else if (sc.ch == 0x60 && cobolBackticksIdentifier) { + sc.SetState(SCE_COBOL_QUOTEDIDENTIFIER); + } else if (sc.Match('/', '*')) { + if (sc.Match("/**") || sc.Match("/*!")) { // Support of Doxygen doc. style + sc.SetState(SCE_COBOL_COMMENTDOC); + } else { + sc.SetState(SCE_COBOL_COMMENT); + } + sc.Forward(); // Eat the * so it isn't used for the end of the comment + } else if (sc.Match('-', '-')) { + sc.SetState(SCE_COBOL_COMMENTLINE); + } else if (sc.ch == '#') { + sc.SetState(SCE_COBOL_COMMENTLINEDOC); + } else if (sc.ch == '\'') { + sc.SetState(SCE_COBOL_CHARACTER); + } else if (sc.ch == '\"') { + sc.SetState(SCE_COBOL_STRING); + } else if (isoperator(static_cast<char>(sc.ch))) { + sc.SetState(SCE_COBOL_OPERATOR); + } + } + } + sc.Complete(); +} + +static bool IsStreamCommentStyle(int style) { + return style == SCE_COBOL_COMMENT || + style == SCE_COBOL_COMMENTDOC || + style == SCE_COBOL_COMMENTDOCKEYWORD || + style == SCE_COBOL_COMMENTDOCKEYWORDERROR; +} + +// Store both the current line's fold level and the next lines in the +// level store to make it easy to pick up with each increment. +static void FoldCOBOLDoc(unsigned int startPos, int length, int initStyle, + WordList *[], Accessor &styler) { + bool foldComment = styler.GetPropertyInt("fold.comment") != 0; + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + bool foldOnlyBegin = styler.GetPropertyInt("fold.cobol.only.begin", 0) != 0; + + unsigned int endPos = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelCurrent = SC_FOLDLEVELBASE; + if (lineCurrent > 0) { + levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16; + } + int levelNext = levelCurrent; + char chNext = styler[startPos]; + int styleNext = styler.StyleAt(startPos); + int style = initStyle; + bool endFound = false; + for (unsigned int i = startPos; i < endPos; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + int stylePrev = style; + style = styleNext; + styleNext = styler.StyleAt(i + 1); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + if (foldComment && IsStreamCommentStyle(style)) { + if (!IsStreamCommentStyle(stylePrev)) { + levelNext++; + } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { + // Comments don't end at end of line and the next character may be unstyled. + levelNext--; + } + } + if (foldComment && (style == SCE_COBOL_COMMENTLINE)) { + if ((ch == '-') && (chNext == '-')) { + char chNext2 = styler.SafeGetCharAt(i + 2); + char chNext3 = styler.SafeGetCharAt(i + 3); + if (chNext2 == '{' || chNext3 == '{') { + levelNext++; + } else if (chNext2 == '}' || chNext3 == '}') { + levelNext--; + } + } + } + if (style == SCE_COBOL_OPERATOR) { + if (ch == '(') { + levelNext++; + } else if (ch == ')') { + levelNext--; + } + } + // If new keyword (cannot trigger on elseif or nullif, does less tests) + if (style == SCE_COBOL_WORD && stylePrev != SCE_COBOL_WORD) { + const int MAX_KW_LEN = 6; // Maximum length of folding keywords + char s[MAX_KW_LEN + 2]; + unsigned int j = 0; + for (; j < MAX_KW_LEN + 1; j++) { + if (!iswordchar(styler[i + j])) { + break; + } + s[j] = static_cast<char>(tolower(styler[i + j])); + } + if (j == MAX_KW_LEN + 1) { + // Keyword too long, don't test it + s[0] = '\0'; + } else { + s[j] = '\0'; + } + if ((!foldOnlyBegin) && (strcmp(s, "if") == 0 || strcmp(s, "loop") == 0)) { + if (endFound) { + // ignore + endFound = false; + } else { + levelNext++; + } + } else if (strcmp(s, "begin") == 0) { + levelNext++; + } else if (strcmp(s, "end") == 0 || + // DROP TABLE IF EXISTS or CREATE TABLE IF NOT EXISTS + strcmp(s, "exists") == 0) { + endFound = true; + levelNext--; + if (levelNext < SC_FOLDLEVELBASE) { + levelNext = SC_FOLDLEVELBASE; + } + } + } + if (atEOL) { + int levelUse = levelCurrent; + int lev = levelUse | levelNext << 16; + if (visibleChars == 0 && foldCompact) + lev |= SC_FOLDLEVELWHITEFLAG; + if (levelUse < levelNext) + lev |= SC_FOLDLEVELHEADERFLAG; + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelCurrent = levelNext; + visibleChars = 0; + endFound = false; + } + if (!isspacechar(ch)) { + visibleChars++; + } + } +} + +static const char * const cobolWordListDesc[] = { + "Keywords", + "Database Objects", + "PLDoc", + "User Keywords 1", + "User Keywords 2", + "User Keywords 3", + "User Keywords 4", + 0 +}; + +LexerModule lmCOBOL(SCLEX_COBOL, ColouriseCOBOLDoc, "cobol", FoldCOBOLDoc, cobolWordListDesc); Index: scintilla/KeyWords.cxx =================================================================== --- scintilla/KeyWords.cxx (revision 4171) +++ scintilla/KeyWords.cxx (working copy) @@ -148,6 +148,7 @@ LINK_LEXER(lmCmake); LINK_LEXER(lmCPP); LINK_LEXER(lmCss); + LINK_LEXER(lmCOBOL); LINK_LEXER(lmD); LINK_LEXER(lmDiff); LINK_LEXER(lmF77); Index: scintilla/Makefile.am =================================================================== --- scintilla/Makefile.am (revision 4171) +++ scintilla/Makefile.am (working copy) @@ -13,6 +13,7 @@ LexCPP.cxx \ LexCaml.cxx \ LexCmake.cxx \ +LexCOBOL.cxx \ LexCrontab.cxx \ LexCSS.cxx \ LexD.cxx \ Index: src/filetypes.c =================================================================== --- src/filetypes.c (revision 4171) +++ src/filetypes.c (working copy) @@ -472,6 +472,17 @@ ft->comment_close = g_strdup("*/"); ft->group = GEANY_FILETYPE_GROUP_MISC; +#define COBOL + ft = filetypes[GEANY_FILETYPES_COBOL]; + ft->lang = 11; + ft->name = g_strdup("COBOL"); + ft->title = g_strdup(_("COBOL file")); + ft->extension = g_strdup("cob"); + ft->pattern = utils_strv_new("*.cob", "*.cpy", NULL); + ft->comment_open = g_strdup("*>"); + ft->comment_close = g_strdup(""); + ft->group = GEANY_FILETYPE_GROUP_MISC; + #define LATEX ft = filetypes[GEANY_FILETYPES_LATEX]; ft->lang = 8; Index: src/filetypes.h =================================================================== --- src/filetypes.h (revision 4171) +++ src/filetypes.h (working copy) @@ -70,6 +70,7 @@ GEANY_FILETYPES_SH, GEANY_FILETYPES_FORTRAN, GEANY_FILETYPES_SQL, + GEANY_FILETYPES_COBOL, GEANY_FILETYPES_F77, GEANY_FILETYPES_DOCBOOK, GEANY_FILETYPES_D, Index: src/editor.c =================================================================== --- src/editor.c (revision 4171) +++ src/editor.c (working copy) @@ -2633,6 +2633,7 @@ case SCLEX_LUA: style_comment = SCE_LUA_COMMENT; break; case SCLEX_CSS: style_comment = SCE_CSS_COMMENT; break; case SCLEX_SQL: style_comment = SCE_SQL_COMMENT; break; + case SCLEX_COBOL: style_comment = SCE_COBOL_COMMENT; break; case SCLEX_CAML: style_comment = SCE_CAML_COMMENT; break; case SCLEX_D: style_comment = SCE_D_COMMENT; break; case SCLEX_PASCAL: style_comment = SCE_PAS_COMMENT; break; @@ -3251,6 +3252,9 @@ style == SCE_C_STRING || style == SCE_C_STRINGEOL); + case SCLEX_COBOL: + return (style == SCE_COBOL_STRING); + case SCLEX_PASCAL: return (style == SCE_PAS_CHARACTER || style == SCE_PAS_STRING || @@ -3450,6 +3454,11 @@ style == SCE_SQL_COMMENTLINE || style == SCE_SQL_COMMENTDOC); + case SCLEX_COBOL: + return (style == SCE_COBOL_COMMENT || + style == SCE_COBOL_COMMENTLINE || + style == SCE_COBOL_COMMENTDOC); + case SCLEX_TCL: return (style == SCE_TCL_COMMENT || style == SCE_TCL_COMMENTLINE || @@ -4749,6 +4758,7 @@ case SCLEX_MAKEFILE: case SCLEX_ASM: case SCLEX_SQL: + case SCLEX_COBOL: case SCLEX_PROPERTIES: case SCLEX_FORTRAN: /* Is this the best option for Fortran? */ case SCLEX_CAML: Index: data/filetypes.cpy =================================================================== --- data/filetypes.cpy (revision 0) +++ data/filetypes.cpy (revision 0) @@ -0,0 +1,41 @@ +# 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 +commentline=0x808080;0xffffff;false;false +commentdoc=0x3f5fbf;0xffffff;false;false +number=0x7f7f00;0xffffff;false;false +word=0x001a7f;0xffffff;true;false +word2=0x7f0000;0xffffff;true;false +string=0x7f007f;0xffffff;false;false +character=0x000000;0xffffff;false;false +operator=0x000000;0xffffff;true;false +identifier=0x111199;0xffffff;false;false +quotedidentifier=0x111199;0xffffff;false;false + +[keywords] +# all items must be in one line +keywords=accept access add address advancing after alphabet alphabetic alphabetic-lower alphabetic-upper alphanumeric alphanumeric-edited als alternate and any are area areas ascending assign at author before binary blank block bottom by cancel cbll cd cf ch character characters class clock-units close cobol code code-set collating column comma common communications computational compute configuration content continue control converting corr corresponding count currency data date date-compiled date-written day day-of-week de debug-contents debug-item debug-line debug-name debug-sub-1 debug-sub-2 debug-sub-3 debugging decimal-point delaratives delete delimited delimiter depending descending destination detail disable display divide division down duplicates dynamic egi else emi enable end-add end-compute end-delete end-divide end-evaluate end-if end-multiply end-of-page end-perform end-read end-receive end-return end-rewrite end-search end-start end-string end-subtract end-unstring end-write environment equal error esi evaluate every exception extend external false fd file file-control filler final first footing for from generate giving global greater group heading high-value high-values i-o i-o-control identification in index indexed indicate initial initialize initiate input input-output inspect installation into is just justified key label last leading left length lock memory merge message mode modules move multiple multiply native negative next no not number numeric numeric-edited object-computer occurs of off omitted on open optional or order organization other output overflow packed-decimal padding page page-counter perform pf ph pic picture plus position positive printing procedure procedures procedd program program-id purge queue quotes random rd read receive record records redefines reel reference references relative release remainder removal replace replacing report reporting reports rerun reserve reset return returning reversed rewind rewrite rf rh right rounded same sd search section security segment segment-limited select send sentence separate sequence sequential set sign size sort sort-merge source source-computer special-names standard standard-1 standard-2 start status string sub-queue-1 sub-queue-2 sub-queue-3 subtract sum suppress symbolic sync synchronized table tallying tape terminal terminate test text than then through thru time times to top trailing true type unit unstring until up upon usage use using value values varying when with words working-storage write + +[settings] +# default extension used when saving files +#extension=cpy + +# 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= + +# set to false if a comment character/string should start at column 0 of a line, true uses any +# indentation 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=false + +# context action command (please see Geany's main documentation for details) +context_action_cmd= Index: data/filetypes.cob =================================================================== --- data/filetypes.cob (revision 0) +++ data/filetypes.cob (revision 0) @@ -0,0 +1,41 @@ +# 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 +commentline=0x808080;0xffffff;false;false +commentdoc=0x3f5fbf;0xffffff;false;false +number=0x7f7f00;0xffffff;false;false +word=0x001a7f;0xffffff;true;false +word2=0x7f0000;0xffffff;true;false +string=0x7f007f;0xffffff;false;false +character=0x000000;0xffffff;false;false +operator=0x000000;0xffffff;true;false +identifier=0x111199;0xffffff;false;false +quotedidentifier=0x111199;0xffffff;false;false + +[keywords] +# all items must be in one line +keywords=accept access add address advancing after alphabet alphabetic alphabetic-lower alphabetic-upper alphanumeric alphanumeric-edited als alternate and any are area areas ascending assign at author before binary blank block bottom by cancel cbll cd cf ch character characters class clock-units close cobol code code-set collating column comma common communications computational compute configuration content continue control converting corr corresponding count currency data date date-compiled date-written day day-of-week de debug-contents debug-item debug-line debug-name debug-sub-1 debug-sub-2 debug-sub-3 debugging decimal-point delaratives delete delimited delimiter depending descending destination detail disable display divide division down duplicates dynamic egi else emi enable end-add end-compute end-delete end-divide end-evaluate end-if end-multiply end-of-page end-perform end-read end-receive end-return end-rewrite end-search end-start end-string end-subtract end-unstring end-write environment equal error esi evaluate every exception extend external false fd file file-control filler final first footing for from generate giving global greater group heading high-value high-values i-o i-o-control identification in index indexed indicate initial initialize initiate input input-output inspect installation into is just justified key label last leading left length lock memory merge message mode modules move multiple multiply native negative next no not number numeric numeric-edited object-computer occurs of off omitted on open optional or order organization other output overflow packed-decimal padding page page-counter perform pf ph pic picture plus position positive printing procedure procedures procedd program program-id purge queue quotes random rd read receive record records redefines reel reference references relative release remainder removal replace replacing report reporting reports rerun reserve reset return returning reversed rewind rewrite rf rh right rounded same sd search section security segment segment-limited select send sentence separate sequence sequential set sign size sort sort-merge source source-computer special-names standard standard-1 standard-2 start status string sub-queue-1 sub-queue-2 sub-queue-3 subtract sum suppress symbolic sync synchronized table tallying tape terminal terminate test text than then through thru time times to top trailing true type unit unstring until up upon usage use using value values varying when with words working-storage write + +[settings] +# default extension used when saving files +#extension=cob + +# 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= + +# set to false if a comment character/string should start at column 0 of a line, true uses any +# indentation 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=false + +# context action command (please see Geany's main documentation for details) +context_action_cmd= Index: data/filetype_extensions.conf =================================================================== --- data/filetype_extensions.conf (revision 4171) +++ data/filetype_extensions.conf (working copy) @@ -45,5 +45,6 @@ reStructuredText=*.rest;*.reST;*.rst; txt2tags=*.t2t; SQL=*.sql; +COBOL=*.cob;*.cpy; YAML=*.yaml;*.yml; None=*; Index: wscript =================================================================== --- wscript (revision 4171) +++ wscript (working copy) @@ -86,7 +86,7 @@ 'scintilla/KeyWords.cxx', 'scintilla/LexAda.cxx', 'scintilla/LexAsm.cxx', 'scintilla/LexBash.cxx', 'scintilla/LexBasic.cxx', 'scintilla/LexCaml.cxx', 'scintilla/LexCmake.cxx', 'scintilla/LexCPP.cxx', - 'scintilla/LexCrontab.cxx', 'scintilla/LexCSS.cxx', 'scintilla/LexD.cxx', + 'scintilla/LexCrontab.cxx', 'scintilla/LexCSS.cxx', 'scintilla/LexCOBOL.cxx', 'scintilla/LexD.cxx', 'scintilla/LexFortran.cxx', 'scintilla/LexHaskell.cxx', 'scintilla/LexHTML.cxx', 'scintilla/LexLua.cxx', 'scintilla/LexMarkdown.cxx', 'scintilla/LexMatlab.cxx', 'scintilla/LexNsis.cxx', 'scintilla/LexOthers.cxx',
_______________________________________________ Geany-devel mailing list [email protected] http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
