mike-mcgann commented on code in PR #981:
URL: https://github.com/apache/daffodil/pull/981#discussion_r1129979595
##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/parsers/DelimiterParsers.scala:
##########
@@ -108,12 +109,14 @@ class DelimiterTextParser(
if (foundDelimiter.isDefined) {
if (!containsLocalMatch(foundDelimiter.get.matchedDFAs, start)) {
// It was a remote delimiter but we should have found a local one.
- PE(
- start,
- "Found out of scope delimiter: '%s' '%s'",
- foundDelimiter.get.matchedDFAs(0).lookingFor,
-
Misc.remapStringToVisibleGlyphs(foundDelimiter.get.matchedDelimiterValue.get),
- )
+ if (requiredOnEmptyValue) {
Review Comment:
This is for the case where the data is `John,(Jacob),Doe` when present and
`John,,Doe` when not present having an initiator of `(` and a terminator of `)`
for the middle name. When the middle name was not present, Daffodil was raising
an error as described in the ticket: `Parse Error: Found out of scope
delimiter: ',' ','`. When that block is reached, the existing comment says "It
was a remote delimiter but we should have found a local one". I put a
breakpoint here and in this case it found a comma while it was looking for the
parens. In this case, where the delimiters should be absent when the value is
empty, parsing can continue. That seemed to work but I'm not sure if that is
100% correct.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]