Skip to content

Commit

Permalink
LoggerOps: log optional token
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Sep 29, 2024
1 parent 98560bf commit f2e4603
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ object LoggerOps {

def log(tokens: Tokens): String = tokens.map(log).mkString("\n")

def log(token: Token): String = f"[${token.structure}%-40s"
def log(token: Token): String = logTok(token)
def logTok(token: Token): String = f"[${token.structure}%-40s"
def logTok(token: Option[Token]): String = token.fold("")(log)

def log(t: Tree): String = log(t, false)
def log(t: Tree, tokensOnly: Boolean): String = {
Expand Down

0 comments on commit f2e4603

Please sign in to comment.