builtInCodeLanguages top-level constant
Every language this package can highlight out of the box.
Implementation
const List<CodeLanguage> builtInCodeLanguages = [
CodeLanguage(
id: 'c',
keywords: {..._cCore, 'restrict', '_Bool', 'bool'},
builtins: {'size_t', 'FILE', 'printf', 'malloc', 'free', 'memcpy'},
constants: {'NULL'},
chars: ["'"],
strings: ['"'],
directives: true,
),
CodeLanguage(
id: 'cpp',
aliases: ['c++'],
keywords: {
..._cCore,
'bool',
'catch',
'class',
'concept',
'constexpr',
'consteval',
'const_cast',
'decltype',
'delete',
'dynamic_cast',
'explicit',
'export',
'final',
'friend',
'mutable',
'namespace',
'new',
'noexcept',
'operator',
'override',
'private',
'protected',
'public',
'reinterpret_cast',
'requires',
'static_cast',
'template',
'this',
'throw',
'try',
'typename',
'using',
'virtual',
},
builtins: {
'std',
'string',
'vector',
'map',
'set',
'cout',
'cin',
'cerr',
'endl',
'size_t',
'unique_ptr',
'shared_ptr',
'optional',
},
constants: {'nullptr', 'NULL'},
chars: ["'"],
strings: ['"'],
directives: true,
),
CodeLanguage(
id: 'csharp',
aliases: ['cs', 'c#'],
keywords: {
'abstract',
'as',
'async',
'await',
'base',
'bool',
'break',
'byte',
'case',
'catch',
'char',
'checked',
'class',
'const',
'continue',
'decimal',
'default',
'delegate',
'do',
'double',
'else',
'enum',
'event',
'explicit',
'extern',
'finally',
'fixed',
'float',
'for',
'foreach',
'get',
'goto',
'if',
'implicit',
'in',
'init',
'int',
'interface',
'internal',
'is',
'lock',
'long',
'namespace',
'new',
'object',
'operator',
'out',
'override',
'params',
'private',
'protected',
'public',
'readonly',
'record',
'ref',
'return',
'sbyte',
'sealed',
'set',
'short',
'sizeof',
'stackalloc',
'static',
'string',
'struct',
'switch',
'this',
'throw',
'try',
'typeof',
'uint',
'ulong',
'unchecked',
'unsafe',
'ushort',
'using',
'var',
'virtual',
'void',
'volatile',
'where',
'while',
'yield',
},
builtins: {'Console', 'Task', 'List', 'Dictionary', 'String', 'Math'},
constants: {'null'},
chars: ["'"],
strings: ['"'],
annotations: false,
directives: true,
),
CodeLanguage(
id: 'dart',
keywords: {
'abstract',
'as',
'assert',
'async',
'await',
'base',
'break',
'case',
'catch',
'class',
'const',
'continue',
'covariant',
'default',
'deferred',
'do',
'dynamic',
'else',
'enum',
'export',
'extends',
'extension',
'external',
'factory',
'final',
'finally',
'for',
'get',
'hide',
'if',
'implements',
'import',
'in',
'interface',
'is',
'late',
'library',
'mixin',
'new',
'on',
'operator',
'part',
'required',
'rethrow',
'return',
'sealed',
'set',
'show',
'static',
'super',
'switch',
'sync',
'this',
'throw',
'try',
'typedef',
'var',
'void',
'when',
'while',
'with',
'yield',
},
builtins: {
'int',
'double',
'num',
'bool',
'String',
'List',
'Map',
'Set',
'Future',
'Stream',
'Object',
'Iterable',
'print',
},
constants: {'null'},
multilineStrings: ['"""', "'''"],
annotations: true,
),
CodeLanguage(
id: 'go',
aliases: ['golang'],
keywords: {
'break',
'case',
'chan',
'const',
'continue',
'default',
'defer',
'else',
'fallthrough',
'for',
'func',
'go',
'goto',
'if',
'import',
'interface',
'map',
'package',
'range',
'return',
'select',
'struct',
'switch',
'type',
'var',
},
builtins: {
'append',
'cap',
'close',
'copy',
'delete',
'len',
'make',
'new',
'panic',
'print',
'println',
'recover',
'string',
'int',
'int64',
'float64',
'bool',
'byte',
'rune',
'error',
'fmt',
},
constants: {'nil', 'iota'},
chars: ["'"],
strings: ['"'],
multilineStrings: ['`'],
),
CodeLanguage(
id: 'java',
keywords: {
'abstract',
'assert',
'boolean',
'break',
'byte',
'case',
'catch',
'char',
'class',
'const',
'continue',
'default',
'do',
'double',
'else',
'enum',
'extends',
'final',
'finally',
'float',
'for',
'goto',
'if',
'implements',
'import',
'instanceof',
'int',
'interface',
'long',
'native',
'new',
'package',
'permits',
'private',
'protected',
'public',
'record',
'return',
'sealed',
'short',
'static',
'strictfp',
'super',
'switch',
'synchronized',
'this',
'throw',
'throws',
'transient',
'try',
'var',
'void',
'volatile',
'while',
'yield',
},
builtins: {
'String',
'System',
'Integer',
'Long',
'Double',
'Boolean',
'Object',
'List',
'Map',
'Set',
'ArrayList',
'HashMap',
'Optional',
'Stream',
},
constants: {'null'},
chars: ["'"],
strings: ['"'],
annotations: true,
),
CodeLanguage(
id: 'javascript',
aliases: ['js', 'jsx', 'mjs'],
keywords: {
'as',
'async',
'await',
'break',
'case',
'catch',
'class',
'const',
'continue',
'debugger',
'default',
'delete',
'do',
'else',
'export',
'extends',
'finally',
'for',
'from',
'function',
'get',
'if',
'import',
'in',
'instanceof',
'let',
'new',
'of',
'return',
'set',
'static',
'super',
'switch',
'this',
'throw',
'try',
'typeof',
'var',
'void',
'while',
'with',
'yield',
},
builtins: {
'console',
'window',
'document',
'Math',
'JSON',
'Promise',
'Array',
'Object',
'String',
'Number',
'Boolean',
'Symbol',
'Map',
'Set',
'RegExp',
'Error',
'require',
'module',
'exports',
'process',
},
constants: {'null', 'undefined', 'NaN', 'Infinity'},
multilineStrings: ['`'],
),
CodeLanguage(
id: 'json',
keywords: {},
constants: {'null'},
lineComments: [],
blockComments: [],
strings: ['"'],
stringKeys: true,
capitalizedIsType: false,
),
CodeLanguage(
id: 'kotlin',
aliases: ['kt'],
keywords: {
'as',
'break',
'by',
'catch',
'class',
'companion',
'const',
'constructor',
'continue',
'crossinline',
'data',
'do',
'else',
'enum',
'external',
'final',
'finally',
'for',
'fun',
'get',
'if',
'import',
'in',
'infix',
'init',
'inline',
'inner',
'interface',
'internal',
'is',
'lateinit',
'noinline',
'object',
'open',
'operator',
'out',
'override',
'package',
'private',
'protected',
'public',
'reified',
'return',
'sealed',
'set',
'super',
'suspend',
'tailrec',
'this',
'throw',
'try',
'typealias',
'val',
'var',
'vararg',
'when',
'where',
'while',
},
builtins: {
'Int',
'Long',
'Double',
'Float',
'Boolean',
'String',
'List',
'Map',
'Set',
'Unit',
'Any',
'println',
'print',
'it',
},
constants: {'null'},
chars: ["'"],
strings: ['"'],
multilineStrings: ['"""'],
annotations: true,
),
CodeLanguage(
id: 'python',
aliases: ['py'],
keywords: {
'and',
'as',
'assert',
'async',
'await',
'break',
'case',
'class',
'continue',
'def',
'del',
'elif',
'else',
'except',
'finally',
'for',
'from',
'global',
'if',
'import',
'in',
'is',
'lambda',
'match',
'nonlocal',
'not',
'or',
'pass',
'raise',
'return',
'try',
'while',
'with',
'yield',
},
builtins: {
'print',
'len',
'range',
'str',
'int',
'float',
'bool',
'list',
'dict',
'set',
'tuple',
'self',
'super',
'open',
'enumerate',
'zip',
'map',
'filter',
'isinstance',
'type',
'sorted',
'sum',
},
booleans: {'True', 'False'},
constants: {'None'},
lineComments: ['#'],
blockComments: [],
multilineStrings: ['"""', "'''"],
annotations: true,
),
CodeLanguage(
id: 'rust',
aliases: ['rs'],
keywords: {
'as',
'async',
'await',
'break',
'const',
'continue',
'crate',
'dyn',
'else',
'enum',
'extern',
'fn',
'for',
'if',
'impl',
'in',
'let',
'loop',
'match',
'mod',
'move',
'mut',
'pub',
'ref',
'return',
'self',
'Self',
'static',
'struct',
'super',
'trait',
'type',
'unsafe',
'use',
'where',
'while',
},
builtins: {
'String',
'Vec',
'Option',
'Result',
'Box',
'Some',
'None',
'Ok',
'Err',
'println',
'print',
'format',
'u8',
'u32',
'u64',
'i32',
'i64',
'f64',
'usize',
'bool',
'str',
},
// No character literals: `'a` is a lifetime far more often than it is a
// letter, and mis-lexing one swallows the rest of the line.
strings: ['"'],
),
CodeLanguage(
id: 'shell',
aliases: ['sh', 'bash', 'zsh'],
keywords: {
'if',
'then',
'else',
'elif',
'fi',
'for',
'while',
'until',
'do',
'done',
'case',
'esac',
'in',
'function',
'return',
'break',
'continue',
'local',
'export',
'source',
'alias',
'set',
'unset',
'shift',
'exit',
},
builtins: {
'echo',
'cd',
'ls',
'cat',
'grep',
'sed',
'awk',
'curl',
'git',
'sudo',
'mkdir',
'rm',
'cp',
'mv',
'test',
'read',
},
lineComments: ['#'],
blockComments: [],
variables: true,
capitalizedIsType: false,
),
CodeLanguage(
id: 'sql',
keywords: {
'select',
'from',
'where',
'insert',
'into',
'values',
'update',
'set',
'delete',
'create',
'table',
'alter',
'drop',
'index',
'view',
'join',
'left',
'right',
'inner',
'outer',
'full',
'on',
'group',
'by',
'order',
'having',
'limit',
'offset',
'union',
'all',
'as',
'and',
'or',
'not',
'null',
'distinct',
'primary',
'key',
'foreign',
'references',
'default',
'constraint',
'check',
'unique',
'case',
'when',
'then',
'else',
'end',
'exists',
'between',
'like',
'in',
'asc',
'desc',
'with',
'returning',
},
builtins: {
'count',
'sum',
'avg',
'min',
'max',
'coalesce',
'cast',
'now',
'int',
'text',
'varchar',
'boolean',
'timestamp',
'serial',
'uuid',
},
lineComments: ['--'],
strings: ["'"],
ignoreCase: true,
capitalizedIsType: false,
),
CodeLanguage(
id: 'swift',
keywords: {
'actor',
'associatedtype',
'async',
'await',
'break',
'case',
'catch',
'class',
'continue',
'default',
'defer',
'deinit',
'didSet',
'do',
'else',
'enum',
'extension',
'fallthrough',
'fileprivate',
'final',
'for',
'func',
'get',
'guard',
'if',
'import',
'in',
'indirect',
'init',
'inout',
'internal',
'is',
'lazy',
'let',
'mutating',
'nonmutating',
'open',
'operator',
'private',
'protocol',
'public',
'repeat',
'rethrows',
'return',
'self',
'Self',
'set',
'some',
'static',
'struct',
'subscript',
'super',
'switch',
'throw',
'throws',
'try',
'typealias',
'unowned',
'var',
'weak',
'where',
'while',
'willSet',
},
builtins: {
'String',
'Int',
'Double',
'Float',
'Bool',
'Array',
'Dictionary',
'Set',
'Optional',
'Result',
'print',
'Task',
'Data',
'URL',
},
constants: {'nil'},
strings: ['"'],
multilineStrings: ['"""'],
annotations: true,
),
CodeLanguage(
id: 'typescript',
aliases: ['ts', 'tsx'],
keywords: {
'abstract',
'any',
'as',
'asserts',
'async',
'await',
'bigint',
'boolean',
'break',
'case',
'catch',
'class',
'const',
'continue',
'declare',
'default',
'delete',
'do',
'else',
'enum',
'export',
'extends',
'finally',
'for',
'from',
'function',
'get',
'if',
'implements',
'import',
'in',
'infer',
'instanceof',
'interface',
'is',
'keyof',
'let',
'namespace',
'never',
'new',
'number',
'object',
'of',
'private',
'protected',
'public',
'readonly',
'return',
'satisfies',
'set',
'static',
'string',
'super',
'switch',
'symbol',
'this',
'throw',
'try',
'type',
'typeof',
'unknown',
'var',
'void',
'while',
'yield',
},
builtins: {
'console',
'window',
'document',
'Math',
'JSON',
'Promise',
'Array',
'Object',
'String',
'Number',
'Boolean',
'Symbol',
'Map',
'Set',
'Record',
'Partial',
'Readonly',
'Error',
'require',
},
constants: {'null', 'undefined', 'NaN', 'Infinity'},
multilineStrings: ['`'],
annotations: true,
),
];