Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
aappleby committed Dec 14, 2023
1 parent eaa3dae commit a745f45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions examples/c_parser/c_parse_nodes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ struct TraceToken {
template <StringParam match_name, typename pattern>
using Cap = parseroni::Capture<match_name, pattern, CNode>;

//template <StringParam match_name, typename pattern>
//using Cap = TraceToken<match_name, Capture<match_name, pattern, CNode>>;

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -122,7 +123,7 @@ struct Keyword : public CNode, PatternWrapper<Keyword<lit>> {
static_assert(SST<c_keywords>::contains(lit.str_val));

static TokenSpan match(CContext& ctx, TokenSpan body) {
if (!body.is_valid()) return body.fail();
if (!body.is_valid() || body.is_empty()) return body.fail();
if (ctx.atom_cmp(*body.begin, LEX_KEYWORD) != 0) return body.fail();
if (ctx.atom_cmp(*body.begin, lit.span()) != 0) return body.fail();
return body.advance(1);
Expand All @@ -132,7 +133,7 @@ struct Keyword : public CNode, PatternWrapper<Keyword<lit>> {
template <StringParam lit>
struct Literal2 : public CNode, PatternWrapper<Literal2<lit>> {
static TokenSpan match(CContext& ctx, TokenSpan body) {
if (!body.is_valid()) return body.fail();
if (!body.is_valid() || body.is_empty()) return body.fail();
if (ctx.atom_cmp(*body.begin, lit.span()) != 0) return body.fail();
return body.advance(1);
}
Expand All @@ -142,7 +143,7 @@ struct Literal2 : public CNode, PatternWrapper<Literal2<lit>> {

template <StringParam lit>
inline TokenSpan match_punct(CContext& ctx, TokenSpan body) {
if (!body.is_valid()) return body.fail();
if (!body.is_valid() || body.is_empty()) return body.fail();

size_t lit_len = lit.str_len;
const char* lit_val = lit.str_val;
Expand Down
2 changes: 1 addition & 1 deletion rules.ninja
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rule ems_compile_cpp
deps = gcc

rule ems_js_binary
command = emcc ${ems_opts_ld} --embed-file="${embed}" ${in} ${libraries} -o ${out}
command = emcc ${ems_opts_ld} ${in} ${libraries} -o ${out}

################################################################################

Expand Down

0 comments on commit a745f45

Please sign in to comment.