Author Topic: B2: Odd asm syntax colouring (old issue)  (Read 1696 times)

jc44

  • Senior Community Member
  • Posts: 329
  • Hero Points: 22
B2: Odd asm syntax colouring (old issue)
« on: August 22, 2018, 02:30:34 PM »
Asm blocks such as the one blow have odd highlighting - see attached png

static inline uint32_t hevc_mem_bits32_arm(const void * p, const unsigned int bits)
{
    unsigned int n;
    __asm__ (
        "rev        %[n], %
  •                      \n\t"

        : [n]"=r"(n)
        :
  • "r"(*(const uint32_t *)((const uint8_t *)p + (bits >> 3)))

        :
        );
    return n << (bits & 7);
}

Life can be even more confused if you include comments in the asm lines:

tatic inline uint32_t get_cabac_by22_peek_arm(const CABACContext *const c)
{
    uint32_t rv = c->low &~ 1, tmp;
    __asm__ (
        "cmp      %[inv] , #0                    \n\t"
        "it       ne                             \n\t"
// A comment (with brackets)
        "umullne  %[tmp] , %[rv] , %[inv], %[rv] \n\t"
        :  // Outputs
             [rv]"+r"(rv),
             [tmp]"=r"(tmp)
        :  // Inputs
             [inv]"r"(c->range)
        :  // Clobbers
                "cc"
    );
    return rv << 1;
}

Thanks

John Cox

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6864
  • Hero Points: 528
Re: B2: Odd asm syntax colouring (old issue)
« Reply #1 on: August 22, 2018, 10:35:17 PM »
The current embedded color coding for this is way off. I think we need to change this to just color all this as C++ and that will work better for now. The C/C++ parser (and beautifier) will still skip over this correctly.

jc44

  • Senior Community Member
  • Posts: 329
  • Hero Points: 22
Re: B2: Odd asm syntax colouring (old issue)
« Reply #2 on: August 23, 2018, 10:30:57 AM »
It would be great if it worked properly, but straight C syntax colouring works for me too.