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

Unify default value parsing with core string parser #1017

Closed
ssalbdivad opened this issue Jun 18, 2024 · 0 comments
Closed

Unify default value parsing with core string parser #1017

ssalbdivad opened this issue Jun 18, 2024 · 0 comments

Comments

@ssalbdivad
Copy link
Member

Currently we have a regex to parse UnitLiterals and handle default values in string like:

type({
  foo: "string = 'foo'",
});

This is fine, but we could giver better error messages if we used our core parser to handle this, then performed some additional check at the top-level to make sure we didn't parse a top-level default value.

Either that or we come up with an acceptable definition for a default value on a shallow type, but it feels messy.

Either way the rules would be identical but we could give better errors when e.g. we try to use a default value before the end of the string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (merged or closed)
Development

No branches or pull requests

1 participant