estree v2.4.2 ESTree

Defines structs that represent the JavaScript AST nodes from the ESTree spec.

ESTree Spec

Also includes a JavaScript AST to JavaScript code generator.

alias ESTree.Tools.Builder
alias ESTree.Tools.Generator

ast = Builder.array_expression([
  Builder.literal(1),
  Builder.identifier(:a)
])

Generator.generate(ast)
#"[1, a]"

Summary

Types

assignment_operator ::
  := |
  :"+=" |
  :"-=" |
  :"*=" |
  :"/=" |
  :"%=" |
  :"<<=" |
  :">>=" |
  :">>>=" |
  :"|=" |
  :"^=" |
  :"&=" |
  :"**="
binary_operator ::
  :== |
  :!= |
  :=== |
  :!== |
  :< |
  :<= |
  :> |
  :>= |
  :"<<" |
  :">>" |
  :>>> |
  :+ |
  :- |
  :* |
  :/ |
  :% |
  :| |
  :^ |
  :& |
  :in |
  :instanceof |
  :"**"
logical_operator :: :|| | :&&
unary_operator ::
  :- |
  :+ |
  :! |
  :"~" |
  :typeof |
  :void |
  :delete
update_operator :: :++ | :--