-
Notifications
You must be signed in to change notification settings - Fork 72
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
clarify what is meant by standalone
#65
Comments
I guess a tag is "standalone" when it is the only non-whitespace token on a line. |
This doesn't appear to be the full definition, especially with respect to parent tags. For example, the "Inherit" test case in EDIT: And this is made more explicit in other standalone cases in the inheritance test suite. |
@softprops @zombiezen Does #131 address your question? An even more elaborate version can be found in #130. To be fair to @groue, parent tag pairs were not included in the spec yet when he wrote his reply. |
The test cases paint a clear picture, yes! I came across this issue because although the test cases are very precise and I was able to deduce the intended behavior through experimentation, the prose in the various overviews mention "standalone" without giving a definition. IMO, it would be nice to give a non-normative explanation for readers, but I don't think there's anything in the test cases that need to change. |
I meant the GitHub comments (including the opening post) that came with #131 (and #130), rather than the tests introduced by #131. Does that prose satisfy your wish or are you still looking for something less normative? Could you perhaps refer to a nonnormative description of another Mustache feature that you wish the standalone description could mimic? |
Ah that makes more sense. Yes, that prose is incredibly helpful for understanding the intended behavior, thank you. If the summary in #131 was added to the inheritance extension's overview with a couple tweaks, IMO that would help future readers tremendously. A few specific suggestions based on trying to use that prose to pass the test cases:
Hope that's helpful. Thank you for the pointers and your thoroughness! 🙂 |
@zombiezen I'm not entirely opposed to adding documentation about the whitespace handling rules to the spec overviews. That being said, I'm a bit worried that a disproportional amount of text will be dedicated to whitespace handling rather than the core semantics of partials and inheritance. The main idea is that we try to make Mustache handle whitespace exactly in the way that the human end user would intuitively expect; the complexity of the whitespace rules is a side effect of human intuition being subtle and nuanced. Other than putting all of that prose in the overviews, I can think of two other options:
If either of these options appeals to you, you would be welcome to submit a pull request as far as I'm concerned.
How about "compile time block deindentation"?
Understandable. #131 is a condensed version of #130, where it comes with an interjection "so that's BB, BS, BE, BN, EB, ES, EE or EN for argument blocks but only BB or BE for parameter blocks".
Yes, I think you are right.
Welcome! |
There are a number of places in the specs that mention an entity should be treated one way if it is standalone and another if it is not without giving any definition of what it means to be
standalone
. Can someone please elaborate what exactly it means to bestandalone
?The text was updated successfully, but these errors were encountered: