Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A match expression followed by a rewrite expression using a named whitespace matcher produces unexpected output #363

Open
markrian opened this issue May 23, 2023 · 0 comments

Comments

@markrian
Copy link

markrian commented May 23, 2023

Describe the bug

Running this configuration:

[foo]
match=":[1]"
rewrite=":[1]"
rule="""
where
match :[1] { ":[_~foo]" -> true },
rewrite :[1] { ":[ _]" -> "|" },
"""

Against the string one foo two three produces one | two three, whereas I would expect it to produce one|foo|two|three.

Interestingly changing the order of the match and rewrite fixes it. That is, changing the rule above to the following produces the expected output:

where
rewrite :[1] { ":[ _]" -> "|" },
match :[1] { ":[_~foo]" -> true },

Also interestingly, using the original order but using a plain space character instead of the named whitespace matcher also produces the expected out:

where
match :[1] { ":[_~foo]" -> true },
rewrite :[1] { " " -> "|" },

Reproducing

  • If this looks like a bug in the matcher, go to https://comby.live and paste a shared link below:

https://bit.ly/43kUxrz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant