copyWith method
Mode
copyWith({
- String? name,
- String? label,
- dynamic scope,
- dynamic begin,
- dynamic end,
- dynamic beginScope,
- dynamic endScope,
- List? contains,
- dynamic keywords,
- dynamic illegal,
- num? relevance,
- dynamic subLanguage,
- bool? endsWithParent,
- bool? endsParent,
- bool? excludeBegin,
- bool? excludeEnd,
- bool? returnBegin,
- bool? returnEnd,
- bool? skip,
- Mode? starts,
- List<
Mode> ? variants, - bool clearVariants = false,
Implementation
Mode copyWith({
String? name,
String? label,
dynamic scope,
dynamic begin,
dynamic end,
dynamic beginScope,
dynamic endScope,
List<dynamic>? contains,
dynamic keywords,
dynamic illegal,
num? relevance,
dynamic subLanguage,
bool? endsWithParent,
bool? endsParent,
bool? excludeBegin,
bool? excludeEnd,
bool? returnBegin,
bool? returnEnd,
bool? skip,
Mode? starts,
List<Mode>? variants,
bool clearVariants = false,
}) {
final copy = Mode(
name: name ?? this.name,
label: label ?? this.label,
aliases: aliases != null ? List.from(aliases!) : null,
scope: scope ?? this.scope,
begin: begin ?? this.begin,
end: end ?? this.end,
match: match,
beginScope: beginScope ?? this.beginScope,
endScope: endScope ?? this.endScope,
contains:
contains ??
(this.contains != null ? List.from(this.contains!) : null),
keywords: keywords ?? this.keywords,
illegal: illegal ?? this.illegal,
relevance: relevance ?? this.relevance,
subLanguage: subLanguage ?? this.subLanguage,
endsWithParent: endsWithParent ?? this.endsWithParent,
endsParent: endsParent ?? this.endsParent,
excludeBegin: excludeBegin ?? this.excludeBegin,
excludeEnd: excludeEnd ?? this.excludeEnd,
returnBegin: returnBegin ?? this.returnBegin,
returnEnd: returnEnd ?? this.returnEnd,
skip: skip ?? this.skip,
starts: starts ?? this.starts?.shallowCopy(),
variants: clearVariants ? null : (variants ?? this.variants),
beginKeywords: beginKeywords,
beforeMatch: beforeMatch,
exports: exports,
preprocessor: preprocessor,
caseInsensitive: caseInsensitive,
unicodeRegex: unicodeRegex,
disableAutodetect: disableAutodetect,
classNameAliases: classNameAliases != null
? Map.from(classNameAliases!)
: null,
supersetOf: supersetOf,
compilerExtensions: compilerExtensions,
binary: binary,
onBegin: onBegin,
onEnd: onEnd,
beforeBeginCallback: beforeBeginCallback,
emitTokens: emitTokens,
);
return copy;
}