Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add lingua franca language #993

Merged
merged 2 commits into from
May 2, 2024
Merged

Conversation

oowekyala
Copy link
Contributor

This adds support for the Lingua Franca language (LF). LF is a coordination language that embeds fragments of another language (eg Rust, C, Python). For that reason tokei's embedded language feature is very valuable. Here's a sample output when run on this repo:

 Language            Files        Lines         Code     Comments       Blanks
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
...
 Lingua Franca          87         8964         4379         2567         2018
 |- C                   30         2451         1923          307          221
 |- C++                 24         2120         1659          238          223
 |- Python               1           14           14            0            0
 |- Rust                21         1967         1670          141          156
 |- TypeScript          10          429          384           23           22
 (Total)                          15945        10029         3276         2640

| "{{key}}" => Some({{key}}),
{% endfor %}
unknown => {
warn!("Unknown language name: {}", unknown);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should have a warn! here, because people use it as a library, and they may not want to have it warn when getting None can be expected behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks! I'll change that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually all other such methods like from_file_extension use a warn! call, so maybe this change should be part of another PR?

@XAMPPRocky
Copy link
Owner

Thank you for your PR! I'll try to review this more throughly in the future 🙂

@XAMPPRocky
Copy link
Owner

Thank you for your PR, and congrats on your first contribution! 🎉

@XAMPPRocky XAMPPRocky merged commit 0f85cfe into XAMPPRocky:master May 2, 2024
@oowekyala oowekyala deleted the add-lf-language branch May 3, 2024 10:45
ErikSchierboom pushed a commit to exercism/tokei that referenced this pull request Jun 7, 2024
ErikSchierboom pushed a commit to exercism/tokei that referenced this pull request Jun 7, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants