summaryrefslogtreecommitdiff
path: root/src/parse/language.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-05-26 23:14:40 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-05-26 23:14:40 +0000
commit41973ef1ab2935818a07b5899c1961e9c8c85214 (patch)
tree4c787ed51e8d3b7d00f11c61e2274c267c8a1981 /src/parse/language.c
parent83146f43df1f1330c10cedad4e97e90c7f2c1243 (diff)
downloadlibcss-41973ef1ab2935818a07b5899c1961e9c8c85214.tar.gz
libcss-41973ef1ab2935818a07b5899c1961e9c8c85214.tar.bz2
More refactoring groundwork. This actually compiles and passes the testsuite.
svn path=/trunk/libcss/; revision=7556
Diffstat (limited to 'src/parse/language.c')
-rw-r--r--src/parse/language.c62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/parse/language.c b/src/parse/language.c
index 6b2d329..5d0403f 100644
--- a/src/parse/language.c
+++ b/src/parse/language.c
@@ -25,29 +25,6 @@ typedef struct context_entry {
void *data; /**< Data for context */
} context_entry;
-/**
- * Context for a CSS language parser
- */
-struct css_language {
- css_stylesheet *sheet; /**< The stylesheet to parse for */
-
-#define STACK_CHUNK 32
- parserutils_stack *context; /**< Context stack */
-
- enum {
- BEFORE_CHARSET,
- BEFORE_RULES,
- HAD_RULE
- } state; /**< State flag, for at-rule handling */
-
- /** \todo These should be statically allocated */
- /** Interned strings */
- lwc_string *strings[LAST_KNOWN];
-
- css_allocator_fn alloc; /**< Memory (de)allocation function */
- void *pw; /**< Client's private data */
-};
-
/* Event handlers */
static css_error language_handle_event(css_parser_event type,
const parserutils_vector *tokens, void *pw);
@@ -105,11 +82,6 @@ static inline css_error parseProperty(css_language *c,
const css_token *property, const parserutils_vector *vector,
int *ctx, css_rule *rule);
-/* Helpers */
-static inline void consumeWhitespace(const parserutils_vector *vector,
- int *ctx);
-static inline bool tokenIsChar(const css_token *token, uint8_t c);
-
/**
* Create a CSS language parser
*
@@ -1087,37 +1059,3 @@ css_error parseProperty(css_language *c, const css_token *property,
return CSS_OK;
}
-/******************************************************************************
- * Helper functions *
- ******************************************************************************/
-
-/**
- * Consume all leading whitespace tokens
- *
- * \param vector The vector to consume from
- * \param ctx The vector's context
- */
-void consumeWhitespace(const parserutils_vector *vector, int *ctx)
-{
- const css_token *token = NULL;
-
- while ((token = parserutils_vector_peek(vector, *ctx)) != NULL &&
- token->type == CSS_TOKEN_S)
- token = parserutils_vector_iterate(vector, ctx);
-}
-
-/**
- * Determine if a token is a character
- *
- * \param token The token to consider
- * \param c The character to match (lowercase ASCII only)
- * \return True if the token matches, false otherwise
- */
-bool tokenIsChar(const css_token *token, uint8_t c)
-{
- return token != NULL && token->type == CSS_TOKEN_CHAR &&
- lwc_string_length(token->ilower) == 1 &&
- lwc_string_data(token->ilower)[0] == c;
-}
-
-