mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-06-29 01:10:48 +00:00
Renamed ValueParser#String() to ValueParser#StringToken() to avoid
conflicts/confusion with Parboiled method.
This commit is contained in:
parent
dfd5501132
commit
fcd77dca6b
|
@ -5,7 +5,9 @@ import java.util.List;
|
||||||
|
|
||||||
import org.parboiled.BaseParser;
|
import org.parboiled.BaseParser;
|
||||||
import org.parboiled.Rule;
|
import org.parboiled.Rule;
|
||||||
|
import org.parboiled.annotations.BuildParseTree;
|
||||||
|
|
||||||
|
@BuildParseTree
|
||||||
class ValueParser extends BaseParser<List<Object>> {
|
class ValueParser extends BaseParser<List<Object>> {
|
||||||
|
|
||||||
public Rule Array() {
|
public Rule Array() {
|
||||||
|
@ -33,17 +35,17 @@ class ValueParser extends BaseParser<List<Object>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Rule NonEmptyArray() {
|
Rule NonEmptyArray() {
|
||||||
return FirstOf(Array(), OneOrMore(TestNot(']'), FirstOf(String(), Array(), ',', ' ', OtherValue())));
|
return FirstOf(Array(), OneOrMore(TestNot(']'), FirstOf(StringToken(), Array(), ',', ' ', OtherValue())));
|
||||||
|
}
|
||||||
|
|
||||||
|
Rule StringToken() {
|
||||||
|
return Sequence(Sequence('"', ZeroOrMore(Sequence(TestNot('"'), ANY)), '"'), pushToken(match()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Rule EmptyArray() {
|
Rule EmptyArray() {
|
||||||
return Sequence('[', ']', startList(), endList());
|
return Sequence('[', ']', startList(), endList());
|
||||||
}
|
}
|
||||||
|
|
||||||
Rule String() {
|
|
||||||
return Sequence(Sequence('"', ZeroOrMore(TestNot('"'), ANY), '"'), pushToken(match()));
|
|
||||||
}
|
|
||||||
|
|
||||||
Rule OtherValue() {
|
Rule OtherValue() {
|
||||||
return Sequence(ZeroOrMore(NoneOf("],")), pushToken(match()));
|
return Sequence(ZeroOrMore(NoneOf("],")), pushToken(match()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue