Search code examples
scalatwirl

Escaping "=>" in twirl template


I have a twirl template containing the string "=>".

The offending peice of my template is

@for(signal <- signalsIn ++ signalsOut) {
    @(signal.name) => odw_@(signal.name),
  }clk => clk

Where the output I desire is something like

this_signal => odw_this_signal,
that_signal => odw_that_signal,
clk => clk

I get the "expected start of definition" error presumably because twirl is interpreting the "=>" as syntax.


Solution

  • "=>" can be produced by @("=>")