123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411 |
- """
- pygments.lexers._julia_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Julia builtins.
- :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
- """
- # operators
- # see https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm
- # Julia v1.6.0-rc1
- OPERATORS_LIST = [
- # other
- '->',
- # prec-assignment
- ':=', '$=',
- # prec-conditional, prec-lazy-or, prec-lazy-and
- '?', '||', '&&',
- # prec-colon
- ':',
- # prec-plus
- '$',
- # prec-decl
- '::',
- ]
- DOTTED_OPERATORS_LIST = [
- # prec-assignment
- r'=', r'+=', r'-=', r'*=', r'/=', r'//=', r'\=', r'^=', r'÷=', r'%=', r'<<=',
- r'>>=', r'>>>=', r'|=', r'&=', r'⊻=', r'≔', r'⩴', r"≕'", r'~',
- # prec-pair
- '=>',
- # prec-arrow
- r'→', r'↔', r'↚', r'↛', r'↞', r'↠', r'↢', r'↣', r'↦', r'↤', r'↮', r'⇎', r'⇍', r'⇏',
- r'⇐', r'⇒', r'⇔', r'⇴', r'⇶', r'⇷', r'⇸', r'⇹', r'⇺', r'⇻', r'⇼', r'⇽', r'⇾', r'⇿',
- r'⟵', r'⟶', r'⟷', r'⟹', r'⟺', r'⟻', r'⟼', r'⟽', r'⟾', r'⟿', r'⤀', r'⤁', r'⤂', r'⤃',
- r'⤄', r'⤅', r'⤆', r'⤇', r'⤌', r'⤍', r'⤎', r'⤏', r'⤐', r'⤑', r'⤔', r'⤕', r'⤖', r'⤗',
- r'⤘', r'⤝', r'⤞', r'⤟', r'⤠', r'⥄', r'⥅', r'⥆', r'⥇', r'⥈', r'⥊', r'⥋', r'⥎', r'⥐',
- r'⥒', r'⥓', r'⥖', r'⥗', r'⥚', r'⥛', r'⥞', r'⥟', r'⥢', r'⥤', r'⥦', r'⥧', r'⥨', r'⥩',
- r'⥪', r'⥫', r'⥬', r'⥭', r'⥰', r'⧴', r'⬱', r'⬰', r'⬲', r'⬳', r'⬴', r'⬵', r'⬶', r'⬷',
- r'⬸', r'⬹', r'⬺', r'⬻', r'⬼', r'⬽', r'⬾', r'⬿', r'⭀', r'⭁', r'⭂', r'⭃', r'⭄', r'⭇',
- r'⭈', r'⭉', r'⭊', r'⭋', r'⭌', r'←', r'→', r'⇜', r'⇝', r'↜', r'↝', r'↩', r'↪', r'↫',
- r'↬', r'↼', r'↽', r'⇀', r'⇁', r'⇄', r'⇆', r'⇇', r'⇉', r'⇋', r'⇌', r'⇚', r'⇛', r'⇠',
- r'⇢', r'↷', r'↶', r'↺', r'↻', r'-->', r'<--', r'<-->',
- # prec-comparison
- r'>', r'<', r'>=', r'≥', r'<=', r'≤', r'==', r'===', r'≡', r'!=', r'≠', r'!==',
- r'≢', r'∈', r'∉', r'∋', r'∌', r'⊆', r'⊈', r'⊂', r'⊄', r'⊊', r'∝', r'∊', r'∍', r'∥',
- r'∦', r'∷', r'∺', r'∻', r'∽', r'∾', r'≁', r'≃', r'≂', r'≄', r'≅', r'≆', r'≇', r'≈',
- r'≉', r'≊', r'≋', r'≌', r'≍', r'≎', r'≐', r'≑', r'≒', r'≓', r'≖', r'≗', r'≘', r'≙',
- r'≚', r'≛', r'≜', r'≝', r'≞', r'≟', r'≣', r'≦', r'≧', r'≨', r'≩', r'≪', r'≫', r'≬',
- r'≭', r'≮', r'≯', r'≰', r'≱', r'≲', r'≳', r'≴', r'≵', r'≶', r'≷', r'≸', r'≹', r'≺',
- r'≻', r'≼', r'≽', r'≾', r'≿', r'⊀', r'⊁', r'⊃', r'⊅', r'⊇', r'⊉', r'⊋', r'⊏', r'⊐',
- r'⊑', r'⊒', r'⊜', r'⊩', r'⊬', r'⊮', r'⊰', r'⊱', r'⊲', r'⊳', r'⊴', r'⊵', r'⊶', r'⊷',
- r'⋍', r'⋐', r'⋑', r'⋕', r'⋖', r'⋗', r'⋘', r'⋙', r'⋚', r'⋛', r'⋜', r'⋝', r'⋞', r'⋟',
- r'⋠', r'⋡', r'⋢', r'⋣', r'⋤', r'⋥', r'⋦', r'⋧', r'⋨', r'⋩', r'⋪', r'⋫', r'⋬', r'⋭',
- r'⋲', r'⋳', r'⋴', r'⋵', r'⋶', r'⋷', r'⋸', r'⋹', r'⋺', r'⋻', r'⋼', r'⋽', r'⋾', r'⋿',
- r'⟈', r'⟉', r'⟒', r'⦷', r'⧀', r'⧁', r'⧡', r'⧣', r'⧤', r'⧥', r'⩦', r'⩧', r'⩪', r'⩫',
- r'⩬', r'⩭', r'⩮', r'⩯', r'⩰', r'⩱', r'⩲', r'⩳', r'⩵', r'⩶', r'⩷', r'⩸', r'⩹', r'⩺',
- r'⩻', r'⩼', r'⩽', r'⩾', r'⩿', r'⪀', r'⪁', r'⪂', r'⪃', r'⪄', r'⪅', r'⪆', r'⪇', r'⪈',
- r'⪉', r'⪊', r'⪋', r'⪌', r'⪍', r'⪎', r'⪏', r'⪐', r'⪑', r'⪒', r'⪓', r'⪔', r'⪕', r'⪖',
- r'⪗', r'⪘', r'⪙', r'⪚', r'⪛', r'⪜', r'⪝', r'⪞', r'⪟', r'⪠', r'⪡', r'⪢', r'⪣', r'⪤',
- r'⪥', r'⪦', r'⪧', r'⪨', r'⪩', r'⪪', r'⪫', r'⪬', r'⪭', r'⪮', r'⪯', r'⪰', r'⪱', r'⪲',
- r'⪳', r'⪴', r'⪵', r'⪶', r'⪷', r'⪸', r'⪹', r'⪺', r'⪻', r'⪼', r'⪽', r'⪾', r'⪿', r'⫀',
- r'⫁', r'⫂', r'⫃', r'⫄', r'⫅', r'⫆', r'⫇', r'⫈', r'⫉', r'⫊', r'⫋', r'⫌', r'⫍', r'⫎',
- r'⫏', r'⫐', r'⫑', r'⫒', r'⫓', r'⫔', r'⫕', r'⫖', r'⫗', r'⫘', r'⫙', r'⫷', r'⫸', r'⫹',
- r'⫺', r'⊢', r'⊣', r'⟂', r'<:', r'>:',
- # prec-pipe
- '<|', '|>',
- # prec-colon
- r'…', r'⁝', r'⋮', r'⋱', r'⋰', r'⋯',
- # prec-plus
- r'+', r'-', r'¦', r'|', r'⊕', r'⊖', r'⊞', r'⊟', r'++', r'∪', r'∨', r'⊔', r'±', r'∓',
- r'∔', r'∸', r'≏', r'⊎', r'⊻', r'⊽', r'⋎', r'⋓', r'⧺', r'⧻', r'⨈', r'⨢', r'⨣', r'⨤',
- r'⨥', r'⨦', r'⨧', r'⨨', r'⨩', r'⨪', r'⨫', r'⨬', r'⨭', r'⨮', r'⨹', r'⨺', r'⩁', r'⩂',
- r'⩅', r'⩊', r'⩌', r'⩏', r'⩐', r'⩒', r'⩔', r'⩖', r'⩗', r'⩛', r'⩝', r'⩡', r'⩢', r'⩣',
- # prec-times
- r'*', r'/', r'⌿', r'÷', r'%', r'&', r'⋅', r'∘', r'×', '\\', r'∩', r'∧', r'⊗', r'⊘',
- r'⊙', r'⊚', r'⊛', r'⊠', r'⊡', r'⊓', r'∗', r'∙', r'∤', r'⅋', r'≀', r'⊼', r'⋄', r'⋆',
- r'⋇', r'⋉', r'⋊', r'⋋', r'⋌', r'⋏', r'⋒', r'⟑', r'⦸', r'⦼', r'⦾', r'⦿', r'⧶', r'⧷',
- r'⨇', r'⨰', r'⨱', r'⨲', r'⨳', r'⨴', r'⨵', r'⨶', r'⨷', r'⨸', r'⨻', r'⨼', r'⨽', r'⩀',
- r'⩃', r'⩄', r'⩋', r'⩍', r'⩎', r'⩑', r'⩓', r'⩕', r'⩘', r'⩚', r'⩜', r'⩞', r'⩟', r'⩠',
- r'⫛', r'⊍', r'▷', r'⨝', r'⟕', r'⟖', r'⟗', r'⨟',
- # prec-rational, prec-bitshift
- '//', '>>', '<<', '>>>',
- # prec-power
- r'^', r'↑', r'↓', r'⇵', r'⟰', r'⟱', r'⤈', r'⤉', r'⤊', r'⤋', r'⤒', r'⤓', r'⥉', r'⥌',
- r'⥍', r'⥏', r'⥑', r'⥔', r'⥕', r'⥘', r'⥙', r'⥜', r'⥝', r'⥠', r'⥡', r'⥣', r'⥥', r'⥮',
- r'⥯', r'↑', r'↓',
- # unary-ops, excluding unary-and-binary-ops
- '!', r'¬', r'√', r'∛', r'∜'
- ]
- # Generated with the following in Julia v1.6.0-rc1
- '''
- #!/usr/bin/env julia
- import REPL.REPLCompletions
- res = String["in", "isa", "where"]
- for kw in collect(x.keyword for x in REPLCompletions.complete_keyword(""))
- if !(contains(kw, " ") || kw == "struct")
- push!(res, kw)
- end
- end
- sort!(unique!(setdiff!(res, ["true", "false"])))
- foreach(x -> println("\'", x, "\',"), res)
- '''
- KEYWORD_LIST = (
- 'baremodule',
- 'begin',
- 'break',
- 'catch',
- 'ccall',
- 'const',
- 'continue',
- 'do',
- 'else',
- 'elseif',
- 'end',
- 'export',
- 'finally',
- 'for',
- 'function',
- 'global',
- 'if',
- 'import',
- 'in',
- 'isa',
- 'let',
- 'local',
- 'macro',
- 'module',
- 'quote',
- 'return',
- 'try',
- 'using',
- 'where',
- 'while',
- )
- # Generated with the following in Julia v1.6.0-rc1
- '''
- #!/usr/bin/env julia
- import REPL.REPLCompletions
- res = String[]
- for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),
- REPLCompletions.completions("", 0)[1])
- try
- v = eval(Symbol(compl.mod))
- if (v isa Type || v isa TypeVar) && (compl.mod != "=>")
- push!(res, compl.mod)
- end
- catch e
- end
- end
- sort!(unique!(res))
- foreach(x -> println("\'", x, "\',"), res)
- '''
- BUILTIN_LIST = (
- 'AbstractArray',
- 'AbstractChannel',
- 'AbstractChar',
- 'AbstractDict',
- 'AbstractDisplay',
- 'AbstractFloat',
- 'AbstractIrrational',
- 'AbstractMatch',
- 'AbstractMatrix',
- 'AbstractPattern',
- 'AbstractRange',
- 'AbstractSet',
- 'AbstractString',
- 'AbstractUnitRange',
- 'AbstractVecOrMat',
- 'AbstractVector',
- 'Any',
- 'ArgumentError',
- 'Array',
- 'AssertionError',
- 'BigFloat',
- 'BigInt',
- 'BitArray',
- 'BitMatrix',
- 'BitSet',
- 'BitVector',
- 'Bool',
- 'BoundsError',
- 'CapturedException',
- 'CartesianIndex',
- 'CartesianIndices',
- 'Cchar',
- 'Cdouble',
- 'Cfloat',
- 'Channel',
- 'Char',
- 'Cint',
- 'Cintmax_t',
- 'Clong',
- 'Clonglong',
- 'Cmd',
- 'Colon',
- 'Complex',
- 'ComplexF16',
- 'ComplexF32',
- 'ComplexF64',
- 'ComposedFunction',
- 'CompositeException',
- 'Condition',
- 'Cptrdiff_t',
- 'Cshort',
- 'Csize_t',
- 'Cssize_t',
- 'Cstring',
- 'Cuchar',
- 'Cuint',
- 'Cuintmax_t',
- 'Culong',
- 'Culonglong',
- 'Cushort',
- 'Cvoid',
- 'Cwchar_t',
- 'Cwstring',
- 'DataType',
- 'DenseArray',
- 'DenseMatrix',
- 'DenseVecOrMat',
- 'DenseVector',
- 'Dict',
- 'DimensionMismatch',
- 'Dims',
- 'DivideError',
- 'DomainError',
- 'EOFError',
- 'Enum',
- 'ErrorException',
- 'Exception',
- 'ExponentialBackOff',
- 'Expr',
- 'Float16',
- 'Float32',
- 'Float64',
- 'Function',
- 'GlobalRef',
- 'HTML',
- 'IO',
- 'IOBuffer',
- 'IOContext',
- 'IOStream',
- 'IdDict',
- 'IndexCartesian',
- 'IndexLinear',
- 'IndexStyle',
- 'InexactError',
- 'InitError',
- 'Int',
- 'Int128',
- 'Int16',
- 'Int32',
- 'Int64',
- 'Int8',
- 'Integer',
- 'InterruptException',
- 'InvalidStateException',
- 'Irrational',
- 'KeyError',
- 'LinRange',
- 'LineNumberNode',
- 'LinearIndices',
- 'LoadError',
- 'MIME',
- 'Matrix',
- 'Method',
- 'MethodError',
- 'Missing',
- 'MissingException',
- 'Module',
- 'NTuple',
- 'NamedTuple',
- 'Nothing',
- 'Number',
- 'OrdinalRange',
- 'OutOfMemoryError',
- 'OverflowError',
- 'Pair',
- 'PartialQuickSort',
- 'PermutedDimsArray',
- 'Pipe',
- 'ProcessFailedException',
- 'Ptr',
- 'QuoteNode',
- 'Rational',
- 'RawFD',
- 'ReadOnlyMemoryError',
- 'Real',
- 'ReentrantLock',
- 'Ref',
- 'Regex',
- 'RegexMatch',
- 'RoundingMode',
- 'SegmentationFault',
- 'Set',
- 'Signed',
- 'Some',
- 'StackOverflowError',
- 'StepRange',
- 'StepRangeLen',
- 'StridedArray',
- 'StridedMatrix',
- 'StridedVecOrMat',
- 'StridedVector',
- 'String',
- 'StringIndexError',
- 'SubArray',
- 'SubString',
- 'SubstitutionString',
- 'Symbol',
- 'SystemError',
- 'Task',
- 'TaskFailedException',
- 'Text',
- 'TextDisplay',
- 'Timer',
- 'Tuple',
- 'Type',
- 'TypeError',
- 'TypeVar',
- 'UInt',
- 'UInt128',
- 'UInt16',
- 'UInt32',
- 'UInt64',
- 'UInt8',
- 'UndefInitializer',
- 'UndefKeywordError',
- 'UndefRefError',
- 'UndefVarError',
- 'Union',
- 'UnionAll',
- 'UnitRange',
- 'Unsigned',
- 'Val',
- 'Vararg',
- 'VecElement',
- 'VecOrMat',
- 'Vector',
- 'VersionNumber',
- 'WeakKeyDict',
- 'WeakRef',
- )
- # Generated with the following in Julia v1.6.0-rc1
- '''
- #!/usr/bin/env julia
- import REPL.REPLCompletions
- res = String["true", "false"]
- for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),
- REPLCompletions.completions("", 0)[1])
- try
- v = eval(Symbol(compl.mod))
- if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)
- push!(res, compl.mod)
- end
- catch e
- end
- end
- sort!(unique!(res))
- foreach(x -> println("\'", x, "\',"), res)
- '''
- LITERAL_LIST = (
- 'ARGS',
- 'C_NULL',
- 'DEPOT_PATH',
- 'ENDIAN_BOM',
- 'ENV',
- 'Inf',
- 'Inf16',
- 'Inf32',
- 'Inf64',
- 'InsertionSort',
- 'LOAD_PATH',
- 'MergeSort',
- 'NaN',
- 'NaN16',
- 'NaN32',
- 'NaN64',
- 'PROGRAM_FILE',
- 'QuickSort',
- 'RoundDown',
- 'RoundFromZero',
- 'RoundNearest',
- 'RoundNearestTiesAway',
- 'RoundNearestTiesUp',
- 'RoundToZero',
- 'RoundUp',
- 'VERSION',
- 'devnull',
- 'false',
- 'im',
- 'missing',
- 'nothing',
- 'pi',
- 'stderr',
- 'stdin',
- 'stdout',
- 'true',
- 'undef',
- 'π',
- 'ℯ',
- )
|