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

Migrate to Abstract Syntax Trees Generator in mutator #242

Closed
bugdea1er opened this issue May 12, 2022 · 10 comments
Closed

Migrate to Abstract Syntax Trees Generator in mutator #242

bugdea1er opened this issue May 12, 2022 · 10 comments
Assignees

Comments

@bugdea1er
Copy link
Member

Use https://github.com/unified-ast/ast-generator tool in mutator

@tdv42
Copy link
Member

tdv42 commented Jun 8, 2022

after cqfn/astranaut#52 is resolved

@tdv42
Copy link
Member

tdv42 commented Jun 14, 2022

after cqfn/astranaut#52 is resolved

Resolved for now

@bugdea1er
Copy link
Member Author

Waiting for cqfn/astranaut#61

@tdv42
Copy link
Member

tdv42 commented Jul 26, 2022

Waiting for cqfn/astranaut#61

Resolved for now

@bugdea1er
Copy link
Member Author

@bugdea1er
Copy link
Member Author

bugdea1er commented Aug 2, 2022

cqfn / astranaut cannot return custom nodes from the tree transformer, so we need to implement converter both from our tree to astranaut's nodes and vice versa.
For a first demonstration a simple converter for several nodes was implemented and a simple mutation was passed to the tree transformer.

The development goes here

For the test

def bitwiseXor():
    return (5  + 4)

and the transformer rule
Binop(#1, #2)<"+"> -> Binop(#1, #2)<"-">

we got an expected result of

def bitwiseXor():
    return (5  - 4)

@tdv42
Copy link
Member

tdv42 commented Aug 9, 2022

next steps:

  1. Implement converter ASTG tree to AST
  2. Migrate existing migrations to ASTG
  3. Add more migrations

@tdv42
Copy link
Member

tdv42 commented Aug 9, 2022

Suggested implement syntax for specifying a specific occurrence of a node in a transformation rule: cqfn/astranaut#71

@tdv42
Copy link
Member

tdv42 commented Sep 13, 2022

Waiting for cqfn/astranaut#81

@bugdea1er
Copy link
Member Author

Checker module migrated to a separate repository

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

No branches or pull requests

2 participants