diff --git a/MassBank-Project/MassBank-lib/src/main/java/massbank/RecordParserDefinition.java b/MassBank-Project/MassBank-lib/src/main/java/massbank/RecordParserDefinition.java index 7c05eb11..bfd3025a 100644 --- a/MassBank-Project/MassBank-lib/src/main/java/massbank/RecordParserDefinition.java +++ b/MassBank-Project/MassBank-lib/src/main/java/massbank/RecordParserDefinition.java @@ -117,7 +117,7 @@ public RecordParserDefinition(Set config) { // }) .end() // check semantic here - .callCC(this::checkSemantic) + .callCC(config.contains("validate") ? this::checkSemantic : this::doNothing) ); @@ -538,14 +538,16 @@ public RecordParserDefinition(Set config) { } return result; }) + ) .seq(Token.NEWLINE_PARSER) .pick(2) -// .map((Object value) -> { -// System.out.println(value); -// return value; -// }) - ); +//// .map((Object value) -> { +//// System.out.println(value); +//// return value; +//// }) + + ); // 2.2.3 CH$FORMULA @@ -1801,6 +1803,9 @@ private Record setPK_PEAK(List value) { return record; } + private Result doNothing(Function continuation, Context context) { + return continuation.apply(context); + } private Result checkSemantic(Function continuation, Context context) { Result r = continuation.apply(context); diff --git a/MassBank-Project/MassBank-lib/src/main/java/massbank/cli/Validator.java b/MassBank-Project/MassBank-lib/src/main/java/massbank/cli/Validator.java index d847bbd0..8e6fa96e 100644 --- a/MassBank-Project/MassBank-lib/src/main/java/massbank/cli/Validator.java +++ b/MassBank-Project/MassBank-lib/src/main/java/massbank/cli/Validator.java @@ -181,6 +181,7 @@ else if (argumentf.isDirectory()) { // basic validation Set config = new HashSet(); + config.add("validate"); if (legacyMode.get()) config.add("legacy"); if (onlineMode.get()) config.add("online"); Record record = validate(recordString, config);