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

Problematic handling of apostrophe in scintillua lexers #128

Open
mcepl opened this issue Jan 16, 2025 · 1 comment
Open

Problematic handling of apostrophe in scintillua lexers #128

mcepl opened this issue Jan 16, 2025 · 1 comment

Comments

@mcepl
Copy link

mcepl commented Jan 16, 2025

English language uses apostrophes quite often (a way more often than other languages I know) not only as a substitute for double quotes, but also in normal text (namely, The Saxon Genitive). The result is that the string definition as it was originally in the org lexer (and many others) doesn’t work very well:

-- Strings.
local sq_str = P('L')^-1 * lexer.range("'")
local dq_str = P('L')^-1 * lexer.range('"')
lex:add_rule('string', lex:tag(lexer.STRING, sq_str + dq_str))

Every English possessive breaks the highlighting (with home-made lexer, which includes this construct):

screenshot-2025-01-15_17-01-1736958165

I am not sure how to fix it.

@orbitalquark
Copy link
Owner

A simple fix would be to not match single quoted ranges. I'd be curious how org mode handles parsing of single quotes if it supports both single-quoted strings and bare apostrophes.

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

No branches or pull requests

2 participants