Reorganized the parser as a proper class so that I could easily reenter it to
deal with things like optional second open and close tag characters. In the
process, made the parser simply pass through certain kinds of malformed input
as text.
I hope to go further in this regard, avoiding parse exceptions in favor of
simply showing the user the malformed output unsubstituted. It's just as easy
to see "{{broken blah blah" in ones result template as it is to read exception
messages, and apps that wish to use JMustache for things like end-user
templates will find this much more agreeable.
for use when variables resolve to null, but still wishes for exceptions to be
thrown when values are not resolvable (i.e. are typos). Pre-existing behavior
is preserved if one uses defaultValue() or does not change the default
configuration.
Nota bene: there are complexities, so be sure to read the documentation.
rather than "missingVariableValue" because the value is used any time a
variable resolves to null, not necessarily just when it is missing. If you
have a context like:
new Object() {
String foo = null;
}
and reference {{foo}} in your template, foo is not missing, per se, but the
default value will still be used for it.
Call missingVariableValue(value) on a Compiler object to get a new
version that will insert "value" for missing values (rather than
throwing an exception). Useful when you have templates you would
rather generated *something* instead of erroring or for when objects may
have null values themselves.
into inner interface Mustache.TemplateLoader, eliminated top-level
UnsupportedTemplateLoader. Eliminated static configuration of active template
loader in favor of per-Compiler configured template loader, which is how all
other configuration is handled.More complex tests are needed, but will have to
wait until I'm less sleep deprived.
whether we're seeing {{.}} or not. Also reinstated treatment of ".foo" as a
compound key. I'm not 100% sure that makes more sense than treating ".foo" as a
simple key, but I'd rather change less behavior than more when making the {{.}}
fix.
This is implemented so that by default, the library does not support template loading (which it already does not)
but instead of treating partial calls as a context lookup for a ">key", an exception is thrown.
in the replacement for this tag." This is already supported via {{&foo}} as
well, but we like to be thorough.
Also generate MustacheParseException when parsing (a subclass of
MustacheException) mostly for convenience in testing.