You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, I don't think C line continuations are fully supported. Sure, PR #29 added line continuation to extras, and there is code in place to support line continuations in string literals and comments. But that only captures a tiny fraction of all possible uses. For example, this is valid C code for a function that returns 42:
i\
n\
tbar(void){
return4\
2;
}
I don't know if it is even possible to do this in tree-sitter (at least with basic methods); when implementing a C parser "by hand" the easiest way to handle it usually is to deal with it in the code which reads the input stream before passing the data to the tokenizer/lexer (of course care has to be taken to preserve line/column information).
Of course one can also consciously decide to not support this (most syntax highlighters out there don't seem to deal with this at all). Though then I think it'd be a good idea to document this explicitly.
The text was updated successfully, but these errors were encountered:
Right now, I don't think C line continuations are fully supported. Sure, PR #29 added line continuation to
extras
, and there is code in place to support line continuations in string literals and comments. But that only captures a tiny fraction of all possible uses. For example, this is valid C code for a function that returns 42:I don't know if it is even possible to do this in tree-sitter (at least with basic methods); when implementing a C parser "by hand" the easiest way to handle it usually is to deal with it in the code which reads the input stream before passing the data to the tokenizer/lexer (of course care has to be taken to preserve line/column information).
Of course one can also consciously decide to not support this (most syntax highlighters out there don't seem to deal with this at all). Though then I think it'd be a good idea to document this explicitly.
The text was updated successfully, but these errors were encountered: