Revert "Remove dependency on package:charcode (#29)" (#33)

This reverts commit 7e41395d327e93b432f380aaf4c9668f0d952ef3.

Since this has not been published or rolled through to the SDK or
Flutter we will hold it back to reduce risk.
diff --git a/lib/src/charcode.dart b/lib/src/charcode.dart
deleted file mode 100644
index d157749..0000000
--- a/lib/src/charcode.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// Character '\'.
-const int $backslash = 0x5C;
-
-/// "Carriage return" control character.
-const int $cr = 0x0D;
-
-/// Character '"'.
-const int $doubleQuote = 0x22;
-
-/// Character 'f'.
-const int $f = 0x66;
-
-/// "Line feed" control character.
-const int $lf = 0x0A;
-
-/// Space character.
-const int $space = 0x20;
-
-/// Character 'x'.
-const int $x = 0x78;
diff --git a/lib/src/eager_span_scanner.dart b/lib/src/eager_span_scanner.dart
index d27a818..415b9f3 100644
--- a/lib/src/eager_span_scanner.dart
+++ b/lib/src/eager_span_scanner.dart
@@ -2,7 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'charcode.dart';
+import 'package:charcode/ascii.dart';
+
 import 'line_scanner.dart';
 import 'span_scanner.dart';
 
diff --git a/lib/src/line_scanner.dart b/lib/src/line_scanner.dart
index af6b6e7..358d4c1 100644
--- a/lib/src/line_scanner.dart
+++ b/lib/src/line_scanner.dart
@@ -2,7 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'charcode.dart';
+import 'package:charcode/ascii.dart';
+
 import 'string_scanner.dart';
 
 // Note that much of this code is duplicated in eager_span_scanner.dart.
diff --git a/lib/src/string_scanner.dart b/lib/src/string_scanner.dart
index 5d69c75..564774c 100644
--- a/lib/src/string_scanner.dart
+++ b/lib/src/string_scanner.dart
@@ -2,9 +2,9 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+import 'package:charcode/charcode.dart';
 import 'package:source_span/source_span.dart';
 
-import 'charcode.dart';
 import 'exception.dart';
 import 'utils.dart';
 
@@ -110,7 +110,7 @@
     if (name == null) {
       if (character == $backslash) {
         name = r'"\"';
-      } else if (character == $doubleQuote) {
+      } else if (character == $double_quote) {
         name = r'"\""';
       } else {
         name = '"${String.fromCharCode(character)}"';
diff --git a/pubspec.yaml b/pubspec.yaml
index 1b2c2e5..0d29f2e 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -8,6 +8,7 @@
   sdk: ">=2.12.0-0 <3.0.0"
 
 dependencies:
+  charcode: '>=1.2.0-nullsafety <1.2.0'
   source_span: '>=1.8.0-nullsafety <1.8.0'
 
 dev_dependencies:
diff --git a/test/line_scanner_test.dart b/test/line_scanner_test.dart
index a3deff1..0bbd499 100644
--- a/test/line_scanner_test.dart
+++ b/test/line_scanner_test.dart
@@ -2,7 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'package:string_scanner/src/charcode.dart';
+import 'package:charcode/charcode.dart';
 import 'package:string_scanner/string_scanner.dart';
 import 'package:test/test.dart';
 
diff --git a/test/string_scanner_test.dart b/test/string_scanner_test.dart
index 34176b8..0327499 100644
--- a/test/string_scanner_test.dart
+++ b/test/string_scanner_test.dart
@@ -2,7 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-import 'package:string_scanner/src/charcode.dart';
+import 'package:charcode/charcode.dart';
 import 'package:string_scanner/string_scanner.dart';
 import 'package:test/test.dart';