View Issue Details

IDProjectCategoryView StatusLast Update
0036296PatchesPatchpublic2019-11-17 16:34
ReporterGabor BorosAssigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version2.1 (SVN)Product Build 
Target VersionFixed in Version2.2 
Summary0036296: SynEdit - SQL highlighter for Firebird 2.5, 3.0 and 4.0
DescriptionThe keyword lists in the attached patch are based on the keywords.cpp in Firebird sources.

2.5:
https://github.com/FirebirdSQL/firebird/blob/B2_5_Release/src/dsql/keywords.cpp

3.0:
https://github.com/FirebirdSQL/firebird/blob/B3_0_Release/src/common/keywords.cpp

4.0:
https://github.com/FirebirdSQL/firebird/blob/master/src/common/keywords.cpp
TagsNo tags attached.
Fixed in Revision62236
LazTarget2.2
Widgetset
Attached Files
  • synhighlightersql.pas.patch (12,797 bytes)
    Index: components/synedit/synhighlightersql.pas
    ===================================================================
    --- components/synedit/synhighlightersql.pas	(revision 62218)
    +++ components/synedit/synhighlightersql.pas	(working copy)
    @@ -68,7 +68,8 @@
       TProcTableProc = procedure of object;
     
       TSQLDialect = (sqlStandard, sqlInterbase6, sqlMSSQL7, sqlMySQL, sqlOracle,
    -    sqlSybase, sqlIngres, sqlMSSQL2K, sqlPostgres, sqlSQLite);                                           // JJV 2000-11-16
    +    sqlSybase, sqlIngres, sqlMSSQL2K, sqlPostgres, sqlSQLite,                                           // JJV 2000-11-16
    +    sqlFirebird25, sqlFirebird30, sqlFirebird40);
     
     type
       PIdentifierTable = ^TIdentifierTable;
    @@ -1041,6 +1042,147 @@
         'VARBYTE';
     {end}                                                                           // JJV 2000-11-16
     
    +//---Firebird 2.5 keywords------------------------------------------------------
    +  Firebird25KW: string =
    +    'ABS,ACCENT,ACOS,ACTION,ACTIVE,ADD,ADMIN,AFTER,ALL,ALTER,ALWAYS,AND,ANY,'+
    +    'AS,ASC,ASCENDING,ASCII_CHAR,ASCII_VAL,ASIN,AT,ATAN,ATAN2,AUTO,AUTONOMOUS,'+
    +    'AVG,BACKUP,BEFORE,BEGIN,BETWEEN,BIGINT,BIN_AND,BIN_NOT,BIN_OR,BIN_SHL,'+
    +    'BIN_SHR,BIN_XOR,BIT_LENGTH,BLOB,BLOCK,BOTH,BREAK,BY,CALLER,CASCADE,CASE,'+
    +    'CAST,CEIL,CEILING,CHAR,CHAR_LENGTH,CHAR_TO_UUID,CHARACTER,CHARACTER_LENGTH,'+
    +    'CHECK,CLOSE,COALESCE,COLLATE,COLLATION,COLUMN,COMMENT,COMMIT,COMMITTED,'+
    +    'COMMON,COMPUTED,CONDITIONAL,CONNECT,CONSTRAINT,CONTAINING,COS,COSH,COT,'+
    +    'COUNT,CREATE,CROSS,CSTRING,CURRENT,CURRENT_CONNECTION,CURRENT_DATE,'+
    +    'CURRENT_ROLE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_TRANSACTION,'+
    +    'CURRENT_USER,CURSOR,DATABASE,DATA,DATE,DATEADD,DATEDIFF,DAY,DEC,DECIMAL,'+
    +    'DECLARE,DECODE,DEFAULT,DELETE,DELETING,DESC,DESCENDING,DESCRIPTOR,'+
    +    'DIFFERENCE,DISCONNECT,DISTINCT,DO,DOMAIN,DOUBLE,DROP,ELSE,END,ENTRY_POINT,'+
    +    'ESCAPE,EXCEPTION,EXECUTE,EXISTS,EXIT,EXP,EXTERNAL,EXTRACT,FETCH,FILE,'+
    +    'FILTER,FIRST,FIRSTNAME,FLOAT,FLOOR,FOR,FOREIGN,FREE_IT,FROM,FULL,FUNCTION,'+
    +    'GDSCODE,GENERATED,GENERATOR,GEN_ID,GEN_UUID,GLOBAL,GRANT,GRANTED,GROUP,'+
    +    'HASH,HAVING,HOUR,IF,IGNORE,IIF,IN,INACTIVE,INDEX,INNER,INPUT_TYPE,'+
    +    'INSENSITIVE,INSERT,INSERTING,INT,INTEGER,INTO,IS,ISOLATION,JOIN,KEY,LAST,'+
    +    'LASTNAME,LEADING,LEAVE,LEFT,LENGTH,LEVEL,LIKE,LIMBO,LIST,LN,LOCALTIME,'+
    +    'LOCALTIMESTAMP,LOCK,LOG,LOG10,LONG,LOWER,LPAD,MANUAL,MAPPING,MATCHED,'+
    +    'MATCHING,MAX,MAXVALUE,MAXIMUM_SEGMENT,MERGE,MILLISECOND,MIDDLENAME,MIN,'+
    +    'MINUTE,MINVALUE,MOD,MODULE_NAME,MONTH,NAMES,NATIONAL,NATURAL,NCHAR,NEXT,'+
    +    'NO,NOT,NULLIF,NULL,NULLS,NUMERIC,OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,'+
    +    'ORDER,OS_NAME,OUTER,OUTPUT_TYPE,OVERFLOW,OVERLAY,PAD,PAGE,PAGES,PAGE_SIZE,'+
    +    'PARAMETER,PASSWORD,PI,PLACING,PLAN,POSITION,POST_EVENT,POWER,PRECISION,'+
    +    'PRESERVE,PRIMARY,PRIVILEGES,PROCEDURE,PROTECTED,RAND,RDB$DB_KEY,READ,REAL,'+
    +    'RECORD_VERSION,RECREATE,RECURSIVE,REFERENCES,RELEASE,REPLACE,REQUESTS,'+
    +    'RESERV,RESERVING,RESTART,RESTRICT,RETAIN,RETURNING,RETURNING_VALUES,'+
    +    'RETURNS,REVERSE,REVOKE,RIGHT,ROLE,ROLLBACK,ROUND,ROW_COUNT,ROWS,RPAD,'+
    +    'SAVEPOINT,SCALAR_ARRAY,SCHEMA,SECOND,SEGMENT,SELECT,SENSITIVE,SEQUENCE,'+
    +    'SET,SHADOW,SHARED,SIGN,SIMILAR,SIN,SINGULAR,SINH,SIZE,SKIP,SMALLINT,'+
    +    'SNAPSHOT,SOME,SORT,SOURCE,SPACE,SQLCODE,SQLSTATE,SQRT,STABILITY,START,'+
    +    'STARTING,STARTS,STATEMENT,STATISTICS,SUBSTRING,SUB_TYPE,SUM,SUSPEND,TABLE,'+
    +    'TAN,TANH,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEOUT,TO,TRAILING,TRANSACTION,'+
    +    'TRIGGER,TRIM,TRUNC,TWO_PHASE,TYPE,UNCOMMITTED,UNDO,UNION,UNIQUE,UPDATE,'+
    +    'UPDATING,UPPER,USER,USING,UUID_TO_CHAR,VALUE,VALUES,VARCHAR,VARIABLE,'+
    +    'VARYING,VIEW,WAIT,WEEK,WEEKDAY,WHEN,WHERE,WHILE,WITH,WORK,WRITE,YEAR,YEARDAY';
    +
    +//---Firebird 3.0 keywords------------------------------------------------------
    +  Firebird30KW: string =
    +    'ABS,ABSOLUTE,ACCENT,ACOS,ACOSH,ACTION,ACTIVE,ADD,ADMIN,AFTER,ALL,ALTER,'+
    +    'ALWAYS,AND,ANY,AS,ASC,ASCENDING,ASCII_CHAR,ASCII_VAL,ASIN,ASINH,AT,ATAN,'+
    +    'ATAN2,ATANH,AUTO,AUTONOMOUS,AVG,BACKUP,BEFORE,BEGIN,BETWEEN,BIGINT,BIN_AND,'+
    +    'BIN_NOT,BIN_OR,BIN_SHL,BIN_SHR,BIN_XOR,BIT_LENGTH,BLOB,BLOCK,BODY,BOOLEAN,'+
    +    'BOTH,BREAK,BY,CALLER,CASCADE,CASE,CAST,CEIL,CEILING,CHAR,CHAR_LENGTH,'+
    +    'CHAR_TO_UUID,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,COLLATE,'+
    +    'COLLATION,COLUMN,COMMENT,COMMIT,COMMITTED,COMMON,COMPUTED,CONDITIONAL,'+
    +    'CONNECT,CONSTRAINT,CONTAINING,CONTINUE,CORR,COS,COSH,COT,COUNT,COVAR_POP,'+
    +    'COVAR_SAMP,CREATE,CROSS,CSTRING,CURRENT,CURRENT_CONNECTION,CURRENT_DATE,'+
    +    'CURRENT_ROLE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_TRANSACTION,'+
    +    'CURRENT_USER,CURSOR,DATABASE,DATA,DATE,DATEADD,DATEDIFF,DAY,DDL,DEC,'+
    +    'DECIMAL,DECLARE,DECODE,DECRYPT,DEFAULT,DELETE,DELETING,DENSE_RANK,DESC,'+
    +    'DESCENDING,DESCRIPTOR,DETERMINISTIC,DIFFERENCE,DISCONNECT,DISTINCT,DO,'+
    +    'DOMAIN,DOUBLE,DROP,ELSE,ENCRYPT,END,ENGINE,ENTRY_POINT,ESCAPE,EXCEPTION,'+
    +    'EXECUTE,EXISTS,EXIT,EXP,EXTERNAL,EXTRACT,FALSE,FETCH,FILE,FILTER,FIRST,'+
    +    'FIRST_VALUE,FIRSTNAME,FLOAT,FLOOR,FOR,FOREIGN,FREE_IT,FROM,FULL,FUNCTION,'+
    +    'GDSCODE,GENERATED,GENERATOR,GEN_ID,GEN_UUID,GLOBAL,GRANT,GRANTED,GROUP,'+
    +    'HASH,HAVING,HOUR,IDENTITY,IF,IGNORE,IIF,IN,INACTIVE,INCREMENT,INDEX,INNER,'+
    +    'INPUT_TYPE,INSENSITIVE,INSERT,INSERTING,INT,INTEGER,INTO,IS,ISOLATION,JOIN,'+
    +    'KEY,LAG,LAST,LAST_VALUE,LASTNAME,LEAD,LEADING,LEAVE,LEFT,LENGTH,LEVEL,LIKE,'+
    +    'LIMBO,LINGER,LIST,LN,LOCALTIME,LOCALTIMESTAMP,LOCK,LOG,LOG10,LONG,LOWER,'+
    +    'LPAD,MANUAL,MAPPING,MATCHED,MATCHING,MAX,MAXVALUE,MERGE,MILLISECOND,'+
    +    'MIDDLENAME,MIN,MINUTE,MINVALUE,MOD,MODULE_NAME,MONTH,NAME,NAMES,NATIONAL,'+
    +    'NATURAL,NCHAR,NEXT,NO,NOT,NTH_VALUE,NULLIF,NULL,NULLS,NUMERIC,OCTET_LENGTH,'+
    +    'OF,OFFSET,ON,ONLY,OPEN,OPTION,OR,ORDER,OS_NAME,OUTER,OUTPUT_TYPE,OVER,'+
    +    'OVERFLOW,OVERLAY,PACKAGE,PAD,PAGE,PAGES,PAGE_SIZE,PARAMETER,PARTITION,'+
    +    'PASSWORD,PI,PLACING,PLAN,PLUGIN,POSITION,POST_EVENT,POWER,PRECISION,'+
    +    'PRESERVE,PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PROTECTED,RAND,RANK,RDB$DB_KEY,'+
    +    'RDB$GET_CONTEXT,RDB$RECORD_VERSION,RDB$SET_CONTEXT,READ,REAL,'+
    +    'RECORD_VERSION,RECREATE,RECURSIVE,REFERENCES,REGR_AVGX,REGR_AVGY,'+
    +    'REGR_COUNT,REGR_INTERCEPT,REGR_R2,REGR_SLOPE,REGR_SXX,REGR_SXY,REGR_SYY,'+
    +    'RELATIVE,RELEASE,REPLACE,REQUESTS,RESERV,RESERVING,RESTART,RESTRICT,RETAIN,'+
    +    'RETURN,RETURNING,RETURNING_VALUES,RETURNS,REVERSE,REVOKE,RIGHT,ROLE,'+
    +    'ROLLBACK,ROUND,ROW,ROW_COUNT,ROW_NUMBER,ROWS,RPAD,SAVEPOINT,SCALAR_ARRAY,'+
    +    'SCHEMA,SCROLL,SECOND,SEGMENT,SELECT,SENSITIVE,SEQUENCE,SERVERWIDE,SET,'+
    +    'SHADOW,SHARED,SIGN,SIMILAR,SIN,SINGULAR,SINH,SIZE,SKIP,SMALLINT,SNAPSHOT,'+
    +    'SOME,SORT,SOURCE,SPACE,SQLCODE,SQLSTATE,SQRT,STABILITY,START,STARTING,'+
    +    'STARTS,STATEMENT,STATISTICS,STDDEV_POP,STDDEV_SAMP,SUBSTRING,SUB_TYPE,SUM,'+
    +    'SUSPEND,TABLE,TAGS,TAN,TANH,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEOUT,TO,'+
    +    'TRAILING,TRANSACTION,TRIGGER,TRIM,TRUE,TRUNC,TRUSTED,TWO_PHASE,TYPE,'+
    +    'UNCOMMITTED,UNDO,UNION,UNIQUE,UNKNOWN,UPDATE,UPDATING,UPPER,USAGE,USER,'+
    +    'USING,UUID_TO_CHAR,VALUE,VALUES,VAR_POP,VAR_SAMP,VARCHAR,VARIABLE,VARYING,'+
    +    'VIEW,WAIT,WEEK,WEEKDAY,WHEN,WHERE,WHILE,WITH,WORK,WRITE,YEAR,YEARDAY';
    +
    +//---Firebird 4.0 keywords------------------------------------------------------
    +  Firebird40KW: string =
    +    'ABS,ABSOLUTE,ACCENT,ACOS,ACOSH,ACTION,ACTIVE,ADD,ADMIN,AFTER,ALL,ALTER,'+
    +    'ALWAYS,AND,ANY,AS,ASC,ASCENDING,ASCII_CHAR,ASCII_VAL,ASIN,ASINH,AT,ATAN,'+
    +    'ATAN2,ATANH,AUTO,AUTONOMOUS,AVG,BACKUP,BASE64_DECODE,BASE64_ENCODE,BEFORE,'+
    +    'BEGIN,BETWEEN,BIGINT,BIN_AND,BIN_NOT,BIN_OR,BIN_SHL,BIN_SHR,BIN_XOR,BINARY,'+
    +    'BIND,BIT_LENGTH,BLOB,BLOCK,BODY,BOOLEAN,BOTH,BREAK,BY,CALLER,CASCADE,CASE,'+
    +    'CAST,CEIL,CEILING,CHAR,CHAR_LENGTH,CHAR_TO_UUID,CHARACTER,CHARACTER_LENGTH,'+
    +    'CHECK,CLEAR,CLOSE,COALESCE,COLLATE,COLLATION,COLUMN,COMMENT,COMMIT,'+
    +    'COMMITTED,COMMON,COMPARE_DECFLOAT,COMPUTED,CONDITIONAL,CONNECT,CONNECTIONS,'+
    +    'CONSISTENCY,CONSTRAINT,CONTAINING,CONTINUE,CORR,COS,COSH,COT,COUNT,COUNTER,'+
    +    'COVAR_POP,COVAR_SAMP,CRC32,CREATE,CROSS,CSTRING,CTR_BIG_ENDIAN,CTR_LENGTH,'+
    +    'CTR_LITTLE_ENDIAN,CUME_DIST,CURRENT,CURRENT_CONNECTION,CURRENT_DATE,'+
    +    'CURRENT_ROLE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_TRANSACTION,'+
    +    'CURRENT_USER,CURSOR,DATABASE,DATA,DATE,DATEADD,DATEDIFF,DAY,DDL,DEC,'+
    +    'DECFLOAT,DECIMAL,DECLARE,DECODE,DECRYPT,DEFAULT,DEFINER,DELETE,DELETING,'+
    +    'DENSE_RANK,DESC,DESCENDING,DESCRIPTOR,DETERMINISTIC,DIFFERENCE,DISCONNECT,'+
    +    'DISTINCT,DO,DOMAIN,DOUBLE,DROP,ELSE,ENCRYPT,END,ENGINE,ENTRY_POINT,ESCAPE,'+
    +    'EXCEPTION,EXCESS,EXCLUDE,EXECUTE,EXISTS,EXIT,EXP,EXTERNAL,EXTRACT,FALSE,'+
    +    'FETCH,FILE,FILTER,FIRST,FIRST_DAY,FIRST_VALUE,FIRSTNAME,FLOAT,FLOOR,'+
    +    'FOLLOWING,FOR,FOREIGN,FREE_IT,FROM,FULL,FUNCTION,GDSCODE,GENERATED,'+
    +    'GENERATOR,GEN_ID,GEN_UUID,GLOBAL,GRANT,GRANTED,GROUP,HASH,HAVING,'+
    +    'HEX_DECODE,HEX_ENCODE,HOUR,IDENTITY,IDLE,IF,IGNORE,IIF,IN,INACTIVE,'+
    +    'INCREMENT,INDEX,INNER,INPUT_TYPE,INSENSITIVE,INSERT,INSERTING,INT,INT128,'+
    +    'INTEGER,INTO,INVOKER,IS,ISOLATION,IV,JOIN,KEY,LAG,LAST,LAST_DAY,LAST_VALUE,'+
    +    'LASTNAME,LEAD,LEADING,LEAVE,LEFT,LEGACY,LENGTH,LEVEL,LIFETIME,LIKE,LIMBO,'+
    +    'LINGER,LIST,LN,LOCAL,LOCALTIME,LOCALTIMESTAMP,LOCK,LOG,LOG10,LONG,LOWER,'+
    +    'LPAD,LPARAM,MANUAL,MAPPING,MATCHED,MATCHING,MAX,MAXVALUE,MERGE,MESSAGE,'+
    +    'MILLISECOND,MIDDLENAME,MIN,MINUTE,MINVALUE,MOD,MODE,MODULE_NAME,MONTH,NAME,'+
    +    'NAMES,NATIONAL,NATIVE,NATURAL,NCHAR,NEXT,NO,NORMALIZE_DECFLOAT,NOT,'+
    +    'NTH_VALUE,NTILE,NULLIF,NULL,NULLS,NUMBER,NUMERIC,OCTET_LENGTH,OF,OFFSET,'+
    +    'OLDEST,ON,ONLY,OPEN,OPTION,OR,ORDER,OS_NAME,OTHERS,OUTER,OUTPUT_TYPE,OVER,'+
    +    'OVERFLOW,OVERLAY,OVERRIDING,PACKAGE,PAD,PAGE,PAGES,PAGE_SIZE,PARAMETER,'+
    +    'PARTITION,PASSWORD,PERCENT_RANK,PI,PLACING,PLAN,PLUGIN,POOL,POSITION,'+
    +    'POST_EVENT,POWER,PRECEDING,PRECISION,PRESERVE,PRIMARY,PRIOR,PRIVILEGE,'+
    +    'PRIVILEGES,PROCEDURE,PROTECTED,QUANTIZE,RAND,RANGE,RANK,RDB$DB_KEY,'+
    +    'RDB$ERROR,RDB$GET_CONTEXT,RDB$GET_TRANSACTION_CN,RDB$RECORD_VERSION,'+
    +    'RDB$ROLE_IN_USE,RDB$SET_CONTEXT,RDB$SYSTEM_PRIVILEGE,READ,REAL,'+
    +    'RECORD_VERSION,RECREATE,RECURSIVE,REFERENCES,REGR_AVGX,REGR_AVGY,'+
    +    'REGR_COUNT,REGR_INTERCEPT,REGR_R2,REGR_SLOPE,REGR_SXX,REGR_SXY,REGR_SYY,'+
    +    'RELATIVE,RELEASE,REPLACE,REQUESTS,RESERV,RESERVING,RESET,RESTART,RESTRICT,'+
    +    'RETAIN,RETURN,RETURNING,RETURNING_VALUES,RETURNS,REVERSE,REVOKE,RIGHT,ROLE,'+
    +    'ROLLBACK,ROUND,ROW,ROW_COUNT,ROW_NUMBER,ROWS,RPAD,RSA_DECRYPT,RSA_ENCRYPT,'+
    +    'RSA_PRIVATE,RSA_PUBLIC,RSA_SIGN,RSA_VERIFY,SALT_LENGTH,SAVEPOINT,'+
    +    'SCALAR_ARRAY,SCHEMA,SCROLL,SECOND,SECURITY,SEGMENT,SELECT,SENSITIVE,'+
    +    'SEQUENCE,SERVERWIDE,SESSION,SET,SHADOW,SHARED,SIGN,SIGNATURE,SIMILAR,SIN,'+
    +    'SINGULAR,SINH,SIZE,SKIP,SMALLINT,SNAPSHOT,SOME,SORT,SOURCE,SPACE,SQL,'+
    +    'SQLCODE,SQLSTATE,SQRT,STABILITY,START,STARTING,STARTS,STATEMENT,STATISTICS,'+
    +    'STDDEV_POP,STDDEV_SAMP,SUBSTRING,SUB_TYPE,SUM,SUSPEND,SYSTEM,TABLE,TAGS,'+
    +    'TAN,TANH,TEMPORARY,THEN,TIES,TIME,TIMESTAMP,TIMEOUT,TIMEZONE_HOUR,'+
    +    'TIMEZONE_MINUTE,TO,TOTALORDER,TRAILING,TRANSACTION,TRAPS,TRIGGER,TRIM,TRUE,'+
    +    'TRUNC,TRUSTED,TWO_PHASE,TYPE,UNBOUNDED,UNCOMMITTED,UNDO,UNION,UNIQUE,'+
    +    'UNKNOWN,UPDATE,UPDATING,UPPER,USAGE,USER,USING,UUID_TO_CHAR,VALUE,VALUES,'+
    +    'VAR_POP,VAR_SAMP,VARBINARY,VARCHAR,VARIABLE,VARYING,VIEW,WAIT,WEEK,WEEKDAY,'+
    +    'WHEN,WHERE,WHILE,WINDOW,WITH,WITHOUT,WORK,WRITE,YEAR,YEARDAY,ZONE';
    +
     procedure MakeIdentTable;
     var
       c: char;
    @@ -1655,8 +1797,11 @@
       else if fDialect = sqlOracle then begin
         Include(Result, '#');
         Include(Result, '$');
    -  end;
    +  end
     {end}                                                                           // DJLP 2000-08-11
    +  else if (fDialect = sqlFirebird25) or
    +          (fDialect = sqlFirebird30) or
    +          (fDialect = sqlFirebird40) then Include(Result, '$');
     end;
     
     class function TSynSQLSyn.GetLanguageName: string;
    @@ -1792,6 +1937,12 @@
           EnumerateKeywords(Ord(tkKey), StandardKW, IdentChars + ['-'], @DoAddKeyword);
         sqlSybase:
           EnumerateKeywords(Ord(tkKey), SybaseKW, IdentChars, @DoAddKeyword);
    +    sqlFirebird25:
    +      EnumerateKeywords(Ord(tkKey), Firebird25KW, IdentChars, @DoAddKeyword);
    +    sqlFirebird30:
    +      EnumerateKeywords(Ord(tkKey), Firebird30KW, IdentChars, @DoAddKeyword);
    +    sqlFirebird40:
    +      EnumerateKeywords(Ord(tkKey), Firebird40KW, IdentChars, @DoAddKeyword);
       end;
       PutTableNamesInKeywordList;
       DefHighlightChange(Self);
    

Activities

Gabor Boros

2019-11-11 21:03

reporter  

synhighlightersql.pas.patch (12,797 bytes)
Index: components/synedit/synhighlightersql.pas
===================================================================
--- components/synedit/synhighlightersql.pas	(revision 62218)
+++ components/synedit/synhighlightersql.pas	(working copy)
@@ -68,7 +68,8 @@
   TProcTableProc = procedure of object;
 
   TSQLDialect = (sqlStandard, sqlInterbase6, sqlMSSQL7, sqlMySQL, sqlOracle,
-    sqlSybase, sqlIngres, sqlMSSQL2K, sqlPostgres, sqlSQLite);                                           // JJV 2000-11-16
+    sqlSybase, sqlIngres, sqlMSSQL2K, sqlPostgres, sqlSQLite,                                           // JJV 2000-11-16
+    sqlFirebird25, sqlFirebird30, sqlFirebird40);
 
 type
   PIdentifierTable = ^TIdentifierTable;
@@ -1041,6 +1042,147 @@
     'VARBYTE';
 {end}                                                                           // JJV 2000-11-16
 
+//---Firebird 2.5 keywords------------------------------------------------------
+  Firebird25KW: string =
+    'ABS,ACCENT,ACOS,ACTION,ACTIVE,ADD,ADMIN,AFTER,ALL,ALTER,ALWAYS,AND,ANY,'+
+    'AS,ASC,ASCENDING,ASCII_CHAR,ASCII_VAL,ASIN,AT,ATAN,ATAN2,AUTO,AUTONOMOUS,'+
+    'AVG,BACKUP,BEFORE,BEGIN,BETWEEN,BIGINT,BIN_AND,BIN_NOT,BIN_OR,BIN_SHL,'+
+    'BIN_SHR,BIN_XOR,BIT_LENGTH,BLOB,BLOCK,BOTH,BREAK,BY,CALLER,CASCADE,CASE,'+
+    'CAST,CEIL,CEILING,CHAR,CHAR_LENGTH,CHAR_TO_UUID,CHARACTER,CHARACTER_LENGTH,'+
+    'CHECK,CLOSE,COALESCE,COLLATE,COLLATION,COLUMN,COMMENT,COMMIT,COMMITTED,'+
+    'COMMON,COMPUTED,CONDITIONAL,CONNECT,CONSTRAINT,CONTAINING,COS,COSH,COT,'+
+    'COUNT,CREATE,CROSS,CSTRING,CURRENT,CURRENT_CONNECTION,CURRENT_DATE,'+
+    'CURRENT_ROLE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_TRANSACTION,'+
+    'CURRENT_USER,CURSOR,DATABASE,DATA,DATE,DATEADD,DATEDIFF,DAY,DEC,DECIMAL,'+
+    'DECLARE,DECODE,DEFAULT,DELETE,DELETING,DESC,DESCENDING,DESCRIPTOR,'+
+    'DIFFERENCE,DISCONNECT,DISTINCT,DO,DOMAIN,DOUBLE,DROP,ELSE,END,ENTRY_POINT,'+
+    'ESCAPE,EXCEPTION,EXECUTE,EXISTS,EXIT,EXP,EXTERNAL,EXTRACT,FETCH,FILE,'+
+    'FILTER,FIRST,FIRSTNAME,FLOAT,FLOOR,FOR,FOREIGN,FREE_IT,FROM,FULL,FUNCTION,'+
+    'GDSCODE,GENERATED,GENERATOR,GEN_ID,GEN_UUID,GLOBAL,GRANT,GRANTED,GROUP,'+
+    'HASH,HAVING,HOUR,IF,IGNORE,IIF,IN,INACTIVE,INDEX,INNER,INPUT_TYPE,'+
+    'INSENSITIVE,INSERT,INSERTING,INT,INTEGER,INTO,IS,ISOLATION,JOIN,KEY,LAST,'+
+    'LASTNAME,LEADING,LEAVE,LEFT,LENGTH,LEVEL,LIKE,LIMBO,LIST,LN,LOCALTIME,'+
+    'LOCALTIMESTAMP,LOCK,LOG,LOG10,LONG,LOWER,LPAD,MANUAL,MAPPING,MATCHED,'+
+    'MATCHING,MAX,MAXVALUE,MAXIMUM_SEGMENT,MERGE,MILLISECOND,MIDDLENAME,MIN,'+
+    'MINUTE,MINVALUE,MOD,MODULE_NAME,MONTH,NAMES,NATIONAL,NATURAL,NCHAR,NEXT,'+
+    'NO,NOT,NULLIF,NULL,NULLS,NUMERIC,OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,'+
+    'ORDER,OS_NAME,OUTER,OUTPUT_TYPE,OVERFLOW,OVERLAY,PAD,PAGE,PAGES,PAGE_SIZE,'+
+    'PARAMETER,PASSWORD,PI,PLACING,PLAN,POSITION,POST_EVENT,POWER,PRECISION,'+
+    'PRESERVE,PRIMARY,PRIVILEGES,PROCEDURE,PROTECTED,RAND,RDB$DB_KEY,READ,REAL,'+
+    'RECORD_VERSION,RECREATE,RECURSIVE,REFERENCES,RELEASE,REPLACE,REQUESTS,'+
+    'RESERV,RESERVING,RESTART,RESTRICT,RETAIN,RETURNING,RETURNING_VALUES,'+
+    'RETURNS,REVERSE,REVOKE,RIGHT,ROLE,ROLLBACK,ROUND,ROW_COUNT,ROWS,RPAD,'+
+    'SAVEPOINT,SCALAR_ARRAY,SCHEMA,SECOND,SEGMENT,SELECT,SENSITIVE,SEQUENCE,'+
+    'SET,SHADOW,SHARED,SIGN,SIMILAR,SIN,SINGULAR,SINH,SIZE,SKIP,SMALLINT,'+
+    'SNAPSHOT,SOME,SORT,SOURCE,SPACE,SQLCODE,SQLSTATE,SQRT,STABILITY,START,'+
+    'STARTING,STARTS,STATEMENT,STATISTICS,SUBSTRING,SUB_TYPE,SUM,SUSPEND,TABLE,'+
+    'TAN,TANH,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEOUT,TO,TRAILING,TRANSACTION,'+
+    'TRIGGER,TRIM,TRUNC,TWO_PHASE,TYPE,UNCOMMITTED,UNDO,UNION,UNIQUE,UPDATE,'+
+    'UPDATING,UPPER,USER,USING,UUID_TO_CHAR,VALUE,VALUES,VARCHAR,VARIABLE,'+
+    'VARYING,VIEW,WAIT,WEEK,WEEKDAY,WHEN,WHERE,WHILE,WITH,WORK,WRITE,YEAR,YEARDAY';
+
+//---Firebird 3.0 keywords------------------------------------------------------
+  Firebird30KW: string =
+    'ABS,ABSOLUTE,ACCENT,ACOS,ACOSH,ACTION,ACTIVE,ADD,ADMIN,AFTER,ALL,ALTER,'+
+    'ALWAYS,AND,ANY,AS,ASC,ASCENDING,ASCII_CHAR,ASCII_VAL,ASIN,ASINH,AT,ATAN,'+
+    'ATAN2,ATANH,AUTO,AUTONOMOUS,AVG,BACKUP,BEFORE,BEGIN,BETWEEN,BIGINT,BIN_AND,'+
+    'BIN_NOT,BIN_OR,BIN_SHL,BIN_SHR,BIN_XOR,BIT_LENGTH,BLOB,BLOCK,BODY,BOOLEAN,'+
+    'BOTH,BREAK,BY,CALLER,CASCADE,CASE,CAST,CEIL,CEILING,CHAR,CHAR_LENGTH,'+
+    'CHAR_TO_UUID,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,COLLATE,'+
+    'COLLATION,COLUMN,COMMENT,COMMIT,COMMITTED,COMMON,COMPUTED,CONDITIONAL,'+
+    'CONNECT,CONSTRAINT,CONTAINING,CONTINUE,CORR,COS,COSH,COT,COUNT,COVAR_POP,'+
+    'COVAR_SAMP,CREATE,CROSS,CSTRING,CURRENT,CURRENT_CONNECTION,CURRENT_DATE,'+
+    'CURRENT_ROLE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_TRANSACTION,'+
+    'CURRENT_USER,CURSOR,DATABASE,DATA,DATE,DATEADD,DATEDIFF,DAY,DDL,DEC,'+
+    'DECIMAL,DECLARE,DECODE,DECRYPT,DEFAULT,DELETE,DELETING,DENSE_RANK,DESC,'+
+    'DESCENDING,DESCRIPTOR,DETERMINISTIC,DIFFERENCE,DISCONNECT,DISTINCT,DO,'+
+    'DOMAIN,DOUBLE,DROP,ELSE,ENCRYPT,END,ENGINE,ENTRY_POINT,ESCAPE,EXCEPTION,'+
+    'EXECUTE,EXISTS,EXIT,EXP,EXTERNAL,EXTRACT,FALSE,FETCH,FILE,FILTER,FIRST,'+
+    'FIRST_VALUE,FIRSTNAME,FLOAT,FLOOR,FOR,FOREIGN,FREE_IT,FROM,FULL,FUNCTION,'+
+    'GDSCODE,GENERATED,GENERATOR,GEN_ID,GEN_UUID,GLOBAL,GRANT,GRANTED,GROUP,'+
+    'HASH,HAVING,HOUR,IDENTITY,IF,IGNORE,IIF,IN,INACTIVE,INCREMENT,INDEX,INNER,'+
+    'INPUT_TYPE,INSENSITIVE,INSERT,INSERTING,INT,INTEGER,INTO,IS,ISOLATION,JOIN,'+
+    'KEY,LAG,LAST,LAST_VALUE,LASTNAME,LEAD,LEADING,LEAVE,LEFT,LENGTH,LEVEL,LIKE,'+
+    'LIMBO,LINGER,LIST,LN,LOCALTIME,LOCALTIMESTAMP,LOCK,LOG,LOG10,LONG,LOWER,'+
+    'LPAD,MANUAL,MAPPING,MATCHED,MATCHING,MAX,MAXVALUE,MERGE,MILLISECOND,'+
+    'MIDDLENAME,MIN,MINUTE,MINVALUE,MOD,MODULE_NAME,MONTH,NAME,NAMES,NATIONAL,'+
+    'NATURAL,NCHAR,NEXT,NO,NOT,NTH_VALUE,NULLIF,NULL,NULLS,NUMERIC,OCTET_LENGTH,'+
+    'OF,OFFSET,ON,ONLY,OPEN,OPTION,OR,ORDER,OS_NAME,OUTER,OUTPUT_TYPE,OVER,'+
+    'OVERFLOW,OVERLAY,PACKAGE,PAD,PAGE,PAGES,PAGE_SIZE,PARAMETER,PARTITION,'+
+    'PASSWORD,PI,PLACING,PLAN,PLUGIN,POSITION,POST_EVENT,POWER,PRECISION,'+
+    'PRESERVE,PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PROTECTED,RAND,RANK,RDB$DB_KEY,'+
+    'RDB$GET_CONTEXT,RDB$RECORD_VERSION,RDB$SET_CONTEXT,READ,REAL,'+
+    'RECORD_VERSION,RECREATE,RECURSIVE,REFERENCES,REGR_AVGX,REGR_AVGY,'+
+    'REGR_COUNT,REGR_INTERCEPT,REGR_R2,REGR_SLOPE,REGR_SXX,REGR_SXY,REGR_SYY,'+
+    'RELATIVE,RELEASE,REPLACE,REQUESTS,RESERV,RESERVING,RESTART,RESTRICT,RETAIN,'+
+    'RETURN,RETURNING,RETURNING_VALUES,RETURNS,REVERSE,REVOKE,RIGHT,ROLE,'+
+    'ROLLBACK,ROUND,ROW,ROW_COUNT,ROW_NUMBER,ROWS,RPAD,SAVEPOINT,SCALAR_ARRAY,'+
+    'SCHEMA,SCROLL,SECOND,SEGMENT,SELECT,SENSITIVE,SEQUENCE,SERVERWIDE,SET,'+
+    'SHADOW,SHARED,SIGN,SIMILAR,SIN,SINGULAR,SINH,SIZE,SKIP,SMALLINT,SNAPSHOT,'+
+    'SOME,SORT,SOURCE,SPACE,SQLCODE,SQLSTATE,SQRT,STABILITY,START,STARTING,'+
+    'STARTS,STATEMENT,STATISTICS,STDDEV_POP,STDDEV_SAMP,SUBSTRING,SUB_TYPE,SUM,'+
+    'SUSPEND,TABLE,TAGS,TAN,TANH,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEOUT,TO,'+
+    'TRAILING,TRANSACTION,TRIGGER,TRIM,TRUE,TRUNC,TRUSTED,TWO_PHASE,TYPE,'+
+    'UNCOMMITTED,UNDO,UNION,UNIQUE,UNKNOWN,UPDATE,UPDATING,UPPER,USAGE,USER,'+
+    'USING,UUID_TO_CHAR,VALUE,VALUES,VAR_POP,VAR_SAMP,VARCHAR,VARIABLE,VARYING,'+
+    'VIEW,WAIT,WEEK,WEEKDAY,WHEN,WHERE,WHILE,WITH,WORK,WRITE,YEAR,YEARDAY';
+
+//---Firebird 4.0 keywords------------------------------------------------------
+  Firebird40KW: string =
+    'ABS,ABSOLUTE,ACCENT,ACOS,ACOSH,ACTION,ACTIVE,ADD,ADMIN,AFTER,ALL,ALTER,'+
+    'ALWAYS,AND,ANY,AS,ASC,ASCENDING,ASCII_CHAR,ASCII_VAL,ASIN,ASINH,AT,ATAN,'+
+    'ATAN2,ATANH,AUTO,AUTONOMOUS,AVG,BACKUP,BASE64_DECODE,BASE64_ENCODE,BEFORE,'+
+    'BEGIN,BETWEEN,BIGINT,BIN_AND,BIN_NOT,BIN_OR,BIN_SHL,BIN_SHR,BIN_XOR,BINARY,'+
+    'BIND,BIT_LENGTH,BLOB,BLOCK,BODY,BOOLEAN,BOTH,BREAK,BY,CALLER,CASCADE,CASE,'+
+    'CAST,CEIL,CEILING,CHAR,CHAR_LENGTH,CHAR_TO_UUID,CHARACTER,CHARACTER_LENGTH,'+
+    'CHECK,CLEAR,CLOSE,COALESCE,COLLATE,COLLATION,COLUMN,COMMENT,COMMIT,'+
+    'COMMITTED,COMMON,COMPARE_DECFLOAT,COMPUTED,CONDITIONAL,CONNECT,CONNECTIONS,'+
+    'CONSISTENCY,CONSTRAINT,CONTAINING,CONTINUE,CORR,COS,COSH,COT,COUNT,COUNTER,'+
+    'COVAR_POP,COVAR_SAMP,CRC32,CREATE,CROSS,CSTRING,CTR_BIG_ENDIAN,CTR_LENGTH,'+
+    'CTR_LITTLE_ENDIAN,CUME_DIST,CURRENT,CURRENT_CONNECTION,CURRENT_DATE,'+
+    'CURRENT_ROLE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_TRANSACTION,'+
+    'CURRENT_USER,CURSOR,DATABASE,DATA,DATE,DATEADD,DATEDIFF,DAY,DDL,DEC,'+
+    'DECFLOAT,DECIMAL,DECLARE,DECODE,DECRYPT,DEFAULT,DEFINER,DELETE,DELETING,'+
+    'DENSE_RANK,DESC,DESCENDING,DESCRIPTOR,DETERMINISTIC,DIFFERENCE,DISCONNECT,'+
+    'DISTINCT,DO,DOMAIN,DOUBLE,DROP,ELSE,ENCRYPT,END,ENGINE,ENTRY_POINT,ESCAPE,'+
+    'EXCEPTION,EXCESS,EXCLUDE,EXECUTE,EXISTS,EXIT,EXP,EXTERNAL,EXTRACT,FALSE,'+
+    'FETCH,FILE,FILTER,FIRST,FIRST_DAY,FIRST_VALUE,FIRSTNAME,FLOAT,FLOOR,'+
+    'FOLLOWING,FOR,FOREIGN,FREE_IT,FROM,FULL,FUNCTION,GDSCODE,GENERATED,'+
+    'GENERATOR,GEN_ID,GEN_UUID,GLOBAL,GRANT,GRANTED,GROUP,HASH,HAVING,'+
+    'HEX_DECODE,HEX_ENCODE,HOUR,IDENTITY,IDLE,IF,IGNORE,IIF,IN,INACTIVE,'+
+    'INCREMENT,INDEX,INNER,INPUT_TYPE,INSENSITIVE,INSERT,INSERTING,INT,INT128,'+
+    'INTEGER,INTO,INVOKER,IS,ISOLATION,IV,JOIN,KEY,LAG,LAST,LAST_DAY,LAST_VALUE,'+
+    'LASTNAME,LEAD,LEADING,LEAVE,LEFT,LEGACY,LENGTH,LEVEL,LIFETIME,LIKE,LIMBO,'+
+    'LINGER,LIST,LN,LOCAL,LOCALTIME,LOCALTIMESTAMP,LOCK,LOG,LOG10,LONG,LOWER,'+
+    'LPAD,LPARAM,MANUAL,MAPPING,MATCHED,MATCHING,MAX,MAXVALUE,MERGE,MESSAGE,'+
+    'MILLISECOND,MIDDLENAME,MIN,MINUTE,MINVALUE,MOD,MODE,MODULE_NAME,MONTH,NAME,'+
+    'NAMES,NATIONAL,NATIVE,NATURAL,NCHAR,NEXT,NO,NORMALIZE_DECFLOAT,NOT,'+
+    'NTH_VALUE,NTILE,NULLIF,NULL,NULLS,NUMBER,NUMERIC,OCTET_LENGTH,OF,OFFSET,'+
+    'OLDEST,ON,ONLY,OPEN,OPTION,OR,ORDER,OS_NAME,OTHERS,OUTER,OUTPUT_TYPE,OVER,'+
+    'OVERFLOW,OVERLAY,OVERRIDING,PACKAGE,PAD,PAGE,PAGES,PAGE_SIZE,PARAMETER,'+
+    'PARTITION,PASSWORD,PERCENT_RANK,PI,PLACING,PLAN,PLUGIN,POOL,POSITION,'+
+    'POST_EVENT,POWER,PRECEDING,PRECISION,PRESERVE,PRIMARY,PRIOR,PRIVILEGE,'+
+    'PRIVILEGES,PROCEDURE,PROTECTED,QUANTIZE,RAND,RANGE,RANK,RDB$DB_KEY,'+
+    'RDB$ERROR,RDB$GET_CONTEXT,RDB$GET_TRANSACTION_CN,RDB$RECORD_VERSION,'+
+    'RDB$ROLE_IN_USE,RDB$SET_CONTEXT,RDB$SYSTEM_PRIVILEGE,READ,REAL,'+
+    'RECORD_VERSION,RECREATE,RECURSIVE,REFERENCES,REGR_AVGX,REGR_AVGY,'+
+    'REGR_COUNT,REGR_INTERCEPT,REGR_R2,REGR_SLOPE,REGR_SXX,REGR_SXY,REGR_SYY,'+
+    'RELATIVE,RELEASE,REPLACE,REQUESTS,RESERV,RESERVING,RESET,RESTART,RESTRICT,'+
+    'RETAIN,RETURN,RETURNING,RETURNING_VALUES,RETURNS,REVERSE,REVOKE,RIGHT,ROLE,'+
+    'ROLLBACK,ROUND,ROW,ROW_COUNT,ROW_NUMBER,ROWS,RPAD,RSA_DECRYPT,RSA_ENCRYPT,'+
+    'RSA_PRIVATE,RSA_PUBLIC,RSA_SIGN,RSA_VERIFY,SALT_LENGTH,SAVEPOINT,'+
+    'SCALAR_ARRAY,SCHEMA,SCROLL,SECOND,SECURITY,SEGMENT,SELECT,SENSITIVE,'+
+    'SEQUENCE,SERVERWIDE,SESSION,SET,SHADOW,SHARED,SIGN,SIGNATURE,SIMILAR,SIN,'+
+    'SINGULAR,SINH,SIZE,SKIP,SMALLINT,SNAPSHOT,SOME,SORT,SOURCE,SPACE,SQL,'+
+    'SQLCODE,SQLSTATE,SQRT,STABILITY,START,STARTING,STARTS,STATEMENT,STATISTICS,'+
+    'STDDEV_POP,STDDEV_SAMP,SUBSTRING,SUB_TYPE,SUM,SUSPEND,SYSTEM,TABLE,TAGS,'+
+    'TAN,TANH,TEMPORARY,THEN,TIES,TIME,TIMESTAMP,TIMEOUT,TIMEZONE_HOUR,'+
+    'TIMEZONE_MINUTE,TO,TOTALORDER,TRAILING,TRANSACTION,TRAPS,TRIGGER,TRIM,TRUE,'+
+    'TRUNC,TRUSTED,TWO_PHASE,TYPE,UNBOUNDED,UNCOMMITTED,UNDO,UNION,UNIQUE,'+
+    'UNKNOWN,UPDATE,UPDATING,UPPER,USAGE,USER,USING,UUID_TO_CHAR,VALUE,VALUES,'+
+    'VAR_POP,VAR_SAMP,VARBINARY,VARCHAR,VARIABLE,VARYING,VIEW,WAIT,WEEK,WEEKDAY,'+
+    'WHEN,WHERE,WHILE,WINDOW,WITH,WITHOUT,WORK,WRITE,YEAR,YEARDAY,ZONE';
+
 procedure MakeIdentTable;
 var
   c: char;
@@ -1655,8 +1797,11 @@
   else if fDialect = sqlOracle then begin
     Include(Result, '#');
     Include(Result, '$');
-  end;
+  end
 {end}                                                                           // DJLP 2000-08-11
+  else if (fDialect = sqlFirebird25) or
+          (fDialect = sqlFirebird30) or
+          (fDialect = sqlFirebird40) then Include(Result, '$');
 end;
 
 class function TSynSQLSyn.GetLanguageName: string;
@@ -1792,6 +1937,12 @@
       EnumerateKeywords(Ord(tkKey), StandardKW, IdentChars + ['-'], @DoAddKeyword);
     sqlSybase:
       EnumerateKeywords(Ord(tkKey), SybaseKW, IdentChars, @DoAddKeyword);
+    sqlFirebird25:
+      EnumerateKeywords(Ord(tkKey), Firebird25KW, IdentChars, @DoAddKeyword);
+    sqlFirebird30:
+      EnumerateKeywords(Ord(tkKey), Firebird30KW, IdentChars, @DoAddKeyword);
+    sqlFirebird40:
+      EnumerateKeywords(Ord(tkKey), Firebird40KW, IdentChars, @DoAddKeyword);
   end;
   PutTableNamesInKeywordList;
   DefHighlightChange(Self);

Juha Manninen

2019-11-13 00:06

developer   ~0119250

Looks good to me. It should be applied IMO.

Martin Friebe

2019-11-13 13:10

manager   ~0119267

Thanks, applied. r62236

Please close if ok.

Issue History

Date Modified Username Field Change
2019-11-11 21:03 Gabor Boros New Issue
2019-11-11 21:03 Gabor Boros File Added: synhighlightersql.pas.patch
2019-11-13 00:06 Juha Manninen Note Added: 0119250
2019-11-13 13:01 Martin Friebe Assigned To => Martin Friebe
2019-11-13 13:01 Martin Friebe Status new => assigned
2019-11-13 13:10 Martin Friebe Status assigned => resolved
2019-11-13 13:10 Martin Friebe Resolution open => fixed
2019-11-13 13:10 Martin Friebe Fixed in Version => 2.2
2019-11-13 13:10 Martin Friebe Fixed in Revision => 62236
2019-11-13 13:10 Martin Friebe LazTarget => 2.2
2019-11-13 13:10 Martin Friebe Note Added: 0119267
2019-11-17 16:34 Gabor Boros Status resolved => closed