-
Notifications
You must be signed in to change notification settings - Fork 662
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
Add World of Warcraft TOC file lexer #2244
Conversation
Oh, also, the standard file suffix for TOCs ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, generally looks OK.
For the conflict with TeX on *.toc
, you need to write an analyse_text
method that returns a score indicating how probable it is that the file is a Warcraft TOC file. Are there any recurring patterns occurring in those files?
Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr>
Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr>
There are definitely tells, yes. I'll have to see look into how to implement this method and look into how this toc differs from Tex's. Working on this today. |
@jean-abou-samra, thank you for your feedback earlier. Since then, I have
I also fixed some other small things I found that are unrelated to this lexer, but that impeded my development workflow:
Are these other (minor?) changes acceptable in this PR, or should I make new ones? |
The URL fix is good. The |
This reverts commit a6a0749.
Yeah, I know what you mean. I don't want to get stuck on it though, so I will revert. |
Reversion to |
LGTM. |
Thanks @jean-abou-samra! This was a very pleasant PR. I really appreciate your help. |
This PR adds lexer support for World of Warcraft TOC files, which are metadata files that describe addons that augment the game. See 1, 2 for examples of TOC files.
This is a widely developed and distributed file format: On Curseforge, an addon index, there are roughly 10,000 addons. The top addons have 100s of millions of downloads (see 1, 2, 3).
This PR has support for all constructs in a TOC file:
I based my work off on nebularg/language-toc-wow, which serves as GitHub's linguist reference, and the Wowpedia TOC Format article.
Example files have been included, and their
--golden
output looks good to me. All tests pass.