]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/llvm.js
1 /*! `llvm` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
7 Author: Michael Rodler <contact@f0rki.at>
8 Description: language used as intermediate representation in the LLVM compiler framework
9 Website: https://llvm.org/docs/LangRef.html
14 /** @type LanguageFn */
16 const regex
= hljs
.regex
;
17 const IDENT_RE
= /([-a-zA-Z$._][\w$.-]*)/;
20 begin: /\bi\d+(?=\s|\b)/
23 className: 'operator',
28 className: 'punctuation',
35 { begin: /[su]?0[xX][KMLHR]?[a-fA-F0-9]+/ },
36 { begin: /[-+]?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?/ }
42 variants: [ { begin: /^\s*[a-z]+:/ }, // labels
47 className: 'variable',
49 { begin: regex
.concat(/%/, IDENT_RE
) },
57 { begin: regex
.concat(/@/, IDENT_RE
) },
59 { begin: regex
.concat(/!/, IDENT_RE
) },
60 { begin: regex
.concat(/!\d+/, IDENT_RE
) },
61 // https://llvm.org/docs/LangRef.html#namedmetadatastructure
62 // obviously a single digit can also be used in this fashion
69 // TODO: split into different categories of keywords
71 keyword: 'begin end true false declare define global '
72 + 'constant private linker_private internal '
73 + 'available_externally linkonce linkonce_odr weak '
74 + 'weak_odr appending dllimport dllexport common '
75 + 'default hidden protected extern_weak external '
76 + 'thread_local zeroinitializer undef null to tail '
77 + 'target triple datalayout volatile nuw nsw nnan '
78 + 'ninf nsz arcp fast exact inbounds align '
79 + 'addrspace section alias module asm sideeffect '
80 + 'gc dbg linker_private_weak attributes blockaddress '
81 + 'initialexec localdynamic localexec prefix unnamed_addr '
82 + 'ccc fastcc coldcc x86_stdcallcc x86_fastcallcc '
83 + 'arm_apcscc arm_aapcscc arm_aapcs_vfpcc ptx_device '
84 + 'ptx_kernel intel_ocl_bicc msp430_intrcc spir_func '
85 + 'spir_kernel x86_64_sysvcc x86_64_win64cc x86_thiscallcc '
86 + 'cc c signext zeroext inreg sret nounwind '
87 + 'noreturn noalias nocapture byval nest readnone '
88 + 'readonly inlinehint noinline alwaysinline optsize ssp '
89 + 'sspreq noredzone noimplicitfloat naked builtin cold '
90 + 'nobuiltin noduplicate nonlazybind optnone returns_twice '
91 + 'sanitize_address sanitize_memory sanitize_thread sspstrong '
92 + 'uwtable returned type opaque eq ne slt sgt '
93 + 'sle sge ult ugt ule uge oeq one olt ogt '
94 + 'ole oge ord uno ueq une x acq_rel acquire '
95 + 'alignstack atomic catch cleanup filter inteldialect '
96 + 'max min monotonic nand personality release seq_cst '
97 + 'singlethread umax umin unordered xchg add fadd '
98 + 'sub fsub mul fmul udiv sdiv fdiv urem srem '
99 + 'frem shl lshr ashr and or xor icmp fcmp '
100 + 'phi call trunc zext sext fptrunc fpext uitofp '
101 + 'sitofp fptoui fptosi inttoptr ptrtoint bitcast '
102 + 'addrspacecast select va_arg ret br switch invoke '
103 + 'unwind unreachable indirectbr landingpad resume '
104 + 'malloc alloca free load store getelementptr '
105 + 'extractelement insertelement shufflevector getresult '
106 + 'extractvalue insertvalue atomicrmw cmpxchg fence '
108 type: 'void half bfloat float double fp128 x86_fp80 ppc_fp128 '
109 + 'x86_amx x86_mmx ptr label token metadata opaque'
113 // this matches "empty comments"...
114 // ...because it's far more likely this is a statement terminator in
115 // another language than an actual comment
116 hljs
.COMMENT(/;\s*$/, null, { relevance: 0 }),
117 hljs
.COMMENT(/;/, /$/),
124 className: 'char.escape',
143 export default hljsGrammar
;