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

Side by Side Diff: Source/core/css/parser/CSSParserTokenRange.h

Issue 790593004: CSS Parser: Implement selector parsing [1/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 6 years 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 unified diff | Download patch
« no previous file with comments | « Source/core/css/parser/CSSParser.cpp ('k') | Source/core/css/parser/CSSParserTokenRange.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CSSParserTokenRange_h 5 #ifndef CSSParserTokenRange_h
6 #define CSSParserTokenRange_h 6 #define CSSParserTokenRange_h
7 7
8 #include "core/css/parser/CSSParserToken.h" 8 #include "core/css/parser/CSSParserToken.h"
9 #include "wtf/Vector.h" 9 #include "wtf/Vector.h"
10 10
(...skipping 25 matching lines...) Expand all
36 return *(m_first + offset); 36 return *(m_first + offset);
37 } 37 }
38 38
39 const CSSParserToken& consume() 39 const CSSParserToken& consume()
40 { 40 {
41 if (m_first == m_last) 41 if (m_first == m_last)
42 return staticEOFToken; 42 return staticEOFToken;
43 return *m_first++; 43 return *m_first++;
44 } 44 }
45 45
46 const CSSParserToken& consumeIncludingComments()
47 {
48 const CSSParserToken& result = consume();
49 while (peek().type() == CommentToken)
50 ++m_first;
51 return result;
52 }
53
54 const CSSParserToken& consumeIncludingWhitespaceAndComments()
55 {
56 const CSSParserToken& result = consume();
57 consumeWhitespaceAndComments();
58 return result;
59 }
60
46 void consumeComponentValue(); 61 void consumeComponentValue();
47 void consumeWhitespaceAndComments(); 62 void consumeWhitespaceAndComments();
48 63
49 static void initStaticEOFToken(); 64 static void initStaticEOFToken();
50 65
51 private: 66 private:
52 CSSParserTokenRange(const CSSParserToken* first, const CSSParserToken* last) 67 CSSParserTokenRange(const CSSParserToken* first, const CSSParserToken* last)
53 : m_first(first) 68 : m_first(first)
54 , m_last(last) 69 , m_last(last)
55 { } 70 { }
56 71
57 const CSSParserToken* m_first; 72 const CSSParserToken* m_first;
58 const CSSParserToken* m_last; 73 const CSSParserToken* m_last;
59 }; 74 };
60 75
61 } // namespace 76 } // namespace
62 77
63 #endif // CSSParserTokenRange_h 78 #endif // CSSParserTokenRange_h
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSParser.cpp ('k') | Source/core/css/parser/CSSParserTokenRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698