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

Add support for Asymptote and LTspice Symbol schematics #4372

Merged
merged 6 commits into from
Jan 14, 2019
Merged

Conversation

Alhadis
Copy link
Collaborator

@Alhadis Alhadis commented Jan 8, 2019

I discovered Asymptote on Wikipedia, of all places. While assessing its distribution on GitHub, I encountered an even more widespread format with the same file-extension. As both .asy formats qualify for registration on GitHub, they're being added together.

Asymptote

Asymptote is a C++-like programming language for vector graphics generation. It's bundled as part of the TeXLive distribution, which explains the surprising number of results I found. Of the 25,327 .asy files indexed on GitHub, I harvested 2,987 of them, the overwhelming majority of which were all Asymptote source. The others that weren't had negligible distribution:

Some files were binary blobs, which I naturally removed before going through the results.

Syntax highlighting

Unfortunately, I couldn't find an Asymptote grammar that wasn't copylefted. 😢 Thankfully, C++'s grammar is a decent substitute. 👍

LTspice Symbols

Unfortunately, there's very little documentation about the format, as it's data generated by a GUI — a program named LTspice which is something to do with circuitry/electronics/hardware-schematic stuff. 😓 This was the only resource I found on LTspice's .asy format that shed anything insightful.

Nonetheless, there are about twice as many of these files on GitHub than there are Asymptote files. 59,570 indexed results, which were narrowed down thanks to each file having a line beginning with SymbolType. This was also how I excluded LTspice's .asy files from the Asymptote tally, above.

Syntax highlighting

... was hacked together by me and added to the language-pcb repo (hence the submodule bump). Even without much knowledge of the format, highlighting it was easy thanks to the format's limited number of keywords.

Checklist:

  • I am adding a new language.
    • The extension of the new language is used in hundreds of repositories on GitHub.com.
    • I have included a real-world usage sample for all extensions added in this PR:
      • Asymptote/figarc4_3D.asy: Source | CC license
      • Asymptote/kappa-sawteeth.asy: Source | CC license
      • LTspice Symbol/random-shapes.asy: Uhm, drawn by me in LTspice because everything I found was copylefted or unlicensed. Here's a screenshot of my masterpiece:

Grand, ain't it?

  • I have included a change to the heuristics to distinguish my language from others using the same extension.

/cc @lildude, @pchaigno for review
/cc @5N44P so he can laugh at my drawing

Copy link
Contributor

@pchaigno pchaigno left a comment

Choose a reason for hiding this comment

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

Great pull request as usual!

There's a bit of a weird thing going on in the cached license, but good to go for me otherwise.

vendor/licenses/grammar/language-pcb.txt Show resolved Hide resolved
@Alhadis Alhadis merged commit f1f4018 into master Jan 14, 2019
@Alhadis Alhadis deleted the asymptote branch January 14, 2019 16:40
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants