Skip to content

exercism/haxe-representer

Repository files navigation

Haxe Representer

A normalizing representer for Exercism's Haxe track.

Progress

Currently the following is normalized by the representer:

  • Comments
  • Whitespace
  • Braces
  • Exponents
  • Keywords (final, inline, public, private)
  • Identifiers (classes, members, enums, typedefs)
  • Booleans
  • Import statements
  • Using statements
  • Declaration order of vars, functions, enums, typedefs

Design

The high-level steps the representer takes:

  1. Apply formatting to original source code using haxe-formatter
  2. Parse into AST using haxe-parser
  3. Apply normalizations
  4. Convert AST back to source code
  5. Apply formatting to normalized code
  6. Write out representation and mapping