novusnota / prism-ton

πŸ”Ί Maintained set of TON programming language definitions/grammars for Prism.js

Home Page:https://docs.ton.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

prism-ton

πŸ”Ί Maintained set of TON blockchain programming language definitions for Prism.js

Initialization

Upon cloning this repo, invoke the following commands in order of appearance (but just once!):

  1. yarn prism:init β€” initializes the prismjs/prism submodule and installes it's dependencies
  2. yarn prism:links β€” creates all the necessary symbolic links from local files to the prismjs/prism submodule
  3. yarn prism:build β€” builds all the grammars and everything there is in prismjs/prism

Layout

Grammar files are located in langs/X files, where X can be one of:

  • prism-tact.js β€” Tact grammar
  • prism-func.js β€” FunC grammar
  • prism-fift.js β€” Fift grammar
  • prism-tlb.js β€” TL-B grammar

Test files are located in tests/X folders, where X can be one of:

  • tact β€” Tact tests
  • func β€” FunC tests
  • fift β€” Fift tests
  • tlb β€” TL-B tests

Running tests

Once initialized, you'll be able to run tests for each language in this repo, namely:

  • yarn test-tact will run tests for Tact
  • yarn test-func will run tests for FunC
  • yarn test-fift will run tests for Fift
  • yarn test-tlb will run tests for TL-B

And yarn test runs all those tests in succession.

Workflow

The workflow looks like this:

  1. Add changes to the grammar
  2. See how it works by opening the .github/submodule-prism/test.html file in the browser
  3. Add/update tests
  4. Execute and modify tests until they pass :)
  5. Commit & push
  6. Make PRs to:
  • ton-community/ton-docs
  • TelegramMessenger/libprisma
  • prismjs/prism

Prism.js docs: https://prismjs.com/extending.html Awesome RegExp visualization tool: https://regex101.com

TODO

  • Github Actions checks akin to ones in prismjs/prism
  • Pre-push hooks with mandatory builds & tests -> push shall be stopped in case of errors

Credits

Based on The Open Network.

Made & maintained with 🀍 by Novus Nota.

License

MIT

About

πŸ”Ί Maintained set of TON programming language definitions/grammars for Prism.js

https://docs.ton.org

License:MIT License


Languages

Language:JavaScript 100.0%