Attribute value quote rules

This commit is contained in:
Wilson Lin 2018-07-05 19:50:51 +12:00
parent 4c311819cc
commit 4d5121a55d
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,20 @@
#ifndef _HDR_HYPERBUILD_RULE_ATTRVALQUOTE
#define _HDR_HYPERBUILD_RULE_ATTRVALQUOTE
#include "../../ext/nicehash/set/int32.h"
#include "../../util/hbchar.h"
#include "./c0.c"
static nh_set_int32_t hb_r_attrvalquote_set;
void hb_r_attrvalquote_init(void) {
hb_r_attrvalquote_set = nh_set_int32_create();
nh_set_int32_add(hb_r_attrvalquote_set, '\'');
nh_set_int32_add(hb_r_attrvalquote_set, '"');
}
int hb_r_attrvalquote_check(hb_char_t c) {
return !nh_set_int32_has(hb_r_attrvalquote_set, c);
}
#endif // _HDR_HYPERBUILD_RULE_ATTRVALQUOTE

View File

@ -2,6 +2,7 @@
#define _HDR_HYPERBUILD_RULE_INIT
#include "./char/attrname.c"
#include "./char/attrvalquote.c"
#include "./char/c0.c"
#include "./char/digit.c"
#include "./char/lcalpha.c"
@ -31,6 +32,7 @@ void hb_r_init(void) {
hb_r_attrname_init();
// Values
hb_r_attrvalquote_init();
hb_r_unquotedattrval_init();
hb_r_entityrefs_init();