[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock
From: |
Lynn Winebarger |
Subject: |
Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2) |
Date: |
Tue, 16 Aug 2022 13:40:21 -0400 |
On Tue, Aug 16, 2022 at 1:19 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
> > I'm only saying there's a disconnect between Jostein's report and Po's
> > response. It's probably a UI issue. There's a checkbox in a dropdown
> > menu that says "Source Code Parsers (Semantic)".
>
> FWIW, I've used (semantic-mode 1) to enable CEDET in Emacs's C source
> files and that was all that was needed to get TAB completion of struct
> field's names working.
> I haven't used it for much more than that, admittedly.
It also works for me, but I also have been mostly looking at Emacs
source with it, and Semantic knows how to use the TAGS file for
context-sensitive completion in C. And something is working
gangbusters in Elisp, but unfortunately I can't really identify which
package is doing the work.
> > * "${" and "{" could both open a block closed by "}"
>
> Why do you think it's a problem?
If you want the lexer to tokenize the ${ as a symbol while still
recognizing the text in between as delimited, it seems like a problem.
I mean, I already deal with that in ordinary font-lock, I was hoping
the parser/lexer generation would address the issue independently of
syntax tables.
>
> > * if/fi, case/esac, etc, or possibly all keyword blocks are closed by "end"
>
> These aren't handled by syntax tables.
>
> > * "variadic" structures like try/catch+/finally?
>
> Same.
>
I know they aren't.
> > It's not clear from the doc just how much this reliance on the syntax
> > table based block identification is baked into the lexer/parser
> > generation.
>
> IIRC the syntax-tables are used for speed so as to skip whole blocks
> without fully parsing their contents.
As I wrote, I'm not sure how baked into the parser/lexer generation
these special token types are, and if blocks are used for things like
error recovery or limiting the scope where the syntactic structure is
either illegal or incomplete. That's part of the selling point of the
design.
I can make the necessary modifications for myself, but if it was
already in Semantic I could make use of it immediately without having
to worry about these copyright assignment issues.
Lynn
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), (continued)
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), Tassilo Horn, 2022/08/10
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), Jostein Kjønigsen, 2022/08/13
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), Po Lu, 2022/08/13
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), Lynn Winebarger, 2022/08/16
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), Po Lu, 2022/08/16
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), Eli Zaretskii, 2022/08/16
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), Lynn Winebarger, 2022/08/16
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), Stefan Monnier, 2022/08/16
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2),
Lynn Winebarger <=
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), Eric Ludlam, 2022/08/16
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), Lynn Winebarger, 2022/08/18
- Re: Why tree-sitter instead of Semantic? (was Re: CC Mode with font-lock-maximum-decoration 2), Eric Ludlam, 2022/08/20
- Re: CC Mode with font-lock-maximum-decoration 2, Alan Mackenzie, 2022/08/08
- Re: Major modes using `widen' is a good, even essential, programming practice., Gregory Heytings, 2022/08/07
- Re: Major modes using `widen' is a good, even essential, programming practice., Alan Mackenzie, 2022/08/07
- Re: Major modes using `widen' is a good, even essential, programming practice., Gregory Heytings, 2022/08/07
- Re: Major modes using `widen' is a good, even essential, programming practice., Eli Zaretskii, 2022/08/07
- Re: Major modes using `widen' is a good, even essential, programming practice., Alan Mackenzie, 2022/08/08
- Re: Major modes using `widen' is a good, even essential, programming practice., Eli Zaretskii, 2022/08/08