Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: add neo smart contract syntax analyzer #839

Merged
merged 55 commits into from
Mar 23, 2024

Conversation

Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Dec 17, 2023

This pr adds the syntax rules of the neo smart contract.

It:

  • Bans the use of decimal type
  • Bans the use of double type
  • Bans unsupported BigInteger, String, Char, Math methods and syntax.
  • Bans out, ref keywords.
  • Bans the use of LINQ.
  • Bans unsupported collection types.

All baned syntax will show errors in the IDE.

Code Fix:

double => long;
float => int;
out => local variable and return value;
anonymous function => methods;

@Jim8y
Copy link
Contributor Author

Jim8y commented Dec 17, 2023

Screenshot 2023-12-17 at 10 18 46 PM

@Jim8y Jim8y requested a review from shargon December 18, 2023 06:10
@Jim8y Jim8y mentioned this pull request Dec 18, 2023
@Jim8y Jim8y mentioned this pull request Dec 23, 2023
@Jim8y Jim8y self-assigned this Feb 26, 2024
@Jim8y
Copy link
Contributor Author

Jim8y commented Feb 26, 2024

Will add syntax analyer for using using BigInteger = System.Numerics.BigInteger;

@Jim8y
Copy link
Contributor Author

Jim8y commented Mar 2, 2024

Add syntax check for UInt160 and ECPoint assignment format check

@shargon
Copy link
Member

shargon commented Mar 2, 2024

UTs

@Jim8y Jim8y removed the blocked label Mar 13, 2024
@Jim8y
Copy link
Contributor Author

Jim8y commented Mar 13, 2024

@shargon now good to go.

Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can we use this analyser in the smart contract?

@Jim8y
Copy link
Contributor Author

Jim8y commented Mar 22, 2024

@shargon now use this analyer in the examples to demonstrate how to use it.

@shargon
Copy link
Member

shargon commented Mar 22, 2024

Thanks @Jim8y, now is ready for me

@Jim8y Jim8y merged commit 905246d into neo-project:master Mar 23, 2024
4 checks passed
@Jim8y Jim8y deleted the syntax-analyzer branch March 23, 2024 01:33
Jim8y added a commit to Ashuaidehao/neo-devpack-dotnet that referenced this pull request Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants