[NTG-context] issue with scite module

Pablo Rodriguez oinos at gmx.es
Thu Jun 2 17:36:43 CEST 2022


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scite-xml.diff
Type: text/x-patch
Size: 982 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220602/bd58cec0/attachment.bin>


More information about the ntg-context mailing list