Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 89bb62c

Browse files
Indent scala code with 2 spaces
1 parent 02183d8 commit 89bb62c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

‎README.md‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,24 @@ To support multiple Scala versions, see the example in [scala/scala-module-depen
2929
import scala.util.parsing.combinator._
3030

3131
case class WordFreq(word: String, count: Int) {
32-
override def toString = "Word <" + word + "> " +
33-
"occurs with frequency " + count
32+
override def toString = "Word <" + word + "> " +
33+
"occurs with frequency " + count
3434
}
3535

3636
class SimpleParser extends RegexParsers {
37-
def word: Parser[String] = """[a-z]+""".r ^^ { _.toString }
38-
def number: Parser[Int] = """(0|[1-9]\d*)""".r ^^ { _.toInt }
39-
def freq: Parser[WordFreq] = word ~ number ^^ { case wd ~ fr => WordFreq(wd,fr) }
37+
def word: Parser[String] = """[a-z]+""".r ^^ { _.toString }
38+
def number: Parser[Int] = """(0|[1-9]\d*)""".r ^^ { _.toInt }
39+
def freq: Parser[WordFreq] = word ~ number ^^ { case wd ~ fr => WordFreq(wd,fr) }
4040
}
4141

4242
object TestSimpleParser extends SimpleParser {
43-
def main(args: Array[String]) = {
44-
parse(freq, "johnny 121") match {
45-
case Success(matched,_) => println(matched)
46-
case Failure(msg,_) => println("FAILURE: " + msg)
47-
case Error(msg,_) => println("ERROR: " + msg)
48-
}
43+
def main(args: Array[String]) = {
44+
parse(freq, "johnny 121") match {
45+
case Success(matched,_) => println(matched)
46+
case Failure(msg,_) => println("FAILURE: " + msg)
47+
case Error(msg,_) => println("ERROR: " + msg)
4948
}
49+
}
5050
}
5151
```
5252

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /