File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
shared/src/test/scala/scala/util/parsing/combinator Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -140,14 +140,14 @@ private object grammars1 extends StandardTokenParsers with PackratParsers {
140140 */
141141
142142
143- val term : PackratParser [Int ] = (term~ (" +" ~> fact) ^^ {case x~ y => x+ y}
144- | term~ (" -" ~> fact) ^^ {case x~ y => x- y}
145- | fact)
146-
147- val fact : PackratParser [Int ] = (fact~ (" *" ~> numericLit) ^^ {case x~ y => x* y.toInt}
148- | fact~ (" /" ~> numericLit) ^^ {case x~ y => x/ y.toInt}
149- | " (" ~> term<~ " )"
150- | numericLit ^^ {_.toInt})
143+ val term : PackratParser [Int ] = (term~ (" +" ~> fact) ^^ {case x~ y => x+ y}
144+ | term~ (" -" ~> fact) ^^ {case x~ y => x- y}
145+ | fact)
146+
147+ val fact : PackratParser [Int ] = (fact~ (" *" ~> numericLit) ^^ {case x~ y => x* y.toInt}
148+ | fact~ (" /" ~> numericLit) ^^ {case x~ y => x/ y.toInt}
149+ | " (" ~> term<~ " )"
150+ | numericLit ^^ {_.toInt})
151151}
152152
153153private object grammars2 extends StandardTokenParsers with PackratParsers {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ class T1100 {
1212 def p1 : Parser [Char ] = accept('a' ) | err(" errors are propagated" )
1313 }
1414
15- val expected = """ [1.4] error: errors are propagated
15+ val expected = """ [1.4] error: errors are propagated
1616
1717aaab
1818 ^"""
You can’t perform that action at this time.
0 commit comments