codekingpro/portable-devtools
114k
1"""2 pygments.lexers._julia_builtins3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~4 5 Julia builtins.6 7 :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.8 :license: BSD, see LICENSE for details.9"""10 11# operators12# see https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm13# Julia v1.6.0-rc114OPERATORS_LIST = [15 # other16 '->',17 # prec-assignment18 ':=', '$=',19 # prec-conditional, prec-lazy-or, prec-lazy-and20 '?', '||', '&&',21 # prec-colon22 ':',23 # prec-plus24 '$',25 # prec-decl26 '::',27]28DOTTED_OPERATORS_LIST = [29 # prec-assignment30 r'=', r'+=', r'-=', r'*=', r'/=', r'//=', r'\=', r'^=', r'÷=', r'%=', r'<<=',31 r'>>=', r'>>>=', r'|=', r'&=', r'⊻=', r'≔', r'⩴', r"≕'", r'~',32 # prec-pair33 '=>',34 # prec-arrow35 r'→', r'↔', r'↚', r'↛', r'↞', r'↠', r'↢', r'↣', r'↦', r'↤', r'↮', r'⇎', r'⇍', r'⇏',36 r'⇐', r'⇒', r'⇔', r'⇴', r'⇶', r'⇷', r'⇸', r'⇹', r'⇺', r'⇻', r'⇼', r'⇽', r'⇾', r'⇿',37 r'⟵', r'⟶', r'⟷', r'⟹', r'⟺', r'⟻', r'⟼', r'⟽', r'⟾', r'⟿', r'⤀', r'⤁', r'⤂', r'⤃',38 r'⤄', r'⤅', r'⤆', r'⤇', r'⤌', r'⤍', r'⤎', r'⤏', r'⤐', r'⤑', r'⤔', r'⤕', r'⤖', r'⤗',39 r'⤘', r'⤝', r'⤞', r'⤟', r'⤠', r'⥄', r'⥅', r'⥆', r'⥇', r'⥈', r'⥊', r'⥋', r'⥎', r'⥐',40 r'⥒', r'⥓', r'⥖', r'⥗', r'⥚', r'⥛', r'⥞', r'⥟', r'⥢', r'⥤', r'⥦', r'⥧', r'⥨', r'⥩',41 r'⥪', r'⥫', r'⥬', r'⥭', r'⥰', r'⧴', r'⬱', r'⬰', r'⬲', r'⬳', r'⬴', r'⬵', r'⬶', r'⬷',42 r'⬸', r'⬹', r'⬺', r'⬻', r'⬼', r'⬽', r'⬾', r'⬿', r'⭀', r'⭁', r'⭂', r'⭃', r'⭄', r'⭇',43 r'⭈', r'⭉', r'⭊', r'⭋', r'⭌', r'←', r'→', r'⇜', r'⇝', r'↜', r'↝', r'↩', r'↪', r'↫',44 r'↬', r'↼', r'↽', r'⇀', r'⇁', r'⇄', r'⇆', r'⇇', r'⇉', r'⇋', r'⇌', r'⇚', r'⇛', r'⇠',45 r'⇢', r'↷', r'↶', r'↺', r'↻', r'-->', r'<--', r'<-->',46 # prec-comparison47 r'>', r'<', r'>=', r'≥', r'<=', r'≤', r'==', r'===', r'≡', r'!=', r'≠', r'!==',48 r'≢', r'∈', r'∉', r'∋', r'∌', r'⊆', r'⊈', r'⊂', r'⊄', r'⊊', r'∝', r'∊', r'∍', r'∥',49 r'∦', r'∷', r'∺', r'∻', r'∽', r'∾', r'≁', r'≃', r'≂', r'≄', r'≅', r'≆', r'≇', r'≈',50 r'≉', r'≊', r'≋', r'≌', r'≍', r'≎', r'≐', r'≑', r'≒', r'≓', r'≖', r'≗', r'≘', r'≙',51 r'≚', r'≛', r'≜', r'≝', r'≞', r'≟', r'≣', r'≦', r'≧', r'≨', r'≩', r'≪', r'≫', r'≬',52 r'≭', r'≮', r'≯', r'≰', r'≱', r'≲', r'≳', r'≴', r'≵', r'≶', r'≷', r'≸', r'≹', r'≺',53 r'≻', r'≼', r'≽', r'≾', r'≿', r'⊀', r'⊁', r'⊃', r'⊅', r'⊇', r'⊉', r'⊋', r'⊏', r'⊐',54 r'⊑', r'⊒', r'⊜', r'⊩', r'⊬', r'⊮', r'⊰', r'⊱', r'⊲', r'⊳', r'⊴', r'⊵', r'⊶', r'⊷',55 r'⋍', r'⋐', r'⋑', r'⋕', r'⋖', r'⋗', r'⋘', r'⋙', r'⋚', r'⋛', r'⋜', r'⋝', r'⋞', r'⋟',56 r'⋠', r'⋡', r'⋢', r'⋣', r'⋤', r'⋥', r'⋦', r'⋧', r'⋨', r'⋩', r'⋪', r'⋫', r'⋬', r'⋭',57 r'⋲', r'⋳', r'⋴', r'⋵', r'⋶', r'⋷', r'⋸', r'⋹', r'⋺', r'⋻', r'⋼', r'⋽', r'⋾', r'⋿',58 r'⟈', r'⟉', r'⟒', r'⦷', r'⧀', r'⧁', r'⧡', r'⧣', r'⧤', r'⧥', r'⩦', r'⩧', r'⩪', r'⩫',59 r'⩬', r'⩭', r'⩮', r'⩯', r'⩰', r'⩱', r'⩲', r'⩳', r'⩵', r'⩶', r'⩷', r'⩸', r'⩹', r'⩺',60 r'⩻', r'⩼', r'⩽', r'⩾', r'⩿', r'⪀', r'⪁', r'⪂', r'⪃', r'⪄', r'⪅', r'⪆', r'⪇', r'⪈',61 r'⪉', r'⪊', r'⪋', r'⪌', r'⪍', r'⪎', r'⪏', r'⪐', r'⪑', r'⪒', r'⪓', r'⪔', r'⪕', r'⪖',62 r'⪗', r'⪘', r'⪙', r'⪚', r'⪛', r'⪜', r'⪝', r'⪞', r'⪟', r'⪠', r'⪡', r'⪢', r'⪣', r'⪤',63 r'⪥', r'⪦', r'⪧', r'⪨', r'⪩', r'⪪', r'⪫', r'⪬', r'⪭', r'⪮', r'⪯', r'⪰', r'⪱', r'⪲',64 r'⪳', r'⪴', r'⪵', r'⪶', r'⪷', r'⪸', r'⪹', r'⪺', r'⪻', r'⪼', r'⪽', r'⪾', r'⪿', r'⫀',65 r'⫁', r'⫂', r'⫃', r'⫄', r'⫅', r'⫆', r'⫇', r'⫈', r'⫉', r'⫊', r'⫋', r'⫌', r'⫍', r'⫎',66 r'⫏', r'⫐', r'⫑', r'⫒', r'⫓', r'⫔', r'⫕', r'⫖', r'⫗', r'⫘', r'⫙', r'⫷', r'⫸', r'⫹',67 r'⫺', r'⊢', r'⊣', r'⟂', r'<:', r'>:',68 # prec-pipe69 '<|', '|>',70 # prec-colon71 r'…', r'⁝', r'⋮', r'⋱', r'⋰', r'⋯',72 # prec-plus73 r'+', r'-', r'¦', r'|', r'⊕', r'⊖', r'⊞', r'⊟', r'++', r'∪', r'∨', r'⊔', r'±', r'∓',74 r'∔', r'∸', r'≏', r'⊎', r'⊻', r'⊽', r'⋎', r'⋓', r'⧺', r'⧻', r'⨈', r'⨢', r'⨣', r'⨤',75 r'⨥', r'⨦', r'⨧', r'⨨', r'⨩', r'⨪', r'⨫', r'⨬', r'⨭', r'⨮', r'⨹', r'⨺', r'⩁', r'⩂',76 r'⩅', r'⩊', r'⩌', r'⩏', r'⩐', r'⩒', r'⩔', r'⩖', r'⩗', r'⩛', r'⩝', r'⩡', r'⩢', r'⩣',77 # prec-times78 r'*', r'/', r'⌿', r'÷', r'%', r'&', r'⋅', r'∘', r'×', '\\', r'∩', r'∧', r'⊗', r'⊘',79 r'⊙', r'⊚', r'⊛', r'⊠', r'⊡', r'⊓', r'∗', r'∙', r'∤', r'⅋', r'≀', r'⊼', r'⋄', r'⋆',80 r'⋇', r'⋉', r'⋊', r'⋋', r'⋌', r'⋏', r'⋒', r'⟑', r'⦸', r'⦼', r'⦾', r'⦿', r'⧶', r'⧷',81 r'⨇', r'⨰', r'⨱', r'⨲', r'⨳', r'⨴', r'⨵', r'⨶', r'⨷', r'⨸', r'⨻', r'⨼', r'⨽', r'⩀',82 r'⩃', r'⩄', r'⩋', r'⩍', r'⩎', r'⩑', r'⩓', r'⩕', r'⩘', r'⩚', r'⩜', r'⩞', r'⩟', r'⩠',83 r'⫛', r'⊍', r'▷', r'⨝', r'⟕', r'⟖', r'⟗', r'⨟',84 # prec-rational, prec-bitshift85 '//', '>>', '<<', '>>>',86 # prec-power87 r'^', r'↑', r'↓', r'⇵', r'⟰', r'⟱', r'⤈', r'⤉', r'⤊', r'⤋', r'⤒', r'⤓', r'⥉', r'⥌',88 r'⥍', r'⥏', r'⥑', r'⥔', r'⥕', r'⥘', r'⥙', r'⥜', r'⥝', r'⥠', r'⥡', r'⥣', r'⥥', r'⥮',89 r'⥯', r'↑', r'↓',90 # unary-ops, excluding unary-and-binary-ops91 '!', r'¬', r'√', r'∛', r'∜'92]93 94# Generated with the following in Julia v1.6.0-rc195'''96#!/usr/bin/env julia97 98import REPL.REPLCompletions99res = String["in", "isa", "where"]100for kw in collect(x.keyword for x in REPLCompletions.complete_keyword(""))101 if !(contains(kw, " ") || kw == "struct")102 push!(res, kw)103 end104end105sort!(unique!(setdiff!(res, ["true", "false"])))106foreach(x -> println("\'", x, "\',"), res)107'''108KEYWORD_LIST = (109 'baremodule',110 'begin',111 'break',112 'catch',113 'ccall',114 'const',115 'continue',116 'do',117 'else',118 'elseif',119 'end',120 'export',121 'finally',122 'for',123 'function',124 'global',125 'if',126 'import',127 'in',128 'isa',129 'let',130 'local',131 'macro',132 'module',133 'quote',134 'return',135 'try',136 'using',137 'where',138 'while',139)140 141# Generated with the following in Julia v1.6.0-rc1142'''143#!/usr/bin/env julia144 145import REPL.REPLCompletions146res = String[]147for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),148 REPLCompletions.completions("", 0)[1])149 try150 v = eval(Symbol(compl.mod))151 if (v isa Type || v isa TypeVar) && (compl.mod != "=>")152 push!(res, compl.mod)153 end154 catch e155 end156end157sort!(unique!(res))158foreach(x -> println("\'", x, "\',"), res)159'''160BUILTIN_LIST = (161 'AbstractArray',162 'AbstractChannel',163 'AbstractChar',164 'AbstractDict',165 'AbstractDisplay',166 'AbstractFloat',167 'AbstractIrrational',168 'AbstractMatch',169 'AbstractMatrix',170 'AbstractPattern',171 'AbstractRange',172 'AbstractSet',173 'AbstractString',174 'AbstractUnitRange',175 'AbstractVecOrMat',176 'AbstractVector',177 'Any',178 'ArgumentError',179 'Array',180 'AssertionError',181 'BigFloat',182 'BigInt',183 'BitArray',184 'BitMatrix',185 'BitSet',186 'BitVector',187 'Bool',188 'BoundsError',189 'CapturedException',190 'CartesianIndex',191 'CartesianIndices',192 'Cchar',193 'Cdouble',194 'Cfloat',195 'Channel',196 'Char',197 'Cint',198 'Cintmax_t',199 'Clong',200 'Clonglong',201 'Cmd',202 'Colon',203 'Complex',204 'ComplexF16',205 'ComplexF32',206 'ComplexF64',207 'ComposedFunction',208 'CompositeException',209 'Condition',210 'Cptrdiff_t',211 'Cshort',212 'Csize_t',213 'Cssize_t',214 'Cstring',215 'Cuchar',216 'Cuint',217 'Cuintmax_t',218 'Culong',219 'Culonglong',220 'Cushort',221 'Cvoid',222 'Cwchar_t',223 'Cwstring',224 'DataType',225 'DenseArray',226 'DenseMatrix',227 'DenseVecOrMat',228 'DenseVector',229 'Dict',230 'DimensionMismatch',231 'Dims',232 'DivideError',233 'DomainError',234 'EOFError',235 'Enum',236 'ErrorException',237 'Exception',238 'ExponentialBackOff',239 'Expr',240 'Float16',241 'Float32',242 'Float64',243 'Function',244 'GlobalRef',245 'HTML',246 'IO',247 'IOBuffer',248 'IOContext',249 'IOStream',250 'IdDict',251 'IndexCartesian',252 'IndexLinear',253 'IndexStyle',254 'InexactError',255 'InitError',256 'Int',257 'Int128',258 'Int16',259 'Int32',260 'Int64',261 'Int8',262 'Integer',263 'InterruptException',264 'InvalidStateException',265 'Irrational',266 'KeyError',267 'LinRange',268 'LineNumberNode',269 'LinearIndices',270 'LoadError',271 'MIME',272 'Matrix',273 'Method',274 'MethodError',275 'Missing',276 'MissingException',277 'Module',278 'NTuple',279 'NamedTuple',280 'Nothing',281 'Number',282 'OrdinalRange',283 'OutOfMemoryError',284 'OverflowError',285 'Pair',286 'PartialQuickSort',287 'PermutedDimsArray',288 'Pipe',289 'ProcessFailedException',290 'Ptr',291 'QuoteNode',292 'Rational',293 'RawFD',294 'ReadOnlyMemoryError',295 'Real',296 'ReentrantLock',297 'Ref',298 'Regex',299 'RegexMatch',300 'RoundingMode',301 'SegmentationFault',302 'Set',303 'Signed',304 'Some',305 'StackOverflowError',306 'StepRange',307 'StepRangeLen',308 'StridedArray',309 'StridedMatrix',310 'StridedVecOrMat',311 'StridedVector',312 'String',313 'StringIndexError',314 'SubArray',315 'SubString',316 'SubstitutionString',317 'Symbol',318 'SystemError',319 'Task',320 'TaskFailedException',321 'Text',322 'TextDisplay',323 'Timer',324 'Tuple',325 'Type',326 'TypeError',327 'TypeVar',328 'UInt',329 'UInt128',330 'UInt16',331 'UInt32',332 'UInt64',333 'UInt8',334 'UndefInitializer',335 'UndefKeywordError',336 'UndefRefError',337 'UndefVarError',338 'Union',339 'UnionAll',340 'UnitRange',341 'Unsigned',342 'Val',343 'Vararg',344 'VecElement',345 'VecOrMat',346 'Vector',347 'VersionNumber',348 'WeakKeyDict',349 'WeakRef',350)351 352# Generated with the following in Julia v1.6.0-rc1353'''354#!/usr/bin/env julia355 356import REPL.REPLCompletions357res = String["true", "false"]358for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),359 REPLCompletions.completions("", 0)[1])360 try361 v = eval(Symbol(compl.mod))362 if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)363 push!(res, compl.mod)364 end365 catch e366 end367end368sort!(unique!(res))369foreach(x -> println("\'", x, "\',"), res)370'''371LITERAL_LIST = (372 'ARGS',373 'C_NULL',374 'DEPOT_PATH',375 'ENDIAN_BOM',376 'ENV',377 'Inf',378 'Inf16',379 'Inf32',380 'Inf64',381 'InsertionSort',382 'LOAD_PATH',383 'MergeSort',384 'NaN',385 'NaN16',386 'NaN32',387 'NaN64',388 'PROGRAM_FILE',389 'QuickSort',390 'RoundDown',391 'RoundFromZero',392 'RoundNearest',393 'RoundNearestTiesAway',394 'RoundNearestTiesUp',395 'RoundToZero',396 'RoundUp',397 'VERSION',398 'devnull',399 'false',400 'im',401 'missing',402 'nothing',403 'pi',404 'stderr',405 'stdin',406 'stdout',407 'true',408 'undef',409 'π',410 'ℯ',411)412 