Skip to content

how get all patterns that match that given subject string #10

@perfgao

Description

@perfgao

Hi,

I noticed that The Match_Tmpl not supports MV_ALL_MATCHES.

if (state->is_term) {
     if (variant == MV_FIRST_MATCH) {
         ac_result_t r;
         r.match_begin = idx - state->depth;
         r.match_end = idx - 1;
         r.pattern_idx = state->is_term - 1;
         return r;
     }

     if (variant == MV_LEFT_LONGEST) {
         int match_begin = idx - state->depth;
         int match_end = idx - 1;

         if (r.match_begin == -1 ||
             match_end - match_begin > r.match_end - r.match_begin) {
             r.match_begin = match_begin;
             r.match_end = match_end;
             r.pattern_idx = state->is_term - 1;
         }
         continue;
     }

     ASSERT(false && "NYI");
 }

What should I do if i want get all patterns that match that given subject
string? Why not implement variant == MV_ALL_MATCHES?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions