Drop dependency on `package:charcode`. (dart-lang/yaml#109)

Co-authored-by: Jacob MacDonald <jakemac@google.com>
diff --git a/pkgs/yaml/CHANGELOG.md b/pkgs/yaml/CHANGELOG.md
index eb225af..5676b6a 100644
--- a/pkgs/yaml/CHANGELOG.md
+++ b/pkgs/yaml/CHANGELOG.md
@@ -1,9 +1,10 @@
-## 3.1.0-dev
+## 3.1.0
 
-`loadYaml` and related functions now accept a `recover` flag instructing the parser
+* `loadYaml` and related functions now accept a `recover` flag instructing the parser
   to attempt to recover from parse errors and may return invalid or synthetic nodes.
   When recovering, an `ErrorListener` can also be supplied to listen for errors that
   are recovered from.
+* Drop dependency on `package:charcode`.
 
 ## 3.0.0
 
diff --git a/pkgs/yaml/lib/src/charcodes.dart b/pkgs/yaml/lib/src/charcodes.dart
new file mode 100644
index 0000000..705da62
--- /dev/null
+++ b/pkgs/yaml/lib/src/charcodes.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2021, 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 $plus = 0x2b;
+
+/// Character `-`.
+const int $minus = 0x2d;
+
+/// Character `.`.
+const int $dot = 0x2e;
+
+/// Character `0`.
+const int $0 = 0x30;
+
+/// Character `9`.
+const int $9 = 0x39;
+
+/// Character `F`.
+const int $F = 0x46;
+
+/// Character `N`.
+const int $N = 0x4e;
+
+/// Character `T`.
+const int $T = 0x54;
+
+/// Character `f`.
+const int $f = 0x66;
+
+/// Character `n`.
+const int $n = 0x6e;
+
+/// Character `o`.
+const int $o = 0x6f;
+
+/// Character `t`.
+const int $t = 0x74;
+
+/// Character `x`.
+const int $x = 0x78;
+
+/// Character `~`.
+const int $tilde = 0x7e;
diff --git a/pkgs/yaml/lib/src/loader.dart b/pkgs/yaml/lib/src/loader.dart
index 0056a64..07f5c8b 100644
--- a/pkgs/yaml/lib/src/loader.dart
+++ b/pkgs/yaml/lib/src/loader.dart
@@ -2,10 +2,10 @@
 // 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/ascii.dart';
 import 'package:source_span/source_span.dart';
 import 'package:yaml/src/error_listener.dart';
 
+import 'charcodes.dart';
 import 'equality.dart';
 import 'event.dart';
 import 'parser.dart';
diff --git a/pkgs/yaml/pubspec.yaml b/pkgs/yaml/pubspec.yaml
index adb1758..b9d836a 100644
--- a/pkgs/yaml/pubspec.yaml
+++ b/pkgs/yaml/pubspec.yaml
@@ -1,5 +1,5 @@
 name: yaml
-version: 3.1.0-dev
+version: 3.1.0
 
 description: A parser for YAML, a human-friendly data serialization standard
 homepage: https://github.com/dart-lang/yaml
@@ -8,7 +8,6 @@
   sdk: '>=2.12.0-0 <3.0.0'
 
 dependencies:
-  charcode: ^1.2.0
   collection: ^1.15.0
   source_span: ^1.8.0
   string_scanner: ^1.1.0