From c2bbb7d9f6b060602ac95a48990fa1959f0864ea Mon Sep 17 00:00:00 2001 From: iska Date: Mon, 21 Dec 2015 17:18:45 +0100 Subject: [PATCH] Add source code documentation for the private CSS Selectors related classes --- HTMLKit/CSSCodePoints.h | 4 ++++ HTMLKit/CSSInputStream.h | 42 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/HTMLKit/CSSCodePoints.h b/HTMLKit/CSSCodePoints.h index 0d1a0fc..a76dcda 100644 --- a/HTMLKit/CSSCodePoints.h +++ b/HTMLKit/CSSCodePoints.h @@ -6,6 +6,10 @@ // Copyright (c) 2015 BrainCookie. All rights reserved. // +///------------------------------------------------------ +/// HTMLKit private header +//------------------------------------------------------ + #define CODEPOINTS \ CODEPOINT( CONTROL, 0x0080 ) \ CODEPOINT( CHARACTER_TABULATION, 0x0009 ) \ diff --git a/HTMLKit/CSSInputStream.h b/HTMLKit/CSSInputStream.h index 3bf9c1e..50dbe00 100644 --- a/HTMLKit/CSSInputStream.h +++ b/HTMLKit/CSSInputStream.h @@ -6,15 +6,57 @@ // Copyright (c) 2015 BrainCookie. All rights reserved. // +///------------------------------------------------------ +/// HTMLKit private header +///------------------------------------------------------ + #import #import "HTMLInputStreamReader.h" +/** + The CSS Inpute Stream. + + Extends the HTML Input Stream with methods relevant to CSS selectors tokenizing/parsing. + */ @interface CSSInputStream : HTMLInputStreamReader +/** + Consumes leading whitespace characters. + */ - (void)consumeWhitespace; + +/** + Consumes a CSS identifier. + http://www.w3.org/TR/css-syntax-3/#consume-an-ident-like-token + http://www.w3.org/TR/css-syntax-3/#consume-a-string-token + http://www.w3.org/TR/css-syntax-3/#would-start-an-identifier + + @returns A consumed identifier, `nil` if the stream doesn't start with a valid identifier. + */ - (NSString *)consumeIdentifier; + +/** + Consumes characters until the specified code-point is met. + + @param endingCodePoint The code-point at which the input stream stops consuming. + @returns The consumed string, `nil` nothing was consumed. + */ - (NSString *)consumeStringWithEndingCodePoint:(UTF32Char)endingCodePoint; + +/** + Consumes an escaped code point. + http://www.w3.org/TR/css-syntax-3/#consume-an-escaped-code-point + http://www.w3.org/TR/css-syntax-3/#starts-with-a-valid-escape + + @returns The value of the escaped code-point. + */ - (UTF32Char)consumeEscapedCodePoint; + +/** + Consumes a CSS selector combinator. + + @returns The consumed combinator, `nil` if nothing was consumed. + */ - (NSString *)consumeCombinator; @end