Skip to content

Commit 54dad05

Browse files
committed
Updated documentation
1 parent 79fc19f commit 54dad05

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
Elixir-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+
```

lib/es_tree.ex

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
defmodule 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

0 commit comments

Comments
 (0)