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

Backreferences... #35

Open
3 of 8 tasks
xparq opened this issue Sep 7, 2023 · 0 comments
Open
3 of 8 tasks

Backreferences... #35

xparq opened this issue Sep 7, 2023 · 0 comments

Comments

@xparq
Copy link
Owner

xparq commented Sep 7, 2023

It's just that SAVE and DEF (which USE is the counterpart of, currently) use different namespaces.

  • How to properly address the addressing bit of the operations?... With addressing bits, literally? Or should it be part of the operand? "name" itself should tell where to look for the item, like URLs?
  • It should leave the door open to further extensions. (Which really cries for the URL-like semantics...)
    • But then, if dispatching on "name": how to make it efficient? Compilation (Grammar preprocessing/compilation phase (after construction, before parsing) #31)?
      • Yes, leaving it to the name -- e.g. like "\name" or "$name", or both -- gives an instant way to make it work, and leaves the door open for a preprocessing phase to convert it to whatever it wants.
      • Well, not so fast with that "instant" solution... :-/ Actually, USE would need to know actually, if the named capture has actually matched already and it has not been backtracked, so it still has valid data! :-o So, it:
        • needs a flag that the slot has valid data ("" may not actually mean that! :-/ )
        • needs the "transactional" backtracking cleanup mechanism (which would be required for Aggregate captures with _SAVE/_SAVE_AS #10 anyway!)...
  • It should be unified with the named patterns namespace, too.
    • OK, so probably a different opcode should be generated for each; seems enough to unify them for the "API", with name prefixes, and then leaving it to the preprocessor to adjust.
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