Skip to content

๐Ÿ”บ Maintained set of TON programming language definitions/grammars for Prism.js

License

Notifications You must be signed in to change notification settings

novusnota/prism-ton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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