From: Pablo Rodriguez via ntg-context <ntg-context@ntg.nl>
To: Max Chernoff via ntg-context <ntg-context@ntg.nl>
Cc: Pablo Rodriguez <oinos@gmx.es>
Subject: Re: issue with scite module
Date: Thu, 2 Jun 2022 17:36:43 +0200 [thread overview]
Message-ID: <232ea01f-c762-3c93-e8e1-f555b0ae4125@gmx.es> (raw)
In-Reply-To: <cac73198-f067-80c6-633c-b2172f65ddac@telus.net>
[-- Attachment #1: Type: text/plain, Size: 1969 bytes --]
On 6/1/22 23:58, Max Chernoff via ntg-context wrote:
>> Now, I still don’t understand LPEG and don’t know if there’s a general
>> “character” class that doesn’t need a list...
Many thanks for your reply, Hraban.
> The easiest way that I found was to just cheat and use everything with
> a TeX catcode 11 ("letters"):
>
> local name = (R("az","AZ","09") + S("_-.") + lpeg.utfchartabletopattern(characters.csletters))^1
Many thanks for your reply, Max,
I’m afraid I cannot make your proposed fix work.
For the sake of consistency (with buff-imp-xml.lua), I think the patch
should read (also attached to the message to avoid wrong line breaking):
--- scite-context-lexer-xml.lua 2022-06-01 17:24:38.625976000 +0200
+++
context/tex/texmf-context/context/data/scite/context/lexers/scite-context-lexer-xml.lua
2022-06-02 16:37:30.112824947 +0200
@@ -13,7 +13,7 @@
-- todo: parse entities in attributes
local global, string, table, lpeg = _G, string, table, lpeg
-local P, R, S, C, Cmt, Cp = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cmt,
lpeg.Cp
+local P, R, S, C, Cmt, Cp, lpatterns = lpeg.P, lpeg.R, lpeg.S, lpeg.C,
lpeg.Cmt, lpeg.Cp, lpeg.patterns
local type = type
local match, find = string.match, string.find
@@ -41,7 +41,8 @@
local equal = P("=")
local ampersand = P("&")
-local name = (R("az","AZ","09") + S("_-."))^1
+local alsoname = lpatterns.utf8two + lpatterns.utf8three +
lpatterns.utf8four
+local name = (R("az","AZ","09") + S("_-.") + + alsoname)^1
local openbegin = P("<")
local openend = P("</")
local closebegin = P("/>") + P(">")
But I’m afraid I cannot make it work on my computer (Linux64).
On another Win64 computer, both patches worked perfectly fine.
Both machines run LMTX current latest. So I have an issue on my
installation that I have to fix first.
Many thanks for your help,
Pablo
[-- Attachment #2: scite-xml.diff --]
[-- Type: text/x-patch, Size: 982 bytes --]
--- scite-context-lexer-xml.lua 2022-06-01 17:24:38.625976000 +0200
+++ context/tex/texmf-context/context/data/scite/context/lexers/scite-context-lexer-xml.lua 2022-06-02 16:37:30.112824947 +0200
@@ -13,7 +13,7 @@
-- todo: parse entities in attributes
local global, string, table, lpeg = _G, string, table, lpeg
-local P, R, S, C, Cmt, Cp = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cmt, lpeg.Cp
+local P, R, S, C, Cmt, Cp, lpatterns = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cmt, lpeg.Cp, lpeg.patterns
local type = type
local match, find = string.match, string.find
@@ -41,7 +41,8 @@
local equal = P("=")
local ampersand = P("&")
-local name = (R("az","AZ","09") + S("_-."))^1
+local alsoname = lpatterns.utf8two + lpatterns.utf8three + lpatterns.utf8four
+local name = (R("az","AZ","09") + S("_-.") + + alsoname)^1
local openbegin = P("<")
local openend = P("</")
local closebegin = P("/>") + P(">")
[-- Attachment #3: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2022-06-02 15:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-01 16:47 Pablo Rodriguez via ntg-context
2022-06-01 16:58 ` Henning Hraban Ramm via ntg-context
2022-06-01 17:45 ` Pablo Rodriguez via ntg-context
2022-06-01 19:00 ` Henning Hraban Ramm via ntg-context
2022-06-01 21:58 ` Max Chernoff via ntg-context
2022-06-02 15:36 ` Pablo Rodriguez via ntg-context [this message]
2022-06-02 17:03 ` Pablo Rodriguez via ntg-context
2022-06-02 22:52 ` Max Chernoff via ntg-context
2022-06-04 8:42 ` Pablo Rodriguez via ntg-context
2022-06-04 9:59 Pablo Rodriguez via ntg-context
2022-06-04 21:18 ` Max Chernoff via ntg-context
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=232ea01f-c762-3c93-e8e1-f555b0ae4125@gmx.es \
--to=ntg-context@ntg.nl \
--cc=oinos@gmx.es \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).