mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-06-01 01:11:36 +00:00
Renamed StatementParser to ValueParser
This commit is contained in:
parent
697349e9a2
commit
2b8bf136a9
|
@ -23,7 +23,7 @@ class ArrayConverter implements ValueConverter {
|
|||
|
||||
@Override
|
||||
public Object convert(String s) {
|
||||
StatementParser parser = Parboiled.createParser(StatementParser.class);
|
||||
ValueParser parser = Parboiled.createParser(ValueParser.class);
|
||||
ParsingResult<List<Object>> parsingResult = new BasicParseRunner<List<Object>>(parser.Array()).run(s);
|
||||
List<Object> tokens = parsingResult.resultValue;
|
||||
List<Object> values = convertList(tokens);
|
||||
|
|
|
@ -18,7 +18,7 @@ class BooleanConverter implements ValueConverter {
|
|||
|
||||
@Override
|
||||
public Object convert(String s) {
|
||||
StatementParser parser = Parboiled.createParser(StatementParser.class);
|
||||
ValueParser parser = Parboiled.createParser(ValueParser.class);
|
||||
|
||||
List<String> resultValue = new BasicParseRunner<List<String>>(parser.Boolean()).run(s).resultValue;
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ class IntegerConverter implements ValueConverter {
|
|||
|
||||
@Override
|
||||
public boolean canConvert(String s) {
|
||||
StatementParser parser = Parboiled.createParser(StatementParser.class);
|
||||
ValueParser parser = Parboiled.createParser(ValueParser.class);
|
||||
return new BasicParseRunner<Object>(parser.Integer()).run(s).resultValue != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object convert(String s) {
|
||||
StatementParser parser = Parboiled.createParser(StatementParser.class);
|
||||
ValueParser parser = Parboiled.createParser(ValueParser.class);
|
||||
List<String> resultValue = new BasicParseRunner<List<String>>(parser.Integer()).run(s).resultValue;
|
||||
|
||||
if (resultValue == null) {
|
||||
|
|
|
@ -16,7 +16,7 @@ class LiteralStringConverter implements ValueConverter {
|
|||
|
||||
@Override
|
||||
public Object convert(String s) {
|
||||
StatementParser parser = Parboiled.createParser(StatementParser.class);
|
||||
ValueParser parser = Parboiled.createParser(ValueParser.class);
|
||||
List<Object> resultValue = new BasicParseRunner<List<Object>>(parser.LiteralString()).run(s).resultValue;
|
||||
|
||||
if (resultValue == null) {
|
||||
|
|
|
@ -141,7 +141,7 @@ class TomlParser {
|
|||
}
|
||||
|
||||
private String getTableArrayName(String line) {
|
||||
StatementParser parser = Parboiled.createParser(StatementParser.class);
|
||||
ValueParser parser = Parboiled.createParser(ValueParser.class);
|
||||
ParsingResult<List<Object>> parsingResult = new BasicParseRunner<List<Object>>(parser.TableArray()).run(line);
|
||||
|
||||
if (parsingResult.resultValue == null) {
|
||||
|
@ -156,7 +156,7 @@ class TomlParser {
|
|||
}
|
||||
|
||||
private String getTableName(String line) {
|
||||
StatementParser parser = Parboiled.createParser(StatementParser.class);
|
||||
ValueParser parser = Parboiled.createParser(ValueParser.class);
|
||||
ParsingResult<List<Object>> parsingResult = new BasicParseRunner<List<Object>>(parser.Table()).run(line);
|
||||
|
||||
if (parsingResult.resultValue == null) {
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
import org.parboiled.BaseParser;
|
||||
import org.parboiled.Rule;
|
||||
|
||||
class StatementParser extends BaseParser<List<Object>> {
|
||||
class ValueParser extends BaseParser<List<Object>> {
|
||||
|
||||
public Rule Array() {
|
||||
return FirstOf(EmptyArray(), Sequence('[', startList(), OneOrMore(FirstOf(NonEmptyArray(), ' ', ',')), ']', endList()));
|
Loading…
Reference in a new issue