Add Leo
This PR adds Linguist support for the Leo progamming language. Leo is a high-level language that allows developers to use zero-knowledge proofs in their applications while abstracting away the cryptographic complexities. Leo programs are compiled into Aleo instructions, which can be executed on the Aleo blockchain.
References
Checklist
- [x] I am adding a new language.
- [x] The extension of the new language is used in hundreds of repositories on GitHub.com. https://github.com/search?q=path%3A*main.leo+NOT+owner%3AProvableHQ++NOT+owner%3AAleoNet+NOT+is%3Afork&type=code&p=3. Note that the
main.leofile is expected to occur once per repository, which meets the requirements outlined here. - [x] I have included a real-world usage sample for all extensions added in this PR. They are covered under the license that is tagged at the top of each file.
- [x] I have included a syntax highlighting grammar: https://github.com/ProvableHQ/leo-linguist/blob/master/syntaxes/leo.tmLanguage.json
- [x] I have added a color
- Hex value:
#6814ec - Rationale: These are the brand colors.
- Hex value:
- [x] The extension of the new language is used in hundreds of repositories on GitHub.com. https://github.com/search?q=path%3A*main.leo+NOT+owner%3AProvableHQ++NOT+owner%3AAleoNet+NOT+is%3Afork&type=code&p=3. Note that the
Closes https://github.com/github-linguist/linguist/issues/6900
The extension of the new language is used in hundreds of repositories on GitHub.com. https://github.com/search?q=path%3A*main.leo+NOT+owner%3AProvableHQ++NOT+owner%3AAleoNet+NOT+is%3Afork&type=code&p=3. Note that the main.leo file is expected to occur once per repository, which meets the requirements outlined https://github.com/github-linguist/linguist/issues/5756.
This PR is not adding support for a single file, it's adding support for an extension which means the extension criteria applies and as with https://github.com/github-linguist/linguist/pull/6969, it appears quite common for a repo to contain multiple .leo files.
It seems quite common for .leo files to mention aleo so adding that to filter out files which clearly aren't Leo (there are a lot of XML files using this extension) indicates things are nearly there.
Closes #6900
Might be worth adding a heuristic like ^\s*program\s*[a-zA-Z_0-9\.]*\s*\{ to match the program declaration at the top of .leo files. This would give 1.9k files at the moment which is less than 50% of all .leo files.
Might be worth adding a heuristic like
^\s*program\s*[a-zA-Z_0-9\.]*\s*\{to match the program declaration at the top of.leofiles. This would give 1.9k files at the moment which is less than 50% of all.leofiles.
The heuristic wouldn't have any effect as this language is the only one with the .leo extension. It does however confirm popularity is now good to go.
@d0cd Please merge in main. I can't because your PR has come from an org-owned repo.
Thanks @lildude! We'll get this updated and merged in by Friday (earlier, if needed). Are there any deadlines on your end on cutting the next Linguist release?
@d0cd I need to make the release by the end of Thursday, UK time, at the latest.
Sounds good @lildude, we'll have it in ASAP! There have been a few updates to the language since making this PR. Do you recommend folding those in to this PR or holding off to another one?
Do you recommend folding those in to this PR or holding off to another one?
It depends. If this is just updating the samples, or grammar (not needed unless it's a completely new repo as we update all grammars with each release) then this PR is fine. If it's modifying the extensions, then any new ones are likely to hold up this PR even longer.
Once this has been merged, users can always use an override for any new extensions.
Got it, we have some grammar updates and a color change but if the release process updates the submodule, then it should be fairly straightforward!