-
Notifications
You must be signed in to change notification settings - Fork 45
Syntax for empty string value #73
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
Comments
As I'd like to use the first form for all messages (#63), my preference (and an ongoing intent) has been to go for the second form. It has the benefit of being explicit and clearly visually distinctive, which I find helpful in this case. A zero-length value is an edge-case and I'd like to mark it visually as such. |
#83 clarified the requirements for # ERROR: messages must have values or attributes.
message =
# ERROR: terms must have values.
-term = # OK: messages can have no values.
message =
.attr = An attribute
# ERROR: terms must always have values.
-term =
.attr = An attribute # OK: both values here are empty strings (length == 0).
message = {""}
-term = {""} # OK: variant values can also be empty strings.
message =
{ $num ->
[zero] {""}
[one] One something.
*[other] Many somethings.
} |
I talked to @Pike and @zbraniecki about this and they agreed to use |
|
Right now, there's no syntax for an empty string value, AFAICT.
One way to think about that would be to just use
The other way is to try to create a non-"" AST value that evaluates to "". One candidate would be
But that's also not allowed, 'cause
quote-text
is'"' (text-char - '"' | '\"')+ '"'
, note the+
instead of a*
.I didn't investigate what the fall-out of allowing
*
would be.The text was updated successfully, but these errors were encountered: