TokenSet.fromArray constructor

TokenSet.fromArray(
  1. List arr
)

Implementation

factory TokenSet.fromArray(List arr) {
  var builder = TokenSetBuilder();

  for (dynamic item in arr) {
    builder.insert(item is Token ? item.toString() : item);
  }

  builder.finish();
  return builder.root;
}