Skip to content

A library for syntactically rewriting Python programs, pronounced (sinner).

License

Notifications You must be signed in to change notification settings

wrongtest-intellif/synr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synr

Synr is a library that provides a stable Abstract Syntax Tree for Python.

Features

  • The Synr AST does not change between Python versions.
  • Every AST node contains line and column information.
  • There is a single AST node for assignments (compared to three in Python's ast module).
  • Support for returning multiple errors at once.
  • Support for custom error reporting.

Usage

import synr

def test_program(x: int):
  return x + 2

# Parse a Python function into an AST
ast = synr.to_ast(test_program, synr.PrinterDiagnosticContext())

Documentation

Please see https://synr.readthedocs.io/en/latest/ for documentation.

About

A library for syntactically rewriting Python programs, pronounced (sinner).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%