Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding catcode of a character in a cctab from outside #880

Closed
blefloch opened this issue Apr 25, 2021 · 1 comment
Closed

Finding catcode of a character in a cctab from outside #880

blefloch opened this issue Apr 25, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@blefloch
Copy link
Member

While implementing #877 about catcodes produced by l3regex I thought of a nice extension, which would be to use some particular catcode table. The easiest/fastest approach for this would be to have a way to access particular entries in a catcode table without actually running \cctab_begin:N.

The key question is whether this is accessible from the Lua side in LuaTeX (alternatively I guess one could switch to the given catcodetable locally, and look up the catcode on the TeX side). A possible implementation for non-luatex engines is

\int_compare:nNnTF {#2} < { 256 }
  { \intarray_item:Nn #1 { #2 + 1 } }
  { \char_value_catcode:n {#2} }
@blefloch blefloch added the enhancement New feature or request label Apr 25, 2021
@zauguin
Copy link
Member

zauguin commented Apr 25, 2021

The key question is whether this is accessible from the Lua side in LuaTeX

It is. (tex.getcatcode (42, 0x4242) gives the catcode of char U+4242 in table 42)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants