backyard-generator 0.1.10

Convert AST node back to PHP code.
Documentation
use backyard_nodes::{ cast_node, Node, NodeWrapper };

use crate::generator::{ Builder, Generator };

use super::identifier::IdentifierGenerator;

pub struct LabelGenerator;

impl LabelGenerator {
  pub fn generate<'arena>(
    generator: &mut Generator<'arena, '_>,
    builder: &mut Builder,
    node: &Node<'arena>
  ) {
    let node = cast_node!(Label, &node.wrapper);

    IdentifierGenerator::generate(generator, builder, &node.label);
    builder.push(":");
  }
}