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

Allow prefixes/suffixes in tries/create a way to express non-included prefixes/suffixes on symbol declarations #63

Open
mlorbetske opened this issue Aug 9, 2016 · 2 comments
Assignees
Milestone

Comments

@mlorbetske
Copy link
Member

Sometimes a replacement/macro only makes sense with some surrounding context, tries should contain marker information as to how many of the first bytes of the match should be emitted and where to position the output buffer.

Ex.

If I want to replace "bar" but only in the case that it appears as "foobarbaz", the trie can contain "foobarbaz" and link it to an operation but should indicate that the first 3 characters should be treated as non-matched (to emit "foo"/give it to a handler that matches "foo" or a subset before executing the operation at the position of "bar") and the input buffer's position should be 3 before the end of the match (to allow "bar" to be emitted/matched similar to "foo" from the pre- case)

@mlorbetske
Copy link
Member Author

Current design is to unify the two trie structures and demand (via generic constraints) that a start-end pair must be present for all terminal trie nodes that indicates the section of the path to terminal that should be used as the located token.

@sayedihashimi
Copy link
Member

Yes I think this is needed for real world templates. For example in my CSS I have "background-color: white" and I want to prompt for a new color. When the replacement is applied it should only change "white" if it's immediately after "background-color:".

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

No branches or pull requests

3 participants