Adding epislon and nothing
This commit is contained in:
parent
875c9b9c57
commit
e69fd2e5b9
2 changed files with 11 additions and 1 deletions
|
|
@ -1,15 +1,20 @@
|
|||
#include "parser_internal.h"
|
||||
|
||||
|
||||
static HParseResult* parse_nothing() {
|
||||
// not a mistake, this parser always fails
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool nothing_ctrvm(HRVMProg *prog, void* env) {
|
||||
h_rvm_insert_insn(prog, RVM_MATCH, 0x00FF);
|
||||
return true;
|
||||
}
|
||||
|
||||
static const HParserVtable nothing_vt = {
|
||||
.parse = parse_nothing,
|
||||
.isValidRegular = h_true,
|
||||
.isValidCF = h_true,
|
||||
.compile_to_rvm = nothing_ctrvm,
|
||||
};
|
||||
|
||||
const HParser* h_nothing_p() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue