[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple functi
From: |
Yuan Fu |
Subject: |
bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function |
Date: |
Mon, 21 Nov 2022 01:45:06 -0800 |
> On Nov 20, 2022, at 10:09 PM, Po Lu via Bug reports for GNU Emacs, the Swiss
> army knife of text editors <bug-gnu-emacs@gnu.org> wrote:
>
>
> c-ts-mode cannot fontify the following code:
>
> ifsubmitbufl (tp)
> {
> register *kb1 = tp;
> extern tbase, i_len;
> register l = len;
>
> again:
>
> highprio (); /* tbase is used by protoureg */
> iomap (&UBR, tbase += UBR_SIZ);
> UBR->addr_l = kb1;
> UBR->addr_m = kb1 >> 010;
> UBR->mode_l = 07777 &~ UBR_INST;
> UBR->mode_m = 0;
> UBR->long_l = l;
> UBR->long_m = l >> 010;
>
> iounmap ();
> tally_iostat (tbase);
> iospoke (UBR, P_LOCK);
> resetprio ();
>
> SWITCH (S_WAIT|S_HIGH|S_IMMED, 0700, again); /* this returns to
> BR->senv[0], except
> if CL_HI */
> }
>
> here, ifsubmitbufl, tbase, l and again are fontified as types. They are
> fontified correctly by CC Mode, as three identifiers and one label.
Thanks, I fixe the label’s face. As for ifsubmitbufl, tbase, and l, I don’t
really understand the syntax here, and I think neither does tree-sitter . In
general tree-sitter struggles with nonstandard (in its book anyway) syntax. And
there aren’t much we can do (except for maybe improve tree-sitter-c’s parser).
>
> Trying to indent after "again:" results in text being indented to column
> 0.
Seems to work fine here. I don’t see anything I changed recently that could
affect this, either.
Yuan
- bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function, Po Lu, 2022/11/21
- bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function,
Yuan Fu <=
- bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function, Po Lu, 2022/11/21
- bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function, Eli Zaretskii, 2022/11/21
- bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function, Richard Stallman, 2022/11/24
- bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function, Po Lu, 2022/11/25
- bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function, Richard Stallman, 2022/11/28
- bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function, Po Lu, 2022/11/28
- bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function, Yuan Fu, 2022/11/25
- bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function, Eli Zaretskii, 2022/11/25
- bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function, Richard Stallman, 2022/11/28
bug#59435: 29.0.50; tree-sitter fails to fontify or indent simple function, Stefan Kangas, 2022/11/21