Gets or creates a unique ID for a variable.
int getVarId(String name) { return _varIds.putIfAbsent(name, () => _varCounter++); }