Skip to content

Is it valid to use custom_term alongside char_term, string_term, and regex_term within one terms() ? #85

@95833

Description

@95833

It doesn't seem to be supported at the moment, but perhaps it could work if the code is modified from

if constexpr (generate_lexer)
{
    res = regex::dfa_match(lexer_sm, opts, ps.current_sp, ps.current_it, ps.buffer_end, ps.error_stream);
}
else
{
    lexer_type custom_lexer;
    res = custom_lexer.match(opts, ps.current_sp, ps.current_it, ps.buffer_end, ps.error_stream);
}

to

if constexpr (generate_lexer)
{
    res = regex::dfa_match(lexer_sm, opts, ps.current_sp, ps.current_it, ps.buffer_end, ps.error_stream);
}
else {
    lexer_type custom_lexer;
    res = custom_lexer.match(opts, ps.current_sp, ps.current_it, ps.buffer_end, ps.error_stream);

    if (res.term_idx == uninitialized16)
        res = regex::dfa_match(lexer_sm, opts, ps.current_sp, ps.current_it, ps.buffer_end, ps.error_stream);
}

?
However, I'm not familiar with how terms() works internally, could you update the project to support this functionality?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions