OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 explicit VTTTokenizer(const String& input); | 58 explicit VTTTokenizer(const String& input); |
59 | 59 |
60 typedef VTTTokenizerState State; | 60 typedef VTTTokenizerState State; |
61 | 61 |
62 void reset(); | 62 void reset(); |
63 | 63 |
64 bool nextToken(VTTToken&); | 64 bool nextToken(VTTToken&); |
65 | 65 |
66 inline bool haveBufferedCharacterToken() { return false; } | 66 inline bool haveBufferedCharacterToken() { return false; } |
67 | 67 |
68 inline void bufferCharacter(UChar character) | |
69 { | |
70 ASSERT(character != kEndOfFileMarker); | |
71 m_token->appendToCharacter(character); | |
72 } | |
73 | |
74 inline bool advanceAndEmitToken(SegmentedString& source, VTTTokenTypes::Type
type) | 68 inline bool advanceAndEmitToken(SegmentedString& source, VTTTokenTypes::Type
type) |
75 { | 69 { |
76 source.advanceAndUpdateLineNumber(); | 70 source.advanceAndUpdateLineNumber(); |
77 return emitToken(type); | 71 return emitToken(type); |
78 } | 72 } |
79 | 73 |
80 inline bool emitToken(VTTTokenTypes::Type type) | 74 inline bool emitToken(VTTTokenTypes::Type type) |
81 { | 75 { |
82 m_token->setType(type); | 76 m_token->setType(type); |
83 return true; | 77 return true; |
(...skipping 13 matching lines...) Expand all Loading... |
97 StringBuilder m_buffer; | 91 StringBuilder m_buffer; |
98 SegmentedString m_input; | 92 SegmentedString m_input; |
99 | 93 |
100 // ://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-st
ream | 94 // ://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-st
ream |
101 InputStreamPreprocessor<VTTTokenizer> m_inputStreamPreprocessor; | 95 InputStreamPreprocessor<VTTTokenizer> m_inputStreamPreprocessor; |
102 }; | 96 }; |
103 | 97 |
104 } | 98 } |
105 | 99 |
106 #endif | 100 #endif |
OLD | NEW |