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

Support multiple Zone Delimiters by file extension #196

Open
eldipa opened this issue Jul 5, 2021 · 0 comments
Open

Support multiple Zone Delimiters by file extension #196

eldipa opened this issue Jul 5, 2021 · 0 comments
Labels
enhancement something nice to have but it is not neither critical nor urgent

Comments

@eldipa
Copy link
Collaborator

eldipa commented Jul 5, 2021

Describe the feature you'd like
Currently byexample supports a single Zone Delimiter selected by the file extension of the target files.

It would be useful to support more Zone Delimiters because some files may have different zones.

Markdown is one case where two zones are well defined: the fenced-code blocks and the HTML comment blocks. byexample supports those two as a single zone at the expenses of a much complex regex.

C/C++ is another example with two zones too: single line comments (//) and multiline comments (/* */). In this case it is too complex to capture those two zones in a single regex. It is be much easier just combining the two Zone Delimiters that byexample already has for each case.

Additional context (optional)

There are issues when two Zone Delimiters yield overlapping zones. Think in the following C/C++ example:

/* This is the zone 1
    // This is the zone 2
    // ?: cpp_example
    //  result
*/

The other issue is that byexample assumes that the zones returned by the (currently) single Zone Delimiter are in order (so they will be executed following that order). Using more than one Zone Delimiter the partial results will have to be merged and sorted.

@eldipa eldipa added the enhancement something nice to have but it is not neither critical nor urgent label Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement something nice to have but it is not neither critical nor urgent
Projects
None yet
Development

No branches or pull requests

1 participant