15 Var Init

Change variable initialization from var a = new A(...) to C-style: A a(...).

Input text:

function init() {
  var foo = new Foo();
  var bar = new Bar(foo, true);
  var foos = new List<Foo>(3);
  var baz = new Baz(random());
}

Desired output:

function init() {
  Foo foo();
  Bar bar(foo, true);
  List<Foo> foos(3);
  Baz baz(random());
}

Original source.

Last modified March 15, 2024: Parsing unit. (015098c)