tact-lang / tact-docs

Tact main documentation
https://docs.tact-lang.org
41 stars 36 forks source link

fix: grammar color related to `!` #183

Closed sansx closed 2 months ago

sansx commented 2 months ago

fix operator-logic match, now it can show operator like !=, !! in right color for example: previous - 2024-04-10 02 10 02 fixed -

2024-04-10 02 11 30

and so on

anton-trunov commented 2 months ago

Nice catch, thanks! As for the solution, what happens when the source code contains !!! or =! and so on? Those should not be highlighted as operators

sansx commented 2 months ago

Nice catch, thanks! As for the solution, what happens when the source code contains !!! or =! and so on? Those should not be highlighted as operators

in general, it won't be an issue, cuz we need to add {:tact} after operators to light it, so it will be in a small range

* `&&{:tact}` for [logical AND](/book/operators#binary-logical-and),
* `||{:tact}` for [logical OR](/book/operators#binary-logical-or),
* `!{:tact}` for [logical inversion](/book/operators#unary-inverse),
* `=={:tact}` and `!={:tact}` for checking [equality](/book/operators#binary-equality),

but yeah, it might happen in some day we make some mistake in adding such things, better not accept them before they become true, here is the optimized version :D

2024-04-10 11 16 42
sansx commented 2 months ago

I updated a explicitly operators version, is there any thing I can optimize about that

anton-trunov commented 2 months ago

I looked into this issue and it seems to be not worth it to try and disable highlighting in the cases like !!!. Let's go with the simplest solution then

sansx commented 2 months ago

I looked into this issue and it seems to be not worth it to try and disable highlighting in the cases like !!!. Let's go with the simplest solution then

of course, you're right, if we start to make strict match there will be many circumstances need to think about, it will quite take time. and I'd like to use my time to contribute in other more important parts of docs. XD

anton-trunov commented 2 months ago

@sansx your contributions are very welcome! btw, the current contribution qualifies for this SBT: https://society.ton.org/contribute-to-tact-compiler. We'll need your TON wallet address to issue your SBT

sansx commented 2 months ago

thank you! I'm glad I could help, My wallet address: UQCscO2q1znzE2ma4eoSpTmDzpc68uMOjYeMcLtPLS_ULywi

anton-trunov commented 2 months ago

@sansx done!

sansx commented 2 months ago

Got it, thank you so much! 🥳