Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

fix: grammar color related to ! #183

Merged
merged 6 commits into from
Apr 11, 2024
Merged

Conversation

sansx
Copy link
Contributor

@sansx sansx commented Apr 9, 2024

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
Copy link
Member

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
Copy link
Contributor Author

sansx commented Apr 10, 2024

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 sansx marked this pull request as draft April 10, 2024 03:24
@sansx sansx marked this pull request as ready for review April 10, 2024 03:31
@sansx
Copy link
Contributor Author

sansx commented Apr 11, 2024

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

@anton-trunov
Copy link
Member

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
Copy link
Contributor Author

sansx commented Apr 11, 2024

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
Copy link
Member

@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

@anton-trunov anton-trunov merged commit 31c7448 into tact-lang:main Apr 11, 2024
1 check passed
@sansx
Copy link
Contributor Author

sansx commented Apr 11, 2024

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

@anton-trunov
Copy link
Member

@sansx done!

@sansx
Copy link
Contributor Author

sansx commented Apr 11, 2024

Got it, thank you so much! 🥳

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

Successfully merging this pull request may close these issues.

2 participants