use raw strings to avoid escaping (#50322)
This commit is contained in:
committed by
GitHub
parent
8735ab1e35
commit
b953c3e5a8
@@ -460,7 +460,7 @@ class _Transform {
|
||||
}
|
||||
|
||||
|
||||
const String _transformCommandAtom = ' *([^(]+)\\(([^)]*)\\)';
|
||||
const String _transformCommandAtom = r' *([^(]+)\(([^)]*)\)';
|
||||
final RegExp _transformValidator = RegExp('^($_transformCommandAtom)*\$');
|
||||
final RegExp _transformCommand = RegExp(_transformCommandAtom);
|
||||
|
||||
@@ -522,7 +522,7 @@ Matrix3 _matrix(double a, double b, double c, double d, double e, double f) {
|
||||
|
||||
// Matches a pixels expression e.g "14px".
|
||||
// First group is just the number.
|
||||
final RegExp _pixelsExp = RegExp('^([0-9]+)px\$');
|
||||
final RegExp _pixelsExp = RegExp(r'^([0-9]+)px$');
|
||||
|
||||
/// Parses a pixel expression, e.g "14px", and returns the number.
|
||||
/// Throws an [ArgumentError] if the given string doesn't match the pattern.
|
||||
|
||||
@@ -559,7 +559,7 @@ void main() {
|
||||
),
|
||||
]);
|
||||
|
||||
expect(animation.toDart('_AnimatedIconData', '_\$data1'),
|
||||
expect(animation.toDart('_AnimatedIconData', r'_$data1'),
|
||||
'const _AnimatedIconData _\$data1 = const _AnimatedIconData(\n'
|
||||
' const Size(48.0, 48.0),\n'
|
||||
' const <_PathFrames>[\n'
|
||||
|
||||
Reference in New Issue
Block a user