4 releases

0.2.2 Jan 30, 2023
0.2.1 Aug 18, 2022
0.2.0 Aug 13, 2022
0.1.1 Sep 23, 2021

#406 in Text processing

21 downloads per month

MPL-2.0 license

73KB
2K SLoC

Nyar High-Level Intermediate Representation

Task

  • From text to AST
  • Macro expand
  • Fill missing lex level info

TEXT -> AST -> CSR -> CPS

Stage Abstract Syntax Tree

Remove all whitespace and comments (except documentation comments)

Stage Class Scope Resolver

Eliminate control flow keywords like

break, continue, fallthrough yield, yield_from

Transform such non-local exit to function call.

Identify tail calls and tail recursion.

Common subexpression elimination.

Stage Continuation Passing Style

Dependencies

~9MB
~213K SLoC