ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Anyone working on a treesitter grammar?
@ 2024-07-04 19:22 juh+ntg-context--- via ntg-context
  2024-07-04 19:39 ` [NTG-context] " Henning Hraban Ramm
  2024-07-05 10:33 ` Jethro Djan
  0 siblings, 2 replies; 7+ messages in thread
From: juh+ntg-context--- via ntg-context @ 2024-07-04 19:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: juh+ntg-context

Dear all,

no mention here https://tree-sitter.github.io/tree-sitter/ and searching 
for treesitter on the Wiki gives no match?

Many texteditors have treesitter support builtin so having a ConTeXt 
grammar would be nice.

TIA
juh
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: Anyone working on a treesitter grammar?
  2024-07-04 19:22 [NTG-context] Anyone working on a treesitter grammar? juh+ntg-context--- via ntg-context
@ 2024-07-04 19:39 ` Henning Hraban Ramm
  2024-07-04 20:31   ` juh+ntg-context--- via ntg-context
  2024-07-05 10:33 ` Jethro Djan
  1 sibling, 1 reply; 7+ messages in thread
From: Henning Hraban Ramm @ 2024-07-04 19:39 UTC (permalink / raw)
  To: ntg-context

Am 04.07.24 um 21:22 schrieb juh+ntg-context--- via ntg-context:
> no mention here https://tree-sitter.github.io/tree-sitter/ and searching 
> for treesitter on the Wiki gives no match?
> 
> Many texteditors have treesitter support builtin so having a ConTeXt 
> grammar would be nice.

https://github.com/pmazaitis/tree-sitter-context_en

Now, if you could explain me how to install this in Pulsar?

Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: Anyone working on a treesitter grammar?
  2024-07-04 19:39 ` [NTG-context] " Henning Hraban Ramm
@ 2024-07-04 20:31   ` juh+ntg-context--- via ntg-context
  2024-07-04 21:01     ` Henning Hraban Ramm
  0 siblings, 1 reply; 7+ messages in thread
From: juh+ntg-context--- via ntg-context @ 2024-07-04 20:31 UTC (permalink / raw)
  To: ntg-context; +Cc: juh+ntg-context

Am 04.07.24 um 21:39 schrieb Henning Hraban Ramm:
> https://github.com/pmazaitis/tree-sitter-context_en

Thanks a lot.

> Now, if you could explain me how to install this in Pulsar?

I am struggling with emacs and neovim.

Ciao!
juh

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: Anyone working on a treesitter grammar?
  2024-07-04 20:31   ` juh+ntg-context--- via ntg-context
@ 2024-07-04 21:01     ` Henning Hraban Ramm
  2024-07-05 10:07       ` Jethro Djan
  0 siblings, 1 reply; 7+ messages in thread
From: Henning Hraban Ramm @ 2024-07-04 21:01 UTC (permalink / raw)
  To: ntg-context

Am 04.07.24 um 22:31 schrieb juh+ntg-context--- via ntg-context:
> Am 04.07.24 um 21:39 schrieb Henning Hraban Ramm:
>> https://github.com/pmazaitis/tree-sitter-context_en
> 
> Thanks a lot.
> 
>> Now, if you could explain me how to install this in Pulsar?
> 
> I am struggling with emacs and neovim.

If you get it working, please document how.

Hraban

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: Anyone working on a treesitter grammar?
  2024-07-04 21:01     ` Henning Hraban Ramm
@ 2024-07-05 10:07       ` Jethro Djan
  0 siblings, 0 replies; 7+ messages in thread
From: Jethro Djan @ 2024-07-05 10:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1616 bytes --]

Hello,

All tree-sitter projects look like this I think. For Neovim, all you have
to do is clone the project to a place in your path and generate a parser
using the command 'tree-sitter generate'. Then you open Neovim to install
it with 'TSInstall <language-name> (the name of the grammar without
'-tree-sitter' in Vim command mode). Have a look at the official Neovim
tree-sitter website (
https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#adding-parsers).
I am afraid I don't know much about Emacs.

I don't know if this particular one works though.

Jethro

On Thu, Jul 4, 2024 at 9:06 PM Henning Hraban Ramm <texml@fiee.net> wrote:

> Am 04.07.24 um 22:31 schrieb juh+ntg-context--- via ntg-context:
> > Am 04.07.24 um 21:39 schrieb Henning Hraban Ramm:
> >> https://github.com/pmazaitis/tree-sitter-context_en
> >
> > Thanks a lot.
> >
> >> Now, if you could explain me how to install this in Pulsar?
> >
> > I am struggling with emacs and neovim.
>
> If you get it working, please document how.
>
> Hraban
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 2721 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: Anyone working on a treesitter grammar?
  2024-07-04 19:22 [NTG-context] Anyone working on a treesitter grammar? juh+ntg-context--- via ntg-context
  2024-07-04 19:39 ` [NTG-context] " Henning Hraban Ramm
@ 2024-07-05 10:33 ` Jethro Djan
  2024-07-05 11:36   ` Henning Hraban Ramm
  1 sibling, 1 reply; 7+ messages in thread
From: Jethro Djan @ 2024-07-05 10:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2050 bytes --]

Hi,

I tried to write one some time ago but it seems my knowledge of ConTeXt was
insufficient. I gave up. I also think it would be nice.

If I can recall, one of the first problems I ran into concerned how ConTeXt
environments work (among other things I cannot recall). In LaTeX, you have
something like:
\begin{theorem}
When you are writing the grammar, you can clearly separate the tokens into
'\', 'begin', '{' and '}'. So you get a consistent object that the
tree-sitter library can work with. But with ConTeXt, you have something
like this:
\startTheorem
We know that it is actually made up of '\', 'start' and 'Theorem'. But
there is nothing separating the latter two so I couldn't find a way to make
it general enough across board because of how configurable ConTeXt is (we
have very few pre-defined environments). So I went with \start[theorem]. I
am very sure it was my skill but just some thoughts from someone who tried
in the past.

Maybe we could benefit from pre-converting the source file to an XML-like
tree before applying the grammar? At which point you are venturing into LSP
territory...

Jethro

On Thu, Jul 4, 2024 at 7:36 PM juh+ntg-context--- via ntg-context <
ntg-context@ntg.nl> wrote:

> Dear all,
>
> no mention here https://tree-sitter.github.io/tree-sitter/ and searching
> for treesitter on the Wiki gives no match?
>
> Many texteditors have treesitter support builtin so having a ConTeXt
> grammar would be nice.
>
> TIA
> juh
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3096 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: Anyone working on a treesitter grammar?
  2024-07-05 10:33 ` Jethro Djan
@ 2024-07-05 11:36   ` Henning Hraban Ramm
  0 siblings, 0 replies; 7+ messages in thread
From: Henning Hraban Ramm @ 2024-07-05 11:36 UTC (permalink / raw)
  To: ntg-context

Am 05.07.24 um 12:33 schrieb Jethro Djan:
> Hi,
> 
> I tried to write one some time ago but it seems my knowledge of ConTeXt 
> was insufficient. I gave up. I also think it would be nice.

Well, obviously, Paul managed to do it:
https://github.com/pmazaitis/tree-sitter-context


> Maybe we could benefit from pre-converting the source file to an 
> XML-like tree before applying the grammar? At which point you 
> are venturing into LSP territory...

You know about the XML interface files?
See texmf-context/tex/context/interface/mkiv/


Hraban

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-07-05 11:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-04 19:22 [NTG-context] Anyone working on a treesitter grammar? juh+ntg-context--- via ntg-context
2024-07-04 19:39 ` [NTG-context] " Henning Hraban Ramm
2024-07-04 20:31   ` juh+ntg-context--- via ntg-context
2024-07-04 21:01     ` Henning Hraban Ramm
2024-07-05 10:07       ` Jethro Djan
2024-07-05 10:33 ` Jethro Djan
2024-07-05 11:36   ` Henning Hraban Ramm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).