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

Unified Diff: lib/src/tokenizer.dart

Issue 11260039: Advance html5lib to newest breaking changes in core: getKeys -> keys, etc (Closed) Base URL: git@github.com:dart-lang/html5lib.git@master
Patch Set: Created 8 years, 2 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 | « lib/src/list_proxy.dart ('k') | lib/src/treebuilder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/tokenizer.dart
diff --git a/lib/src/tokenizer.dart b/lib/src/tokenizer.dart
index 8f3a439c3361373326dfb7c715e825e16109451f..024922d2cf2d53a933e2689084a2b6790712b13e 100644
--- a/lib/src/tokenizer.dart
+++ b/lib/src/tokenizer.dart
@@ -14,7 +14,7 @@ import 'utils.dart';
// we had it implemented in Dart.
Map<String, List<String>> entitiesByFirstChar = (() {
var result = {};
- for (var k in entities.getKeys()) {
+ for (var k in entities.keys) {
result.putIfAbsent(k[0], () => []).add(k);
}
return result;
@@ -71,7 +71,7 @@ class HtmlTokenizer implements Iterator<Token> {
reset();
}
- get lastData => currentToken.data.last();
+ get lastData => currentToken.data.last;
TagToken get currentTagToken => currentToken;
DoctypeToken get currentDoctypeToken => currentToken;
@@ -211,16 +211,16 @@ class HtmlTokenizer implements Iterator<Token> {
// Read the next character to see if it's hex or decimal
bool hex = false;
charStack.add(stream.char());
- if (charStack.last() == 'x' || charStack.last() == 'X') {
+ if (charStack.last == 'x' || charStack.last == 'X') {
hex = true;
charStack.add(stream.char());
}
- // charStack.last() should be the first digit
- if (hex && isHexDigit(charStack.last()) ||
- (!hex && isDigit(charStack.last()))) {
+ // charStack.last should be the first digit
+ if (hex && isHexDigit(charStack.last) ||
+ (!hex && isDigit(charStack.last))) {
// At least one digit found, so consume the whole number
- stream.unget(charStack.last());
+ stream.unget(charStack.last);
output = consumeNumberEntity(hex);
} else {
// No digits found
@@ -237,7 +237,7 @@ class HtmlTokenizer implements Iterator<Token> {
var filteredEntityList = entitiesByFirstChar[charStack[0]];
if (filteredEntityList == null) filteredEntityList = const [];
- while (charStack.last() !== EOF) {
+ while (charStack.last !== EOF) {
var name = joinStr(charStack);
filteredEntityList = filteredEntityList.filter(
(e) => e.startsWith(name));
@@ -1211,14 +1211,14 @@ class HtmlTokenizer implements Iterator<Token> {
bool markupDeclarationOpenState() {
var charStack = [stream.char()];
- if (charStack.last() == "-") {
+ if (charStack.last == "-") {
charStack.add(stream.char());
- if (charStack.last() == "-") {
+ if (charStack.last == "-") {
currentToken = new CommentToken("");
state = commentStartState;
return true;
}
- } else if (charStack.last() == 'd' || charStack.last() == 'D') {
+ } else if (charStack.last == 'd' || charStack.last == 'D') {
var matched = true;
for (var expected in const ['oO', 'cC', 'tT', 'yY', 'pP', 'eE']) {
var char = stream.char();
@@ -1233,14 +1233,14 @@ class HtmlTokenizer implements Iterator<Token> {
state = doctypeState;
return true;
}
- } else if (charStack.last() == "[" &&
+ } else if (charStack.last == "[" &&
parser !== null && parser.tree.openElements.length > 0 &&
- parser.tree.openElements.last().namespace
+ parser.tree.openElements.last.namespace
!= parser.tree.defaultNamespace) {
var matched = true;
for (var expected in const ["C", "D", "A", "T", "A", "["]) {
charStack.add(stream.char());
- if (charStack.last() != expected) {
+ if (charStack.last != expected) {
matched = false;
break;
}
« no previous file with comments | « lib/src/list_proxy.dart ('k') | lib/src/treebuilder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698