Coder Social home page Coder Social logo

novusnota / prism-ton Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 39 KB

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

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

License: MIT License

JavaScript 100.00%
fift func tact the-open-network tl-b ton grammar grammars prism-js prismjs

prism-ton's Introduction

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

prism-ton's People

Contributors

novusnota avatar

Stargazers

 avatar

Watchers

 avatar

prism-ton's Issues

Update Tact to v1.3.0

See: tact-lang/tact#280

Applicable list of changes:

  • Fixed precedence levels for bitwise operators, equality and comparisons. Now the precedence levels match common languages like JS/TS.
  • Support for string escape sequences: \\, \", \n, \r, \t, \v, \b, \f, \u{0} through \u{FFFFFF}, \u0000 through \uFFFF, \x00 through \xFF.
  • Bitwise XOR (^) operator.
  • try {...} and try {...} catch {...} statements.
  • foreach loop for the Map type: foreach (k, v in map) {...}.
  • Trailing commas for all comma-separated lists.

Tracking issue: Tact v1.4.0

To be resolved by: #6

  • Bitwise NOT ~
  • New augmented assignment operators: |=, &=, ^=
  • Underscores _ as unused variable identifiers
  • As a bonus: start highlighting variables as well

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.