File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 11Elixir-ESTree
22============
33
4- Defines structs that represent the ESTree AST definitions. Also includes a JavaScript AST to JavaScript code generator.
4+ Defines structs that represent the JavaScript AST nodes from the ESTree spec.
55
66[ ESTree Spec] ( https://github.com/estree/estree )
7+
8+ Also includes a JavaScript AST to JavaScript code generator.
9+
10+ ``` elixir
11+ alias ESTree .Tools .Builder
12+ alias ESTree .Tools .Generator
13+
14+ ast = Builder .array_expression ([
15+ Builder .literal (1 ),
16+ Builder .identifier (:a )
17+ ])
18+
19+ Generator .generate (ast)
20+ # "[1, a]"
21+ ```
Original file line number Diff line number Diff line change 11defmodule ESTree do
22 @ moduledoc """
3- Defines structs that represent the ESTree AST definitions. Also includes a JavaScript AST to JavaScript code generator.
3+ Defines structs that represent the JavaScript AST nodes from the ESTree spec.
44
55 [ESTree Spec](https://github.com/estree/estree)
6+
7+ Also includes a JavaScript AST to JavaScript code generator.
8+
9+ alias ESTree.Tools.Builder
10+ alias ESTree.Tools.Generator
11+
12+ ast = Builder.array_expression([
13+ Builder.literal(1),
14+ Builder.identifier(:a)
15+ ])
16+
17+ Generator.generate(ast)
18+ #"[1, a]"
619 """
720
821 @ type unary_operator :: :- | :+ | :! | :"~" | :typeof | :void | :delete
You can’t perform that action at this time.
0 commit comments