Hi Robert,
On 9/7/21 9:27 PM, Robert Wilhelm wrote:
+static int parse_date_literal(parser_ctx_t *ctx, const WCHAR **ret) +{
- const WCHAR *ptr = ++ctx->ptr;
- WCHAR *rptr;
- int len = 0;
- while(ctx->ptr < ctx->end) {
if(*ctx->ptr == '\n' || *ctx->ptr == '\r') {
FIXME("newline inside date literal\n");
return 0;
}
if(*ctx->ptr == '#')
break;
ctx->ptr++;
- }
- if(ctx->ptr == ctx->end) {
FIXME("unterminated date literal\n");
return 0;
- }
- len += ctx->ptr-ptr;
- *ret = rptr = parser_alloc(ctx, (len+1)*sizeof(WCHAR));
- if(!rptr)
return 0;
- while(ptr < ctx->ptr) {
*rptr++ = *ptr++;
- }
- *rptr = 0;
- ctx->ptr++;
- return tDate;
+}
I think that the conversion should happen here. For example with the attached test, native fails parsing early and never reaches the first trace. We may pass converted date down the pipe.
Thanks,
Jacek