mbeckerle commented on code in PR #947:
URL: https://github.com/apache/daffodil/pull/947#discussion_r1095142460
##########
daffodil-core/src/main/scala/org/apache/daffodil/dpath/DFDLExpressionParser.scala:
##########
@@ -270,34 +276,41 @@ class DFDLPathExpressionParser[T <: AnyRef](
RelativePathExpr)("path")
def RelativePathExpr: Parser[RelativePathExpression] = log(
- StepExpr ~ ("/" ~> StepExpr).* ^^ { case s1 ~ moreSteps =>
RelativePathExpression(s1 :: moreSteps, isEvaluatedAbove) } |
- StepExpr ~ ("//" ~> StepExpr).* ^^ { _ => context.SDE("'//' is
unsupported in DFDL Expression Syntax.") })("relativePath")
+ StepExpr ~ ("/" ~> StepExpr).* ^^ { case s1 ~ moreSteps =>
+ RelativePathExpression(s1 :: moreSteps, isEvaluatedAbove)
+ } |
+ StepExpr ~ ("//" ~> StepExpr).* ^^ { _ => context.SDE("'//' is
unsupported in DFDL Expression Syntax.") })(
+ "relativePath")
- def StepExpr: Parser[StepExpression] = log(AxisStep | VarRef ^^ { varRef =>
this.context.SDE("Variables cannot be used in path expressions. Error: $%s",
varRef.qnameString) })("step")
+ def StepExpr: Parser[StepExpression] = log(AxisStep | VarRef ^^ { varRef =>
+ this.context.SDE("Variables cannot be used in path expressions. Error:
$%s", varRef.qnameString)
+ })("step")
def AxisStep: Parser[StepExpression] =
Reverse | Forward
def Reverse = AbbrevReverseStep ~> Predicate.? ^^ { Up(_) } |
(SupportedReverseAxis ~> NodeTest) ~ Predicate.? ^^ { case qn ~ p => {
Up2(qn, p) } } |
- (UnsupportedReverseAxis ~ NodeTest) ~ Predicate.? ^^ { case name ~ _ =>
context.SDE("'%s::' is an unsupported axis in DFDL Expression Syntax.", name) }
+ (UnsupportedReverseAxis ~ NodeTest) ~ Predicate.? ^^ { case name ~ _ =>
+ context.SDE("'%s::' is an unsupported axis in DFDL Expression Syntax.",
name)
+ }
def Forward = ContextItemExpr ~> Predicate.? ^^ { Self(_) } |
SupportedForwardAxis ~ NodeTest ~ Predicate.? ^^ {
- case "self" ~ qn ~ p => Self2(qn, p)
+ case "self" ~ qn ~ p => Self2(qn, p)
case "child" ~ qn ~ p => NamedStep(qn, p)
// $COVERAGE-OFF$
case _ => Assert.impossible()
// $COVERAGE-ON$
} |
- UnsupportedForwardAxis ~ Predicate.? ^^ { case name ~ _ =>
context.SDE("'%s::' is an unsupported axis in DFDL Expression Syntax.", name) }
|
+ UnsupportedForwardAxis ~ Predicate.? ^^ { case name ~ _ =>
+ context.SDE("'%s::' is an unsupported axis in DFDL Expression Syntax.",
name)
+ } |
NodeTest ~ Predicate.? ^^ { case qn ~ p => { NamedStep(qn, p) } }
- def Predicate: Parser[PredicateExpression] = log(
- "[" ~> Expr <~ "]" ^^ { PredicateExpression(_) })("predicate")
+ def Predicate: Parser[PredicateExpression] = log("[" ~> Expr <~ "]" ^^ {
PredicateExpression(_) })("predicate")
Review Comment:
The line length being used here is much too long. (113 chars).
I think the max should be 96 chars / line.
--
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]