Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Many-to-Many Relations between Pattern and Rewrite Pattern in Rule #48

@lmt-swallow

Description

@lmt-swallow

Problem

Now a rule includes only one pattern and one rewrite pattern, though it's natural that multiple patterns could be transformed into a rewrite pattern, and vice versa.

Possible Solutions

Suppose we'd like to transform both of f(:[X], :[Y]) and g(:[X], :[Y]) into either of a(:[X], :[Y]) or b(:[X], :[Y]). We need something like:

version: "1"
rules:
  - id: demo
    language: go
    message: ""
    patterns: 
      - "f(:[X], :[Y])"
      - "g(:[X], :[Y])"
    rewrite-options: 
      - "a(:[X], :[Y])"
      - "b(:[X], :[Y])"

Additional Notes

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions