OLD | NEW |
1 /** This library contains token types used by the html5 tokenizer. */ | 1 /** This library contains token types used by the html5 tokenizer. */ |
2 library token; | 2 library token; |
3 | 3 |
4 import 'package:html5lib/dom_parsing.dart' show SourceSpan; | 4 import 'package:html5lib/dom_parsing.dart' show SourceSpan; |
5 | 5 |
6 /** An html5 token. */ | 6 /** An html5 token. */ |
7 abstract class Token { | 7 abstract class Token { |
8 SourceSpan span; | 8 SourceSpan span; |
9 | 9 |
10 abstract int get kind; | 10 abstract int get kind; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 String systemId; | 85 String systemId; |
86 String name; | 86 String name; |
87 bool correct; | 87 bool correct; |
88 | 88 |
89 DoctypeToken({this.publicId, this.systemId, this.correct: false}) | 89 DoctypeToken({this.publicId, this.systemId, this.correct: false}) |
90 : name = ""; | 90 : name = ""; |
91 | 91 |
92 int get kind => TokenKind.doctype; | 92 int get kind => TokenKind.doctype; |
93 | 93 |
94 // TODO(jmesserly): remove. These are only here because of Token.data | 94 // TODO(jmesserly): remove. These are only here because of Token.data |
95 String get data { throw const UnsupportedOperationException("data"); } | 95 String get data { throw new UnsupportedError("data"); } |
96 set data(value) { throw const UnsupportedOperationException("data"); } | 96 set data(value) { throw new UnsupportedError("data"); } |
97 } | 97 } |
98 | 98 |
99 | 99 |
100 class TokenKind { | 100 class TokenKind { |
101 static const int spaceCharacters = 0; | 101 static const int spaceCharacters = 0; |
102 static const int characters = 1; | 102 static const int characters = 1; |
103 static const int startTag = 2; | 103 static const int startTag = 2; |
104 static const int endTag = 3; | 104 static const int endTag = 3; |
105 static const int comment = 4; | 105 static const int comment = 4; |
106 static const int doctype = 5; | 106 static const int doctype = 5; |
107 static const int parseError = 6; | 107 static const int parseError = 6; |
108 } | 108 } |
OLD | NEW |