Class ASTNodeWriterAbstract

Base class for all ASTNodeWriters. Child classes are responsible for generating a SrcDesc for every node.

Constructors

Methods

Constructors

Methods

  • Add the node to the descrioption generated by writeInner, any additional "wrappings" and return it. Usually writeWhole is responsible for adding semicolons and documentation, since these are not generally part of source mappings.

    For example given this source:

    a = 1;
    

    ExpressionStatement.writeInner would return the following desc:

    [[Assignment#3, [[Identifier#1, ["a"]], " = ", [Literal#2, ["1"]] ]]]
    

    Then ExpressionStatement.writeWhole would add in the ExpressionStatement node and the semicolon to return:

    [[ExpressionStatement#4, [[Assignment#3, [[Identifier#1, ["a"]], " = ", [Literal#2, ["1"]] ]]]], ";"]
    

    Parameters

    Returns SrcDesc

Generated using TypeDoc