Refactor the parseConcatenation() method in ConfigDocumentParser
to not throw out parsed values if only one value was seen. Rename
parseConcatenation to consolidateValues().
Create a new Parser, ConfigDocumentParser, which can parse an
input reader into a ConfigNodeComplexValue, which can
then be used to reproduce the exact original text of the input.
Address ConfigNode PR feedback, including
* Add @Override tags for all tokens() methods
* Make `children()` method in ConfigNodeComplexValue final
* Rename ConfigNodeKey to ConfigNodePath
* Rename ConfigNodeKeyValue to ConfigNodeField
* Modify PathParser so it can parse a string into either a Path
or a ConfigNodePath
Save the list of Tokens from which a Path was created when a
Path is parsed from a string in Parser.parsePath. Change
ConfigNodeKey to store a Path instead of a token.
Address various PR feedback, including:
* Remove unused map from ConfigNodeComplexValue
* Stop caching KeyValue indexes in ConfigNodeComplexValue
* Return an Iterable<Token> for the children() methods in
ConfigNodeComplexValue and ConfigNodeKeyValue
* Change all ConfigNode classes to implement AbstractConfigNode
* Remove the constructor and the token instance variable
from AbstractConfigNode. Make the render() method final and
have it use a new tokens() method which returns the list
of tokens contained by the node.
* Stop caching values in ConfigNodeKeyValue
Remove repeats of a key when setting a value in a
ConfigNodeComplexValue. Add a new node type, ConfigNodeKeyValue,
to represent a key-value pair and its surrounding whitespace.
Add various ConfigNode classes to represent the various
ConfigNode types. All of these are fully functional, with the
exception of ConfigNodeComplexValue, which lacks the ability
to delete duplicates of a key or add a new key.
Fix an == that should have been equals in ConfigBeanImpl.java
Fix missing equals/hashCode on IgnoredWhitespace token
Add some `<?>` that Xlint:unchecked wanted
Make RenderComparator serializable just to silence findbugs
findbugs still reports some "serializable without void
constructors" but those are not accurate because we replace
the instance with another class before serializing.
At present, we don't make a file() include relative to the
file doing the including. This is discussed in #202.
We should most likely change this behavior, but this
commit documents and tests it.
For broken doc comments in impl, just deleted them for
the most part rather than writing a bunch of useless docs.
"impl" is now included in the docs because javadoc 8 seems
to explode otherwise, but it's well-labeled as internal ABI.
Fixes#176 by ensuring SerializedConfigValue implements the java.lang.Object
contract without exploding. This is a completely internal class, but
-Dsun.io.serialization.extendedDebugInfo=true calls toString on it.
This is a rearrangement of ConfigFactory so that defaultApplication is public.
Also fixes a bug where we were caching the overload that takes parse and resolve
options, without putting those options in the cache key. Moved to only cache
the actual default config (the one that doesn't take any options).
Fixes#196 plus the separate bug about bad caching.
Clean up the lossless tokens code based on feedback.
* Change nextTokenFromIterator() method to
nextTokenIgnoringWhitespace()
* Use StringBuilder in Tokenizer.render()
* Extract Whitespace token creation into a
`createWhitespaceTokenFromSaver` method
* Add DoubleSlashComment and HashComment subclasses of
Comment. Make Comment abstract.
* Make `tokenText()` method virtual and overload it in
subclasses that derive their original token text entirely
from other fields.
* Use `tokenizerTest` method in all relevant Tokenizer tests
* Add extra multi-line comment Tokenizer tests
Keep the original text of all tokens when Tokenizing a config
minus comments. Add a render method to the TokenIterator class
which generates the original text from which the tokens were
parsed.