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

expl3 syntax highlighting #48

Closed
Evpok opened this issue Aug 25, 2015 · 4 comments
Closed

expl3 syntax highlighting #48

Evpok opened this issue Aug 25, 2015 · 4 comments

Comments

@Evpok
Copy link

Evpok commented Aug 25, 2015

Same as textmate/latex.tmbundle#79 it would be really useful if the blocks between \ExplSyntaxOn and \ExplSyntaxOff could be properly highlighted.

@yudai-nkt
Copy link
Collaborator

yudai-nkt commented Jul 16, 2016

Hi @Evpok,

Since the original maintainers are somehow inactive on this package for almost one year, I am now making a new one (yudai-nkt/language-tex) based on the clone of this repo. Several bugs are fixed and expl3 highlight is also support to some extent in expl3 branch.

It's been a while since you opened this issue, but I'm glad if you get interested in my package and give it a try.

This is how expl3 syntax looks with my package (example taken from siunitx package):

2016-07-16 20 39 35

As you can see in the screenshot above, current implementation is not perfect. For example, commenst are not rendered as comment. This is not included in the picture, but control sequences like \newcommand and \ifx are in the same color as the other ordinary macros. This problem has to be settled to merge into master.

Another problem is that because I'm not an expert of expl3 grammar, the current pattern matching is quite rough (especially, function and variable are not distinguished). If someone can invent better regex to represent the syntax, it will be highly appreciated also.

@Evpok
Copy link
Author

Evpok commented Jul 16, 2016

Hi @yudai-nkt ! Thanks for following up on this issue and taking the burden of this package. I'll be glad to test it as soon as I come back from vacations, but I have to admit that it not being available via apm is a bit of a show-stopper for those of us with synchronized settings on several machines.

I'll be happy to try and help support LaTeX3/expl syntax, though I have to admit that the Textmate syntax feels really alien to me.

@yudai-nkt
Copy link
Collaborator

yudai-nkt commented Jul 16, 2016

I will surely publish my package when it's ready, but it won't include expl3 support because it's not in master branch. Since expl3 branch obviously contains bugs, I am reluctant to merge it.

However, the maleffect is limited between \ExplSyntaxOn and \ExplSyntaxOff or in packages with \ProvideExplPackage, so I should consider to merge for the convenience of those who are kind to take their time for the test.

the Textmate syntax feels really alien to me

It's alien to me too. 😭 There are incomprehensible piles of \t and entries which seem to be ported from TextMate and unnecessary.


Edit: As @yitzchak points out in yudai-nkt/language-tex#2, you can simply install my package by apm install yudai-nkt/language-tex. You maybe already know that, but I just want to let you know just in case.

@yudai-nkt
Copy link
Collaborator

Hi, this is me again.

With the release of language-tex v0.3.0, expl3 syntax is fully supported! Unlike the previous one above, this version distinguishes variable, function and its argument specification. It also does not override the original setting such as % anymore.

2016-08-27 1 40 44

FYI only.

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