Skip to content

Commit

Permalink
fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pruemmer committed May 28, 2024
1 parent 2f9d06b commit 592f9a7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/scala/ostrich/AutomatonParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ case class AutomatonFragment(name: String, initStates: String, transitions: Seq[


class AutomatonParser {
def identifier[_: P]: P[String] = P(CharsWhileIn("a-zA-Z_0-9").!)
def identifier[$: P]: P[String] = P(CharsWhileIn("a-zA-Z_0-9").!)

def number[_: P]: P[Int] = P(CharsWhileIn("0-9").!).map(_.toInt)
def number[$: P]: P[Int] = P(CharsWhileIn("0-9").!).map(_.toInt)

def range[_: P]: P[(Int, Int)] = P("[" ~/ number ~ "," ~ number ~ "]").map { case (start, end) => (start, end) }
def range[$: P]: P[(Int, Int)] = P("[" ~/ number ~ "," ~ number ~ "]").map { case (start, end) => (start, end) }

def transition[_: P]: P[Transition] = P(identifier ~ "->" ~ identifier ~ range ~ ";").map {
def transition[$: P]: P[Transition] = P(identifier ~ "->" ~ identifier ~ range ~ ";").map {
case (from, to, range) => Transition(from, to, range)
}
def init[_: P]: P[String] = P("init" ~/ identifier ~ ";")
def accepting[_: P]: P[Seq[String]] = P("accepting" ~/ identifier.rep(1, sep = ",") ~ ";").map(_.toSeq)
def init[$: P]: P[String] = P("init" ~/ identifier ~ ";")
def accepting[$: P]: P[Seq[String]] = P("accepting" ~/ identifier.rep(1, sep = ",") ~ ";").map(_.toSeq)

def automaton[_: P]: P[AutomatonFragment] = P("automaton" ~/ identifier ~ "{" ~ init ~ transition.rep ~ accepting ~ "}").map {
def automaton[$: P]: P[AutomatonFragment] = P("automaton" ~/ identifier ~ "{" ~ init ~ transition.rep ~ accepting ~ "}").map {
case (name, initStates, transitions, acceptingStates) => AutomatonFragment(name, initStates, transitions, acceptingStates)
}

Expand Down

0 comments on commit 592f9a7

Please sign in to comment.