#axon #sky-spark #syntax-tree #programming-language

axon_parser

Parses a representation of SkySpark's Axon language into an AST

20 unstable releases (7 breaking)

0.8.2 Oct 4, 2021
0.8.1 Jul 27, 2021
0.7.0 Jul 25, 2021
0.5.4 Jan 25, 2021
0.5.0 Dec 27, 2020

#1881 in Parser implementations

Download history 5/week @ 2024-02-19 4/week @ 2024-02-26 91/week @ 2024-04-01

91 downloads per month

MIT license

200KB
5K SLoC

Axon Parser

Parses the output of SkySpark's toAxonCode(parseAst( ... )) into an abstract syntax tree.

Features

  • Parse an AST representing a Axon func.
  • Code formatting

Code Formatting

The code formatting is basic and opinionated, and strays from idiomatic Axon code to keep the implementation relatively simple. The configuration is currently limited to the type and size of indentation used.

For example, Axon like:

( param1  ,param2:"arg2")=>"hello world"

will become:

(param1, param2: "arg2") => do
  "hello world"
end

It may not produce the prettiest Axon code, plus the formatted output has not been extensively tested for correctness.

Getting Started

See the documentation for the parse_func and parse_func_to_formatted_lines functions.

Dependencies

~3.5–6.5MB
~111K SLoC