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

Enforce Leading and Trailing double quote in ByteMachine #23

Open
jonessha opened this issue Aug 10, 2022 · 5 comments
Open

Enforce Leading and Trailing double quote in ByteMachine #23

jonessha opened this issue Aug 10, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@jonessha
Copy link
Contributor

jonessha commented Aug 10, 2022

What is your idea?

In actual usage of Ruler, ByteMachine stores string values always with a beginning and ending double quote. However, ByteMachine is capable of storing string values that begin and end with any character. This unnecessary flexibility leads to more complexity and special cases, for example, to support a leading or trailing wildcard character for wildcard patterns. We can simplify the code and remove some special cases by updating ByteMachine to either enforce the leading/trailing double quotes itself, or to be the component that adds these double quotes.

Would you be willing to make the change?

Maybe.

Additional context

Discussion arose during: #18

@jonessha jonessha added the enhancement New feature or request label Aug 10, 2022
@timbray
Copy link
Collaborator

timbray commented Aug 10, 2022

Um, for {"x": [true]} does Ruler actually add quotes? At one point it didn't.

@jonessha
Copy link
Contributor Author

Oops, right, I'm just talking about string values. Will update description.

@timbray
Copy link
Collaborator

timbray commented Aug 10, 2022

Also numbers, right?

@jonessha
Copy link
Contributor Author

Err, numbers don't get quotes added. For example, just verified there were no quotes added for:

machine.addRule("rule1", "{"x": [123]}");

Is that unexpected?

@timbray
Copy link
Collaborator

timbray commented Aug 10, 2022

Oops, I said that backward, I meant that numbers are not "-wrapped. Anyhow, I think we have converged here.

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

No branches or pull requests

2 participants