Skip to content

Extending the writer with the possibility to write a comment to the outputStream #439

@pietercolpaert

Description

@pietercolpaert

Recently we added support for optionally parsing comments. We should probably also have a public function in the writer that allows one to write a comment. I.e.:

addComment(comment: string) {
   this._outputStream.push('# ' + comment . "\n");
}

In the StreamWriter, it could then be listening in on comment events from the input.

Does this sound reasonable? If so, I can open a PR.

EDIT: we need to be careful about newlines in the comment string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions