atom / language-c

C support in Atom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tree-sitter parsing breaks function-like macro syntax highlighting in C

openformatproj opened this issue · comments

Description

From atom/atom/Tree-sitter parsing breaks function-like macro syntax highlighting in C #18346

Steps to Reproduce

  1. define a global function macro, as
#define IFERR(RET) \
if (RET<0) {

#define CONTINUE \
  continue; \
}
  1. instantiate it
IFERR(bytes_red)
 errsys("Ricezione nuova richiesta");
CONTINUE;

Expected behavior: macro names in blue, arguments in white

Actual behavior: macro names in orange, arguments in blue, further troubles between two macros
atom syntax

Edit by @rsese to add screenshots

With Tree-sitter:

tree-sitter

Tree-sitter disabled:

tree-sitter-disabled

Reproduces how often: 100%

Versions

Atom Version: 1.33.1
OS: Ubuntu 18.04, Windows 10

Thanks @openformatproj - reproduced on macOS 10.12.6 with 1.33.1. With Tree-sitter:

tree-sitter

Tree-sitter disabled:

tree-sitter-disabled