From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id 24D4B2902A for ; Fri, 5 Jul 2024 12:34:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id A514E484933 for ; Fri, 5 Jul 2024 12:34:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=gmail.com Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ExWo72Tok9oT for ; Fri, 5 Jul 2024 12:34:08 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id B610E484748 for ; Fri, 5 Jul 2024 12:33:46 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id B20934845D7 for ; Fri, 5 Jul 2024 12:33:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4HLNJ3kPWT8F for ; Fri, 5 Jul 2024 12:33:33 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.215.177; helo=mail-pg1-f177.google.com; envelope-from=jthryeboah@gmail.com; receiver= Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 5AED74845D2 for ; Fri, 5 Jul 2024 12:33:33 +0200 (CEST) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-761e0f371f5so811502a12.1 for ; Fri, 05 Jul 2024 03:33:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720175611; x=1720780411; darn=ntg.nl; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=dxcLgkzCXeJ80xwT2INP0XopuMi4J2MknPV1ondXsk8=; b=cignVRDKlfJfSwAm8dbyhIrsaO3siwrZ00BS0XU7DUQ9vGUgBi8v7CEnI6YJMjrWIk xnjqvF1kBUgLkdoUpDWTGIcfiLgCxGIyJFDCMvf62aOKuZKtKd0sXMdqbDW/k8GIUGbH FxmmeGL4tOpxnhnCiyP+NmHocQmdIkBiPqAxNA0qWpkiNATpzelZlLPmB1hhP7+ECDAO 4PgxYh1mL7wbPeilPESZoYxCwkfh1DUi5cKDgDyuXz3p0nlvQ6Ysu/SPN0vt907vObIs qZwTUA6NgRLKoCW9KOZc51z6kUiE3uNLHsY+Glz4F1B6wUP7SJFcjKnEdnaexyVESnAt SNvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720175611; x=1720780411; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dxcLgkzCXeJ80xwT2INP0XopuMi4J2MknPV1ondXsk8=; b=GeGUTsartWViuDkgWkuoLm9TgiIGD7oQNdn5VEQ3knELRdhVMPuKh1G++D7dH7trh2 EMvVEDu/HGcp7DDHqis7eI4nXVQAxXE00A1xxvLBxtNThC3k4m8g3JXrhyIq0H/C6mKA iFHcQIHwNBqZzpCC+HabUFH8I3Q78IakLbGlzt9jonrV2O95AWrnT0Qo3AFzvDCNGwKv bKVymJRD9mJVGQWIVlIgv8sjoKXgBaxtY55MnPUDOJbln4XnWnFAuSeziuQCldDv1ZA6 HZDhMhM3sF8HY+fu32jBOmqwcCJcjRL+BsjyqYSyXasN+kL8O6arMUiNqu4Vxw2Q3Msr EFmg== X-Gm-Message-State: AOJu0YxBnQNdkRQ8Q6ZmLgBlLH+VNRVxCMKTWzatVQx+YpY7TTGxPAHi XNupdADXiYRRk6VyDUkPC5IKRkg6Q/DRmMxukOhsaW/hM//Up/KPMF0REiG4EngTfgrzA3GfJSs WraQPps2mZjRQjI/PwK1XerPFvSCmAQ== X-Google-Smtp-Source: AGHT+IHDWLaUsMWEm7+kmlEhGIAeFof2T5JgDL+VpQjGboR9LJhCWDGd0f71UzAVfs2xkDJ0mBgBm80qJYtCFBU3oow= X-Received: by 2002:a17:90a:c381:b0:2c9:75a7:5c25 with SMTP id 98e67ed59e1d1-2c99f3ac56cmr5735692a91.15.1720175610885; Fri, 05 Jul 2024 03:33:30 -0700 (PDT) MIME-Version: 1.0 References: <74c9162b-a40c-45e8-80c0-eee1f2ff7205@mailbox.org> In-Reply-To: <74c9162b-a40c-45e8-80c0-eee1f2ff7205@mailbox.org> From: Jethro Djan Date: Fri, 5 Jul 2024 10:33:19 +0000 Message-ID: To: mailing list for ConTeXt users Message-ID-Hash: 3JFCV7XZBNPK34TOVGPUTWCMXWLISBMX X-Message-ID-Hash: 3JFCV7XZBNPK34TOVGPUTWCMXWLISBMX X-MailFrom: jthryeboah@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Anyone working on a treesitter grammar? List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============0248771926367709456==" --===============0248771926367709456== Content-Type: multipart/alternative; boundary="0000000000003d00d4061c7d98f3" --0000000000003d00d4061c7d98f3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=E2=80=AFPM 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 > > _________________________________________________________________________= __________ > --0000000000003d00d4061c7d98f3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

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

If I can recall, one of the = first problems I ran into concerned how ConTeXt environments=C2=A0work (amo= ng other things I cannot recall). In LaTeX, you have something=C2=A0like:
\begin{theorem}
When you are writing the grammar, you ca= n clearly separate the tokens into '\', 'begin', '{'= ; and '}'. So you get a consistent object that the tree-sitter libr= ary can work with. But with ConTeXt, you have something like this:
\startTheorem
We know that it is actually made up=C2=A0of '= \', 'start' and 'Theorem'. But there is nothing separat= ing the latter two so I couldn't find a way to make it general enough a= cross board because of how configurable ConTeXt is (we have very few pre-de= fined 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 fil= e to an XML-like tree before applying the grammar? At which point you are= =C2=A0venturing into LSP territory...

Jethro=C2=A0=

On Thu, Jul 4, 2024 at 7:36=E2=80=AFPM juh+ntg-context--- via n= tg-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 t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / https://mailman.ntg.nl/mail= man3/lists/ntg-context.ntg.nl
webpage=C2=A0 : https://www.pragma-ade.nl / https://context.aanhet.net= (mirror)
archive=C2=A0 : https://github.com/contextgarden/context=
wiki=C2=A0 =C2=A0 =C2=A0: https://wiki.contextgarden.net
___________________________________________________________________________= ________
--0000000000003d00d4061c7d98f3-- --===============0248771926367709456== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0248771926367709456==--