3
$\begingroup$

Basically what the title says. Are questions about how to implement syntax highlighting and semantic highlighting on-topic under "programming language implementation"?

$\endgroup$
2
  • $\begingroup$ There are a few LSP questions already; what kinds of question are you thinking of as within "syntax highlighting"? "How do I write a vim highlighting definition?", "How do I implement syntax highlighting in a text box in WinForms?";, and "What regular expression covers this syntax?" are all about implementing syntax highlighting, but in very different ways and different again from the LSP ones. $\endgroup$
    – Michael Homer Mod
    Commented Jun 21, 2023 at 21:42
  • $\begingroup$ My question was going to be about correctly detecting contextual keywords without semantic highlighting. In the Swift declaration weak var weak: AnyObject?, the first "weak" is a keyword and the second one is an identifier. Systems that only use syntax highlighting and not semantic highlighting tend to get that wrong, and I was wondering what strategies exist to mitigate it. $\endgroup$
    – Bbrk24
    Commented Jun 21, 2023 at 21:45

1 Answer 1

4
$\begingroup$

I think they should be allowed. Both because syntax highlighting is commonly done by an LSP server which can be implemented as part of a compiler, and also because the implementation techniques used for syntax highlighting ─ i.e. lexing and parsing ─ are explicitly on-topic here.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .