Skip to content

Commit

Permalink
Continue on refactored RecordParserDefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
meier-rene committed Nov 26, 2024
1 parent f8ae55d commit ff39250
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public RecordParserDefinition(Set<String> config) {
// })
.end()
// check semantic here
.callCC(this::checkSemantic)
.callCC(config.contains("validate") ? this::checkSemantic : this::doNothing)
);


Expand Down Expand Up @@ -538,14 +538,16 @@ public RecordParserDefinition(Set<String> 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
Expand Down Expand Up @@ -1801,6 +1803,9 @@ private Record setPK_PEAK(List<?> value) {
return record;
}

private Result doNothing(Function<Context, Result> continuation, Context context) {
return continuation.apply(context);
}

private Result checkSemantic(Function<Context, Result> continuation, Context context) {
Result r = continuation.apply(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ else if (argumentf.isDirectory()) {

// basic validation
Set<String> config = new HashSet<String>();
config.add("validate");
if (legacyMode.get()) config.add("legacy");
if (onlineMode.get()) config.add("online");
Record record = validate(recordString, config);
Expand Down

0 comments on commit ff39250

Please sign in to comment.