julia function
Highlight.js language definition for julia.
Implementation
Mode julia(Highlight hljs) {
final Mode mode0 = Mode();
final Mode mode1 = Mode();
final Mode mode2 = Mode();
final Mode mode3 = Mode();
final Mode mode4 = Mode();
final Mode mode5 = Mode();
final Mode mode6 = Mode();
final Mode mode7 = Mode();
final Mode mode8 = Mode();
final Mode mode9 = Mode();
final Mode mode10 = Mode();
final Mode mode11 = Mode();
final Mode mode12 = Mode();
final Mode mode13 = Mode();
final Mode mode14 = Mode();
final Mode mode15 = Mode();
final Mode mode16 = Mode();
final Mode mode17 = Mode();
mode0.scope = r'number';
mode0.begin =
r'(\b0x[\d_]*(\.[\d_]*)?|0x\.\d[\d_]*)p[-+]?\d+|\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\b\d[\d_]*(\.[\d_]*)?|\.\d[\d_]*)([eEfF][-+]?\d+)?';
mode0.relevance = 0;
mode1.scope = r'string';
mode1.begin = r"'(.|\\[xXuU][a-zA-Z0-9]+)'";
mode2.scope = r'string';
mode2.contains = [mode3, mode4, mode6];
mode2.variants = [mode16, mode17];
mode3.begin = r'\\[\s\S]';
mode3.relevance = 0;
mode4.scope = r'subst';
mode4.begin = r'\$\(';
mode4.end = r'\)';
mode4.keywords = {
r'$pattern': r'[A-Za-z_\u00A1-\uFFFF][A-Za-z_0-9\u00A1-\uFFFF]*',
r'keyword': [
r'baremodule',
r'begin',
r'break',
r'catch',
r'ccall',
r'const',
r'continue',
r'do',
r'else',
r'elseif',
r'end',
r'export',
r'false',
r'finally',
r'for',
r'function',
r'global',
r'if',
r'import',
r'in',
r'isa',
r'let',
r'local',
r'macro',
r'module',
r'quote',
r'return',
r'true',
r'try',
r'using',
r'where',
r'while',
],
r'literal': [
r'ARGS',
r'C_NULL',
r'DEPOT_PATH',
r'ENDIAN_BOM',
r'ENV',
r'Inf',
r'Inf16',
r'Inf32',
r'Inf64',
r'InsertionSort',
r'LOAD_PATH',
r'MergeSort',
r'NaN',
r'NaN16',
r'NaN32',
r'NaN64',
r'PROGRAM_FILE',
r'QuickSort',
r'RoundDown',
r'RoundFromZero',
r'RoundNearest',
r'RoundNearestTiesAway',
r'RoundNearestTiesUp',
r'RoundToZero',
r'RoundUp',
r'VERSION|0',
r'devnull',
r'false',
r'im',
r'missing',
r'nothing',
r'pi',
r'stderr',
r'stdin',
r'stdout',
r'true',
r'undef',
r'π',
r'ℯ',
],
r'built_in': [
r'AbstractArray',
r'AbstractChannel',
r'AbstractChar',
r'AbstractDict',
r'AbstractDisplay',
r'AbstractFloat',
r'AbstractIrrational',
r'AbstractMatrix',
r'AbstractRange',
r'AbstractSet',
r'AbstractString',
r'AbstractUnitRange',
r'AbstractVecOrMat',
r'AbstractVector',
r'Any',
r'ArgumentError',
r'Array',
r'AssertionError',
r'BigFloat',
r'BigInt',
r'BitArray',
r'BitMatrix',
r'BitSet',
r'BitVector',
r'Bool',
r'BoundsError',
r'CapturedException',
r'CartesianIndex',
r'CartesianIndices',
r'Cchar',
r'Cdouble',
r'Cfloat',
r'Channel',
r'Char',
r'Cint',
r'Cintmax_t',
r'Clong',
r'Clonglong',
r'Cmd',
r'Colon',
r'Complex',
r'ComplexF16',
r'ComplexF32',
r'ComplexF64',
r'CompositeException',
r'Condition',
r'Cptrdiff_t',
r'Cshort',
r'Csize_t',
r'Cssize_t',
r'Cstring',
r'Cuchar',
r'Cuint',
r'Cuintmax_t',
r'Culong',
r'Culonglong',
r'Cushort',
r'Cvoid',
r'Cwchar_t',
r'Cwstring',
r'DataType',
r'DenseArray',
r'DenseMatrix',
r'DenseVecOrMat',
r'DenseVector',
r'Dict',
r'DimensionMismatch',
r'Dims',
r'DivideError',
r'DomainError',
r'EOFError',
r'Enum',
r'ErrorException',
r'Exception',
r'ExponentialBackOff',
r'Expr',
r'Float16',
r'Float32',
r'Float64',
r'Function',
r'GlobalRef',
r'HTML',
r'IO',
r'IOBuffer',
r'IOContext',
r'IOStream',
r'IdDict',
r'IndexCartesian',
r'IndexLinear',
r'IndexStyle',
r'InexactError',
r'InitError',
r'Int',
r'Int128',
r'Int16',
r'Int32',
r'Int64',
r'Int8',
r'Integer',
r'InterruptException',
r'InvalidStateException',
r'Irrational',
r'KeyError',
r'LinRange',
r'LineNumberNode',
r'LinearIndices',
r'LoadError',
r'MIME',
r'Matrix',
r'Method',
r'MethodError',
r'Missing',
r'MissingException',
r'Module',
r'NTuple',
r'NamedTuple',
r'Nothing',
r'Number',
r'OrdinalRange',
r'OutOfMemoryError',
r'OverflowError',
r'Pair',
r'PartialQuickSort',
r'PermutedDimsArray',
r'Pipe',
r'ProcessFailedException',
r'Ptr',
r'QuoteNode',
r'Rational',
r'RawFD',
r'ReadOnlyMemoryError',
r'Real',
r'ReentrantLock',
r'Ref',
r'Regex',
r'RegexMatch',
r'RoundingMode',
r'SegmentationFault',
r'Set',
r'Signed',
r'Some',
r'StackOverflowError',
r'StepRange',
r'StepRangeLen',
r'StridedArray',
r'StridedMatrix',
r'StridedVecOrMat',
r'StridedVector',
r'String',
r'StringIndexError',
r'SubArray',
r'SubString',
r'SubstitutionString',
r'Symbol',
r'SystemError',
r'Task',
r'TaskFailedException',
r'Text',
r'TextDisplay',
r'Timer',
r'Tuple',
r'Type',
r'TypeError',
r'TypeVar',
r'UInt',
r'UInt128',
r'UInt16',
r'UInt32',
r'UInt64',
r'UInt8',
r'UndefInitializer',
r'UndefKeywordError',
r'UndefRefError',
r'UndefVarError',
r'Union',
r'UnionAll',
r'UnitRange',
r'Unsigned',
r'Val',
r'Vararg',
r'VecElement',
r'VecOrMat',
r'Vector',
r'VersionNumber',
r'WeakKeyDict',
r'WeakRef',
],
};
mode4.contains = [
mode0,
mode1,
mode2,
mode5,
mode7,
mode8,
mode11,
mode14,
mode15,
];
mode5.scope = r'string';
mode5.contains = [mode3, mode4, mode6];
mode5.begin = r'`';
mode5.end = r'`';
mode6.scope = r'variable';
mode6.begin = r'\$[A-Za-z_\u00A1-\uFFFF][A-Za-z_0-9\u00A1-\uFFFF]*';
mode7.scope = r'meta';
mode7.begin = r'@[A-Za-z_\u00A1-\uFFFF][A-Za-z_0-9\u00A1-\uFFFF]*';
mode8.scope = r'comment';
mode8.variants = [mode9, mode10];
mode9.begin = r'#=';
mode9.end = r'=#';
mode9.relevance = 10;
mode10.begin = r'#';
mode10.end = r'$';
mode11.scope = r'comment';
mode11.begin = r'#';
mode11.end = r'$';
mode11.contains = [mode12, mode13];
mode12.scope = r'doctag';
mode12.begin = r'[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)';
mode12.end = r'(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):';
mode12.excludeBegin = true;
mode12.relevance = 0;
mode13.begin =
r"[ ]+((?:I|a|is|so|us|to|at|if|in|it|on|[A-Za-z]+['](d|ve|re|ll|t|s|n)|[A-Za-z]+[-][a-z]+|[A-Za-z][a-z]{2,})[.]?[:]?([.][ ]|[ ])){3}";
mode14.scope = r'keyword';
mode14.begin = r'\b(((abstract|primitive)\s+)type|(mutable\s+)?struct)\b';
mode15.begin = r'<:';
mode16.begin = r'\w*"""';
mode16.end = r'"""\w*';
mode16.relevance = 10;
mode17.begin = r'\w*"';
mode17.end = r'"\w*';
return Mode(
keywords: {
r'$pattern': r'[A-Za-z_\u00A1-\uFFFF][A-Za-z_0-9\u00A1-\uFFFF]*',
r'keyword': [
r'baremodule',
r'begin',
r'break',
r'catch',
r'ccall',
r'const',
r'continue',
r'do',
r'else',
r'elseif',
r'end',
r'export',
r'false',
r'finally',
r'for',
r'function',
r'global',
r'if',
r'import',
r'in',
r'isa',
r'let',
r'local',
r'macro',
r'module',
r'quote',
r'return',
r'true',
r'try',
r'using',
r'where',
r'while',
],
r'literal': [
r'ARGS',
r'C_NULL',
r'DEPOT_PATH',
r'ENDIAN_BOM',
r'ENV',
r'Inf',
r'Inf16',
r'Inf32',
r'Inf64',
r'InsertionSort',
r'LOAD_PATH',
r'MergeSort',
r'NaN',
r'NaN16',
r'NaN32',
r'NaN64',
r'PROGRAM_FILE',
r'QuickSort',
r'RoundDown',
r'RoundFromZero',
r'RoundNearest',
r'RoundNearestTiesAway',
r'RoundNearestTiesUp',
r'RoundToZero',
r'RoundUp',
r'VERSION|0',
r'devnull',
r'false',
r'im',
r'missing',
r'nothing',
r'pi',
r'stderr',
r'stdin',
r'stdout',
r'true',
r'undef',
r'π',
r'ℯ',
],
r'built_in': [
r'AbstractArray',
r'AbstractChannel',
r'AbstractChar',
r'AbstractDict',
r'AbstractDisplay',
r'AbstractFloat',
r'AbstractIrrational',
r'AbstractMatrix',
r'AbstractRange',
r'AbstractSet',
r'AbstractString',
r'AbstractUnitRange',
r'AbstractVecOrMat',
r'AbstractVector',
r'Any',
r'ArgumentError',
r'Array',
r'AssertionError',
r'BigFloat',
r'BigInt',
r'BitArray',
r'BitMatrix',
r'BitSet',
r'BitVector',
r'Bool',
r'BoundsError',
r'CapturedException',
r'CartesianIndex',
r'CartesianIndices',
r'Cchar',
r'Cdouble',
r'Cfloat',
r'Channel',
r'Char',
r'Cint',
r'Cintmax_t',
r'Clong',
r'Clonglong',
r'Cmd',
r'Colon',
r'Complex',
r'ComplexF16',
r'ComplexF32',
r'ComplexF64',
r'CompositeException',
r'Condition',
r'Cptrdiff_t',
r'Cshort',
r'Csize_t',
r'Cssize_t',
r'Cstring',
r'Cuchar',
r'Cuint',
r'Cuintmax_t',
r'Culong',
r'Culonglong',
r'Cushort',
r'Cvoid',
r'Cwchar_t',
r'Cwstring',
r'DataType',
r'DenseArray',
r'DenseMatrix',
r'DenseVecOrMat',
r'DenseVector',
r'Dict',
r'DimensionMismatch',
r'Dims',
r'DivideError',
r'DomainError',
r'EOFError',
r'Enum',
r'ErrorException',
r'Exception',
r'ExponentialBackOff',
r'Expr',
r'Float16',
r'Float32',
r'Float64',
r'Function',
r'GlobalRef',
r'HTML',
r'IO',
r'IOBuffer',
r'IOContext',
r'IOStream',
r'IdDict',
r'IndexCartesian',
r'IndexLinear',
r'IndexStyle',
r'InexactError',
r'InitError',
r'Int',
r'Int128',
r'Int16',
r'Int32',
r'Int64',
r'Int8',
r'Integer',
r'InterruptException',
r'InvalidStateException',
r'Irrational',
r'KeyError',
r'LinRange',
r'LineNumberNode',
r'LinearIndices',
r'LoadError',
r'MIME',
r'Matrix',
r'Method',
r'MethodError',
r'Missing',
r'MissingException',
r'Module',
r'NTuple',
r'NamedTuple',
r'Nothing',
r'Number',
r'OrdinalRange',
r'OutOfMemoryError',
r'OverflowError',
r'Pair',
r'PartialQuickSort',
r'PermutedDimsArray',
r'Pipe',
r'ProcessFailedException',
r'Ptr',
r'QuoteNode',
r'Rational',
r'RawFD',
r'ReadOnlyMemoryError',
r'Real',
r'ReentrantLock',
r'Ref',
r'Regex',
r'RegexMatch',
r'RoundingMode',
r'SegmentationFault',
r'Set',
r'Signed',
r'Some',
r'StackOverflowError',
r'StepRange',
r'StepRangeLen',
r'StridedArray',
r'StridedMatrix',
r'StridedVecOrMat',
r'StridedVector',
r'String',
r'StringIndexError',
r'SubArray',
r'SubString',
r'SubstitutionString',
r'Symbol',
r'SystemError',
r'Task',
r'TaskFailedException',
r'Text',
r'TextDisplay',
r'Timer',
r'Tuple',
r'Type',
r'TypeError',
r'TypeVar',
r'UInt',
r'UInt128',
r'UInt16',
r'UInt32',
r'UInt64',
r'UInt8',
r'UndefInitializer',
r'UndefKeywordError',
r'UndefRefError',
r'UndefVarError',
r'Union',
r'UnionAll',
r'UnitRange',
r'Unsigned',
r'Val',
r'Vararg',
r'VecElement',
r'VecOrMat',
r'Vector',
r'VersionNumber',
r'WeakKeyDict',
r'WeakRef',
],
},
illegal: r'<\/',
name: r'Julia',
contains: [
mode0,
mode1,
mode2,
mode5,
mode7,
mode8,
mode11,
mode14,
mode15,
],
);
}