php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
state.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021-2022 Alexander Borisov
3 *
4 * Author: Alexander Borisov <borisov@lexbor.com>
5 */
6
7#include "lexbor/css/state.h"
8#include "lexbor/css/css.h"
10
11
12bool
14 const lxb_css_syntax_token_t *token, void *ctx)
15{
16 switch (token->type) {
19 return true;
20
22 return true;
23
24 default:
25 break;
26 }
27
28 return lxb_css_parser_failed(parser);
29}
30
31bool
33 const lxb_css_syntax_token_t *token, void *ctx)
34{
35 if (token->type == LXB_CSS_SYNTAX_TOKEN__END) {
36 return lxb_css_parser_success(parser);
37 }
38
39 /* The lxb_css_syntax_parser_consume(...) locked in this state. */
40
42
43 return true;
44}
45
46bool
48 const lxb_css_syntax_token_t *token, void *ctx)
49{
50 return lxb_css_parser_stop(parser);
51}
struct lxb_css_syntax_token lxb_css_syntax_token_t
Definition base.h:46
struct lxb_css_parser lxb_css_parser_t
Definition base.h:41
bool lxb_css_parser_stop(lxb_css_parser_t *parser)
Definition parser.c:257
bool lxb_css_parser_success(lxb_css_parser_t *parser)
Definition parser.c:279
bool lxb_css_parser_failed(lxb_css_parser_t *parser)
Definition parser.c:286
bool lxb_css_state_success(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, void *ctx)
Definition state.c:13
bool lxb_css_state_failed(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, void *ctx)
Definition state.c:32
bool lxb_css_state_stop(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, void *ctx)
Definition state.c:47
void lxb_css_syntax_parser_consume(lxb_css_parser_t *parser)
Definition parser.c:171
void lxb_css_syntax_token_consume(lxb_css_syntax_tokenizer_t *tkz)
Definition token.c:63
@ LXB_CSS_SYNTAX_TOKEN_WHITESPACE
Definition token.h:81
@ LXB_CSS_SYNTAX_TOKEN__END
Definition token.h:103
lxb_css_syntax_tokenizer_t * tkz
Definition parser.h:136
lxb_css_syntax_token_type_t type
Definition token.h:192