335 lines
9.4 KiB
YAML
335 lines
9.4 KiB
YAML
# https://macromates.com/manual/en/language_grammars
|
|
# https://macromates.com/manual/en/regular_expressions
|
|
# https://www.sublimetext.com/docs/3/scope_naming.html
|
|
|
|
# Coloring
|
|
# https://code.visualstudio.com/docs/getstarted/themes
|
|
# https://code.visualstudio.com/api/extension-guides/color-theme#syntax-colors
|
|
# https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide
|
|
# https://code.visualstudio.com/docs/cpp/colorization-cpp
|
|
|
|
$schema: https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json
|
|
name: LLVM IR
|
|
scopeName: source.llvm
|
|
patterns:
|
|
- match: "\\bvoid\\b|\
|
|
\\bhalf\\b|\
|
|
\\bfloat\\b|\
|
|
\\bdouble\\b|\
|
|
\\bx86_fp80\\b|\
|
|
\\bfp128\\b|\
|
|
\\bppc_fp128\\b|\
|
|
\\blabel\\b|\
|
|
\\bmetadata\\b|\
|
|
\\bx86_mmx\\b|\
|
|
\\btype\\b|\
|
|
\\blabel\\b|\
|
|
\\bopaque\\b|\
|
|
\\btoken\\b|\
|
|
\\bi\\d+\\**"
|
|
name: storage.type.llvm
|
|
- match: "!([a-zA-Z]+)\\s*\\("
|
|
captures:
|
|
1:
|
|
name: storage.type.llvm
|
|
- match: "\\badd\\b|\
|
|
\\baddrspacecast\\b|\
|
|
\\balloca\\b|\
|
|
\\band\\b|\
|
|
\\barcp\\b|\
|
|
\\bashr\\b|\
|
|
\\batomicrmw\\b|\
|
|
\\bbitcast\\b|\
|
|
\\bbr\\b|\
|
|
\\bcatchpad\\b|\
|
|
\\bcatchswitch\\b|\
|
|
\\bcatchret\\b|\
|
|
\\bcall\\b|\
|
|
\\bcallbr\\b|\
|
|
\\bcleanuppad\\b|\
|
|
\\bcleanupret\\b|\
|
|
\\bcmpxchg\\b|\
|
|
\\beq\\b|\
|
|
\\bexact\\b|\
|
|
\\bextractelement\\b|\
|
|
\\bextractvalue\\b|\
|
|
\\bfadd\\b|\
|
|
\\bfast\\b|\
|
|
\\bfcmp\\b|\
|
|
\\bfdiv\\b|\
|
|
\\bfence\\b|\
|
|
\\bfmul\\b|\
|
|
\\bfpext\\b|\
|
|
\\bfptosi\\b|\
|
|
\\bfptoui\\b|\
|
|
\\bfptrunc\\b|\
|
|
\\bfree\\b|\
|
|
\\bfrem\\b|\
|
|
\\bfsub\\b|\
|
|
\\bfneg\\b|\
|
|
\\bgetelementptr\\b|\
|
|
\\bicmp\\b|\
|
|
\\binbounds\\b|\
|
|
\\bindirectbr\\b|\
|
|
\\binsertelement\\b|\
|
|
\\binsertvalue\\b|\
|
|
\\binttoptr\\b|\
|
|
\\binvoke\\b|\
|
|
\\blandingpad\\b|\
|
|
\\bload\\b|\
|
|
\\blshr\\b|\
|
|
\\bmalloc\\b|\
|
|
\\bmax\\b|\
|
|
\\bmin\\b|\
|
|
\\bmul\\b|\
|
|
\\bnand\\b|\
|
|
\\bne\\b|\
|
|
\\bninf\\b|\
|
|
\\bnnan\\b|\
|
|
\\bnsw\\b|\
|
|
\\bnsz\\b|\
|
|
\\bnuw\\b|\
|
|
\\boeq\\b|\
|
|
\\boge\\b|\
|
|
\\bogt\\b|\
|
|
\\bole\\b|\
|
|
\\bolt\\b|\
|
|
\\bone\\b|\
|
|
\\bor\\b|\
|
|
\\bord\\b|\
|
|
\\bphi\\b|\
|
|
\\bptrtoint\\b|\
|
|
\\bresume\\b|\
|
|
\\bret\\b|\
|
|
\\bsdiv\\b|\
|
|
\\bselect\\b|\
|
|
\\bsext\\b|\
|
|
\\bsge\\b|\
|
|
\\bsgt\\b|\
|
|
\\bshl\\b|\
|
|
\\bshufflevector\\b|\
|
|
\\bsitofp\\b|\
|
|
\\bsle\\b|\
|
|
\\bslt\\b|\
|
|
\\bsrem\\b|\
|
|
\\bstore\\b|\
|
|
\\bsub\\b|\
|
|
\\bswitch\\b|\
|
|
\\btrunc\\b|\
|
|
\\budiv\\b|\
|
|
\\bueq\\b|\
|
|
\\buge\\b|\
|
|
\\bugt\\b|\
|
|
\\buitofp\\b|\
|
|
\\bule\\b|\
|
|
\\bult\\b|\
|
|
\\bumax\\b|\
|
|
\\bumin\\b|\
|
|
\\bune\\b|\
|
|
\\buno\\b|\
|
|
\\bunreachable\\b|\
|
|
\\bunwind\\b|\
|
|
\\burem\\b|\
|
|
\\bva_arg\\b|\
|
|
\\bxchg\\b|\
|
|
\\bxor\\b|\
|
|
\\bzext\\b"
|
|
name: keyword.instruction.llvm
|
|
- match: "\\bacq_rel\\b|\
|
|
\\bacquire\\b|\
|
|
\\baddrspace\\b|\
|
|
\\balias\\b|\
|
|
\\balign\\b|\
|
|
\\balignstack\\b|\
|
|
\\balwaysinline\\b|\
|
|
\\bappending\\b|\
|
|
\\bargmemonly\\b|\
|
|
\\barm_aapcscc\\b|\
|
|
\\barm_aapcs_vfpcc\\b|\
|
|
\\barm_apcscc\\b|\
|
|
\\basm\\b|\
|
|
\\batomic\\b|\
|
|
\\bavailable_externally\\b|\
|
|
\\bblockaddress\\b|\
|
|
\\bbuiltin\\b|\
|
|
\\bbyref\\b|\
|
|
\\bbyval\\b|\
|
|
\\bc\\b|\
|
|
\\bcatch\\b|\
|
|
\\bcaller\\b|\
|
|
\\bcc\\b|\
|
|
\\bccc\\b|\
|
|
\\bcleanup\\b|\
|
|
\\bcoldcc\\b|\
|
|
\\bcomdat\\b|\
|
|
\\bcommon\\b|\
|
|
\\bconstant\\b|\
|
|
\\bdatalayout\\b|\
|
|
\\bdeclare\\b|\
|
|
\\bdefault\\b|\
|
|
\\bdefine\\b|\
|
|
\\bdeplibs\\b|\
|
|
\\bdereferenceable\\b|\
|
|
\\bdistinct\\b|\
|
|
\\bdllexport\\b|\
|
|
\\bdllimport\\b|\
|
|
\\bdso_local\\b|\
|
|
\\bdso_preemptable\\b|\
|
|
\\bexcept\\b|\
|
|
\\bexternal\\b|\
|
|
\\bexternally_initialized\\b|\
|
|
\\bextern_weak\\b|\
|
|
\\bfastcc\\b|\
|
|
\\btailcc\\b|\
|
|
\\bfilter\\b|\
|
|
\\bfrom\\b|\
|
|
\\bgc\\b|\
|
|
\\bglobal\\b|\
|
|
\\bhhvmcc\\b|\
|
|
\\bhhvm_ccc\\b|\
|
|
\\bhidden\\b|\
|
|
\\bimmarg\\b|\
|
|
\\binitialexec\\b|\
|
|
\\binlinehint\\b|\
|
|
\\binreg\\b|\
|
|
\\binteldialect\\b|\
|
|
\\bintel_ocl_bicc\\b|\
|
|
\\binternal\\b|\
|
|
\\blinkonce\\b|\
|
|
\\blinkonce_odr\\b|\
|
|
\\blocaldynamic\\b|\
|
|
\\blocalexec\\b|\
|
|
\\blocal_unnamed_addr\\b|\
|
|
\\bminsize\\b|\
|
|
\\bmodule\\b|\
|
|
\\bmonotonic\\b|\
|
|
\\bmsp430_intrcc\\b|\
|
|
\\bmustprogress\\b|\
|
|
\\bmusttail\\b|\
|
|
\\bnaked\\b|\
|
|
\\bnest\\b|\
|
|
\\bnoalias\\b|\
|
|
\\bnobuiltin\\b|\
|
|
\\bnocapture\\b|\
|
|
\\bnoimplicitfloat\\b|\
|
|
\\bnoinline\\b|\
|
|
\\bnonlazybind\\b|\
|
|
\\bnonnull\\b|\
|
|
\\bnorecurse\\b|\
|
|
\\bnoredzone\\b|\
|
|
\\bnoreturn\\b|\
|
|
\\bnoundef\\b|\
|
|
\\bnounwind\\b|\
|
|
\\boptnone\\b|\
|
|
\\boptsize\\b|\
|
|
\\bpersonality\\b|\
|
|
\\bprivate\\b|\
|
|
\\bprotected\\b|\
|
|
\\bptx_device\\b|\
|
|
\\bptx_kernel\\b|\
|
|
\\breadnone\\b|\
|
|
\\breadonly\\b|\
|
|
\\brelease\\b|\
|
|
\\breturned\\b|\
|
|
\\breturns_twice\\b|\
|
|
\\bsanitize_address\\b|\
|
|
\\bsanitize_memory\\b|\
|
|
\\bsanitize_thread\\b|\
|
|
\\bsection\\b|\
|
|
\\bseq_cst\\b|\
|
|
\\bsideeffect\\b|\
|
|
\\bsignext\\b|\
|
|
\\bsyncscope\\b|\
|
|
\\bsource_filename\\b|\
|
|
\\bspeculatable\\b|\
|
|
\\bspir_func\\b|\
|
|
\\bspir_kernel\\b|\
|
|
\\bsret\\b|\
|
|
\\bssp\\b|\
|
|
\\bsspreq\\b|\
|
|
\\bsspstrong\\b|\
|
|
\\bstrictfp\\b|\
|
|
\\bswiftcc\\b|\
|
|
\\bswiftself\\b|\
|
|
\\btail\\b|\
|
|
\\btarget\\b|\
|
|
\\bthread_local\\b|\
|
|
\\bto\\b|\
|
|
\\btriple\\b|\
|
|
\\bunnamed_addr\\b|\
|
|
\\bunordered\\b|\
|
|
\\buselistorder\\b|\
|
|
\\buselistorder_bb\\b|\
|
|
\\buwtable\\b|\
|
|
\\bvolatile\\b|\
|
|
\\bweak\\b|\
|
|
\\bweak_odr\\b|\
|
|
\\bwithin\\b|\
|
|
\\bwriteonly\\b|\
|
|
\\bx86_64_sysvcc\\b|\
|
|
\\bwin64cc\\b|\
|
|
\\bx86_fastcallcc\\b|\
|
|
\\bx86_stdcallcc\\b|\
|
|
\\bx86_thiscallcc\\b|\
|
|
\\bzeroext\\b"
|
|
name: storage.modifier.llvm
|
|
- match: "@[-a-zA-Z$._][-a-zA-Z$._0-9]*"
|
|
name: entity.name.function.llvm
|
|
- match: "[%@!]\\d+\\b"
|
|
name: variable.llvm
|
|
- match: "%[-a-zA-Z$._][-a-zA-Z$._0-9]*"
|
|
name: variable.llvm
|
|
- match: "(![-a-zA-Z$._][-a-zA-Z$._0-9]*)\\s*$"
|
|
captures:
|
|
1:
|
|
name: variable.llvm
|
|
- match: "(![-a-zA-Z$._][-a-zA-Z$._0-9]*)\\s*[=!]"
|
|
captures:
|
|
1:
|
|
name: variable.llvm
|
|
- begin: "\""
|
|
end: "\""
|
|
patterns:
|
|
- name: "constant.character.escape.untitled"
|
|
match: "\\."
|
|
name: string.quoted.double.llvm
|
|
- match: "[-a-zA-Z$._][-a-zA-Z$._0-9]*:"
|
|
name: entity.name.label.llvm
|
|
- match: "-?\\b\\d+\\.\\d*(e[+-]\\d+)?\\b"
|
|
name: constant.numeric.float
|
|
- match: "\\b0x\\x+\\b"
|
|
name: constant.numeric.float
|
|
- match: "-?\\b\\d+\\b"
|
|
name: constant.numeric.integer
|
|
- match: "\\btrue\\b|\
|
|
\\bfalse\\b|\
|
|
\\bnull\\b|\
|
|
\\bzeroinitializer\\b|\
|
|
\\bundef\\b|\
|
|
\\bnull\\b|\
|
|
\\bnone\\b"
|
|
name: constant.language
|
|
- match: "\\bDW_TAG_[a-z_]+\\b|\
|
|
\\bDW_ATE_[a-zA-Z_]+\\b|\
|
|
\\bDW_OP_[a-zA-Z0-9_]+\\b|\
|
|
\\bDW_LANG_[a-zA-Z0-9_]+\\b|\
|
|
\\bDW_VIRTUALITY_[a-z_]+\\b|\
|
|
\\bDIFlag[A-Za-z]+\\b"
|
|
name: constant.other
|
|
- match: ";\\s*PR\\d*\\s*$"
|
|
name: string.regexp
|
|
- match: ";\\s*REQUIRES:.*$"
|
|
name: string.regexp
|
|
- match: ";\\s*RUN:.*$"
|
|
name: string.regexp
|
|
- match: ";\\s*ALLOW_RETRIES:.*$"
|
|
name: string.regexp
|
|
- match: ";\\s*CHECK:.*$"
|
|
name: string.regexp
|
|
- match: ";\\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL):.*$"
|
|
name: string.regexp
|
|
- match: ";\\s*XFAIL:.*$"
|
|
name: string.regexp
|
|
- match: ;.*$
|
|
name: comment.line.llvm
|