copyWith method
Returns a copy of this token with the given values. If the path is set, the variable name will be updated as well.
Implementation
Token copyWith({
String? path,
String? variableName,
String? type,
dynamic value,
Map<String, dynamic>? extensions,
}) {
if (path != null && variableName == null) {
variableName = _getVariableName(path, name);
}
return Token(
name: name,
type: type ?? this.type,
value: value ?? this.value,
path: path ?? this.path,
extensions: extensions ?? this.extensions,
variableName: variableName ?? this.variableName,
);
}