Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BPF lexer #2004

Merged
merged 6 commits into from
Oct 24, 2023
Merged

Update BPF lexer #2004

merged 6 commits into from
Oct 24, 2023

Commits on Oct 20, 2023

  1. bpf: highlight signed type keywords

    Signed type keywords such as s16 have always been supported by BPF but
    recently became more frequent. They were missing in the original lexer
    so this commit adds them, with an example.
    
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    pchaigno committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    d277044 View commit details
    Browse the repository at this point in the history
  2. bpf: highlight simpler call syntax

    The lexer already supports the following syntax for call instructions:
    
        call bpf_skb_load_bytes#1234
    
    but a simpler syntax without the number at the end is now also possible.
    This commit adds support for it, with an example.
    
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    pchaigno committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    c66c4db View commit details
    Browse the repository at this point in the history
  3. bpf: highlight all byte-swapping instructions

    The original lexer was missing support for the little-endian
    byte-swapping instructions le{16,32,64}. This commit adds them, together
    with the new bswap{16,32,64} instructions. The later are unconditional
    byte-swapping instructions, meaning they don't depend on the
    architecture.
    
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    pchaigno committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    c4d2dd7 View commit details
    Browse the repository at this point in the history
  4. bpf: fix highlight of negative hexadecimal numbers

    Hexadecimal literals can also have a sign in BPF. This commit fixes this
    error in the lexer and adds a corresponding example.
    
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    pchaigno committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    717d244 View commit details
    Browse the repository at this point in the history
  5. bpf: highlight hexadecimal jump offsets

    The offset of BPF jump instructions is now sometimes displayed in
    hexadecimal format. This commit adds support for that, together with an
    example. It also adds an example to cover the syntax where the jump has
    both an offset literal and an offset label (ex. "+1 <LBB0_2>").
    
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    pchaigno committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    c5c2fe2 View commit details
    Browse the repository at this point in the history
  6. bpf: highlight long jumps

    Jump instructions with a 32-bit offset are displayed as "gotol" instead
    of "goto".
    
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    pchaigno committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    e15dd53 View commit details
    Browse the repository at this point in the history