Trait swc_ecma_codegen::text_writer::WriteJs[][src]

pub trait WriteJs {
    fn increase_indent(&mut self) -> Result;
fn decrease_indent(&mut self) -> Result;
fn write_semi(&mut self) -> Result;
fn write_space(&mut self) -> Result;
fn write_keyword(&mut self, span: Option<Span>, s: &'static str) -> Result;
fn write_operator(&mut self, s: &str) -> Result;
fn write_param(&mut self, s: &str) -> Result;
fn write_property(&mut self, s: &str) -> Result;
fn write_line(&mut self) -> Result;
fn write_lit(&mut self, span: Span, s: &str) -> Result;
fn write_comment(&mut self, span: Span, s: &str) -> Result;
fn write_str_lit(&mut self, span: Span, s: &str) -> Result;
fn write_str(&mut self, s: &str) -> Result;
fn write_symbol(&mut self, span: Span, s: &str) -> Result;
fn write_punct(&mut self, s: &'static str) -> Result; fn target(&self) -> JscTarget { ... } }

Ecmascript writer.

Ported from EmitWriteJs.

Required methods

fn increase_indent(&mut self) -> Result[src]

fn decrease_indent(&mut self) -> Result[src]

fn write_semi(&mut self) -> Result[src]

This may write semicolon.

fn write_space(&mut self) -> Result[src]

fn write_keyword(&mut self, span: Option<Span>, s: &'static str) -> Result[src]

fn write_operator(&mut self, s: &str) -> Result[src]

fn write_param(&mut self, s: &str) -> Result[src]

fn write_property(&mut self, s: &str) -> Result[src]

fn write_line(&mut self) -> Result[src]

fn write_lit(&mut self, span: Span, s: &str) -> Result[src]

fn write_comment(&mut self, span: Span, s: &str) -> Result[src]

fn write_str_lit(&mut self, span: Span, s: &str) -> Result[src]

fn write_str(&mut self, s: &str) -> Result[src]

fn write_symbol(&mut self, span: Span, s: &str) -> Result[src]

fn write_punct(&mut self, s: &'static str) -> Result[src]

Loading content...

Provided methods

fn target(&self) -> JscTarget[src]

Returns javascript target which should be used while generating code.

This defaults to JscTarget::Es2020 because it preserves input as much as possible.

Implementor should return same value regardless how much time it is called.

Loading content...

Implementations on Foreign Types

impl<W: ?Sized> WriteJs for Box<W> where
    W: WriteJs
[src]

Loading content...

Implementors

impl<'a, W: Write> WriteJs for JsWriter<'a, W>[src]

Loading content...