typhonjs-escomplex-commons
Version:
Provides core common utilities for typhonjs-escomplex modules and plugins.
35 lines (33 loc) • 517 B
JavaScript
/**
* Defines the output data from parsing an AST tree.
*/
export default class ASTData
{
/**
* Initializes ASTData
*/
constructor()
{
this.source = '';
this.operands = [];
this.operators = [];
}
/**
* Appends a string.
*
* @param {string} string - A string to append.
*/
write(string)
{
this.source += string;
}
/**
* Convert to string
*
* @returns {string|*|string}
*/
toString()
{
return this.source;
}
}