Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Unified Diff: pkg/yaml/lib/parser.dart

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/yaml/lib/model.dart ('k') | runtime/bin/process_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/yaml/lib/parser.dart
diff --git a/pkg/yaml/lib/parser.dart b/pkg/yaml/lib/parser.dart
index f2f255e7652df22f79254adf898a5daea80e53a7..386bb591240736300cbf0f8d1218dd1bcc7b4c53 100644
--- a/pkg/yaml/lib/parser.dart
+++ b/pkg/yaml/lib/parser.dart
@@ -172,7 +172,7 @@ class _Parser {
/// forward one character. Also updates the current line and column numbers.
int next() {
if (pos == len) return -1;
- var char = s.charCodeAt(pos++);
+ var char = s.codeUnitAt(pos++);
if (isBreak(char)) {
line++;
column = 0;
@@ -193,14 +193,14 @@ class _Parser {
return char;
}
- /// Returns the character at the current position, or the character [i]
+ /// Returns the code unit at the current position, or the character [i]
/// characters after the current position.
///
/// Returns -1 if this would return a character after the end or before the
/// beginning of the input string.
int peek([int i = 0]) {
var peekPos = pos + i;
- return (peekPos >= len || peekPos < 0) ? -1 : s.charCodeAt(peekPos);
+ return (peekPos >= len || peekPos < 0) ? -1 : s.codeUnitAt(peekPos);
}
/// The truthiness operator. Returns `false` if [obj] is `null` or `false`,
@@ -304,7 +304,7 @@ class _Parser {
///
/// Returns whether or not the string was consumed.
bool rawString(String str) =>
- nAtOnce(str.length, (c, i) => str.charCodeAt(i) == c);
+ nAtOnce(str.length, (c, i) => str.codeUnitAt(i) == c);
/// Consumes and returns a string of characters matching [matcher], or null if
/// there are no such characters.
« no previous file with comments | « pkg/yaml/lib/model.dart ('k') | runtime/bin/process_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698