dolphindb 3.0.111 → 3.0.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/i18n/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { I18N } from 'xshell/i18n/index.js';
2
2
  export declare let i18n: I18N;
3
3
  declare const t: (text: string, options?: {
4
- language?: import("xshell/i18n/index.js").Language;
4
+ language?: import("xshell/i18n").Language;
5
5
  context?: string;
6
6
  count?: number;
7
7
  [key: string]: any;
8
- }) => string, language: import("xshell/i18n/index.js").Language;
8
+ }) => string, language: import("xshell/i18n").Language;
9
9
  export { t, language };
package/language.js CHANGED
@@ -549,7 +549,7 @@ function get_tm_language(python = false) {
549
549
  function_call: {
550
550
  patterns: [
551
551
  {
552
- begin: '(@)?(\\w*!?)\\s*(?=\\()',
552
+ begin: '(@)?(\\w*!?)\\b(?=\\s*\\()',
553
553
  beginCaptures: {
554
554
  1: { name: 'variable.other.readwrite.instance.dolphindb' },
555
555
  2: { patterns: [{ include: '#function_name' }] }
package/language.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"language.js","sourceRoot":"","sources":["language.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG;IACjB,cAAc;IACd,YAAY;IACZ,WAAW;IACX,cAAc;IAEd,QAAQ;IACR,MAAM;IACN,QAAQ;IAER,QAAQ;IACR,aAAa;IAEb,cAAc;IACd,iBAAiB;IAEjB,aAAa;IAEb,2CAA2C;IAC3C,KAAK;IACL,QAAQ;IACR,IAAI;IACJ,MAAM;IAGN,YAAY;IACZ,eAAe;IAEf,aAAa;IAEb,QAAQ;IAER,aAAa;IAEb,MAAM;IACN,YAAY;IACZ,WAAW;IACX,iBAAiB;IACjB,WAAW;IACX,iBAAiB;IACjB,gBAAgB;IAChB,YAAY;IACZ,kBAAkB;IAClB,eAAe;IACf,YAAY;IAEZ,YAAY;IACZ,gBAAgB;IAChB,UAAU;IACV,UAAU;IACV,UAAU;IAC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D,QAAQ,EAAE;4BACN,CAAC,EAAE;gCACC,IAAI,EAAE,iDAAiD;6BAC1D;4BACD,CAAC,EAAE;gCACC,IAAI,EAAE,sCAAsC;6BAC/C;4BACD,CAAC,EAAE;gCACC,IAAI,EAAE,mCAAmC;6BAC5C;yBACJ;qBACJ;oBACD;wBACI,KAAK,EAAE,kCAAkC;wBACzC,QAAQ,EAAE;4BACN,CAAC,EAAE;gCACC,IAAI,EAAE,iDAAiD;6BAC1D;4BACD,CAAC,EAAE;gCACC,IAAI,EAAE,sCAAsC;6BAC/C;4BACD,CAAC,EAAE;gCACC,IAAI,EAAE,sCAAsC;6BAC/C;yBACJ;qBACJ;iBACJ;aACJ;SACJ;KACK,CAAA;AACd,CAAC;AAGD,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;AAEjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC,IAAI,CAAC,CAAA","sourcesContent":["const sql_keywords = [\n // 不要单独算关键字比较好\n // 'column',\n // 'table',\n // 'database',\n \n 'select',\n 'exec',\n 'update',\n \n 'insert',\n 'insert into',\n \n 'create table',\n 'create database',\n \n 'alter table',\n \n // alter table ... add column_name datatype\n 'add',\n 'rename',\n 'to',\n 'drop',\n \n \n 'drop table',\n 'drop database',\n \n 'use catalog',\n \n 'delete',\n \n 'transaction',\n \n 'join',\n 'inner join',\n 'full join',\n 'full outer join',\n 'left join',\n 'left outer join',\n 'left semi join',\n 'right join',\n 'right outer join',\n 'left semijoin',\n 'cross join',\n \n 'context by',\n 'partitioned by',\n 'group by',\n 'pivot by',\n 'order by',\n 'cgroup by',\n 'partition by',\n \n 'csort',\n 'limit',\n 'top',\n \n 'into',\n 'from',\n 'where',\n 'having',\n 'with',\n 'set',\n 'as',\n 'in',\n 'or',\n 'not',\n 'on',\n 'like',\n 'values',\n 'if',\n 'exists',\n 'distinct',\n 'map',\n \n \n 'between', 'and', // between ... and ...\n \n 'is null', 'is not null',\n \n // case when ... then ... end\n 'case', 'when', 'then', 'else', 'end',\n \n 'union', 'union all',\n \n 'nulls first', 'nulls last',\n \n 'asc', 'desc',\n]\n\n\nexport const keywords = [\n 'assert',\n \n 'const',\n 'mutable',\n \n 'def',\n 'defg',\n \n // 'map',\n 'mapr',\n \n 'timer',\n \n // 流程控制\n // 'if',\n // 'else',\n 'do',\n 'for',\n 'while',\n 'return',\n 'continue',\n 'break',\n 'try',\n 'catch',\n 'throw',\n 'go',\n \n // 模块\n 'use',\n 'module',\n \n \n // 仅 Python 有的\n 'async',\n 'await',\n 'class',\n 'del',\n 'elif',\n 'except',\n 'finally',\n 'global',\n 'import',\n 'is',\n 'lambda',\n 'nonlocal',\n 'pass',\n 'raise',\n 'yield',\n \n \n // --- SQL\n ... sql_keywords,\n ... sql_keywords.map(keyword => keyword.toUpperCase())\n].sort((l, r) => { // 长的在前面,正则表达式先匹配全部,而不是部分单词,防止高亮显示不正确\n const delta_len = l.length - r.length\n if (delta_len !== 0)\n return -delta_len\n \n return 0 // 否则保留原本顺序\n})\n\n\nexport const constants = [\n 'DFLT',\n 'NULL',\n 'true',\n 'false',\n 'pi',\n 'e',\n \n // --- form\n 'SCALAR',\n 'VECTOR',\n 'PAIR',\n 'MATRIX',\n 'SET',\n 'DICT',\n 'TABLE',\n // 'CHART',\n // 'CHUNK',\n \n // --- type\n 'VOID',\n 'BOOL',\n 'CHAR',\n 'SHORT',\n 'INT', 'INDEX',\n 'LONG',\n 'DATE',\n 'MONTH',\n 'TIME',\n 'MINUTE',\n 'SECOND',\n 'DATETIME',\n 'TIMESTAMP',\n 'NANOTIME',\n 'NANOTIMESTAMP',\n 'FLOAT',\n 'DOUBLE',\n 'SYMBOL',\n 'STRING',\n 'UUID',\n 'FUNCTIONDEF',\n 'HANDLE',\n 'CODE',\n 'DATASOURCE',\n 'RESOURCE',\n 'ANY',\n // 'COMPRESS',\n 'DICTIONARY',\n 'DATEHOUR',\n 'IPADDR',\n 'INT128',\n 'BLOB',\n 'COMPLEX',\n 'POINT',\n 'DURATION',\n 'OBJECT',\n 'DECIMAL32',\n 'DECIMAL64',\n 'DECIMAL128',\n \n // partition type\n 'SEQ',\n 'RANGE',\n 'HASH',\n 'VALUE',\n 'LIST',\n 'COMPO',\n \n \n // defined\n // https://www.dolphindb.cn/cn/help/FunctionsandCommands/FunctionReferences/d/defined.html\n 'VAR',\n 'SHARED',\n 'DEF',\n 'GLOBAL',\n \n \n // 用户权限管理\n // https://www.dolphindb.cn/cn/help/200/SystemManagement/UserAccessControl.html\n // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/CommandsReferences/d/deny.html\n 'TABLE_READ',\n 'TABLE_WRITE',\n 'TABLE_INSERT',\n 'TABLE_UPDATE',\n 'TABLE_DELETE',\n \n 'DBOBJ_CREATE',\n 'DBOBJ_DELETE',\n \n 'DB_DELETE',\n 'DB_INSERT',\n 'DB_MANAGE',\n 'DB_OWNER',\n 'DB_READ',\n 'DB_UPDATE',\n 'DB_WRITE',\n \n 'CATALOG_MANAGE',\n 'CATALOG_READ',\n 'CATALOG_WRITE',\n 'CATALOG_INSERT',\n 'CATALOG_UPDATE',\n 'CATALOG_DELETE',\n \n 'SCHEMA_MANAGE',\n 'SCHEMAOBJ_CREATE',\n 'SCHEMAOBJ_DELETE',\n 'SCHEMA_READ',\n 'SCHEMA_WRITE',\n 'SCHEMA_INSERT',\n 'SCHEMA_UPDATE',\n 'SCHEMA_DELETE',\n \n 'SCRIPT_EXEC',\n 'TASK_GROUP_MEM_LIMIT',\n 'TEST_EXEC',\n 'VIEW_EXEC',\n 'VIEW_OWNER',\n 'QUERY_RESULT_MEM_LIMIT',\n \n \n // hint\n // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/s/sql.html\n 'HINT_HASH',\n 'HINT_SNAPSHOT',\n 'HINT_KEEPORDER',\n 'HINT_SEQ',\n 'HINT_EXPLAIN',\n 'HINT_VECTORIZED',\n \n \n // --- seek mode\n 'HEAD',\n 'CURRENT',\n 'TAIL',\n \n // --- chart type\n // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/p/plot.html\n 'LINE',\n 'PIE',\n 'COLUMN',\n 'BAR',\n 'AREA',\n 'SCATTER',\n 'HISTOGRAM',\n 'KLINE',\n \n \n // --- log level\n 'DEBUG',\n 'INFO',\n 'WARNING',\n 'ERROR',\n \n // keep duplicates\n // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/c/createPartitionedTable.html?highlight=first\n 'FIRST',\n 'LAST',\n 'ALL',\n \n // keep\n // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/i/isDuplicated.html?highlight=none\n 'NONE',\n \n 'HASH_PTN',\n \n // 仅 Python 有的\n 'True',\n 'False',\n 'None',\n \n] as const\n\n\nfunction get_tm_language (python = false) {\n return {\n $schema: 'https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json',\n \n name: python ? 'DolphinDB Python' : 'DolphinDB',\n \n scopeName: python ? 'source.dolphindb-python' : 'source.dolphindb',\n \n patterns: [\n {\n match: '\\\\.\\\\.\\\\.',\n name: 'invalid.ellipsis.dolphindb'\n },\n {\n include: '#keyword'\n },\n {\n include: '#literal'\n },\n {\n include: '#comment'\n },\n {\n include: '#decorator'\n },\n {\n include: '#variable'\n },\n {\n include: '#operator'\n },\n {\n include: '#method_call'\n },\n {\n include: '#function_call'\n },\n {\n include: '#property'\n },\n {\n match: ';',\n name: 'punctuation.terminator.statement.dolphindb'\n },\n {\n match: ',',\n name: 'punctuation.separator.commma.dolphindb'\n }\n ],\n \n \n repository: {\n keyword: {\n // \\b: word boundary\n // (?<![.$]): boundary 不是 . 或 $\n // ?!\\s*: 不是 label\n match: `\\\\b(?<![.$])(${keywords.join('|')})(?!(\\\\s*:|\\\\())\\\\b`,\n name: 'keyword.control.dolphindb'\n },\n \n literal: {\n patterns: [\n { include: '#constant' },\n { include: '#datetime' },\n { include: '#string' },\n { include: '#number' },\n ]\n },\n \n constant: {\n match: `\\\\b(?<![.$])(${constants.join('|')})(?!\\\\s*:)\\\\b`,\n name: 'constant.language.int.dolphindb'\n },\n \n decorator: {\n match: '^@testing',\n name: 'meta.decorator.dolphindb',\n },\n \n datetime: {\n patterns: [\n {\n match: '\\\\b[0-9]{4}[.][0-9]{2}[.][0-9]{2}[T ][0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{3,9})?\\\\b',\n name: 'constant.numeric.datetime.datetime.dolphindb',\n },\n {\n match: '\\\\b[0-9]{4}\\\\.[0-9]{2}M\\\\b',\n name: 'constant.numeric.datetime.month.dolphindb',\n },\n {\n match: '\\\\b[0-9]{4}\\\\.[0-9]{2}\\\\.[0-9]{2}\\\\b',\n name: 'constant.numeric.datetime.date.dolphindb',\n },\n {\n match: '\\\\b[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{3,9})?\\\\b',\n name: 'constant.numeric.datetime.time.dolphindb',\n },\n {\n match: '\\\\b[0-9]{2}:[0-9]{2}m\\\\b',\n name: 'constant.numeric.datetime.minute.dolphindb',\n },\n ]\n },\n \n string: {\n patterns: [\n {\n include: '#string_single_quoted'\n },\n {\n include: '#string_double_quoted'\n },\n {\n begin: \"'''\",\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.string.begin.dolphindb'\n }\n },\n end: \"'''\",\n endCaptures: {\n 0: {\n name: 'punctuation.definition.string.end.dolphindb'\n }\n },\n name: 'string.quoted.single.heredoc.dolphindb',\n patterns: [\n {\n captures: {\n 1: {\n name: 'punctuation.definition.escape.backslash.dolphindb'\n }\n },\n match: '(\\\\\\\\).',\n name: 'constant.character.escape.backslash.dolphindb'\n }\n ]\n },\n {\n begin: '\"\"\"',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.string.begin.dolphindb'\n }\n },\n end: '\"\"\"',\n endCaptures: {\n 0: {\n name: 'punctuation.definition.string.end.dolphindb'\n }\n },\n name: 'string.quoted.double.heredoc.dolphindb',\n patterns: [\n {\n captures: {\n 1: {\n name: 'punctuation.definition.escape.backslash.dolphindb'\n }\n },\n match: '(\\\\\\\\).',\n name: 'constant.character.escape.backslash.dolphindb'\n },\n {\n include: '#interpolated_dolphindb'\n }\n ]\n },\n {\n match: '`[\\\\w\\\\.]*',\n name: 'string.quoted.other.dolphindb'\n }\n ]\n },\n \n number: {\n patterns: [\n {\n match: '\\\\b[01]+[bB]\\\\b',\n name: 'constant.numeric.binary.dolphindb'\n },\n {\n // 97c\n match: '\\\\b[0-9]+([clhsmyM]|ms)\\\\b',\n name: 'constant.numeric.dolphindb'\n },\n {\n // 1.2f, 1f\n match: '\\\\b[0-9]+(\\\\.[0-9]+)?f\\\\b',\n name: 'constant.numeric.dolphindb'\n },\n {\n match: \n '(?x)\\n' +\n '(?:\\n' +\n ' (?:\\\\b[0-9]+(\\\\.)[0-9]+[eE][+-]?[0-9]+\\\\b)| # 1.1E+3\\n' +\n ' (?:\\\\b[0-9]+(\\\\.)[eE][+-]?[0-9]+\\\\b)| # 1.E+3\\n' +\n ' (?:\\\\b(\\\\.)[0-9]+[eE][+-]?[0-9]+\\\\b)| # .1E+3\\n' +\n ' (?:\\\\b[0-9]+[eE][+-]?[0-9]+\\\\b)| # 1E+3\\n' +\n ' (?:\\\\b[0-9]+(\\\\.)[0-9]+\\\\b)| # 1.1\\n' +\n ' (?:\\\\b[0-9]+(?=\\\\.{2,3}))| # 1 followed by a slice\\n' +\n ' (?:\\\\b[0-9]+(\\\\.)\\\\b)| # 1.\\n' +\n ' (?:\\\\b(\\\\.)[0-9]+\\\\b)| # .1\\n' +\n ' (?:\\\\b[0-9]+\\\\b(?!\\\\.)) # 1\\n' +\n ')\\n',\n \n captures: {\n 0: {\n name: 'constant.numeric.decimal.dolphindb'\n },\n 1: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n },\n 2: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n },\n 3: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n },\n 4: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n },\n 5: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n },\n 6: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n }\n }\n },\n ]\n },\n \n string_single_quoted: {\n patterns: [\n {\n begin: \"'\",\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.string.begin.dolphindb'\n }\n },\n end: \"'\",\n endCaptures: {\n 0: {\n name: 'punctuation.definition.string.end.dolphindb'\n }\n },\n name: 'string.quoted.single.dolphindb',\n patterns: [\n {\n captures: {\n 1: {\n name: 'punctuation.definition.escape.backslash.dolphindb'\n }\n },\n match: '(\\\\\\\\)(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)',\n name: 'constant.character.escape.backslash.dolphindb'\n }\n ]\n }\n ]\n },\n \n string_double_quoted: {\n patterns: [\n {\n begin: '\"',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.string.begin.dolphindb'\n }\n },\n end: '\"',\n endCaptures: {\n 0: {\n name: 'punctuation.definition.string.end.dolphindb'\n }\n },\n name: 'string.quoted.double.dolphindb',\n patterns: [\n {\n captures: {\n 1: {\n name: 'punctuation.definition.escape.backslash.dolphindb'\n }\n },\n match: '(\\\\\\\\)(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)',\n name: 'constant.character.escape.backslash.dolphindb'\n },\n {\n include: '#interpolated_dolphindb'\n }\n ]\n }\n ]\n },\n \n function_call: {\n patterns: [\n {\n begin: '(@)?(\\\\w*!?)\\\\s*(?=\\\\()',\n beginCaptures: {\n 1: { name: 'variable.other.readwrite.instance.dolphindb' },\n 2: { patterns: [{ include: '#function_name' }] }\n },\n end: '(?<=\\\\))',\n name: 'meta.function-call.dolphindb',\n patterns: [{ include: '#arguments' }]\n }\n ]\n },\n \n \n method_call: {\n patterns: [\n {\n begin: '(?:(\\\\.)|(::))\\\\s*(\\\\w*!?)(?=\\\\()',\n beginCaptures: {\n 1: { name: 'punctuation.separator.method.period.dolphindb' },\n 2: { name: 'keyword.operator.prototype.dolphindb' },\n 3: { patterns: [{ include: '#function_name' }] }\n },\n end: '(?<=\\\\))',\n name: 'meta.method-call.dolphindb',\n patterns: [{ include: '#arguments' }]\n }\n ]\n },\n \n \n function_name: {\n patterns: [\n {\n match: '[^\\\\d\\\\W]\\\\w*!?',\n name: 'entity.name.function.dolphindb'\n },\n {\n match: '\\\\d[\\\\w]*',\n name: 'invalid.illegal.identifier.dolphindb'\n }\n ]\n },\n \n function_params: {\n patterns: [\n {\n begin: '\\\\(',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.parameters.begin.bracket.round.dolphindb'\n }\n },\n end: '\\\\)',\n endCaptures: {\n 0: {\n name: 'punctuation.definition.parameters.end.bracket.round.dolphindb'\n }\n },\n name: 'meta.parameters.dolphindb',\n patterns: [\n {\n include: '#variable'\n },\n {\n match: '(@(?:[a-zA-Z_$][\\\\w$]*)?)(\\\\.\\\\.\\\\.)?',\n captures: {\n 1: {\n name: 'variable.parameter.function.readwrite.instance.dolphindb'\n },\n 2: {\n name: 'keyword.operator.splat.dolphindb'\n }\n }\n },\n {\n include: '$self'\n }\n ]\n }\n ]\n },\n \n comment: {\n patterns: python ? [\n {\n begin: '#',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.comment.dolphindb'\n }\n },\n end: '$',\n name: 'comment.line.number-sign.dolphindb'\n }\n ] : [\n {\n begin: '/\\\\*',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.comment.dolphindb'\n }\n },\n end: '\\\\*/',\n endCaptures: {\n 0: {\n name: 'punctuation.definition.comment.dolphindb'\n }\n },\n name: 'comment.block.dolphindb'\n },\n {\n begin: '//',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.comment.dolphindb'\n }\n },\n end: '$',\n name: 'comment.line.number-sign.dolphindb'\n },\n ]\n },\n \n arguments: {\n patterns: [\n {\n begin: '\\\\(',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.arguments.begin.bracket.round.dolphindb'\n }\n },\n end: '\\\\)',\n endCaptures: {\n 0: {\n name: 'punctuation.definition.arguments.end.bracket.round.dolphindb'\n }\n },\n name: 'meta.arguments.dolphindb',\n patterns: [\n {\n include: '$self'\n },\n {\n include: '#literal'\n },\n {\n include: '#variable'\n }\n ]\n }\n ]\n },\n \n variable: {\n patterns: [\n {\n match: '(@)([a-zA-Z_\\\\$]\\\\w*)?',\n name: 'variable.other.readwrite.instance.dolphindb'\n }\n ]\n },\n \n interpolated_dolphindb: {\n patterns: [\n {\n begin: '\\\\#\\\\{',\n captures: {\n 0: {\n name: 'punctuation.section.embedded.dolphindb'\n }\n },\n end: '\\\\}',\n name: 'source.dolphindb.embedded.source',\n patterns: [\n {\n include: '$self'\n }\n ]\n }\n ]\n },\n \n \n operator: {\n patterns: [\n {\n match: '<<|>>',\n name: 'keyword.operator.bitwise.shift.dolphindb'\n },\n {\n match: '!=|<=|>=|==|>|<',\n name: 'keyword.operator.comparison.dolphindb'\n },\n {\n match: '<-|->',\n name: 'keyword.operator.join.dolphindb'\n },\n {\n match: '&&|!|\\\\|\\\\|',\n name: 'keyword.operator.logical.dolphindb'\n },\n {\n match: '&|\\\\||\\\\^',\n name: 'keyword.operator.bitwise.dolphindb'\n },\n {\n match: '\\\\.\\\\.',\n name: 'keyword.operator.splat.dolphindb'\n },\n {\n match: '\\\\?',\n name: 'keyword.operator.existential.dolphindb'\n },\n {\n match: '/|<-|%|\\\\*|/|-|\\\\$|\\\\+',\n name: 'keyword.operator.dolphindb'\n },\n {\n match: '([a-zA-Z$_][\\\\w$]*)?\\\\s*(=|:(?!:))(?![>=])',\n captures: {\n 1: {\n name: 'variable.assignment.dolphindb'\n },\n 2: {\n name: 'keyword.operator.assignment.dolphindb'\n }\n }\n }\n ]\n },\n \n property: {\n patterns: [\n {\n match: '(?:(\\\\.)|(::))\\\\s*([A-Z][A-Z0-9_$]*\\\\b\\\\$*)(?=\\\\s*\\\\??(\\\\.\\\\s*[a-zA-Z_$]\\\\w*|::))',\n captures: {\n 1: {\n name: 'punctuation.separator.property.period.dolphindb'\n },\n 2: {\n name: 'keyword.operator.prototype.dolphindb'\n },\n 3: {\n name: 'constant.other.object.property.dolphindb'\n }\n }\n },\n {\n match: '(?:(\\\\.)|(::))\\\\s*(\\\\$*[a-zA-Z_$][\\\\w$]*)(?=\\\\s*\\\\??(\\\\.\\\\s*[a-zA-Z_$]\\\\w*|::))',\n captures: {\n 1: {\n name: 'punctuation.separator.property.period.dolphindb'\n },\n 2: {\n name: 'keyword.operator.prototype.dolphindb'\n },\n 3: {\n name: 'variable.other.object.property.dolphindb'\n }\n }\n },\n {\n match: '(?:(\\\\.)|(::))\\\\s*([A-Z][A-Z0-9_$]*\\\\b\\\\$*)',\n captures: {\n 1: {\n name: 'punctuation.separator.property.period.dolphindb'\n },\n 2: {\n name: 'keyword.operator.prototype.dolphindb'\n },\n 3: {\n name: 'constant.other.property.dolphindb'\n }\n }\n },\n {\n match: '(?:(\\\\.)|(::))\\\\s*(\\\\$*[a-zA-Z_$][\\\\w$]*)',\n captures: {\n 1: {\n name: 'punctuation.separator.property.period.dolphindb'\n },\n 2: {\n name: 'keyword.operator.prototype.dolphindb'\n },\n 3: {\n name: 'variable.other.property.dolphindb'\n }\n }\n },\n {\n match: '(?:(\\\\.)|(::))\\\\s*([0-9][\\\\w$]*)',\n captures: {\n 1: {\n name: 'punctuation.separator.property.period.dolphindb'\n },\n 2: {\n name: 'keyword.operator.prototype.dolphindb'\n },\n 3: {\n name: 'invalid.illegal.identifier.dolphindb'\n }\n }\n }\n ]\n }\n }\n } as Block\n}\n\n\nexport const tm_language = get_tm_language(false)\n\nexport const tm_language_python = get_tm_language(true)\n\n\ninterface Block {\n patterns: Pattern[]\n repository?: Record<string, Pattern | Block>\n}\n\ntype Pattern = Match | Include | Block\n\ntype Match = MatchOne | MatchBeginEnd\n\ninterface MatchOne {\n /** a single-line regular expression */\n match: RegExp | string\n \n /** This is the scope that will be applied to the matched text */\n name?: string\n \n /** This use of the captures > patterns structure is extremely important. \n Without it, a stretch of text matched by a match rule is considered finished, and \n TextMate’s search proceeds to the rest of the line after the matched text. \n With it, the stretch of matched text itself becomes a candidate for further matches. \n */\n captures?: Captures\n}\n\ninterface MatchBeginEnd {\n begin: RegExp | string\n \n end: RegExp | string\n \n /** This is the scope (or an expression evaluating to a scope) to be applied to \n the entire matched stretch(es) of text starting at the start of the begin match.\n */\n name?: string\n \n /** This is the scope to be applied to what’s between the begin match and the end match (or the end of the document). */\n contentName?: string\n \n /** it applies to the region between the begin and end matches. */\n patterns?: Pattern[]\n \n beginCaptures?: Captures\n \n endCaptures?: Captures\n \n whileCaptures?: Captures\n \n /** If the name or number of the matched group happens to be the same for both the begin pattern and the other pattern, \n you can (if appropriate) use captures as a shorthand to avoid saying the same thing twice.\n */\n captures?: Captures\n \n applyEndPatternLast?: 1\n}\n\ninterface Include {\n include: string\n}\n\ntype Captures = Record<string | number, {\n /** This is the scope that will be assigned to the matched group text. */\n name?: string\n \n /** This is a list of match rules to be sought within the matched group text \n — thus permitting the search for matches to continue inside the matched text.\n */\n patterns?: Pattern[]\n}>\n\n"]}
1
+ {"version":3,"file":"language.js","sourceRoot":"","sources":["language.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG;IACjB,cAAc;IACd,YAAY;IACZ,WAAW;IACX,cAAc;IAEd,QAAQ;IACR,MAAM;IACN,QAAQ;IAER,QAAQ;IACR,aAAa;IAEb,cAAc;IACd,iBAAiB;IAEjB,aAAa;IAEb,2CAA2C;IAC3C,KAAK;IACL,QAAQ;IACR,IAAI;IACJ,MAAM;IAGN,YAAY;IACZ,eAAe;IAEf,aAAa;IAEb,QAAQ;IAER,aAAa;IAEb,MAAM;IACN,YAAY;IACZ,WAAW;IACX,iBAAiB;IACjB,WAAW;IACX,iBAAiB;IACjB,gBAAgB;IAChB,YAAY;IACZ,kBAAkB;IAClB,eAAe;IACf,YAAY;IAEZ,YAAY;IACZ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;qBACJ;oBACD;wBACI,KAAK,EAAE,2CAA2C;wBAClD,QAAQ,EAAE;4BACN,CAAC,EAAE;gCACC,IAAI,EAAE,iDAAiD;6BAC1D;4BACD,CAAC,EAAE;gCACC,IAAI,EAAE,sCAAsC;6BAC/C;4BACD,CAAC,EAAE;gCACC,IAAI,EAAE,mCAAmC;6BAC5C;yBACJ;qBACJ;oBACD;wBACI,KAAK,EAAE,kCAAkC;wBACzC,QAAQ,EAAE;4BACN,CAAC,EAAE;gCACC,IAAI,EAAE,iDAAiD;6BAC1D;4BACD,CAAC,EAAE;gCACC,IAAI,EAAE,sCAAsC;6BAC/C;4BACD,CAAC,EAAE;gCACC,IAAI,EAAE,sCAAsC;6BAC/C;yBACJ;qBACJ;iBACJ;aACJ;SACJ;KACK,CAAA;AACd,CAAC;AAGD,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;AAEjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC,IAAI,CAAC,CAAA","sourcesContent":["const sql_keywords = [\n // 不要单独算关键字比较好\n // 'column',\n // 'table',\n // 'database',\n \n 'select',\n 'exec',\n 'update',\n \n 'insert',\n 'insert into',\n \n 'create table',\n 'create database',\n \n 'alter table',\n \n // alter table ... add column_name datatype\n 'add',\n 'rename',\n 'to',\n 'drop',\n \n \n 'drop table',\n 'drop database',\n \n 'use catalog',\n \n 'delete',\n \n 'transaction',\n \n 'join',\n 'inner join',\n 'full join',\n 'full outer join',\n 'left join',\n 'left outer join',\n 'left semi join',\n 'right join',\n 'right outer join',\n 'left semijoin',\n 'cross join',\n \n 'context by',\n 'partitioned by',\n 'group by',\n 'pivot by',\n 'order by',\n 'cgroup by',\n 'partition by',\n \n 'csort',\n 'limit',\n 'top',\n \n 'into',\n 'from',\n 'where',\n 'having',\n 'with',\n 'set',\n 'as',\n 'in',\n 'or',\n 'not',\n 'on',\n 'like',\n 'values',\n 'if',\n 'exists',\n 'distinct',\n 'map',\n \n \n 'between', 'and', // between ... and ...\n \n 'is null', 'is not null',\n \n // case when ... then ... end\n 'case', 'when', 'then', 'else', 'end',\n \n 'union', 'union all',\n \n 'nulls first', 'nulls last',\n \n 'asc', 'desc',\n]\n\n\nexport const keywords = [\n 'assert',\n \n 'const',\n 'mutable',\n \n 'def',\n 'defg',\n \n // 'map',\n 'mapr',\n \n 'timer',\n \n // 流程控制\n // 'if',\n // 'else',\n 'do',\n 'for',\n 'while',\n 'return',\n 'continue',\n 'break',\n 'try',\n 'catch',\n 'throw',\n 'go',\n \n // 模块\n 'use',\n 'module',\n \n \n // 仅 Python 有的\n 'async',\n 'await',\n 'class',\n 'del',\n 'elif',\n 'except',\n 'finally',\n 'global',\n 'import',\n 'is',\n 'lambda',\n 'nonlocal',\n 'pass',\n 'raise',\n 'yield',\n \n \n // --- SQL\n ... sql_keywords,\n ... sql_keywords.map(keyword => keyword.toUpperCase())\n].sort((l, r) => { // 长的在前面,正则表达式先匹配全部,而不是部分单词,防止高亮显示不正确\n const delta_len = l.length - r.length\n if (delta_len !== 0)\n return -delta_len\n \n return 0 // 否则保留原本顺序\n})\n\n\nexport const constants = [\n 'DFLT',\n 'NULL',\n 'true',\n 'false',\n 'pi',\n 'e',\n \n // --- form\n 'SCALAR',\n 'VECTOR',\n 'PAIR',\n 'MATRIX',\n 'SET',\n 'DICT',\n 'TABLE',\n // 'CHART',\n // 'CHUNK',\n \n // --- type\n 'VOID',\n 'BOOL',\n 'CHAR',\n 'SHORT',\n 'INT', 'INDEX',\n 'LONG',\n 'DATE',\n 'MONTH',\n 'TIME',\n 'MINUTE',\n 'SECOND',\n 'DATETIME',\n 'TIMESTAMP',\n 'NANOTIME',\n 'NANOTIMESTAMP',\n 'FLOAT',\n 'DOUBLE',\n 'SYMBOL',\n 'STRING',\n 'UUID',\n 'FUNCTIONDEF',\n 'HANDLE',\n 'CODE',\n 'DATASOURCE',\n 'RESOURCE',\n 'ANY',\n // 'COMPRESS',\n 'DICTIONARY',\n 'DATEHOUR',\n 'IPADDR',\n 'INT128',\n 'BLOB',\n 'COMPLEX',\n 'POINT',\n 'DURATION',\n 'OBJECT',\n 'DECIMAL32',\n 'DECIMAL64',\n 'DECIMAL128',\n \n // partition type\n 'SEQ',\n 'RANGE',\n 'HASH',\n 'VALUE',\n 'LIST',\n 'COMPO',\n \n \n // defined\n // https://www.dolphindb.cn/cn/help/FunctionsandCommands/FunctionReferences/d/defined.html\n 'VAR',\n 'SHARED',\n 'DEF',\n 'GLOBAL',\n \n \n // 用户权限管理\n // https://www.dolphindb.cn/cn/help/200/SystemManagement/UserAccessControl.html\n // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/CommandsReferences/d/deny.html\n 'TABLE_READ',\n 'TABLE_WRITE',\n 'TABLE_INSERT',\n 'TABLE_UPDATE',\n 'TABLE_DELETE',\n \n 'DBOBJ_CREATE',\n 'DBOBJ_DELETE',\n \n 'DB_DELETE',\n 'DB_INSERT',\n 'DB_MANAGE',\n 'DB_OWNER',\n 'DB_READ',\n 'DB_UPDATE',\n 'DB_WRITE',\n \n 'CATALOG_MANAGE',\n 'CATALOG_READ',\n 'CATALOG_WRITE',\n 'CATALOG_INSERT',\n 'CATALOG_UPDATE',\n 'CATALOG_DELETE',\n \n 'SCHEMA_MANAGE',\n 'SCHEMAOBJ_CREATE',\n 'SCHEMAOBJ_DELETE',\n 'SCHEMA_READ',\n 'SCHEMA_WRITE',\n 'SCHEMA_INSERT',\n 'SCHEMA_UPDATE',\n 'SCHEMA_DELETE',\n \n 'SCRIPT_EXEC',\n 'TASK_GROUP_MEM_LIMIT',\n 'TEST_EXEC',\n 'VIEW_EXEC',\n 'VIEW_OWNER',\n 'QUERY_RESULT_MEM_LIMIT',\n \n \n // hint\n // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/s/sql.html\n 'HINT_HASH',\n 'HINT_SNAPSHOT',\n 'HINT_KEEPORDER',\n 'HINT_SEQ',\n 'HINT_EXPLAIN',\n 'HINT_VECTORIZED',\n \n \n // --- seek mode\n 'HEAD',\n 'CURRENT',\n 'TAIL',\n \n // --- chart type\n // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/p/plot.html\n 'LINE',\n 'PIE',\n 'COLUMN',\n 'BAR',\n 'AREA',\n 'SCATTER',\n 'HISTOGRAM',\n 'KLINE',\n \n \n // --- log level\n 'DEBUG',\n 'INFO',\n 'WARNING',\n 'ERROR',\n \n // keep duplicates\n // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/c/createPartitionedTable.html?highlight=first\n 'FIRST',\n 'LAST',\n 'ALL',\n \n // keep\n // https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/i/isDuplicated.html?highlight=none\n 'NONE',\n \n 'HASH_PTN',\n \n // 仅 Python 有的\n 'True',\n 'False',\n 'None',\n \n] as const\n\n\nfunction get_tm_language (python = false) {\n return {\n $schema: 'https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json',\n \n name: python ? 'DolphinDB Python' : 'DolphinDB',\n \n scopeName: python ? 'source.dolphindb-python' : 'source.dolphindb',\n \n patterns: [\n {\n match: '\\\\.\\\\.\\\\.',\n name: 'invalid.ellipsis.dolphindb'\n },\n {\n include: '#keyword'\n },\n {\n include: '#literal'\n },\n {\n include: '#comment'\n },\n {\n include: '#decorator'\n },\n {\n include: '#variable'\n },\n {\n include: '#operator'\n },\n {\n include: '#method_call'\n },\n {\n include: '#function_call'\n },\n {\n include: '#property'\n },\n {\n match: ';',\n name: 'punctuation.terminator.statement.dolphindb'\n },\n {\n match: ',',\n name: 'punctuation.separator.commma.dolphindb'\n }\n ],\n \n \n repository: {\n keyword: {\n // \\b: word boundary\n // (?<![.$]): boundary 不是 . 或 $\n // ?!\\s*: 不是 label\n match: `\\\\b(?<![.$])(${keywords.join('|')})(?!(\\\\s*:|\\\\())\\\\b`,\n name: 'keyword.control.dolphindb'\n },\n \n literal: {\n patterns: [\n { include: '#constant' },\n { include: '#datetime' },\n { include: '#string' },\n { include: '#number' },\n ]\n },\n \n constant: {\n match: `\\\\b(?<![.$])(${constants.join('|')})(?!\\\\s*:)\\\\b`,\n name: 'constant.language.int.dolphindb'\n },\n \n decorator: {\n match: '^@testing',\n name: 'meta.decorator.dolphindb',\n },\n \n datetime: {\n patterns: [\n {\n match: '\\\\b[0-9]{4}[.][0-9]{2}[.][0-9]{2}[T ][0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{3,9})?\\\\b',\n name: 'constant.numeric.datetime.datetime.dolphindb',\n },\n {\n match: '\\\\b[0-9]{4}\\\\.[0-9]{2}M\\\\b',\n name: 'constant.numeric.datetime.month.dolphindb',\n },\n {\n match: '\\\\b[0-9]{4}\\\\.[0-9]{2}\\\\.[0-9]{2}\\\\b',\n name: 'constant.numeric.datetime.date.dolphindb',\n },\n {\n match: '\\\\b[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{3,9})?\\\\b',\n name: 'constant.numeric.datetime.time.dolphindb',\n },\n {\n match: '\\\\b[0-9]{2}:[0-9]{2}m\\\\b',\n name: 'constant.numeric.datetime.minute.dolphindb',\n },\n ]\n },\n \n string: {\n patterns: [\n {\n include: '#string_single_quoted'\n },\n {\n include: '#string_double_quoted'\n },\n {\n begin: \"'''\",\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.string.begin.dolphindb'\n }\n },\n end: \"'''\",\n endCaptures: {\n 0: {\n name: 'punctuation.definition.string.end.dolphindb'\n }\n },\n name: 'string.quoted.single.heredoc.dolphindb',\n patterns: [\n {\n captures: {\n 1: {\n name: 'punctuation.definition.escape.backslash.dolphindb'\n }\n },\n match: '(\\\\\\\\).',\n name: 'constant.character.escape.backslash.dolphindb'\n }\n ]\n },\n {\n begin: '\"\"\"',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.string.begin.dolphindb'\n }\n },\n end: '\"\"\"',\n endCaptures: {\n 0: {\n name: 'punctuation.definition.string.end.dolphindb'\n }\n },\n name: 'string.quoted.double.heredoc.dolphindb',\n patterns: [\n {\n captures: {\n 1: {\n name: 'punctuation.definition.escape.backslash.dolphindb'\n }\n },\n match: '(\\\\\\\\).',\n name: 'constant.character.escape.backslash.dolphindb'\n },\n {\n include: '#interpolated_dolphindb'\n }\n ]\n },\n {\n match: '`[\\\\w\\\\.]*',\n name: 'string.quoted.other.dolphindb'\n }\n ]\n },\n \n number: {\n patterns: [\n {\n match: '\\\\b[01]+[bB]\\\\b',\n name: 'constant.numeric.binary.dolphindb'\n },\n {\n // 97c\n match: '\\\\b[0-9]+([clhsmyM]|ms)\\\\b',\n name: 'constant.numeric.dolphindb'\n },\n {\n // 1.2f, 1f\n match: '\\\\b[0-9]+(\\\\.[0-9]+)?f\\\\b',\n name: 'constant.numeric.dolphindb'\n },\n {\n match: \n '(?x)\\n' +\n '(?:\\n' +\n ' (?:\\\\b[0-9]+(\\\\.)[0-9]+[eE][+-]?[0-9]+\\\\b)| # 1.1E+3\\n' +\n ' (?:\\\\b[0-9]+(\\\\.)[eE][+-]?[0-9]+\\\\b)| # 1.E+3\\n' +\n ' (?:\\\\b(\\\\.)[0-9]+[eE][+-]?[0-9]+\\\\b)| # .1E+3\\n' +\n ' (?:\\\\b[0-9]+[eE][+-]?[0-9]+\\\\b)| # 1E+3\\n' +\n ' (?:\\\\b[0-9]+(\\\\.)[0-9]+\\\\b)| # 1.1\\n' +\n ' (?:\\\\b[0-9]+(?=\\\\.{2,3}))| # 1 followed by a slice\\n' +\n ' (?:\\\\b[0-9]+(\\\\.)\\\\b)| # 1.\\n' +\n ' (?:\\\\b(\\\\.)[0-9]+\\\\b)| # .1\\n' +\n ' (?:\\\\b[0-9]+\\\\b(?!\\\\.)) # 1\\n' +\n ')\\n',\n \n captures: {\n 0: {\n name: 'constant.numeric.decimal.dolphindb'\n },\n 1: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n },\n 2: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n },\n 3: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n },\n 4: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n },\n 5: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n },\n 6: {\n name: 'punctuation.separator.decimal.period.dolphindb'\n }\n }\n },\n ]\n },\n \n string_single_quoted: {\n patterns: [\n {\n begin: \"'\",\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.string.begin.dolphindb'\n }\n },\n end: \"'\",\n endCaptures: {\n 0: {\n name: 'punctuation.definition.string.end.dolphindb'\n }\n },\n name: 'string.quoted.single.dolphindb',\n patterns: [\n {\n captures: {\n 1: {\n name: 'punctuation.definition.escape.backslash.dolphindb'\n }\n },\n match: '(\\\\\\\\)(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)',\n name: 'constant.character.escape.backslash.dolphindb'\n }\n ]\n }\n ]\n },\n \n string_double_quoted: {\n patterns: [\n {\n begin: '\"',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.string.begin.dolphindb'\n }\n },\n end: '\"',\n endCaptures: {\n 0: {\n name: 'punctuation.definition.string.end.dolphindb'\n }\n },\n name: 'string.quoted.double.dolphindb',\n patterns: [\n {\n captures: {\n 1: {\n name: 'punctuation.definition.escape.backslash.dolphindb'\n }\n },\n match: '(\\\\\\\\)(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)',\n name: 'constant.character.escape.backslash.dolphindb'\n },\n {\n include: '#interpolated_dolphindb'\n }\n ]\n }\n ]\n },\n \n function_call: {\n patterns: [\n {\n begin: '(@)?(\\\\w*!?)\\\\b(?=\\\\s*\\\\()',\n beginCaptures: {\n 1: { name: 'variable.other.readwrite.instance.dolphindb' },\n 2: { patterns: [{ include: '#function_name' }] }\n },\n end: '(?<=\\\\))',\n name: 'meta.function-call.dolphindb',\n patterns: [{ include: '#arguments' }]\n }\n ]\n },\n \n \n method_call: {\n patterns: [\n {\n begin: '(?:(\\\\.)|(::))\\\\s*(\\\\w*!?)(?=\\\\()',\n beginCaptures: {\n 1: { name: 'punctuation.separator.method.period.dolphindb' },\n 2: { name: 'keyword.operator.prototype.dolphindb' },\n 3: { patterns: [{ include: '#function_name' }] }\n },\n end: '(?<=\\\\))',\n name: 'meta.method-call.dolphindb',\n patterns: [{ include: '#arguments' }]\n }\n ]\n },\n \n \n function_name: {\n patterns: [\n {\n match: '[^\\\\d\\\\W]\\\\w*!?',\n name: 'entity.name.function.dolphindb'\n },\n {\n match: '\\\\d[\\\\w]*',\n name: 'invalid.illegal.identifier.dolphindb'\n }\n ]\n },\n \n function_params: {\n patterns: [\n {\n begin: '\\\\(',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.parameters.begin.bracket.round.dolphindb'\n }\n },\n end: '\\\\)',\n endCaptures: {\n 0: {\n name: 'punctuation.definition.parameters.end.bracket.round.dolphindb'\n }\n },\n name: 'meta.parameters.dolphindb',\n patterns: [\n {\n include: '#variable'\n },\n {\n match: '(@(?:[a-zA-Z_$][\\\\w$]*)?)(\\\\.\\\\.\\\\.)?',\n captures: {\n 1: {\n name: 'variable.parameter.function.readwrite.instance.dolphindb'\n },\n 2: {\n name: 'keyword.operator.splat.dolphindb'\n }\n }\n },\n {\n include: '$self'\n }\n ]\n }\n ]\n },\n \n comment: {\n patterns: python ? [\n {\n begin: '#',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.comment.dolphindb'\n }\n },\n end: '$',\n name: 'comment.line.number-sign.dolphindb'\n }\n ] : [\n {\n begin: '/\\\\*',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.comment.dolphindb'\n }\n },\n end: '\\\\*/',\n endCaptures: {\n 0: {\n name: 'punctuation.definition.comment.dolphindb'\n }\n },\n name: 'comment.block.dolphindb'\n },\n {\n begin: '//',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.comment.dolphindb'\n }\n },\n end: '$',\n name: 'comment.line.number-sign.dolphindb'\n },\n ]\n },\n \n arguments: {\n patterns: [\n {\n begin: '\\\\(',\n beginCaptures: {\n 0: {\n name: 'punctuation.definition.arguments.begin.bracket.round.dolphindb'\n }\n },\n end: '\\\\)',\n endCaptures: {\n 0: {\n name: 'punctuation.definition.arguments.end.bracket.round.dolphindb'\n }\n },\n name: 'meta.arguments.dolphindb',\n patterns: [\n {\n include: '$self'\n },\n {\n include: '#literal'\n },\n {\n include: '#variable'\n }\n ]\n }\n ]\n },\n \n variable: {\n patterns: [\n {\n match: '(@)([a-zA-Z_\\\\$]\\\\w*)?',\n name: 'variable.other.readwrite.instance.dolphindb'\n }\n ]\n },\n \n interpolated_dolphindb: {\n patterns: [\n {\n begin: '\\\\#\\\\{',\n captures: {\n 0: {\n name: 'punctuation.section.embedded.dolphindb'\n }\n },\n end: '\\\\}',\n name: 'source.dolphindb.embedded.source',\n patterns: [\n {\n include: '$self'\n }\n ]\n }\n ]\n },\n \n \n operator: {\n patterns: [\n {\n match: '<<|>>',\n name: 'keyword.operator.bitwise.shift.dolphindb'\n },\n {\n match: '!=|<=|>=|==|>|<',\n name: 'keyword.operator.comparison.dolphindb'\n },\n {\n match: '<-|->',\n name: 'keyword.operator.join.dolphindb'\n },\n {\n match: '&&|!|\\\\|\\\\|',\n name: 'keyword.operator.logical.dolphindb'\n },\n {\n match: '&|\\\\||\\\\^',\n name: 'keyword.operator.bitwise.dolphindb'\n },\n {\n match: '\\\\.\\\\.',\n name: 'keyword.operator.splat.dolphindb'\n },\n {\n match: '\\\\?',\n name: 'keyword.operator.existential.dolphindb'\n },\n {\n match: '/|<-|%|\\\\*|/|-|\\\\$|\\\\+',\n name: 'keyword.operator.dolphindb'\n },\n {\n match: '([a-zA-Z$_][\\\\w$]*)?\\\\s*(=|:(?!:))(?![>=])',\n captures: {\n 1: {\n name: 'variable.assignment.dolphindb'\n },\n 2: {\n name: 'keyword.operator.assignment.dolphindb'\n }\n }\n }\n ]\n },\n \n property: {\n patterns: [\n {\n match: '(?:(\\\\.)|(::))\\\\s*([A-Z][A-Z0-9_$]*\\\\b\\\\$*)(?=\\\\s*\\\\??(\\\\.\\\\s*[a-zA-Z_$]\\\\w*|::))',\n captures: {\n 1: {\n name: 'punctuation.separator.property.period.dolphindb'\n },\n 2: {\n name: 'keyword.operator.prototype.dolphindb'\n },\n 3: {\n name: 'constant.other.object.property.dolphindb'\n }\n }\n },\n {\n match: '(?:(\\\\.)|(::))\\\\s*(\\\\$*[a-zA-Z_$][\\\\w$]*)(?=\\\\s*\\\\??(\\\\.\\\\s*[a-zA-Z_$]\\\\w*|::))',\n captures: {\n 1: {\n name: 'punctuation.separator.property.period.dolphindb'\n },\n 2: {\n name: 'keyword.operator.prototype.dolphindb'\n },\n 3: {\n name: 'variable.other.object.property.dolphindb'\n }\n }\n },\n {\n match: '(?:(\\\\.)|(::))\\\\s*([A-Z][A-Z0-9_$]*\\\\b\\\\$*)',\n captures: {\n 1: {\n name: 'punctuation.separator.property.period.dolphindb'\n },\n 2: {\n name: 'keyword.operator.prototype.dolphindb'\n },\n 3: {\n name: 'constant.other.property.dolphindb'\n }\n }\n },\n {\n match: '(?:(\\\\.)|(::))\\\\s*(\\\\$*[a-zA-Z_$][\\\\w$]*)',\n captures: {\n 1: {\n name: 'punctuation.separator.property.period.dolphindb'\n },\n 2: {\n name: 'keyword.operator.prototype.dolphindb'\n },\n 3: {\n name: 'variable.other.property.dolphindb'\n }\n }\n },\n {\n match: '(?:(\\\\.)|(::))\\\\s*([0-9][\\\\w$]*)',\n captures: {\n 1: {\n name: 'punctuation.separator.property.period.dolphindb'\n },\n 2: {\n name: 'keyword.operator.prototype.dolphindb'\n },\n 3: {\n name: 'invalid.illegal.identifier.dolphindb'\n }\n }\n }\n ]\n }\n }\n } as Block\n}\n\n\nexport const tm_language = get_tm_language(false)\n\nexport const tm_language_python = get_tm_language(true)\n\n\ninterface Block {\n patterns: Pattern[]\n repository?: Record<string, Pattern | Block>\n}\n\ntype Pattern = Match | Include | Block\n\ntype Match = MatchOne | MatchBeginEnd\n\ninterface MatchOne {\n /** a single-line regular expression */\n match: RegExp | string\n \n /** This is the scope that will be applied to the matched text */\n name?: string\n \n /** This use of the captures > patterns structure is extremely important. \n Without it, a stretch of text matched by a match rule is considered finished, and \n TextMate’s search proceeds to the rest of the line after the matched text. \n With it, the stretch of matched text itself becomes a candidate for further matches. \n */\n captures?: Captures\n}\n\ninterface MatchBeginEnd {\n begin: RegExp | string\n \n end: RegExp | string\n \n /** This is the scope (or an expression evaluating to a scope) to be applied to \n the entire matched stretch(es) of text starting at the start of the begin match.\n */\n name?: string\n \n /** This is the scope to be applied to what’s between the begin match and the end match (or the end of the document). */\n contentName?: string\n \n /** it applies to the region between the begin and end matches. */\n patterns?: Pattern[]\n \n beginCaptures?: Captures\n \n endCaptures?: Captures\n \n whileCaptures?: Captures\n \n /** If the name or number of the matched group happens to be the same for both the begin pattern and the other pattern, \n you can (if appropriate) use captures as a shorthand to avoid saying the same thing twice.\n */\n captures?: Captures\n \n applyEndPatternLast?: 1\n}\n\ninterface Include {\n include: string\n}\n\ntype Captures = Record<string | number, {\n /** This is the scope that will be assigned to the matched group text. */\n name?: string\n \n /** This is a list of match rules to be sought within the matched group text \n — thus permitting the search for matches to continue inside the matched text.\n */\n patterns?: Pattern[]\n}>\n\n"]}
package/package.json CHANGED
@@ -1,20 +1,17 @@
1
1
  {
2
2
  "name": "dolphindb",
3
3
  "description": "DolphinDB JavaScript API",
4
- "version": "3.0.111",
4
+ "version": "3.0.113",
5
5
  "type": "module",
6
6
  "main": "./index.js",
7
7
  "browser": "./browser.js",
8
8
  "scripts": {
9
9
  "build": "tsc",
10
- "test": "tsc && node ./test.js",
10
+ "test": "node ./test.ts",
11
11
  "lint": "eslint \"**/*.{ts,tsx}\"",
12
12
  "fix": "eslint --fix \"**/*.{ts,tsx}\"",
13
13
  "scan": "i18n-scan --input \"**/*.{ts,tsx}\""
14
14
  },
15
- "engines": {
16
- "node": ">=22.1.0"
17
- },
18
15
  "author": "Hongfei Shen <hongfei.shen@dolphindb.com> (https://dolphindb.net/hongfeishen)",
19
16
  "publisher": "Hongfei Shen",
20
17
  "license": "MIT",
@@ -32,14 +29,14 @@
32
29
  "JavaScript"
33
30
  ],
34
31
  "devDependencies": {
35
- "@types/node": "^22.4.1",
36
- "eslint": "^9.9.0",
32
+ "@types/node": "^22.5.1",
33
+ "eslint": "^9.9.1",
37
34
  "typescript": "^5.5.4"
38
35
  },
39
36
  "dependencies": {
40
37
  "dayjs": "^1.11.13",
41
38
  "ipaddr.js": "^2.2.0",
42
- "tslib": "^2.6.3",
43
- "xshell": "^1.0.161"
39
+ "tslib": "^2.7.0",
40
+ "xshell": "^1.0.163"
44
41
  }
45
42
  }
package/unused.d.ts CHANGED
@@ -1 +0,0 @@
1
- export {};
package/unused.js CHANGED
@@ -1,7 +1,6 @@
1
1
  // import { Socket, createServer as create_socket_server, Server as SocketServer } from 'net'
2
2
  // import { TLSSocket, connect as tls_connect } from 'tls'
3
3
  // import type { Duplex } from 'stream'
4
- export {};
5
4
  // import { table, getBorderCharacters, type TableUserConfig } from 'table'
6
5
  // class DdbObj {
7
6
  // port = 8848
package/unused.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"unused.js","sourceRoot":"","sources":["unused.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,0DAA0D;AAC1D,uCAAuC;;AAEvC,2EAA2E;AAE3E,iBAAiB;AACjB,kBAAkB;AAElB,sBAAsB;AACtB,oBAAoB;AAEpB,8BAA8B;AAE9B,kCAAkC;AAGlC,+BAA+B;AAC/B,iBAAiB;AACjB,oBAAoB;AACpB,2DAA2D;AAC3D,SAAS;AACT,uBAAuB;AACvB,wBAAwB;AACxB,YAAY;AACZ,sCAAsC;AACtC,yCAAyC;AAEzC,gCAAgC;AAChC,2BAA2B;AAC3B,8BAA8B;AAE9B,sBAAsB;AACtB,sCAAsC;AACtC,eAAe;AACf,gCAAgC;AAChC,4BAA4B;AAC5B,4BAA4B;AAC5B,2BAA2B;AAC3B,sCAAsC;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iCAAiC;AACjC,aAAa;AAGb,wCAAwC;AACxC,+CAA+C;AAC/C,yCAAyC;AACzC,+DAA+D;AAC/D,yBAAyB;AACzB,gBAAgB;AAEhB,qCAAqC;AAErC,qDAAqD;AACrD,6CAA6C;AAC7C,iEAAiE;AACjE,4CAA4C;AAC5C,6CAA6C;AAC7C,+BAA+B;AAC/B,oBAAoB;AAEpB,wCAAwC;AACxC,6FAA6F;AAC7F,qDAAqD;AACrD,mCAAmC;AACnC,wCAAwC;AACxC,gBAAgB;AAEhB,gGAAgG;AAChG,qCAAqC;AACrC,QAAQ;AACR,IAAI","sourcesContent":["// import { Socket, createServer as create_socket_server, Server as SocketServer } from 'net'\n// import { TLSSocket, connect as tls_connect } from 'tls'\n// import type { Duplex } from 'stream'\n\n// import { table, getBorderCharacters, type TableUserConfig } from 'table'\n\n// class DdbObj {\n// port = 8848\n \n// /** ddb 连接状态 */\n// state = '未连接'\n \n// socket = null as Socket\n \n// clients = new Set<Duplex>()\n \n \n// /** dolphindb http rpc \n// - code\n// - options\n// - session_id: 20 分钟内无操作服务端会清空 session,删除所有变量\n// */\n// async rpc_json (\n// code: string,\n// {\n// hostname = '127.0.0.1',\n// // hostname = 'localhost',\n \n// port = this.port,\n// tls = false,\n// sid = this.sid,\n \n// // TEST\n// proxy = MyProxy.whistle\n// }: {\n// hostname?: string\n// port?: number\n// tls?: boolean\n// sid?: string\n// proxy?: MyProxy | false\n// } = { }\n// ): Promise<DdbJsonObj> {\n// let result = await request_json(`${tls ? 'https' : 'http'}://${hostname}:${port}/${sid}`, {\n// body: {\n// sessionID: sid,\n// functionName: 'executeCode',\n// params: [{\n// name: 'script',\n// form: 'scalar',\n// type: 'string',\n// value: encodeURIComponent(code)\n// }]\n// },\n// proxy\n// })\n \n// this.sid = result.sessionID\n \n// result.resultCode = Number(result.resultCode)\n \n// // result.userId: 未登录时为 `''`\n \n// if (result.resultCode)\n// throw Object.assign(\n// // result.msg: 成功时为 `''`; 失败时为错误信息\n// new Error((result.msg as string).red),\n// result\n// )\n \n \n// return new DdbJsonObj(result.object[0])\n// }\n \n \n// /** 创建 tcp 连接到 ddb,并完成 connect 请求,读到 chunk 后执行 on_chunk 回调\n// 成功完成后 this.socket, this.sid 会被初始化\n// */\n// async connect_socket () {\n// // --- 创建 socket, attach 状态、异常事件处理\n// this.socket = new Socket({\n// allowHalfOpen: false,\n// readable: true,\n// writable: true\n// })\n \n// this.socket.on('lookup', (error, address, family, host) => {\n// console.log('socket 域名解析 (lookup) 完成', error, address, family, host)\n// })\n \n// this.socket.on('ready', () => {\n// console.log('socket 准备就绪')\n// })\n \n// this.socket.on('close', has_error => {\n// console.log('socket 成功关闭,是否出错?', has_error)\n// })\n \n// this.socket.on('timeout', () => {\n// console.log('socket 超时')\n// })\n \n// this.socket.on('error', error => {\n// console.log('socket 出错了', error)\n// })\n \n \n// // ---\n// console.log('将 socket 连接到 server')\n// await new Promise<void>(resolve => {\n// // callback 会被 socket.once('connect', callback)\n// this.socket.connect({\n// port: this.port,\n \n// // host: 'localhost',\n// host: '127.0.0.1',\n \n// family: 0,\n// }, resolve)\n// })\n \n// console.log(this.state = 'socket 已连接')\n \n \n// // ---\n// console.log('发送 connect 请求到 ddb')\n \n// this.socket.write(\n// `API ${this.sid || '0'} 8\\n` +\n// 'connect\\n'\n// )\n \n// console.log(this.state = '已发送 connect 请求')\n \n \n// // --- 读取流数据,只等到 connect 完成,后续 chunk 交给 callback\n// await new Promise<void>(async (resolve, reject) => {\n// let last_chunk: Buffer\n \n// try {\n// for await (const chunk of this.socket) {\n// last_chunk = chunk\n// console.log('ddb.socket 读取到 chunk, 转发给所有 websocket clients')\n \n// const ck = chunk as Uint8Array\n \n// if (this.state === '已发送 connect 请求') {\n// // --- 读取 sid\n// const i_sid_end = ck.indexOf(0x20)\n \n// this.sid = this.dec.decode(\n// ck.subarray(\n// 0,\n// i_sid_end\n// )\n// )\n// console.log('sid = ', this.sid)\n \n// console.log(this.state = 'connect 完成')\n \n// resolve()\n \n// continue\n// }\n \n// this.on_chunk(ck)\n// }\n \n// console.log('ddb.socket 完美结束 (no more data to read)')\n// } catch (error) {\n// console.log('捕获到 socket 错误', error)\n// console.log('最后一个 chunk', last_chunk)\n// reject(error)\n// }\n// })\n// }\n \n \n// on_chunk (chunk: Uint8Array) {\n// for (let client of this.clients)\n// client.write(chunk)\n// }\n// }\n\n\n// class DdbJsonObj {\n// static ddb_null = { name: '', form: 'scalar', type: 'void', value: null } as const\n \n// static table_config: TableUserConfig = {\n// border: getBorderCharacters('void'),\n// singleLine: true,\n// columnDefault: {\n// paddingLeft: 0,\n// paddingRight: 1,\n// alignment: 'right'\n// },\n// }\n \n \n// name: string\n \n// form: DdbJsonForm\n \n// type?: DdbJsonType\n \n// /** 向量有这个属性 */\n// size?: number\n \n// value: null | boolean | number | string | DdbJsonObj | DdbJsonObj[]\n \n// constructor (data?: {\n// name: string\n// form: DdbJsonForm\n// type?: DdbJsonType\n// size?: string | number\n// value: any\n// }) {\n// const { name, form, type, size, value } = data || DdbJsonObj.ddb_null as DdbJsonObj\n \n// this.name = name\n// this.form = form\n// this.type = type\n \n// if ((typeof size === 'string' && size) || typeof size === 'number')\n// this.size = Number(size)\n \n// this.value = (() => {\n// if (form === 'scalar') {\n// if (type === 'void')\n// return null\n \n// if (type === 'int' || type === 'short' || type === 'float' || type === 'double') {\n// if (value === 'pi' || value === 'e')\n// return value\n \n// return Number(value)\n// }\n \n// if (type === 'long')\n// return BigInt(value)\n \n// if (type === 'bool')\n// return Boolean(value)\n \n// // integral: int128\n// // literal: char | string | uuid\n// // temporal: date | month | time | second | datetime | timestamp | nanotime | nanotimestamp | datehour\n// // system: code | ipaddr | duration\n// // complex | point\n// return value\n// }\n \n// if (form === 'pair')\n// return value\n \n// if (form === 'vector')\n// return value\n \n// if (form === 'set')\n// return value\n \n// if (form === 'matrix')\n// return value\n \n// if (form === 'dictionary')\n// return value\n \n// if (form === 'table')\n// return value\n// })()\n// }\n \n \n// [inspect.custom] () {\n// const { form, type, value, name, size } = this\n \n// if (form === 'scalar')\n// return this.format_scalar(type, value)\n \n// if (form === 'pair') {\n// const [l, r] = value as [any, any]\n// return `${ l === null ? '' : this.format_scalar(type, l) }:${ r === null ? '' : this.format_scalar(type, r) }`\n// }\n \n// if (form === 'vector' || form === 'set') {\n// return (name ? `${name} ` : '') +\n// (\n// (value as any[]).map(x => \n// x && typeof x === 'object' ?\n// inspect(\n// new DdbJsonObj(x), \n// { colors: false }\n// )\n// :\n// this.format_scalar(type, x)\n// ).join(', ') || ' '\n// ).surround(\n// form === 'vector' ? '[' : '{',\n// form === 'vector' ? ']' : '}',\n// )\n// }\n \n// if (form === 'dictionary') {\n// const [keys, values] = value as [any, any]\n// let obj = { } as Record<string, DdbJsonObj | string>\n// const size = Number(keys.size)\n// if (!size) return `dict(${keys.type}, ${values.type})`\n \n// for (let i = 0; i < size; i++) {\n// const key = keys.type === 'string' ? \n// keys.value[i]\n// :\n// this.format_scalar(keys.type, keys.value[i])\n \n// const v = values.value[i]\n// const value = typeof v === 'string' ? \n// v\n// :\n// new DdbJsonObj(v)\n// obj[key] = value\n// }\n \n// return obj\n// }\n \n// if (form === 'matrix') {\n// const nrows = Number(value[1].value)\n// const ncols = Number(value[2].value)\n// const values = value[0].value\n \n// let data = [ ]\n// for (let i = 0; i < nrows; i++)\n// for (let j = 0; j < ncols; j++) {\n// const value = values[nrows * j + i]\n// let row = data[i] || [ ]\n// row[j] = this.format_scalar(type, value)\n// data[i] = row\n// }\n \n// return `matrix <${type}[${ncols}][${nrows}]>\\n` +\n// table(data, DdbJsonObj.table_config)\n// }\n \n// if (form === 'table') {\n// const nrows = Number(size)\n// const ncols = (value as any[]).length\n// const headers = (value as any[]).map(({ name }) => name)\n \n// let data = [ ]\n// for (let i = 0; i < nrows; i++)\n// for (let j = 0; j < ncols; j++) {\n// const col = value[j]\n// const v = col.value[i]\n// let row = data[i] || [ ]\n// row[j] = this.format_scalar(col.type, v)\n// data[i] = row\n// }\n \n// return `table ${ name ? `${name} ` : '' }(${nrows} rows)\\n` +\n// table(\n// [\n// headers,\n// ...data\n// ],\n// DdbJsonObj.table_config,\n// )\n// }\n \n// return this\n// }\n \n \n// format_scalar (type: DdbJsonType, value: any) {\n// // 可以被 js 原生类型表示\n// if (\n// type === 'void' || type === 'bool' ||\n// type === 'int' || type === 'short' || type === 'long' || type === 'float' || type === 'double'\n// )\n// return value\n \n// if (type === 'string')\n// return inspect(value, { colors: false })\n \n// // 可以直接用 <value> 表示\n// if (\n// type === 'code' || type === 'point' || type === 'complex' || \n// type === 'second' || type === 'time' || type === 'nanotime' || type === 'datehour' || type === 'duration'\n// )\n// return value || 'null'\n \n// if (type === 'month') {\n// if (!value)\n// return 'null'\n// return `${value}M`\n// }\n \n// if (type === 'minute') {\n// if (!value)\n// return 'null'\n// return `${value}m`\n// }\n \n// // 用 type('<value>') 表示\n// return `${type}(${(value as string).quote()})`\n// }\n// }\n\n\n// type DdbJsonForm = 'scalar' | 'pair' | 'vector' | 'set' | 'matrix' | 'dictionary' | 'table'\n\n// type DdbJsonType = \n// 'void' | 'bool' | 'char' | \n// 'short' | 'int' | 'long' | \n// 'date' | 'month' | 'time' | 'minute' | 'second' | 'datetime' | 'timestamp' | 'nanotime' | 'nanotimestamp' | \n// 'float' | 'double' | 'symbol' | 'string' | 'uuid' | 'functiondef' | 'handle' | 'code' | \n// 'datasource' | 'resource' | 'any' | 'compress' | 'datehour' | 'ipaddr' | 'int128' | 'blob' | 'complex' | 'point' | 'duration'\n\n\n// type DdbJsonScalar = number | string | any\n\n\n// const ddb_gateway = {\n// server: null as SocketServer,\n \n// clients: new Set<Socket>(),\n \n// port: 8849,\n \n// controllers: {\n// /** alias */\n// c0: {\n// hostname: '127.0.0.1',\n// port: 8850,\n// },\n \n// c1: {\n// hostname: '127.0.0.1',\n// port: 8851,\n// },\n \n// c2: {\n// hostname: '127.0.0.1',\n// port: 8852,\n// }\n// },\n \n// master: '',\n \n// sids: new Map<string, string>(),\n \n// state: 'init',\n \n \n// async start () {\n// for (const alias in this.controllers) {\n// this.master = alias\n// break\n// }\n \n// this.server = create_socket_server(\n// {\n// allowHalfOpen: false,\n// pauseOnConnect: false,\n// },\n// this.accept.bind(this)\n// )\n \n// this.server.on('error', error => {\n// console.log(new Date(), 'gateway 出错:', error)\n// })\n \n// await new Promise<void>(resolve => {\n// this.server.listen(this.port, resolve)\n// })\n \n// this.auto_switch_master()\n \n// console.log(new Date(), 'gateway 成功启动')\n// },\n \n \n// async stop () {\n// this.state = 'stopping'\n// console.log(new Date(), '正在停止 auto_switch_master')\n \n// for (const client of this.clients)\n// client.end()\n \n// await new Promise<void>((resolve, reject) => {\n// this.server.close(error => {\n// if (error) {\n// reject(error)\n// return\n// }\n// resolve()\n// })\n// })\n// },\n \n \n// /** 接收到 client tcp 连接 */\n// async accept (client: Socket) {\n// this.clients.add(client)\n \n// const port = client.remotePort\n \n// // --- \n// console.log(port, new Date(), 'gateway accept client 连接,开始建立管道')\n \n// let controller = new Socket({\n// allowHalfOpen: false,\n// readable: true,\n// writable: true,\n// })\n \n// controller.on('lookup', (error, address, family, host) => {\n// console.log(port, new Date(), 'controller 域名解析 (lookup) 完成', error, address, family, host)\n// })\n \n// controller.on('close', has_error => {\n// console.log(port, new Date(), 'controller 关闭连接,是否出错:', has_error)\n// })\n \n// controller.on('timeout', () => {\n// console.log(port, new Date(), 'controller 超时')\n// })\n \n// controller.on('error', error => {\n// console.log(port, new Date(), 'controller 出错了:', error)\n// client.end()\n// })\n \n \n// // --- client 错误处理\n// client.on('error', error => {\n// console.log(port, new Date(), 'client 出错,关闭与 controller 的连接', error)\n// controller.end()\n// })\n \n// client.on('close', has_error => {\n// this.clients.delete(client)\n// console.log(port, new Date(), 'client 关闭连接,是否出错:', has_error)\n// })\n \n \n// // --- \n// console.log(port, new Date(), 'gateway 开始连接到 controller')\n// const { hostname, port: master_port } = this.controllers[this.master]\n// await new Promise<void>(resolve => {\n// // callback 会被 socket.once('connect', callback)\n// controller.connect({\n// port: master_port,\n \n// host: hostname,\n// // host: '127.0.0.1',\n \n// family: 0,\n// }, resolve)\n// })\n// console.log(port, new Date(), 'gateway 已连接到 controller')\n \n// // --- \n// console.log(port, new Date(), 'gateway 建立 client <-> controller')\n// client.pipe(controller)\n// controller.pipe(client)\n// },\n \n \n// /** https://www.dolphindb.cn/cn/help/FunctionsandCommands/FunctionReferences/g/getActiveMaster.html?highlight=getactivemaster */\n// async get_active_master () {\n// for (const alias in this.controllers) {\n// const { hostname, port } = this.controllers[alias] as { hostname: string, port: number }\n// const sid = this.sids.get(alias)\n// try {\n// const master = (\n// await ddb.rpc_json('getActiveMaster()', { hostname, port, sid })\n// ).value as string\n// console.log(new Date(), `${alias}.getActiveMaster() -> ${this.master}`)\n// this.sids.set(alias, sid)\n// if (!master)\n// throw new Error(`${new Date().toString()} getActiveMaster 得到的 master 为空`)\n// return master\n// } catch (error) {\n// console.log(new Date(), error)\n// }\n// }\n \n// return this.master\n// },\n \n \n// async auto_switch_master () {\n// if (this.state === 'stopping') {\n// this.state = 'running'\n// console.log('gateway 恢复 auto_switch_master')\n// return\n// }\n \n// this.state = 'running'\n \n// for (; this.state === 'running'; ) {\n// const master = this.master\n// const master_ = await this.get_active_master()\n// if (master === master_) {\n// await delay(10 * 1000)\n// continue\n// }\n \n// this.master = master_\n// console.log(new Date(), `master 从 ${master} 切换为 ${master_}, 断开所有 clients`)\n// for (const client of this.clients)\n// client.end()\n// await delay(3 * 1000)\n// }\n \n// console.log(new Date(), `gateway.state === ${this.state}, 停止 auto_switch_master`)\n// this.state = 'stopped'\n// }\n// }\n"]}
1
+ {"version":3,"file":"unused.js","sourceRoot":"","sources":["unused.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,0DAA0D;AAC1D,uCAAuC;AAEvC,2EAA2E;AAE3E,iBAAiB;AACjB,kBAAkB;AAElB,sBAAsB;AACtB,oBAAoB;AAEpB,8BAA8B;AAE9B,kCAAkC;AAGlC,+BAA+B;AAC/B,iBAAiB;AACjB,oB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IAA2I;AAC3I,uCAAuC;AACvC,sDAAsD;AACtD,2GAA2G;AAC3G,mDAAmD;AACnD,wBAAwB;AACxB,uCAAuC;AACvC,2FAA2F;AAC3F,wCAAwC;AACxC,8FAA8F;AAC9F,gDAAgD;AAChD,mCAAmC;AACnC,oGAAoG;AACpG,oCAAoC;AACpC,oCAAoC;AACpC,qDAAqD;AACrD,oBAAoB;AACpB,gBAAgB;AAEhB,iCAAiC;AACjC,aAAa;AAGb,wCAAwC;AACxC,+CAA+C;AAC/C,yCAAyC;AACzC,+DAA+D;AAC/D,yBAAyB;AACzB,gBAAgB;AAEhB,qCAAqC;AAErC,qDAAqD;AACrD,6CAA6C;AAC7C,iEAAiE;AACjE,4CAA4C;AAC5C,6CAA6C;AAC7C,+BAA+B;AAC/B,oBAAoB;AAEpB,wCAAwC;AACxC,6FAA6F;AAC7F,qDAAqD;AACrD,mCAAmC;AACnC,wCAAwC;AACxC,gBAAgB;AAEhB,gGAAgG;AAChG,qCAAqC;AACrC,QAAQ;AACR,IAAI","sourcesContent":["// import { Socket, createServer as create_socket_server, Server as SocketServer } from 'net'\n// import { TLSSocket, connect as tls_connect } from 'tls'\n// import type { Duplex } from 'stream'\n\n// import { table, getBorderCharacters, type TableUserConfig } from 'table'\n\n// class DdbObj {\n// port = 8848\n \n// /** ddb 连接状态 */\n// state = '未连接'\n \n// socket = null as Socket\n \n// clients = new Set<Duplex>()\n \n \n// /** dolphindb http rpc \n// - code\n// - options\n// - session_id: 20 分钟内无操作服务端会清空 session,删除所有变量\n// */\n// async rpc_json (\n// code: string,\n// {\n// hostname = '127.0.0.1',\n// // hostname = 'localhost',\n \n// port = this.port,\n// tls = false,\n// sid = this.sid,\n \n// // TEST\n// proxy = MyProxy.whistle\n// }: {\n// hostname?: string\n// port?: number\n// tls?: boolean\n// sid?: string\n// proxy?: MyProxy | false\n// } = { }\n// ): Promise<DdbJsonObj> {\n// let result = await request_json(`${tls ? 'https' : 'http'}://${hostname}:${port}/${sid}`, {\n// body: {\n// sessionID: sid,\n// functionName: 'executeCode',\n// params: [{\n// name: 'script',\n// form: 'scalar',\n// type: 'string',\n// value: encodeURIComponent(code)\n// }]\n// },\n// proxy\n// })\n \n// this.sid = result.sessionID\n \n// result.resultCode = Number(result.resultCode)\n \n// // result.userId: 未登录时为 `''`\n \n// if (result.resultCode)\n// throw Object.assign(\n// // result.msg: 成功时为 `''`; 失败时为错误信息\n// new Error((result.msg as string).red),\n// result\n// )\n \n \n// return new DdbJsonObj(result.object[0])\n// }\n \n \n// /** 创建 tcp 连接到 ddb,并完成 connect 请求,读到 chunk 后执行 on_chunk 回调\n// 成功完成后 this.socket, this.sid 会被初始化\n// */\n// async connect_socket () {\n// // --- 创建 socket, attach 状态、异常事件处理\n// this.socket = new Socket({\n// allowHalfOpen: false,\n// readable: true,\n// writable: true\n// })\n \n// this.socket.on('lookup', (error, address, family, host) => {\n// console.log('socket 域名解析 (lookup) 完成', error, address, family, host)\n// })\n \n// this.socket.on('ready', () => {\n// console.log('socket 准备就绪')\n// })\n \n// this.socket.on('close', has_error => {\n// console.log('socket 成功关闭,是否出错?', has_error)\n// })\n \n// this.socket.on('timeout', () => {\n// console.log('socket 超时')\n// })\n \n// this.socket.on('error', error => {\n// console.log('socket 出错了', error)\n// })\n \n \n// // ---\n// console.log('将 socket 连接到 server')\n// await new Promise<void>(resolve => {\n// // callback 会被 socket.once('connect', callback)\n// this.socket.connect({\n// port: this.port,\n \n// // host: 'localhost',\n// host: '127.0.0.1',\n \n// family: 0,\n// }, resolve)\n// })\n \n// console.log(this.state = 'socket 已连接')\n \n \n// // ---\n// console.log('发送 connect 请求到 ddb')\n \n// this.socket.write(\n// `API ${this.sid || '0'} 8\\n` +\n// 'connect\\n'\n// )\n \n// console.log(this.state = '已发送 connect 请求')\n \n \n// // --- 读取流数据,只等到 connect 完成,后续 chunk 交给 callback\n// await new Promise<void>(async (resolve, reject) => {\n// let last_chunk: Buffer\n \n// try {\n// for await (const chunk of this.socket) {\n// last_chunk = chunk\n// console.log('ddb.socket 读取到 chunk, 转发给所有 websocket clients')\n \n// const ck = chunk as Uint8Array\n \n// if (this.state === '已发送 connect 请求') {\n// // --- 读取 sid\n// const i_sid_end = ck.indexOf(0x20)\n \n// this.sid = this.dec.decode(\n// ck.subarray(\n// 0,\n// i_sid_end\n// )\n// )\n// console.log('sid = ', this.sid)\n \n// console.log(this.state = 'connect 完成')\n \n// resolve()\n \n// continue\n// }\n \n// this.on_chunk(ck)\n// }\n \n// console.log('ddb.socket 完美结束 (no more data to read)')\n// } catch (error) {\n// console.log('捕获到 socket 错误', error)\n// console.log('最后一个 chunk', last_chunk)\n// reject(error)\n// }\n// })\n// }\n \n \n// on_chunk (chunk: Uint8Array) {\n// for (let client of this.clients)\n// client.write(chunk)\n// }\n// }\n\n\n// class DdbJsonObj {\n// static ddb_null = { name: '', form: 'scalar', type: 'void', value: null } as const\n \n// static table_config: TableUserConfig = {\n// border: getBorderCharacters('void'),\n// singleLine: true,\n// columnDefault: {\n// paddingLeft: 0,\n// paddingRight: 1,\n// alignment: 'right'\n// },\n// }\n \n \n// name: string\n \n// form: DdbJsonForm\n \n// type?: DdbJsonType\n \n// /** 向量有这个属性 */\n// size?: number\n \n// value: null | boolean | number | string | DdbJsonObj | DdbJsonObj[]\n \n// constructor (data?: {\n// name: string\n// form: DdbJsonForm\n// type?: DdbJsonType\n// size?: string | number\n// value: any\n// }) {\n// const { name, form, type, size, value } = data || DdbJsonObj.ddb_null as DdbJsonObj\n \n// this.name = name\n// this.form = form\n// this.type = type\n \n// if ((typeof size === 'string' && size) || typeof size === 'number')\n// this.size = Number(size)\n \n// this.value = (() => {\n// if (form === 'scalar') {\n// if (type === 'void')\n// return null\n \n// if (type === 'int' || type === 'short' || type === 'float' || type === 'double') {\n// if (value === 'pi' || value === 'e')\n// return value\n \n// return Number(value)\n// }\n \n// if (type === 'long')\n// return BigInt(value)\n \n// if (type === 'bool')\n// return Boolean(value)\n \n// // integral: int128\n// // literal: char | string | uuid\n// // temporal: date | month | time | second | datetime | timestamp | nanotime | nanotimestamp | datehour\n// // system: code | ipaddr | duration\n// // complex | point\n// return value\n// }\n \n// if (form === 'pair')\n// return value\n \n// if (form === 'vector')\n// return value\n \n// if (form === 'set')\n// return value\n \n// if (form === 'matrix')\n// return value\n \n// if (form === 'dictionary')\n// return value\n \n// if (form === 'table')\n// return value\n// })()\n// }\n \n \n// [inspect.custom] () {\n// const { form, type, value, name, size } = this\n \n// if (form === 'scalar')\n// return this.format_scalar(type, value)\n \n// if (form === 'pair') {\n// const [l, r] = value as [any, any]\n// return `${ l === null ? '' : this.format_scalar(type, l) }:${ r === null ? '' : this.format_scalar(type, r) }`\n// }\n \n// if (form === 'vector' || form === 'set') {\n// return (name ? `${name} ` : '') +\n// (\n// (value as any[]).map(x => \n// x && typeof x === 'object' ?\n// inspect(\n// new DdbJsonObj(x), \n// { colors: false }\n// )\n// :\n// this.format_scalar(type, x)\n// ).join(', ') || ' '\n// ).surround(\n// form === 'vector' ? '[' : '{',\n// form === 'vector' ? ']' : '}',\n// )\n// }\n \n// if (form === 'dictionary') {\n// const [keys, values] = value as [any, any]\n// let obj = { } as Record<string, DdbJsonObj | string>\n// const size = Number(keys.size)\n// if (!size) return `dict(${keys.type}, ${values.type})`\n \n// for (let i = 0; i < size; i++) {\n// const key = keys.type === 'string' ? \n// keys.value[i]\n// :\n// this.format_scalar(keys.type, keys.value[i])\n \n// const v = values.value[i]\n// const value = typeof v === 'string' ? \n// v\n// :\n// new DdbJsonObj(v)\n// obj[key] = value\n// }\n \n// return obj\n// }\n \n// if (form === 'matrix') {\n// const nrows = Number(value[1].value)\n// const ncols = Number(value[2].value)\n// const values = value[0].value\n \n// let data = [ ]\n// for (let i = 0; i < nrows; i++)\n// for (let j = 0; j < ncols; j++) {\n// const value = values[nrows * j + i]\n// let row = data[i] || [ ]\n// row[j] = this.format_scalar(type, value)\n// data[i] = row\n// }\n \n// return `matrix <${type}[${ncols}][${nrows}]>\\n` +\n// table(data, DdbJsonObj.table_config)\n// }\n \n// if (form === 'table') {\n// const nrows = Number(size)\n// const ncols = (value as any[]).length\n// const headers = (value as any[]).map(({ name }) => name)\n \n// let data = [ ]\n// for (let i = 0; i < nrows; i++)\n// for (let j = 0; j < ncols; j++) {\n// const col = value[j]\n// const v = col.value[i]\n// let row = data[i] || [ ]\n// row[j] = this.format_scalar(col.type, v)\n// data[i] = row\n// }\n \n// return `table ${ name ? `${name} ` : '' }(${nrows} rows)\\n` +\n// table(\n// [\n// headers,\n// ...data\n// ],\n// DdbJsonObj.table_config,\n// )\n// }\n \n// return this\n// }\n \n \n// format_scalar (type: DdbJsonType, value: any) {\n// // 可以被 js 原生类型表示\n// if (\n// type === 'void' || type === 'bool' ||\n// type === 'int' || type === 'short' || type === 'long' || type === 'float' || type === 'double'\n// )\n// return value\n \n// if (type === 'string')\n// return inspect(value, { colors: false })\n \n// // 可以直接用 <value> 表示\n// if (\n// type === 'code' || type === 'point' || type === 'complex' || \n// type === 'second' || type === 'time' || type === 'nanotime' || type === 'datehour' || type === 'duration'\n// )\n// return value || 'null'\n \n// if (type === 'month') {\n// if (!value)\n// return 'null'\n// return `${value}M`\n// }\n \n// if (type === 'minute') {\n// if (!value)\n// return 'null'\n// return `${value}m`\n// }\n \n// // 用 type('<value>') 表示\n// return `${type}(${(value as string).quote()})`\n// }\n// }\n\n\n// type DdbJsonForm = 'scalar' | 'pair' | 'vector' | 'set' | 'matrix' | 'dictionary' | 'table'\n\n// type DdbJsonType = \n// 'void' | 'bool' | 'char' | \n// 'short' | 'int' | 'long' | \n// 'date' | 'month' | 'time' | 'minute' | 'second' | 'datetime' | 'timestamp' | 'nanotime' | 'nanotimestamp' | \n// 'float' | 'double' | 'symbol' | 'string' | 'uuid' | 'functiondef' | 'handle' | 'code' | \n// 'datasource' | 'resource' | 'any' | 'compress' | 'datehour' | 'ipaddr' | 'int128' | 'blob' | 'complex' | 'point' | 'duration'\n\n\n// type DdbJsonScalar = number | string | any\n\n\n// const ddb_gateway = {\n// server: null as SocketServer,\n \n// clients: new Set<Socket>(),\n \n// port: 8849,\n \n// controllers: {\n// /** alias */\n// c0: {\n// hostname: '127.0.0.1',\n// port: 8850,\n// },\n \n// c1: {\n// hostname: '127.0.0.1',\n// port: 8851,\n// },\n \n// c2: {\n// hostname: '127.0.0.1',\n// port: 8852,\n// }\n// },\n \n// master: '',\n \n// sids: new Map<string, string>(),\n \n// state: 'init',\n \n \n// async start () {\n// for (const alias in this.controllers) {\n// this.master = alias\n// break\n// }\n \n// this.server = create_socket_server(\n// {\n// allowHalfOpen: false,\n// pauseOnConnect: false,\n// },\n// this.accept.bind(this)\n// )\n \n// this.server.on('error', error => {\n// console.log(new Date(), 'gateway 出错:', error)\n// })\n \n// await new Promise<void>(resolve => {\n// this.server.listen(this.port, resolve)\n// })\n \n// this.auto_switch_master()\n \n// console.log(new Date(), 'gateway 成功启动')\n// },\n \n \n// async stop () {\n// this.state = 'stopping'\n// console.log(new Date(), '正在停止 auto_switch_master')\n \n// for (const client of this.clients)\n// client.end()\n \n// await new Promise<void>((resolve, reject) => {\n// this.server.close(error => {\n// if (error) {\n// reject(error)\n// return\n// }\n// resolve()\n// })\n// })\n// },\n \n \n// /** 接收到 client tcp 连接 */\n// async accept (client: Socket) {\n// this.clients.add(client)\n \n// const port = client.remotePort\n \n// // --- \n// console.log(port, new Date(), 'gateway accept client 连接,开始建立管道')\n \n// let controller = new Socket({\n// allowHalfOpen: false,\n// readable: true,\n// writable: true,\n// })\n \n// controller.on('lookup', (error, address, family, host) => {\n// console.log(port, new Date(), 'controller 域名解析 (lookup) 完成', error, address, family, host)\n// })\n \n// controller.on('close', has_error => {\n// console.log(port, new Date(), 'controller 关闭连接,是否出错:', has_error)\n// })\n \n// controller.on('timeout', () => {\n// console.log(port, new Date(), 'controller 超时')\n// })\n \n// controller.on('error', error => {\n// console.log(port, new Date(), 'controller 出错了:', error)\n// client.end()\n// })\n \n \n// // --- client 错误处理\n// client.on('error', error => {\n// console.log(port, new Date(), 'client 出错,关闭与 controller 的连接', error)\n// controller.end()\n// })\n \n// client.on('close', has_error => {\n// this.clients.delete(client)\n// console.log(port, new Date(), 'client 关闭连接,是否出错:', has_error)\n// })\n \n \n// // --- \n// console.log(port, new Date(), 'gateway 开始连接到 controller')\n// const { hostname, port: master_port } = this.controllers[this.master]\n// await new Promise<void>(resolve => {\n// // callback 会被 socket.once('connect', callback)\n// controller.connect({\n// port: master_port,\n \n// host: hostname,\n// // host: '127.0.0.1',\n \n// family: 0,\n// }, resolve)\n// })\n// console.log(port, new Date(), 'gateway 已连接到 controller')\n \n// // --- \n// console.log(port, new Date(), 'gateway 建立 client <-> controller')\n// client.pipe(controller)\n// controller.pipe(client)\n// },\n \n \n// /** https://www.dolphindb.cn/cn/help/FunctionsandCommands/FunctionReferences/g/getActiveMaster.html?highlight=getactivemaster */\n// async get_active_master () {\n// for (const alias in this.controllers) {\n// const { hostname, port } = this.controllers[alias] as { hostname: string, port: number }\n// const sid = this.sids.get(alias)\n// try {\n// const master = (\n// await ddb.rpc_json('getActiveMaster()', { hostname, port, sid })\n// ).value as string\n// console.log(new Date(), `${alias}.getActiveMaster() -> ${this.master}`)\n// this.sids.set(alias, sid)\n// if (!master)\n// throw new Error(`${new Date().toString()} getActiveMaster 得到的 master 为空`)\n// return master\n// } catch (error) {\n// console.log(new Date(), error)\n// }\n// }\n \n// return this.master\n// },\n \n \n// async auto_switch_master () {\n// if (this.state === 'stopping') {\n// this.state = 'running'\n// console.log('gateway 恢复 auto_switch_master')\n// return\n// }\n \n// this.state = 'running'\n \n// for (; this.state === 'running'; ) {\n// const master = this.master\n// const master_ = await this.get_active_master()\n// if (master === master_) {\n// await delay(10 * 1000)\n// continue\n// }\n \n// this.master = master_\n// console.log(new Date(), `master 从 ${master} 切换为 ${master_}, 断开所有 clients`)\n// for (const client of this.clients)\n// client.end()\n// await delay(3 * 1000)\n// }\n \n// console.log(new Date(), `gateway.state === ${this.state}, 停止 auto_switch_master`)\n// this.state = 'stopped'\n// }\n// }\n"]}