Add ogex convert --ogex to Convert Traditional Regex to Ogex Syntax #21
Labels
No labels
Epic
GHA
Release
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
major
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
NiXTheDev/Ogex#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal: Lower the barrier for users switching to Ogex by providing a tool that converts traditional regex patterns to Ogex syntax.
Currently,
transpiler.rsonly converts Ogex syntax to legacy. Add a reverse conversion that takes a pattern with(?<name>...)and outputs(name:...).Implementation Steps:
(?<name>...)and treat it asNamedGroupin AST.ast.rsto retain the original syntax information (maybe a flag indicating if it came from legacy).transpile_to_ogex, traverse the AST and output Ogex syntax for named groups, leaving other syntax unchanged.--to-ogexor subcommandconvert-from-legacy.Testing: