Skip to content
Snippets Groups Projects
Commit a88c6c8a authored by Meredith L. Patterson's avatar Meredith L. Patterson
Browse files

Merge pull request #7 from zaxtax/regex

Adding epislon and nothing
parents 875c9b9c e69fd2e5
No related branches found
No related tags found
No related merge requests found
......@@ -8,10 +8,15 @@ static HParseResult* parse_epsilon(void* env, HParseState* state) {
return res;
}
static bool episilon_ctrvm(HRVMProg *prog, void* env) {
return true;
}
static const HParserVtable epsilon_vt = {
.parse = parse_epsilon,
.isValidRegular = h_true,
.isValidCF = h_true,
.compile_to_rvm = episilon_ctrvm,
};
static const HParser epsilon_p = {
......
#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() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment