4 ms·
> this is only relevant if you want to highlight the multiplication operator differently from the dereferencing operator Can you mention one editor which does
by teo_zero 2y ago
> this is only relevant if you want to highlight the multiplication operator differently from the dereferencing operator
Can you mention one editor which does that?
- quietbritishjim 2y agoI don't think they implied there is. The sentence you quoted is essentially "this is relevant for their article about weird lexical syntax, but (almost definitely) not relevant to their original problem of syntax highlighting".
- mdaniel 2y agoI could be stretching the definition of "does" but the newfound(?) tree-sitter support in Emacs[1] I believe would allow that since it for sure understands the distinction but I don't possess enough font-lock ninjary to actually, for real, bind a different color to the distinct usages /* given foo.c */ int main() { int a, *b; a = 5 * 10; b = &a; printf("a is %d\n", *b); } and then M-x c-ts-mode followed by navigating to each * and invoking M-x treesit-inspect-node-at-point in turn produces, respectively: (declaration declarator: (pointer_declarator "*")) right: (binary_expression operator: "*") arguments: (argument_list (pointer_expression operator: "*")) 1: https://www.emacswiki.org/emacs/Tree-sitter https://www.emacswiki.org/emacs/Tree-sitter
- teo_zero 2y agoThese examples are unambiguous. Try with something more spicy like return (A)*(B); which depends on A being a type or a variable.
- dummy7777 2y agohey