getRequiredArgCount function

int getRequiredArgCount(
  1. String macroValue
)

Get the number of required arguments for a macro.

Returns the highest placeholder number, or -1 if the macro uses $$.

Implementation

int getRequiredArgCount(String macroValue) {
  if (macroValue.contains(r'$$')) return -1;
  return _getMaxPlaceholder(macroValue);
}