Skip to content

Commit

Permalink
Remove duplicated whitespace definition
Browse files Browse the repository at this point in the history
  • Loading branch information
fnussbaum committed Mar 18, 2024
1 parent 5a906ae commit 8e9e32e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/main/scala/viper/silver/parser/FastParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ object FastParserCompanion {
NoTrace((" " | "\t").rep)
}

// TODO why is this duplicated? see FastParser below
implicit val whitespace = {
import NoWhitespace._
implicit ctx: ParsingRun[_] =>
NoTrace((("/*" ~ (!StringIn("*/") ~ AnyChar).rep ~ "*/") | ("//" ~ !StringIn("/") ~ CharsWhile(_ != '\n').? ~ ("\n" | End)) | " " | "\t" | "\n" | "\r").rep)
// NoTrace((("/*" ~ (!StringIn("*/") ~ AnyChar).rep ~ "*/") | ("//" ~ CharsWhile(_ != '\n').? ~ ("\n" | End)) | " " | "\t" | "\n" | "\r").rep)
}

def identStarts[$: P] = CharIn("A-Z", "a-z", "$_")
Expand Down Expand Up @@ -314,16 +312,7 @@ class FastParser {
//////////////////////////

import fastparse._
import FastParserCompanion.{ExtendedParsing, identContinues, identStarts, LeadingWhitespace, Pos, PositionParsing, reservedKw, reservedSym}


// TODO why is this duplicated? see FastParserCompanion
implicit val whitespace = {
import NoWhitespace._
implicit ctx: ParsingRun[_] =>
NoTrace((("/*" ~ (!StringIn("*/") ~ AnyChar).rep ~ "*/") | ("//" ~ !StringIn("/") ~ CharsWhile(_ != '\n').? ~ ("\n" | End)) | " " | "\t" | "\n" | "\r").rep)
// NoTrace((("/*" ~ (!StringIn("*/") ~ AnyChar).rep ~ "*/") | ("//" ~ CharsWhile(_ != '\n').? ~ ("\n" | End)) | " " | "\t" | "\n" | "\r").rep)
}
import FastParserCompanion.{ExtendedParsing, identContinues, identStarts, LeadingWhitespace, Pos, PositionParsing, reservedKw, reservedSym, whitespace}

implicit val lineCol: LineCol = new LineCol(this)

Expand Down

0 comments on commit 8e9e32e

Please sign in to comment.