on master help sign in
Provide a better comment parser - still not correct, but more passable
commit1970a610f70b17a351dba1bea39afba587450e84 authorNeil Mitchell <ndmitchell@gmail.com> dateThu 4 Jan 2018, 22:58 (9 years ago) parent5eed5e9
2 files changed+5−2
gen/Parser.hs+3−1 gen/test.c+2−1
gen/Parser.hs+3−1
@@ -52,7 +52,9 @@ tag = do
5252 let name_ = name `choice` abort "Missing tag name"
5353 choices
5454 [do lit "!--"
55− many $ lit "-->" -- FIXME: Not correct!!!
55+ many $ match (/= '-')
56+ -- FIXME: Not correct!!!
57+ lit "-->"
5658 out TagComment
5759 ,do lit "?"
5860 name_
gen/test.c+2−1
@@ -330,7 +330,8 @@ static inline str gap(const char* ref, const char* start, const char* end)
330330 attr* attr = attr_alloc(&d->attrs); \
331331 attr->name = gap(d->body, name_start, name_end); \
332332 attr->value = gap(d->body, quote_start, p);
333−#define P_TagComment printf("MISSING: TagComment %s\n", p)
333+#define P_TagComment \
334+ // No action required - comments just flow as normal text
334335#define P_TagOpen \
335336 me->nodes.length = -1; \
336337 me->inner = gap(d->body, p, p); \