mike-mcgann commented on code in PR #947:
URL: https://github.com/apache/daffodil/pull/947#discussion_r1095792123
##########
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:
> Lines are far too long.
The default was 80 and it was reformatting a lot because there are quite a
few long lines in the code. I bumped it up to 120 but that is quite long. I've
moved it down to 96. See how that looks.
> Lining up the arrows in match-case clauses is simply annoying and should
be turned off.
Alignment has been disabled.
> Changes are also needed to the way extends and with (one line per) for
traits/classes are formatted.
What specifically would you like changed?
--
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]