Merge remote-tracking branch 'tq/master' into LL such that it compiles
Conflicts: src/Makefile src/backends/packrat.c src/compile.c src/hammer.h src/internal.h src/parsers/action.c src/parsers/and.c src/parsers/attr_bool.c src/parsers/bits.c src/parsers/butnot.c src/parsers/ch.c src/parsers/charset.c src/parsers/choice.c src/parsers/difference.c src/parsers/end.c src/parsers/epsilon.c src/parsers/ignore.c src/parsers/ignoreseq.c src/parsers/indirect.c src/parsers/int_range.c src/parsers/many.c src/parsers/not.c src/parsers/nothing.c src/parsers/optional.c src/parsers/sequence.c src/parsers/token.c src/parsers/unimplemented.c src/parsers/whitespace.c src/parsers/xor.c
This commit is contained in:
commit
c64a4e435e
46 changed files with 1289 additions and 263 deletions
|
|
@ -47,18 +47,24 @@ static HCFChoice* desugar_ab(HAllocator *mm__, void *env) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
static bool ab_ctrvm(HRVMProg *prog, void *env) {
|
||||
HAttrBool *ab = (HAttrBool*)env;
|
||||
return h_compile_regex(prog, ab->p);
|
||||
}
|
||||
|
||||
static const HParserVtable attr_bool_vt = {
|
||||
.parse = parse_attr_bool,
|
||||
.isValidRegular = ab_isValidRegular,
|
||||
.isValidCF = ab_isValidCF,
|
||||
.desugar = desugar_ab,
|
||||
.compile_to_rvm = ab_ctrvm,
|
||||
};
|
||||
|
||||
|
||||
const HParser* h_attr_bool(const HParser* p, HPredicate pred) {
|
||||
HParser* h_attr_bool(const HParser* p, HPredicate pred) {
|
||||
return h_attr_bool__m(&system_allocator, p, pred);
|
||||
}
|
||||
const HParser* h_attr_bool__m(HAllocator* mm__, const HParser* p, HPredicate pred) {
|
||||
HParser* h_attr_bool__m(HAllocator* mm__, const HParser* p, HPredicate pred) {
|
||||
HAttrBool *env = h_new(HAttrBool, 1);
|
||||
env->p = p;
|
||||
env->pred = pred;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue