|
XenevaOS
|
#include <assert.h>#include <string.h>#include <strings.h>#include "stylesheet.h"#include "bytecode/bytecode.h"#include "bytecode/opcodes.h"#include "parse/properties/properties.h"#include "parse/properties/utils.h"#include "utils/parserutilserror.h"
Macros | |
| #define | MAP_ENTRIES 52 |
| #define | ORGB(R, G, B) |
| #define MAP_ENTRIES 52 |
| css_error css__comma_list_to_style | ( | css_language * | c, |
| const parserutils_vector * | vector, | ||
| int32_t * | ctx, | ||
| bool(*)(css_language *c, const css_token *ident) | reserved, | ||
| css_code_t(*)(css_language *c, const css_token *token, bool first) | get_value, | ||
| css_style * | result | ||
| ) |
Parse a comma separated list, converting to bytecode
| c | Parsing context |
| vector | Vector of tokens to process |
| ctx | Pointer to vector iteration context |
| reserved | Callback to determine if an identifier is reserved |
| get_value | Callback to retrieve bytecode value for a token |
| style | Pointer to output style |
Post condition: *ctx is updated with the next token to process If the input is invalid, then *ctx remains unchanged.
| css_error css__ident_list_or_string_to_string | ( | css_language * | c, |
| const parserutils_vector * | vector, | ||
| int32_t * | ctx, | ||
| bool(*)(css_language *c, const css_token *ident) | reserved, | ||
| lwc_string ** | result | ||
| ) |
Create a string from a list of IDENT/S tokens if the next token is IDENT or references the next token's string if it is a STRING
| c | Parsing context |
| vector | Vector containing tokens |
| ctx | Vector iteration context |
| reserved | Callback to determine if an identifier is reserved |
| result | Pointer to location to receive resulting string |
Post condition: *ctx is updated with the next token to process If the input is invalid, then *ctx remains unchanged.
The resulting string's reference is passed to the caller
| css_error css__ident_list_to_string | ( | css_language * | c, |
| const parserutils_vector * | vector, | ||
| int32_t * | ctx, | ||
| bool(*)(css_language *c, const css_token *ident) | reserved, | ||
| lwc_string ** | result | ||
| ) |
Create a string from a list of IDENT/S tokens
| c | Parsing context |
| vector | Vector containing tokens |
| ctx | Vector iteration context |
| reserved | Callback to determine if an identifier is reserved |
| result | Pointer to location to receive resulting string |
Post condition: *ctx is updated with the next token to process If the input is invalid, then *ctx remains unchanged.
The resulting string's reference is passed to the caller
| css_error css__parse_border_side | ( | css_language * | c, |
| const parserutils_vector * | vector, | ||
| int32_t * | ctx, | ||
| css_style * | result, | ||
| enum border_side_e | side | ||
| ) |
Parse border-{top,right,bottom,left} shorthand
| c | Parsing context |
| vector | Vector of tokens to process |
| ctx | Pointer to vector iteration context |
| side | The side we're parsing for |
| result | Pointer to location to receive resulting style |
Post condition: *ctx is updated with the next token to process If the input is invalid, then *ctx remains unchanged.
| css_error css__parse_colour_specifier | ( | css_language * | c, |
| const parserutils_vector * | vector, | ||
| int32_t * | ctx, | ||
| uint16_t * | value, | ||
| uint32_t * | result | ||
| ) |
Parse a colour specifier
| c | Parsing context |
| vector | Vector of tokens to process |
| ctx | Pointer to vector iteration context |
| value | Pointer to location to receive value |
| result | Pointer to location to receive result (AARRGGBB) |
Post condition: *ctx is updated with the next token to process If the input is invalid, then *ctx remains unchanged.
| css_error css__parse_hash_colour | ( | lwc_string * | data, |
| uint32_t * | result | ||
| ) |
Parse a hash colour (#rgb or rrggbb)
| data | Pointer to colour string |
| result | Pointer to location to receive result (AARRGGBB) |
| css_error css__parse_list_style_type_value | ( | css_language * | c, |
| const css_token * | ident, | ||
| uint16_t * | value | ||
| ) |
Parse list-style-type value
| c | Parsing context |
| ident | Identifier to consider |
| value | Pointer to location to receive value |
| css_error css__parse_named_colour | ( | css_language * | c, |
| lwc_string * | data, | ||
| uint32_t * | result | ||
| ) |
Parse a named colour
| c | Parsing context |
| data | Colour name string |
| result | Pointer to location to receive result |
Parse a unit keyword
| ptr | Pointer to keyword string |
| len | Length, in bytes, of string |
| unit | Pointer to location to receive computed unit |
| css_error css__parse_unit_specifier | ( | css_language * | c, |
| const parserutils_vector * | vector, | ||
| int32_t * | ctx, | ||
| uint32_t | default_unit, | ||
| css_fixed * | length, | ||
| uint32_t * | unit | ||
| ) |
Parse a unit specifier
| c | Parsing context |
| vector | Vector of tokens to process |
| ctx | Pointer to current vector iteration context |
| default_unit | The default unit to use if none specified |
| length | Pointer to location to receive length |
| unit | Pointer to location to receive unit |
Post condition: *ctx is updated with the next token to process If the input is invalid, then *ctx remains unchanged.