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

Unified Diff: lib/token.dart

Issue 10916294: switch html5lib to new pkg layout (Closed) Base URL: https://github.com/dart-lang/html5lib.git@master
Patch Set: Created 8 years, 3 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/utils.dart ('k') | lib/tokenizer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/token.dart
diff --git a/lib/token.dart b/lib/token.dart
deleted file mode 100644
index 10d9d8d609ee697bcd27235dc61e17a84f302f06..0000000000000000000000000000000000000000
--- a/lib/token.dart
+++ /dev/null
@@ -1,105 +0,0 @@
-/** This library contains token types used by the html5 tokenizer. */
-#library('token');
-
-/** An html5 token. */
-class Token {
- abstract int get kind;
-
- // TODO(jmesserly): it'd be nice to remove this and always use the ".data"
- // on the particular token type.
- abstract get data;
- abstract set data(value);
-}
-
-class TagToken extends Token {
- String name;
-
- // TODO(jmesserly): this starts as a List, but becomes a Map of attributes.
- // Should probably separate these into different named fields.
- var data;
-
- bool selfClosing;
-
- TagToken(this.name, data, this.selfClosing)
- : data = data == null ? [] : data;
-}
-
-class StartTagToken extends TagToken {
- bool selfClosingAcknowledged;
-
- /** The namespace. This is filled in later during tree building. */
- String namespace;
-
- StartTagToken([String name, data, bool selfClosing = false,
- this.selfClosingAcknowledged = false, this.namespace])
- : super(name, data, selfClosing);
-
- int get kind => TokenKind.startTag;
-}
-
-class EndTagToken extends TagToken {
-
- EndTagToken([String name, data, bool selfClosing = false])
- : super(name, data, selfClosing);
-
- int get kind => TokenKind.endTag;
-}
-
-class StringToken extends Token {
- String data;
- StringToken(this.data);
-}
-
-class ParseErrorToken extends StringToken {
- /** Extra information that goes along with the error message. */
- Map messageParams;
-
- ParseErrorToken([String data, this.messageParams]) : super(data);
-
- int get kind => TokenKind.parseError;
-}
-
-class CharactersToken extends StringToken {
- CharactersToken([String data]) : super(data);
-
- int get kind => TokenKind.characters;
-}
-
-class SpaceCharactersToken extends StringToken {
- SpaceCharactersToken([String data]) : super(data);
-
- int get kind => TokenKind.spaceCharacters;
-}
-
-class CommentToken extends StringToken {
- CommentToken([String data]) : super(data);
-
- int get kind => TokenKind.comment;
-}
-
-class DoctypeToken extends Token {
- String publicId;
- String systemId;
- String name;
- bool correct;
-
- DoctypeToken([this.publicId, this.systemId, this.correct = false])
- : name = "";
-
- int get kind => TokenKind.doctype;
-
- // TODO(jmesserly): remove. These are only here because of Token.data
- String get data { throw const UnsupportedOperationException("data"); }
- set data(value) { throw const UnsupportedOperationException("data"); }
-}
-
-
-class TokenKind {
- static const int spaceCharacters = 0;
- static const int characters = 1;
- static const int startTag = 2;
- static const int endTag = 3;
- static const int comment = 4;
- static const int doctype = 5;
- static const int parseError = 6;
-}
« no previous file with comments | « lib/src/utils.dart ('k') | lib/tokenizer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698