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

Improve man lexer, and generalize it to more file extensions #1056

Closed
wants to merge 1 commit into from

Conversation

Eolien55
Copy link

@Eolien55 Eolien55 commented Nov 23, 2022

The current man lexer has some issues : it is not a man lexer, but really a troff one; it is very bad for highlighting troff documents that do not use the man macros. I thus replaced the old man lexer by a more general troff one. I also changed the filetypes entry, so it accepts more macro sets.

Note: Some man-specific style was kept (headings), and this is more a groff highlighter than a general troff one because of the groff imperative programming that gets highlighted (whiles, breaks, etc.).

@ninewise
Copy link
Collaborator

Could you send the changes to the lexers upstream instead, to https://github.com/orbitalquark/scintillua? We're going to avoid diverging. The filetype changes are welcome, though.

@Eolien55
Copy link
Author

Eolien55 commented Dec 1, 2022

Should I wait for orbitalquark/scintillua#84 to be resolved to make the filetypes change?

@mcepl
Copy link
Contributor

mcepl commented Dec 7, 2022

Should I wait for orbitalquark/scintillua#84 to be resolved to make the filetypes change?

Unfortunately, it seems you have to. But you can certainly remove changes to man.lua and troff.lua from this PR, they belong (if anywhere) upstream.

@Eolien55
Copy link
Author

Eolien55 commented Dec 8, 2022

Well, scintillua is going through a re-modernization of its lexers, and the man one (and all the lexers used in vis) are considered legacy. This also means the lexer in the afformentioned PR is using those new features, provided by Scintillua's lexer.lua, so using this work from upstream would also require updating the lexer system a bit.

@mcepl
Copy link
Contributor

mcepl commented Dec 8, 2022

Well, scintillua is going through a re-modernization of its lexers, and the man one (and all the lexers used in vis) are considered legacy. This also means the lexer in the afformentioned PR is using those new features, provided by Scintillua's lexer.lua, so using this work from upstream would also require updating the lexer system a bit.

Yup, but that’s the problem of orbitalquark/scintillua#84, it doesn’t belong here, does it?

@ninewise
Copy link
Collaborator

You could already do the filetype change if you rename the lexer file, too, but I'd rather not merge that to avoid future confusion (us having a troff lexer which will then conflict with the change troff lexer from upstream, ...)

@Eolien55
Copy link
Author

Yup, but that’s the problem of orbitalquark/scintillua#84, it doesn’t belong here, does it?

Indeed, but what I was saying is that we cannot use the upstream change without also using the upstream lexer.lua. I guess I'll just open another PR for that

@Eolien55
Copy link
Author

I'd rather not merge that to avoid future confusion

I agree. Closing this as of now.

@Eolien55 Eolien55 closed this Dec 10, 2022
@mcepl
Copy link
Contributor

mcepl commented Aug 13, 2023

Yup, but that’s the problem of orbitalquark/scintillua#84, it doesn’t belong here, does it?

Indeed, but what I was saying is that we cannot use the upstream change without also using the upstream lexer.lua. I guess I'll just open another PR for that

I have prepared branch https://git.sr.ht/~mcepl/vis/log/devel_scintillua (hopefully, Soon™ to be merged by @rnpnr ) which upgrades vis lexers (including lexer.lua) to the upstream tag scintillua_6.2. Does it help you to revive your effort here?

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

Successfully merging this pull request may close these issues.

3 participants