Skip to content

Commit

Permalink
feat: #14988 stream dataTypes and builtinFunctions highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxy0551 committed Oct 30, 2024
1 parent a8f6ea8 commit 87f0762
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/languages/flink/flink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,11 @@ export const language = <languages.IMonarchLanguage>{
'EXP',
'CEIL',
'CEILING',
'FLOOR',
'SIN',
'SINH',
'SQRT',
'COS',
'MOD',
'TAN',
'TANH',
'COT',
Expand Down Expand Up @@ -335,6 +336,7 @@ export const language = <languages.IMonarchLanguage>{
'CONCAT',
'CONCAT_WS',
'LPAD',
'RIGHT',
'RPAD',
'FROM_BASE64',
'TO_BASE64',
Expand All @@ -343,6 +345,7 @@ export const language = <languages.IMonarchLanguage>{
'DECODE',
'ENCODE',
'INSTR',
'LEFT',
'LOCATE',
'PARSE_URL',
'REGEXP',
Expand Down Expand Up @@ -375,23 +378,30 @@ export const language = <languages.IMonarchLanguage>{
'TO_TIMESTAMP_LTZ',
'TO_TIMESTAMP',
'CURRENT_WATERMARK',
'OVERLAPS',
// Conditional Functions
'COALESCE',
'GREATEST',
'IF',
'IFNULL',
'IS_ALPHA',
'IS_DECIMAL',
'IS_DIGIT',
'GREATEST',
'LEAST',
'NULLIF',
// Type Conversion Functions
'CAST',
'TRY_CAST',
'TYPEOF',
// Collection Functions
'CARDINALITY',
'ELEMENT',
'array',
'map',
'ARRAY_CONTAINS',
// comparison function
'EXISTS',
'IN',
// JSON Functions
'JSON_EXISTS',
'JSON_STRING',
Expand All @@ -404,14 +414,15 @@ export const language = <languages.IMonarchLanguage>{
// Grouping Functions
'GROUP_ID',
'GROUPING',
'GROUPING_ID',
// Hash Functions
'MD5',
'SHA1',
'SHA2',
'SHA224',
'SHA256',
'SHA384',
'SHA512',
'SHA2',
// Aggregate Functions
'COUNT',
'AVG',
Expand Down Expand Up @@ -459,14 +470,14 @@ export const language = <languages.IMonarchLanguage>{
'TIME',
'TIMESTAMP',
'TIMESTAMP_LTZ',
'INTERVAL',
'ARRAY',
'MULTISET',
'MAP',
'ROW',
'RAW',
'DEC',
'NUMERIC',
'INT',
'INTERVAL'
],
scopeKeywords: ['CASE', 'END', 'WHEN', 'THEN', 'ELSE'],
Expand All @@ -483,6 +494,7 @@ export const language = <languages.IMonarchLanguage>{
{ include: '@complexIdentifiers' },
{ include: '@scopes' },
{ include: '@complexDataTypes' },
{ include: '@complexFunctions' },
[/[;,.]/, TokenClassConsts.DELIMITER],
[/[\(\)\[\]\{\}]/, '@brackets'],
[
Expand Down Expand Up @@ -550,6 +562,7 @@ export const language = <languages.IMonarchLanguage>{
[/DOUBLE\s+PRECISION\b/i, { token: TokenClassConsts.TYPE }],
[/WITHOUT\s+TIME\s+ZONE\b/i, { token: TokenClassConsts.TYPE }],
[/WITH\s+LOCAL\s+TIME\s+ZONE\b/i, { token: TokenClassConsts.TYPE }]
]
],
complexFunctions: [[/NOT\s+IN\b/i, { token: TokenClassConsts.PREDEFINED }]]
}
};

0 comments on commit 87f0762

Please sign in to comment.