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

Cilk: Add support for Cilk (with C/C++) #3522

Merged
merged 2 commits into from Aug 17, 2022
Merged

Cilk: Add support for Cilk (with C/C++) #3522

merged 2 commits into from Aug 17, 2022

Conversation

ailiop
Copy link
Contributor

@ailiop ailiop commented Aug 17, 2022

This PR adds support for the Cilk language extension to C/C++, specifically the set of keywords supported by the latest version of the OpenCilk platform. I have followed the various instructions in the README.

Summary

The entirety of the specification is only a few lines. It just creates 2 new languages by extending C and C++ with the parallel keywords cilk_for, cilk_reducer, cilk_scope, cilk_spawn, and cilk_sync. I used the insertBefore() function to add the new token label before function to capture Cilk keywords which are followed by arguments in parentheses.

Ownership

I specified the OpenCilk GitHub organization (of which I am a part) as the "owner" in components.json. I plan to be handling future bug reports related to the cilkc and cilkcpp languages, but I believe that listing the OpenCilk organization as the owner should ensure better coverage and continuity as the Cilk language evolves.

@github-actions
Copy link

github-actions bot commented Aug 17, 2022

JS File Size Changes (gzipped)

A total of 4 files have changed, with a combined diff of +391 B (+7.6%).

file master pull size diff % diff
components/prism-cilkc.min.js 0 Bytes 161 B +161 B +100.0%
components/prism-cilkcpp.min.js 0 Bytes 169 B +169 B +100.0%
plugins/autoloader/prism-autoloader.min.js 2.42 KB 2.45 KB +31 B +1.3%
plugins/show-language/prism-show-language.min.js 2.71 KB 2.74 KB +30 B +1.1%

Generated by 🚫 dangerJS against 8ab2307

@RunDevelopment
Copy link
Member

Thank you for the PR @ailiop!

The code itself looks good. Due to old infrastructure, you also have to commit the minified files generated by npm run build (this is why the CI fails). After that, this PR is good to go.

@ailiop
Copy link
Contributor Author

ailiop commented Aug 17, 2022

Thank you and sorry for the extra trouble. I had not realized the build-generated files were necessary.

I believe the PR should be ready now.

@ailiop
Copy link
Contributor Author

ailiop commented Aug 17, 2022

Oh, and thank you for making it easy — and well documented — to add a language definition/extension to Prism!

@RunDevelopment RunDevelopment merged commit c8462a2 into PrismJS:master Aug 17, 2022
@RunDevelopment
Copy link
Member

Thank you for contributing!

sorry for the extra trouble. I had not realized the build-generated files were necessary.

No worries. It's not exactly common. Thank you for putting up with it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants