Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.
/ arep Public archive

A higher grep: semantic/syntactic source code searching for Python

License

Notifications You must be signed in to change notification settings

aalireza/arep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arep

Warnings

1. This code was written 7 years ago when the author knew next to nothing about programming language theory, compilers, etc. The author still knows next to nothing about those things but he does recommend using SemGrep and maybe ChatGPT.

2. The project is unmaintained. Python's AST has probably changed a bit since 7 years ago.

Description

arep is searching tool that enables one to scan a Python program and find syntactical and/or semantical patterns within it.

Instead of a string-based method querying, a user declaratively describes the search parameter in one or more constraint objects, then the search engine would return all of the nodes of the programs AST that satisfy those constraints.

This way, results that are extremeley-difficult/nearly-impossible to be searched via string or regex based methods, are trivially found e.g. searching for all of the functions (be it function definitions or function calls or lambda functions that are assigned to a variable).

All of the constraints have a consideration specification where by default is set to None, which means the search engine is indifferent to them. However if changes its value to True/False then the search engine would seek/avoid all of the results that match the constraint. This method enables one build up on the predefined constraints and search of arbitrary complex patterns within the code.

License

This project is licensed under the BSD license (3-clause) - see the LICENSE file for more details.

About

A higher grep: semantic/syntactic source code searching for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages