mirascript-core 0.1.105

Compiler and bytecode definitions for the MiraScript language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::parser::ArrayElementBase;

use super::prelude::*;

impl<E: Formattable, S: Formattable> Formattable for ArrayElementBase<'_, E, S> {
    fn format(&self, formatter: &Formatter) -> FormatDoc {
        use ArrayElementBase::*;
        match self {
            Element(e) => e.format(formatter),
            Spread(op, e) => formatter.token(op).append(e.format(formatter)),
        }
    }
}