Skip to content

(llvm) types and blocks are parsed incorrectly #2782

@gnzlbg

Description

@gnzlbg

Describe the issue

The LLVM types and blocks are parsed incorrectly.

Which language seems to have the issue?
LLVM

Are you using highlight or highlightAuto?
No

Sample Code to Reproduce

;; foooo
define i32 @mul_add(i32 %x, i32 %y, i32 %z) {
  entry:
    %tmp = mul i32 %x, %y
    %tmp2 = add i32 %tmp, %z
    %tmp3 = add i32 %tmp, 0
    ret i32 %tmp3
}

Expected behavior
I expect:

  • define to be a .hljs-keyword
  • i32 to be a .hljs-type (its parsed as a keyword, all types are described here: https://llvm.org/docs/LangRef.html#type-system)
  • @mul_add to be a .hljs-title (its a function name)
  • all the %... to be .hljs-symbol
  • 0 to be a .hljs-literal
  • mul, add, ret to be .hljs-built_in or .hljs-keyword (these are parsed as keywords)
  • entry: is a block, so i'd expect this to be maybe a .hljs-section ? not sure
  • ;; fooo to be a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions